* 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
/**
* Set the caption (as plain text)
*
- * @param $caption Caption
+ * @param $caption string Caption
*/
function setCaption( $caption ) {
$this->mCaption = htmlspecialchars( $caption );
* @deprecated since 1.18 Not used anymore
*/
function useSkin( $skin ) {
- wfDeprecated( __METHOD__ );
+ wfDeprecated( __METHOD__, '1.18' );
/* no op */
}
/**
* isEmpty() returns true if the gallery contains no images
+ * @return bool
*/
function isEmpty() {
return empty( $this->mImages );
* - 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;
}
# 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 );
}
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' );
}