Merge pull request #660 from perosb/U4-6444

Fix for U4-6444
This commit is contained in:
Shannon Deminick
2015-03-25 09:16:49 +11:00

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;