X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FImageGallery.php;h=5a8fb8e4f8fe8534edc6775ee9ef077fb897788f;hb=8263743db1106db6792e0a8f889db1b5f1432e6f;hp=5c2ed89fe321a0319e055eef5a718a01750f4854;hpb=899ed5e58e937da3056cce68c56501b49b468597;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index 5c2ed89fe3..5a8fb8e4f8 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -28,9 +28,9 @@ class ImageGallery { * Contextual title, used when images are being screened * against the bad image list */ - private $contextTitle = false; + protected $contextTitle = false; - private $mAttribs = array(); + protected $mAttribs = array(); /** * Fixed margins @@ -75,7 +75,7 @@ class ImageGallery { /** * Set the caption (as plain text) * - * @param $caption Caption + * @param $caption string Caption */ function setCaption( $caption ) { $this->mCaption = htmlspecialchars( $caption ); @@ -131,7 +131,7 @@ class ImageGallery { * @deprecated since 1.18 Not used anymore */ function useSkin( $skin ) { - wfDeprecated( __METHOD__ ); + wfDeprecated( __METHOD__, '1.18' ); /* no op */ } @@ -168,6 +168,7 @@ class ImageGallery { /** * isEmpty() returns true if the gallery contains no images + * @return bool */ function isEmpty() { return empty( $this->mImages ); @@ -215,13 +216,14 @@ class ImageGallery { * - the additional text provided when adding the image * - the size of the image * + * @return string */ function toHTML() { global $wgLang; if ( $this->mPerRow > 0 ) { $maxwidth = $this->mPerRow * ( $this->mWidths + self::THUMB_PADDING + self::GB_PADDING + self::GB_BORDERS ); - $oldStyle = isset( $this->mAttribs['style'] ) ? $this->mAttribs['style'] : ''; + $oldStyle = isset( $this->mAttribs['style'] ) ? $this->mAttribs['style'] : ''; # _width is ignored by any sane browser. IE6 doesn't know max-width so it uses _width instead $this->mAttribs['style'] = "max-width: {$maxwidth}px;_width: {$maxwidth}px;" . $oldStyle; } @@ -249,11 +251,11 @@ class ImageGallery { # Get the file... if ( $this->mParser instanceof Parser ) { # Give extensions a chance to select the file revision for us - $time = $sha1 = false; + $options = array(); wfRunHooks( 'BeforeParserFetchFileAndTitle', - array( $this->mParser, $nt, &$time, &$sha1, &$descQuery ) ); + array( $this->mParser, $nt, &$options, &$descQuery ) ); # Fetch and register the file (file title may be different via hooks) - list( $img, $nt ) = $this->mParser->fetchFileAndTitle( $nt, $time, $sha1 ); + list( $img, $nt ) = $this->mParser->fetchFileAndTitle( $nt, $options ); } else { $img = wfFindFile( $nt ); } @@ -314,8 +316,7 @@ class ImageGallery { if( $this->mShowBytes ) { if( $img ) { - $fileSize = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'), - $wgLang->formatNum( $img->getSize() ) ); + $fileSize = htmlspecialchars( $wgLang->formatSize( $img->getSize() ) ); } else { $fileSize = wfMsgHtml( 'filemissing' ); }