Show
Ignore:
Timestamp:
2008-04-22 14:03:31 (7 months ago)
Author:
wwalc
Message:

Fix for #2069: templates removed from tags attributes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • MediaWiki/trunk/FCKeditor.body.php

    r1929 r1941  
    124124                return true; 
    125125        } 
     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                } 
     139 
     140                return true; 
     141        } 
    126142 
    127143        public function registerHooks() { 
     
    139155                $wgHooks['ParserBeforeInternalParse'][]         = array($this, "onParserBeforeInternalParse"); 
    140156                $wgHooks['EditPageBeforeConflictDiff'][]                = array($this, 'onEditPageBeforeConflictDiff'); 
     157                $wgHooks['SanitizerAfterFixTagAttributes'][]    = array($this, 'onSanitizerAfterFixTagAttributes'); 
    141158 
    142159                if ($this->debug) {