mirror of
https://github.com/LibreOffice/online.git
synced 2025-08-01 16:04:55 +00:00
wsd: tokenize symbol "_('') _("")"
Change-Id: I9c0e7f30a96a355f6d69b2c5a5244dbfbd863e08
This commit is contained in:
@ -567,7 +567,7 @@ constexpr char BRANDING[] = "branding";
|
||||
constexpr char BRANDING_UNSUPPORTED[] = "branding-unsupported";
|
||||
#endif
|
||||
|
||||
void FileServerRequestHandler::getToken(std::istream& istr, std::string& token)
|
||||
void FileServerRequestHandler::getToken(std::istringstream& istr, std::string& token)
|
||||
{
|
||||
token.clear();
|
||||
int chr = istr.get();
|
||||
@ -583,6 +583,33 @@ void FileServerRequestHandler::getToken(std::istream& istr, std::string& token)
|
||||
token += "%>";
|
||||
istr.get();
|
||||
}
|
||||
else if (chr == '_' && istr.peek() == '(')
|
||||
{
|
||||
token += "_(";
|
||||
istr.get();
|
||||
chr = istr.peek();
|
||||
switch (chr)
|
||||
{
|
||||
case '\"':
|
||||
chr = istr.get();
|
||||
token += (char) chr;
|
||||
break;
|
||||
case '\'':
|
||||
chr = istr.get();
|
||||
token += (char) chr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (chr == '"' && istr.peek() == ')')
|
||||
{
|
||||
token += "\")";
|
||||
istr.get();
|
||||
}
|
||||
else if (chr == '\'' && istr.peek() == ')')
|
||||
{
|
||||
token += "')";
|
||||
istr.get();
|
||||
}
|
||||
else token += (char) chr;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class FileServerRequestHandler
|
||||
{
|
||||
static std::string getRequestPathname(const Poco::Net::HTTPRequest& request);
|
||||
|
||||
static void getToken(std::istream&, std::string&);
|
||||
static void getToken(std::istringstream&, std::string&);
|
||||
static void preprocessFile(const Poco::Net::HTTPRequest& request, Poco::MemoryInputStream& message, const std::shared_ptr<StreamSocket>& socket);
|
||||
static void preprocessAdminFile(const Poco::Net::HTTPRequest& request, const std::shared_ptr<StreamSocket>& socket);
|
||||
public:
|
||||
|
Reference in New Issue
Block a user