Ticket #2069: 2069.patch
File 2069.patch, 3.1 KB (added by , 17 years ago) |
---|
-
FCKeditor.body.php
123 123 124 124 return true; 125 125 } 126 127 public function onSanitizerAfterFixTagAttributes($text, $element, &$attribs) 128 { 129 $text = preg_match_all("/Fckmw\d+fckmw/", $text, $matches); 130 131 if (!empty($matches[0][0])) { 132 global $leaveRawTemplates; 133 if (!isset($leaveRawTemplates)) { 134 $leaveRawTemplates = array(); 135 } 136 $leaveRawTemplates = array_merge($leaveRawTemplates, $matches[0]); 137 $attribs = array_merge($attribs, $matches[0]); 138 } 126 139 140 return true; 141 } 142 127 143 public function registerHooks() { 128 144 global $wgHooks, $wgExtensionFunctions; 129 145 … … 138 154 $wgHooks['LanguageGetMagic'][] = array($this, "onLanguageGetMagic"); 139 155 $wgHooks['ParserBeforeInternalParse'][] = array($this, "onParserBeforeInternalParse"); 140 156 $wgHooks['EditPageBeforeConflictDiff'][] = array($this, 'onEditPageBeforeConflictDiff'); 157 $wgHooks['SanitizerAfterFixTagAttributes'][] = array($this, 'onSanitizerAfterFixTagAttributes'); 141 158 142 159 if ($this->debug) { 143 160 /* -
FCKeditorParser.body.php
463 463 } 464 464 465 465 if (!empty($this->fck_mw_strtr_span)) { 466 global $leaveRawTemplates; 467 if (!empty($leaveRawTemplates)) { 468 foreach ($leaveRawTemplates as $l) { 469 $this->fck_mw_strtr_span[$l] = substr($this->fck_mw_strtr_span[$l], 30, -7); 470 } 471 } 466 472 $parserOutput->setText(strtr($parserOutput->getText(), $this->fck_mw_strtr_span)); 467 473 } 468 474 -
mw12/FCKeditorParser_OldPP.body.php
463 463 } 464 464 465 465 if (!empty($this->fck_mw_strtr_span)) { 466 global $leaveRawTemplates; 467 if (!empty($leaveRawTemplates)) { 468 foreach ($leaveRawTemplates as $l) { 469 $this->fck_mw_strtr_span[$l] = substr($this->fck_mw_strtr_span[$l], 30, -7); 470 } 471 } 466 472 $parserOutput->setText(strtr($parserOutput->getText(), $this->fck_mw_strtr_span)); 467 473 } 468 474 if (!empty($this->fck_matches)) { -
plugins/mediawiki/fckplugin.js
672 672 else 673 673 sAttValue = htmlNode.getAttribute( sAttName, 2 ) ; // We must use getAttribute to get it exactly as it is defined. 674 674 675 attStr += ' ' + sAttName + '="' + String(sAttValue).replace( '"', '"' ) + '"' ; 675 // leave templates 676 if ( sAttName.StartsWith( '{{' ) && sAttName.EndsWith( '}}' ) ) { 677 attStr += ' ' + sAttName ; 678 } 679 else { 680 attStr += ' ' + sAttName + '="' + String(sAttValue).replace( '"', '"' ) + '"' ; 681 } 676 682 } 677 683 } 678 684 return attStr ;