Index: trunk/wiki2xml/php/wiki2xml.php |
— | — | @@ -138,11 +138,16 @@ |
139 | 139 | $b = $a ; |
140 | 140 | $x = "" ; |
141 | 141 | if ( $b >= $this->wl ) return false ; |
| 142 | + $bi = $this->bold_italics ; |
| 143 | + $this->bold_italics = '' ; |
142 | 144 | $closeit1 = $closeit[0] ; |
143 | 145 | while ( 1 ) |
144 | 146 | { |
145 | 147 | $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 | + } |
147 | 152 | if ( $c == "|" ) break ; |
148 | 153 | if ( $c == $closeit1 && $this->nextis ( $b , $closeit , false ) ) break ; |
149 | 154 | if ( !$istarget ) { |
— | — | @@ -161,12 +166,16 @@ |
162 | 167 | } |
163 | 168 | $x .= htmlspecialchars ( $c ) ; |
164 | 169 | $b++ ; |
165 | | - if ( $b >= $this->wl ) return false ; |
| 170 | + if ( $b >= $this->wl ) { |
| 171 | + $this->bold_italics = $bi ; |
| 172 | + return false ; |
166 | 173 | } |
| 174 | + } |
167 | 175 | |
168 | 176 | if ( $closeit == "}}" && !$istarget ) { |
169 | 177 | $xml .= substr ( $this->w , $a , $b - $a ) ; |
170 | 178 | $a = $b ; |
| 179 | + $this->bold_italics = $bi ; |
171 | 180 | return true ; |
172 | 181 | } |
173 | 182 | |
— | — | @@ -179,6 +188,7 @@ |
180 | 189 | } |
181 | 190 | else $xml .= $x ; |
182 | 191 | $a = $b ; |
| 192 | + $this->bold_italics = $bi ; |
183 | 193 | return true ; |
184 | 194 | } |
185 | 195 | |
— | — | @@ -491,7 +501,8 @@ |
492 | 502 | $url = "" ; |
493 | 503 | $c = $b ; |
494 | 504 | $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 ; |
496 | 507 | $x = "" ; |
497 | 508 | if ( !$this->p_external_freelink ( $b , $url , false ) ) return false ; |
498 | 509 | $this->skipblanks ( $b ) ; |