From e6bb9de12b4ca0ee0d2d33cebf610fb2a274b484 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 9 Dec 2004 02:13:00 +0000 Subject: [PATCH] Merge image gallery fixlets from 1.4 --- includes/ImageGallery.php | 8 ++++---- includes/Parser.php | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index 33be587aa9..44177d62a8 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -33,10 +33,10 @@ class ImageGallery * Add an image to the gallery. * * @param Image $image Image object that is added to the gallery - * @param string $text Additional text to be shown. The name and size of the image are always shown. + * @param string $html Additional HTML text to be shown. The name and size of the image are always shown. */ - function add( $image, $text='' ) { - $this->mImages[] = array( &$image, $text ); + function add( $image, $html='' ) { + $this->mImages[] = array( &$image, $html ); } /** @@ -123,7 +123,7 @@ class ImageGallery ''. '
' . $sk->makeKnownLinkObj( $nt, '' ) . '
' . - $textlink . htmlspecialchars( $text ) . $nb; + $textlink . $text . $nb; $s .= "\n" . (($i%4==3) ? "\n" : ''); diff --git a/includes/Parser.php b/includes/Parser.php index 9477b66f6f..0e911d6c92 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3106,7 +3106,12 @@ class Parser } else { $label = ''; } - $ig->add( Image::newFromTitle( $nt ), $label ); + + # FIXME: Use the full wiki parser and add its links + # to the page's links. + $html = $this->mOptions->mSkin->formatComment( $label ); + + $ig->add( Image::newFromTitle( $nt ), $html ); $wgLinkCache->addImageLinkObj( $nt ); } return $ig->toHTML(); -- 2.20.1