[log] $WINDOW should be last because it could contain %

Thanks to @NuclearW for spotting
This commit is contained in:
Kyle Fuller
2014-09-30 18:28:20 +01:00
parent 213c3839a8
commit cf633ee435

View File

@@ -84,9 +84,9 @@ void CLogMod::PutLog(const CString& sLine, const CString& sWindow /*= "Status"*/
// TODO: Properly handle IRC case mapping
// $WINDOW has to be handled last, since it can contain %
sPath.Replace("$USER", CString((m_pUser ? m_pUser->GetUserName() : "UNKNOWN")).AsLower());
sPath.Replace("$NETWORK", CString((m_pNetwork ? m_pNetwork->GetName() : "znc")).AsLower());
sPath.Replace("$WINDOW", CString(sWindow.Replace_n("/", "-").Replace_n("\\", "-")).AsLower());
sPath.Replace("$USER", CString((m_pUser ? m_pUser->GetUserName() : "UNKNOWN")).AsLower());
// Check if it's allowed to write in this specific path
sPath = CDir::CheckPathPrefix(GetSavePath(), sPath);