From f4ff96a552cf658283ab3db45688fb36fefd5e68 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Mon, 23 May 2016 10:16:31 +0000 Subject: [PATCH] InlineImage::FixUrls must be 1) idempotent 2) aligned with the syntax used by CKEditor to prevent creating new entries in the history when nothing was modified. SVN:trunk[4112] --- core/inlineimage.class.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/inlineimage.class.inc.php b/core/inlineimage.class.inc.php index 12fc04d96..a204ca493 100644 --- a/core/inlineimage.class.inc.php +++ b/core/inlineimage.class.inc.php @@ -221,7 +221,7 @@ class InlineImage extends DBObject } $sAttId = $aImgInfo[2][0]; - $sNewImgTag = preg_replace('/src="[^"]+"/', 'src="'.$sUrl.$sAttId.$sSecret.'"', $sImgTag); // preserve other attributes + $sNewImgTag = preg_replace('/src="[^"]+"/', 'src="'.htmlentities($sUrl.$sAttId.$sSecret, ENT_QUOTES, 'UTF-8').'"', $sImgTag); // preserve other attributes, must convert & to & to be idempotent with CKEditor $aNeedles[] = $sImgTag; $aReplacements[] = $sNewImgTag; } @@ -422,7 +422,7 @@ EOF // Hook the file upload of all CKEditor instances $('.htmlEditor').each(function() { var oEditor = $(this).ckeditorGet(); - oEditor.config.extraPlugins = 'uploadimage'; + oEditor.config.extraPlugins = 'font,uploadimage'; oEditor.config.uploadUrl = '$sAbsoluteUrlAppRoot'+'pages/ajax.render.php'; oEditor.config.filebrowserBrowseUrl = '$sAbsoluteUrlAppRoot'+'pages/ajax.render.php?operation=cke_browse&temp_id=$sTempId&obj_class=$sObjClass&obj_key=$iObjKey'; oEditor.on( 'fileUploadResponse', function( evt ) {