jenkins-bot has submitted this change and it was merged.

Change subject: ResourceLoaderImageModule: Improve PHP 5.3 compatibility
......................................................................


ResourceLoaderImageModule: Improve PHP 5.3 compatibility

In PHP 5.3.x and older, the isset() check in code example below will
yield true. In PHP 5.4 and later, and HHVM, it will correctly yield
false. http://3v4l.org/8p3hm

  $options = 'foo';
  isset( $options['bar'] );

Let's not depend on this behavior here.

Change-Id: I67e83af8afe85b3ddfb5db0009759b8ac5bb7d67
---
M includes/resourceloader/ResourceLoaderImageModule.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/resourceloader/ResourceLoaderImageModule.php 
b/includes/resourceloader/ResourceLoaderImageModule.php
index 5be4419..3d65745 100644
--- a/includes/resourceloader/ResourceLoaderImageModule.php
+++ b/includes/resourceloader/ResourceLoaderImageModule.php
@@ -158,7 +158,7 @@
                                        $imageDesc = is_string( $options ) ? 
$options : $options['image'];
 
                                        $allowedVariants = array_merge(
-                                               isset( $options['variants'] ) ? 
$options['variants'] : array(),
+                                               is_array( $options ) && isset( 
$options['variants'] ) ? $options['variants'] : array(),
                                                $this->getGlobalVariants( $type 
)
                                        );
                                        if ( isset( $this->variants[$type] ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/200480
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I67e83af8afe85b3ddfb5db0009759b8ac5bb7d67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <matma....@gmail.com>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to