From bb4f4822d4d34a65bc0dbdb0e3a6cfed72d8488a Mon Sep 17 00:00:00 2001 From: hartvig Date: Thu, 9 Aug 2012 10:27:34 -0200 Subject: [PATCH] Fixes issue with images with a filename that has dimensions appended (ie. myimage_300x200.jpg) inserted into tinyMCE. Work items: 30864 --- .../tinyMCE3/webcontrol/TinyMCEWebControl.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs b/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs index 770239a15e..b386ef6a51 100644 --- a/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs +++ b/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs @@ -326,10 +326,9 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol tempTag += " " + ide.Key.ToString() + "=\"" + ide.Value.ToString() + "\""; // Find the original filename, by removing the might added width and height + // NH, 4.8.1 - above replaced by loading the right media file from the db later! orgSrc = - IOHelper.ResolveUrl(orgSrc.Replace( - "_" + helper.FindAttribute(ht, "width") + "x" + helper.FindAttribute(ht, "height"), ""). - Replace("%20", " ")); + IOHelper.ResolveUrl(orgSrc.Replace("%20", " ")); // Check for either id or guid from media string mediaId = getIdFromSource(orgSrc, localMediaPath); @@ -358,15 +357,10 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol { try { - // Check extention - if (imageMedia.getProperty("umbracoExtension").Value.ToString() != orgSrc.Substring(orgSrc.LastIndexOf(".") + 1, orgSrc.Length - orgSrc.LastIndexOf(".") - 1)) - orgSrc = orgSrc.Substring(0, orgSrc.LastIndexOf(".") + 1) + - imageMedia.getProperty("umbracoExtension").Value.ToString(); - // Format the tag tempTag = tempTag + " rel=\"" + imageMedia.getProperty("umbracoWidth").Value.ToString() + "," + - imageMedia.getProperty("umbracoHeight").Value.ToString() + "\" src=\"" + orgSrc + + imageMedia.getProperty("umbracoHeight").Value.ToString() + "\" src=\"" + IOHelper.ResolveUrl(imageMedia.getProperty("umbracoFile").Value.ToString()) + "\""; tempTag += "/>";