Index: trunk/extensions/Lingo/LingoParser.php |
— | — | @@ -151,7 +151,7 @@ |
152 | 152 | wfSuppressWarnings(); |
153 | 153 | |
154 | 154 | $doc = DOMDocument::loadHTML( |
155 | | - '<html><meta http-equiv="content-type" content="charset=utf-8"/>' . $text . '</html>' |
| 155 | + '<html><head><meta http-equiv="content-type" content="charset=utf-8"/></head><body>' . $text . '</body></html>' |
156 | 156 | ); |
157 | 157 | |
158 | 158 | wfRestoreWarnings(); |
— | — | @@ -251,12 +251,14 @@ |
252 | 252 | if ( $changedDoc ) { |
253 | 253 | $body = $xpath->query( '/html/body' ); |
254 | 254 | |
255 | | - $text = ''; |
256 | | - foreach ( $body->item( 0 )->childNodes as $child ) { |
257 | | - $text .= $doc->saveXML( $child ); |
| 255 | + if ( $body->length > 0 ) { |
| 256 | + $text = ''; |
| 257 | + foreach ( $body->item( 0 )->childNodes as $child ) { |
| 258 | + $text .= $doc->saveXML( $child ); |
| 259 | + } |
| 260 | + |
| 261 | + $this->loadModules( $parser ); |
258 | 262 | } |
259 | | - |
260 | | - $this->loadModules( $parser ); |
261 | 263 | } |
262 | 264 | |
263 | 265 | wfProfileOut( __METHOD__ ); |