# Note that $height <= $maxHeight now, but might not be identical
# because of rounding.
}
- $msgbig = wfMsgHtml( 'show-big-image' );
+ $msgbig = wfMsgHtml( 'show-big-image' );
+ if ( $this->displayImg->getRepo()->canTransformVia404() ) {
+ $thumbSizes = $wgImageLimits;
+ } else {
+ # Creating thumb links triggers thumbnail generation.
+ # Just generate the thumb for the current users prefs.
+ $thumbOption = $user->getOption( 'thumbsize' );
+ $thumbSizes = array( isset( $wgImageLimits[$thumbOption] )
+ ? $wgImageLimits[$thumbOption]
+ : $wgImageLimits[User::getDefaultOption( 'thumbsize' )] );
+ }
+ # Generate thumbnails or thumbnail links as needed...
$otherSizes = array();
- foreach ( $wgImageLimits as $size ) {
- if ( $size[0] < $width_orig && $size[1] < $height_orig &&
- $size[0] != $width && $size[1] != $height ) {
+ foreach ( $thumbSizes as $size ) {
+ if ( $size[0] < $width_orig && $size[1] < $height_orig
+ && $size[0] != $width && $size[1] != $height )
+ {
$otherSizes[] = $this->makeSizeLink( $params, $size[0], $size[1] );
}
}
$msgsmall = wfMessage( 'show-big-image-preview' )->
rawParams( $this->makeSizeLink( $params, $width, $height ) )->
parse();
- if ( count( $otherSizes ) && $this->displayImg->getRepo()->canTransformVia404() ) {
+ if ( count( $otherSizes ) ) {
$msgsmall .= ' ' .
Html::rawElement( 'span', array( 'class' => 'mw-filepage-other-resolutions' ),
wfMessage( 'show-big-image-other' )->rawParams( $lang->pipeList( $otherSizes ) )->
*/
public static function newFromID( $id, $flags = 0 ) {
$db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
- $row = $db->selectRow( 'page', '*', array( 'page_id' => $id ), __METHOD__ );
+ $row = $db->selectRow(
+ 'page',
+ array(
+ 'page_namespace', 'page_title', 'page_id',
+ 'page_len', 'page_is_redirect', 'page_latest',
+ ),
+ array( 'page_id' => $id ),
+ __METHOD__
+ );
if ( $row !== false ) {
$title = Title::newFromRow( $row );
} else {
$pageId = $this->getArticleID( $flags );
if ( $pageId ) {
$db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
- $row = $db->selectRow( 'revision', '*',
+ $row = $db->selectRow( 'revision', Revision::selectFields(),
array( 'rev_page' => $pageId ),
__METHOD__,
array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 1 )
}
$dbr = wfGetDB( DB_MASTER );
- $s = $dbr->selectRow( 'user', '*', array( 'user_id' => $this->mId ), __METHOD__ );
+ $s = $dbr->selectRow( 'user', self::selectFields(), array( 'user_id' => $this->mId ), __METHOD__ );
wfRunHooks( 'UserLoadFromDatabase', array( $this, &$s ) );
$res = $dbr->select(
'user_properties',
- '*',
+ array( 'up_property', 'up_value' ),
array( 'up_user' => $this->getId() ),
__METHOD__
);
return $ret;
}
+
+ /**
+ * Return the list of user fields that should be selected to create
+ * a new user object.
+ * @return array
+ */
+ public static function selectFields() {
+ return array(
+ 'user_id',
+ 'user_name',
+ 'user_real_name',
+ 'user_password',
+ 'user_newpassword',
+ 'user_newpass_time',
+ 'user_email',
+ 'user_touched',
+ 'user_token',
+ 'user_email_authenticated',
+ 'user_email_token',
+ 'user_email_token_expires',
+ 'user_registration',
+ 'user_editcount',
+ );
+ }
}
public function getParamDescription() {
return array(
'xmldoublequote' => 'If specified, double quotes all attributes and content',
- 'xslt' => 'If specified, adds <xslt> as stylesheet',
+ 'xslt' => 'If specified, adds <xslt> as stylesheet. This should be a wiki page '
+ . 'in the MediaWiki namespace whose page name ends with ".xsl"',
'includexmlnamespace' => 'If specified, adds an XML namespace'
);
}
if ( count( $goodNames ) ) {
$this->addTables( 'user' );
- $this->addFields( '*' );
+ $this->addFields( User::selectFields() );
$this->addWhereFld( 'user_name', $goodNames );
if ( isset( $this->prop['groups'] ) || isset( $this->prop['rights'] ) ) {
$method = 'email';
$res = wfGetDB( DB_SLAVE )->select(
'user',
- '*',
+ User::selectFields(),
array( 'user_email' => $data['Email'] ),
__METHOD__
);
/**
* Enforces a byte limit to a textbox, so that UTF-8 entries are counted as well, when, for example,
- * a databae field has a byte limit rather than a character limit.
+ * a database field has a byte limit rather than a character limit.
* Plugin rationale: Browser has native maxlength for number of characters, this plugin exists to
* limit number of bytes instead.
*
!! end
+!! test
+Definition list with empty definition and following paragraph
+!! input
+; term:
+Paragraph text
+!! result
+<dl><dt> term</dt><dd>
+</dd></dl>
+<p>Paragraph text
+</p>
+!! end
###
### External links