r14537 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14536‎ | r14537 | r14538 >
Date:13:59, 2 June 2006
Author:magnusmanske
Status:old
Tags:
Comment:
minor fix
Modified paths:
  • /trunk/wiki2xml/php/wiki2xml.php (modified) (history)

Diff [purge]

Index: trunk/wiki2xml/php/wiki2xml.php
@@ -138,11 +138,16 @@
139139 $b = $a ;
140140 $x = "" ;
141141 if ( $b >= $this->wl ) return false ;
 142+ $bi = $this->bold_italics ;
 143+ $this->bold_italics = '' ;
142144 $closeit1 = $closeit[0] ;
143145 while ( 1 )
144146 {
145147 $c = $this->w[$b] ;
146 - if ( $closeit != "}}" && $c == "\n" ) return false ;
 148+ if ( $closeit != "}}" && $c == "\n" ) {
 149+ $this->bold_italics = $bi ;
 150+ return false ;
 151+ }
147152 if ( $c == "|" ) break ;
148153 if ( $c == $closeit1 && $this->nextis ( $b , $closeit , false ) ) break ;
149154 if ( !$istarget ) {
@@ -161,12 +166,16 @@
162167 }
163168 $x .= htmlspecialchars ( $c ) ;
164169 $b++ ;
165 - if ( $b >= $this->wl ) return false ;
 170+ if ( $b >= $this->wl ) {
 171+ $this->bold_italics = $bi ;
 172+ return false ;
166173 }
 174+ }
167175
168176 if ( $closeit == "}}" && !$istarget ) {
169177 $xml .= substr ( $this->w , $a , $b - $a ) ;
170178 $a = $b ;
 179+ $this->bold_italics = $bi ;
171180 return true ;
172181 }
173182
@@ -179,6 +188,7 @@
180189 }
181190 else $xml .= $x ;
182191 $a = $b ;
 192+ $this->bold_italics = $bi ;
183193 return true ;
184194 }
185195
@@ -491,7 +501,8 @@
492502 $url = "" ;
493503 $c = $b ;
494504 $x = "" ;
495 - while ( $this->w[$c] == "{" && $this->once ( $c , $x , "template" ) ) $c = $b ;
 505+ while ( $c < $this->wl && $this->w[$c] == "{" && $this->once ( $c , $x , "template" ) ) $c = $b ;
 506+ if ( $c >= $this->wl ) return false ;
496507 $x = "" ;
497508 if ( !$this->p_external_freelink ( $b , $url , false ) ) return false ;
498509 $this->skipblanks ( $b ) ;

Status & tagging log