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

Change subject: Avoid fataling Special:Version if LuaSandbox is enabled without 
the PHP extension
......................................................................


Avoid fataling Special:Version if LuaSandbox is enabled without the PHP 
extension

Such a configuration is completely broken, but it's easy enough to
detect and avoid here.

Bug: T131910
Change-Id: I0bf108ec191a59f5506c0cdab00f3e5e68158ed5
---
M engines/LuaSandbox/Engine.php
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/engines/LuaSandbox/Engine.php b/engines/LuaSandbox/Engine.php
index 7eb9c2e..759b738 100644
--- a/engines/LuaSandbox/Engine.php
+++ b/engines/LuaSandbox/Engine.php
@@ -11,6 +11,13 @@
        }
 
        public function getSoftwareInfo( array &$software ) {
+               if ( !extension_loaded( 'luasandbox' ) ) {
+                       // They shouldn't be using this engine if the extension 
isn't
+                       // loaded. But in case they do for some reason, let's 
not have
+                       // Special:Version fatal.
+                       return;
+               }
+
                if ( is_callable( 'LuaSandbox::getVersionInfo' ) ) {
                        $versions = LuaSandbox::getVersionInfo();
                } else {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0bf108ec191a59f5506c0cdab00f3e5e68158ed5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to