summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2020-06-19 19:09:00 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2020-06-19 19:09:00 +0300
commit657c37e71816634d675e30d1910ca1336eea0774 (patch)
tree4877663c53acfaa0f3c763809d491095c228f5b9 /indra/newview
parentca6bb3506d13975bd5a817a09658fa78d7716cc6 (diff)
SL-13487 File extension checks should ignore case
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpreviewtexture.cpp2
-rw-r--r--indra/newview/llviewerassetupload.cpp11
2 files changed, 7 insertions, 6 deletions
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp
index 9d8be4b2fe..1e91da529c 100644
--- a/indra/newview/llpreviewtexture.cpp
+++ b/indra/newview/llpreviewtexture.cpp
@@ -401,7 +401,7 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success,
{
const U32 ext_length = 3;
std::string extension = self->mSaveFileName.substr( self->mSaveFileName.length() - ext_length);
-
+ LLStringUtil::toLower(extension);
// We only support saving in PNG or TGA format
LLPointer<LLImageFormatted> image;
if(extension == "png")
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index d53cc3f745..bc07821ccd 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -316,24 +316,25 @@ bool LLResourceUploadInfo::findAssetTypeOfExtension(const std::string& exten, LL
bool LLResourceUploadInfo::findAssetTypeAndCodecOfExtension(const std::string& exten, LLAssetType::EType& asset_type, U32& codec, bool bulk_upload)
{
bool succ = false;
-
- codec = LLImageBase::getCodecFromExtension(exten);
+ std::string exten_lc(exten);
+ LLStringUtil::toLower(exten_lc);
+ codec = LLImageBase::getCodecFromExtension(exten_lc);
if (codec != IMG_CODEC_INVALID)
{
asset_type = LLAssetType::AT_TEXTURE;
succ = true;
}
- else if (exten == "wav")
+ else if (exten_lc == "wav")
{
asset_type = LLAssetType::AT_SOUND;
succ = true;
}
- else if (exten == "anim")
+ else if (exten_lc == "anim")
{
asset_type = LLAssetType::AT_ANIMATION;
succ = true;
}
- else if (!bulk_upload && (exten == "bvh"))
+ else if (!bulk_upload && (exten_lc == "bvh"))
{
asset_type = LLAssetType::AT_ANIMATION;
succ = true;