Преглед изворни кода

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.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4112 a333f486-631f-4898-b8df-5754b55c2be0

dflaven пре 9 година
родитељ
комит
a47ff4d023
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      core/inlineimage.class.inc.php

+ 2 - 2
core/inlineimage.class.inc.php

@@ -221,7 +221,7 @@ class InlineImage extends DBObject
 				}
 				}
 				$sAttId = $aImgInfo[2][0];
 				$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;
 				$aNeedles[] = $sImgTag;
 				$aReplacements[] = $sNewImgTag;
 				$aReplacements[] = $sNewImgTag;
 			}
 			}
@@ -422,7 +422,7 @@ EOF
 		// Hook the file upload of all CKEditor instances
 		// Hook the file upload of all CKEditor instances
 		$('.htmlEditor').each(function() {
 		$('.htmlEditor').each(function() {
 			var oEditor = $(this).ckeditorGet();
 			var oEditor = $(this).ckeditorGet();
-			oEditor.config.extraPlugins = 'uploadimage';
+			oEditor.config.extraPlugins = 'font,uploadimage';
 			oEditor.config.uploadUrl = '$sAbsoluteUrlAppRoot'+'pages/ajax.render.php';
 			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.config.filebrowserBrowseUrl = '$sAbsoluteUrlAppRoot'+'pages/ajax.render.php?operation=cke_browse&temp_id=$sTempId&obj_class=$sObjClass&obj_key=$iObjKey';
 			oEditor.on( 'fileUploadResponse', function( evt ) {
 			oEditor.on( 'fileUploadResponse', function( evt ) {