Changeset 1867

Show
Ignore:
Timestamp:
2008-04-01 16:57:12 (4 months ago)
Author:
wwalc
Message:

Additional fix for #1035 (html comments missing).

Location:
MediaWiki/trunk
Files:
2 modified

Legend:

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

    r1865 r1867  
    4545         * @return string 
    4646         */ 
    47         private function fck_addToStrtr($text) { 
     47        private function fck_addToStrtr($text, $replaceLineBreaks = true) { 
    4848                $key = 'Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw'; 
    4949                $this->fck_mw_strtr_span_counter++; 
    50                 $this->fck_mw_strtr_span[$key] = str_replace(array("\r\n", "\n", "\r"),"fckLR",$text); 
     50                if ($replaceLineBreaks) { 
     51                        $this->fck_mw_strtr_span[$key] = str_replace(array("\r\n", "\n", "\r"),"fckLR",$text); 
     52                } 
     53                else { 
     54                        $this->fck_mw_strtr_span[$key] = $text; 
     55                } 
    5156                return $key; 
    5257        } 
     
    288293                                # Remove the comment, leading and trailing 
    289294                                # spaces, and leave only one newline. 
    290                                 $replacement = $this->fck_addToStrtr(substr($text, $spaceStart, $spaceLen+1)); 
     295                                $replacement = $this->fck_addToStrtr(substr($text, $spaceStart, $spaceLen+1), false); 
    291296                                $text = substr_replace($text, $replacement."\n", $spaceStart, $spaceLen + 1); 
    292297                        } 
    293298                        else { 
    294299                                # Remove just the comment. 
    295                                 $replacement = $this->fck_addToStrtr(substr($text, $start, $end - $start)); 
     300                                $replacement = $this->fck_addToStrtr(substr($text, $start, $end - $start), false); 
    296301                                $text = substr_replace($text, $replacement, $start, $end - $start); 
    297302                        } 
  • MediaWiki/trunk/mw12/FCKeditorParser_OldPP.body.php

    r1865 r1867  
    4545         * @return string 
    4646         */ 
    47         private function fck_addToStrtr($text) { 
     47        private function fck_addToStrtr($text, $replaceLineBreaks = true) { 
    4848                $key = 'Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw'; 
    4949                $this->fck_mw_strtr_span_counter++; 
    50                 $this->fck_mw_strtr_span[$key] = str_replace(array("\r\n", "\n", "\r"),"fckLR",$text); 
     50                if ($replaceLineBreaks) { 
     51                        $this->fck_mw_strtr_span[$key] = str_replace(array("\r\n", "\n", "\r"),"fckLR",$text); 
     52                } 
     53                else { 
     54                        $this->fck_mw_strtr_span[$key] = $text; 
     55                } 
    5156                return $key; 
    5257        } 
     
    288293                                # Remove the comment, leading and trailing 
    289294                                # spaces, and leave only one newline. 
    290                                 $replacement = $this->fck_addToStrtr(substr($text, $spaceStart, $spaceLen+1)); 
     295                                $replacement = $this->fck_addToStrtr(substr($text, $spaceStart, $spaceLen+1), false); 
    291296                                $text = substr_replace($text, $replacement."\n", $spaceStart, $spaceLen + 1); 
    292297                        } 
    293298                        else { 
    294299                                # Remove just the comment. 
    295                                 $replacement = $this->fck_addToStrtr(substr($text, $start, $end - $start)); 
     300                                $replacement = $this->fck_addToStrtr(substr($text, $start, $end - $start), false); 
    296301                                $text = substr_replace($text, $replacement, $start, $end - $start); 
    297302                        }