mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PageImages
synced 2024-11-24 08:23:28 +00:00
fixes
This commit is contained in:
parent
63361c93c3
commit
54b528a363
|
@ -1,7 +1,18 @@
|
|||
<?php
|
||||
|
||||
class PageImages {
|
||||
public static function registerImage( Title $title, File $file, array &$params, Parser $parser ) {
|
||||
/**
|
||||
*
|
||||
* @param Title $title
|
||||
* @param File|bool $file
|
||||
* @param array $params
|
||||
* @param Parser $parser
|
||||
* @return bool
|
||||
*/
|
||||
public static function registerImage( Title $title, $file, array &$params, Parser $parser ) {
|
||||
if ( !$file ) {
|
||||
return true;
|
||||
}
|
||||
$out = $parser->getOutput();
|
||||
if ( !isset( $out->pageImages ) ) {
|
||||
$out->pageImages = array();
|
||||
|
@ -47,7 +58,7 @@ class PageImages {
|
|||
},
|
||||
$jpegs
|
||||
);
|
||||
arsort( $jpegScores );
|
||||
rsort( $jpegScores );
|
||||
if ( count( $jpegScores ) && $jpegScores[0] >= 0 ) {
|
||||
$lu->mProperties['has_photos'] = 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue