Merge branch 'release/maint-a' of https://github.com/secondlife/viewer
commit
31b70d0abb
|
|
@ -941,15 +941,15 @@ std::string LLDir::getTempFilename() const
|
|||
}
|
||||
|
||||
// static
|
||||
std::string LLDir::getScrubbedFileName(const std::string uncleanFileName)
|
||||
std::string LLDir::getScrubbedFileName(std::string_view uncleanFileName)
|
||||
{
|
||||
std::string name(uncleanFileName);
|
||||
const std::string illegalChars(getForbiddenFileChars());
|
||||
// replace any illegal file chars with and underscore '_'
|
||||
for( unsigned int i = 0; i < illegalChars.length(); i++ )
|
||||
for (const char& ch : illegalChars)
|
||||
{
|
||||
std::string::size_type j = -1;
|
||||
while((j = name.find(illegalChars[i])) > std::string::npos)
|
||||
std::string::size_type j{ 0 };
|
||||
while ((j = name.find(ch, j)) != std::string::npos)
|
||||
{
|
||||
name[j] = '_';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ class LLDir
|
|||
static std::string getDumpLogsDirPath(const std::string &file_name = "");
|
||||
|
||||
// For producing safe download file names from potentially unsafe ones
|
||||
static std::string getScrubbedFileName(const std::string uncleanFileName);
|
||||
static std::string getScrubbedFileName(std::string_view uncleanFileName);
|
||||
static std::string getForbiddenFileChars();
|
||||
void setDumpDir( const std::string& path );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue