mirror of https://github.com/kiwix/libkiwix.git
+ fix escaping problem by kiwix-serve suggestions
This commit is contained in:
parent
f8bb4a9998
commit
ea8f560c76
|
@ -124,4 +124,12 @@ void kiwix::printStringInHexadecimal(const char *s) {
|
|||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
void kiwix::stringReplacement(std::string& str, const std::string& oldStr, const std::string& newStr) {
|
||||
size_t pos = 0;
|
||||
while((pos = str.find(oldStr, pos)) != std::string::npos) {
|
||||
str.replace(pos, oldStr.length(), newStr);
|
||||
pos += newStr.length();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -46,8 +46,10 @@ namespace kiwix {
|
|||
void printStringInHexadecimal(const char *s);
|
||||
void printStringInHexadecimal(UnicodeString s);
|
||||
|
||||
std::string ucFirst (const std::string &word);
|
||||
std::string lcFirst (const std::string &word);
|
||||
std::string ucFirst(const std::string &word);
|
||||
std::string lcFirst(const std::string &word);
|
||||
|
||||
void stringReplacement(std::string& str, const std::string& oldStr, const std::string& newStr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue