diff options
Diffstat (limited to 'indra/newview/lllogchat.cpp')
-rw-r--r-- | indra/newview/lllogchat.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index cb7af207d2..d129687a11 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -40,11 +40,24 @@ const S32 LOG_RECALL_SIZE = 2048; //static std::string LLLogChat::makeLogFileName(std::string filename) { + filename = cleanFileName(filename); filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS,filename); filename += ".txt"; return filename; } +std::string LLLogChat::cleanFileName(std::string filename) +{ + std::string invalidChars = "\"\'\\/?*:<>|"; + S32 position = filename.find_first_of(invalidChars); + while (position != filename.npos) + { + filename[position] = '_'; + position = filename.find_first_of(invalidChars, position); + } + return filename; +} + std::string LLLogChat::timestamp(bool withdate) { time_t utc_time; |