http://www.mediawiki.org/wiki/Special:Code/MediaWiki/74025

Revision: 74025
Author:   demon
Date:     2010-09-30 15:35:10 +0000 (Thu, 30 Sep 2010)

Log Message:
-----------
(bug 25367) wfShellExec() is more explicit when failing due to disabled 
passthru()

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/GlobalFunctions.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2010-09-30 14:00:07 UTC (rev 74024)
+++ trunk/phase3/RELEASE-NOTES  2010-09-30 15:35:10 UTC (rev 74025)
@@ -341,6 +341,7 @@
 * (bug 25292) SkinSubPageSubtitle hook now passes the Skin object as second
   parameter
 * (bug 25167) Correctly load JS fixes for IE6 (fixing a regression in 1.16)
+* (bug 25367) wfShellExec() is more explicit when failing due to disabled 
passthru()
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.

Modified: trunk/phase3/includes/GlobalFunctions.php
===================================================================
--- trunk/phase3/includes/GlobalFunctions.php   2010-09-30 14:00:07 UTC (rev 
74024)
+++ trunk/phase3/includes/GlobalFunctions.php   2010-09-30 15:35:10 UTC (rev 
74025)
@@ -2449,19 +2449,21 @@
                $disabled = false;
                if( wfIniGetBool( 'safe_mode' ) ) {
                        wfDebug( "wfShellExec can't run in safe_mode, PHP's 
exec functions are too broken.\n" );
-                       $disabled = true;
+                       $disabled = 'safemode';
                }
                $functions = explode( ',', ini_get( 'disable_functions' ) );
                $functions = array_map( 'trim', $functions );
                $functions = array_map( 'strtolower', $functions );
                if ( in_array( 'passthru', $functions ) ) {
                        wfDebug( "passthru is in disabled_functions\n" );
-                       $disabled = true;
+                       $disabled = 'passthru';
                }
        }
        if ( $disabled ) {
                $retval = 1;
-               return 'Unable to run external programs in safe mode.';
+               return $disabled == 'safemode' ?
+                       'Unable to run external programs in safe mode.' :
+                       'Unable to run external programs, passthru() is 
disabled.';
        }
 
        wfInitShellLocale();



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

Reply via email to