From 80be4c1d2d73982ea2df6dd7ef3fc3465416c882 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 12 Aug 2008 17:29:50 +0000 Subject: QAR-767 Combined maint-render-7 and maint-viewer-9 merge merge release@93398 viewer-merge-1@94007 -> release dataserver-is-deprecated --- indra/newview/lllogchat.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/lllogchat.cpp') 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; -- cgit v1.2.3