Fix for U4-6444

This commit is contained in:
Per Osbeck
2015-03-24 09:28:53 +01:00
parent aa3c1d645b
commit ffaf1f96b9

View File

@@ -327,6 +327,11 @@ function mediaHelper(umbRequestHelper) {
* @param {string} imagePath Image path, ex: /media/1234/my-image.jpg
*/
detectIfImageByExtension: function (imagePath) {
if (!imagePath) {
return false;
}
var lowered = imagePath.toLowerCase();
var ext = lowered.substr(lowered.lastIndexOf(".") + 1);
return ("," + Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes + ",").indexOf("," + ext + ",") !== -1;