Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -243,6 +243,8 @@ |
244 | 244 | * Special:Contributions/newbies now shows the contributions for the user "newbies". |
245 | 245 | New user contributions are obtained using the form or using ?contribs=newbie in URL. |
246 | 246 | * It is now possible to delete images that have no corresponding description pages. |
| 247 | +* (bug 33165) GlobalFunctions.php line 1312: Call to a member function |
| 248 | + getText() on a non-object |
247 | 249 | |
248 | 250 | === API changes in 1.19 === |
249 | 251 | * Made action=edit less likely to return "unknownerror", by returning the actual error |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -1555,14 +1555,19 @@ |
1556 | 1556 | } |
1557 | 1557 | |
1558 | 1558 | $messageCache = MessageCache::singleton(); |
1559 | | - if( in_array( 'parse', $options, true ) ) { |
1560 | | - $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj )->getText(); |
1561 | | - } elseif ( in_array( 'parseinline', $options, true ) ) { |
1562 | | - $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj )->getText(); |
1563 | | - $m = array(); |
1564 | | - if( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) { |
1565 | | - $string = $m[1]; |
| 1559 | + $parseInline = in_array( 'parseinline', $options, true ); |
| 1560 | + if( in_array( 'parse', $options, true ) || $parseInline ) { |
| 1561 | + $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj ); |
| 1562 | + if ( $string instanceof ParserOutput ) { |
| 1563 | + $string = $string->getText(); |
1566 | 1564 | } |
| 1565 | + |
| 1566 | + if ( $parseInline ) { |
| 1567 | + $m = array(); |
| 1568 | + if( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) { |
| 1569 | + $string = $m[1]; |
| 1570 | + } |
| 1571 | + } |
1567 | 1572 | } elseif ( in_array( 'parsemag', $options, true ) ) { |
1568 | 1573 | $string = $messageCache->transform( $string, |
1569 | 1574 | !$forContent, $langCodeObj ); |