jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/395023 )

Change subject: Avoid passing null to count()
......................................................................


Avoid passing null to count()

PHP 7.2 made the questionable decision to raise a warning for
count( null ). So test for null explicitly before calling count in the
one place where null is expected.

Bug: T181891
Change-Id: I94146c14b63e32ad1e9f2ab9de9ebc403b251102
---
M engines/LuaStandalone/LuaStandaloneEngine.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  星耀晨曦: Looks good to me, but someone else must approve
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/engines/LuaStandalone/LuaStandaloneEngine.php 
b/engines/LuaStandalone/LuaStandaloneEngine.php
index d381590..728e3c0 100644
--- a/engines/LuaStandalone/LuaStandaloneEngine.php
+++ b/engines/LuaStandalone/LuaStandaloneEngine.php
@@ -432,7 +432,7 @@
                }
 
                // Convert to a 1-based array
-               if ( count( $result ) ) {
+               if ( $result !== null && count( $result ) ) {
                        $result = array_combine( range( 1, count( $result ) ), 
$result );
                } else {
                        $result = [];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I94146c14b63e32ad1e9f2ab9de9ebc403b251102
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
Gerrit-Reviewer: 星耀晨曦 <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to