From 2af231d5dcda65603c1bf2e8c6561440fb99b62e Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 7 Jan 2006 00:44:28 +0000 Subject: [PATCH] Fixed broken image registration, by making Parser::renderImageGallery() non-static. This method is possible because it does not appear to be called from outside Parser anymore. --- includes/ImageGallery.php | 1 + includes/Parser.php | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index c33a3f2596..34529b2176 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -106,6 +106,7 @@ class ImageGallery $s .= '
' . htmlspecialchars( $nt->getText() ) . '
' . (($i%4==3) ? "\n" : ''); $i++; + var_dump( $nt ); continue; } diff --git a/includes/Parser.php b/includes/Parser.php index abd372c322..3050e7797a 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -426,7 +426,7 @@ class Parser foreach( $gallery_content as $marker => $content ) { require_once( 'ImageGallery.php' ); if ( $render ) { - $gallery_content[$marker] = Parser::renderImageGallery( $content ); + $gallery_content[$marker] = $this->renderImageGallery( $content ); } else { $gallery_content[$marker] = ''.$content.''; } @@ -3529,12 +3529,9 @@ class Parser * given as text will return the HTML of a gallery with two images, * labeled 'The number "1"' and * 'A tree'. - * - * @static */ function renderImageGallery( $text ) { # Setup the parser - global $wgTitle; $parserOptions = new ParserOptions; $localParser = new Parser(); @@ -3551,7 +3548,7 @@ class Parser if ( count( $matches ) == 0 ) { continue; } - $nt = Title::newFromURL( $matches[1] ); + $nt =& Title::newFromText( $matches[1] ); if( is_null( $nt ) ) { # Bogus title. Ignore these so we don't bomb out later. continue; @@ -3562,8 +3559,8 @@ class Parser $label = ''; } - $html = $localParser->parse( $label , $wgTitle, $parserOptions ); - $html = $html->mText; + $pout = $localParser->parse( $label , $this->mTitle, $parserOptions ); + $html = $pout->getText(); $ig->add( new Image( $nt ), $html ); $this->mOutput->addImage( $nt->getDBkey() ); -- 2.20.1