Check that file is executable in Installer::locateExecutable
authorOri Livneh <ori@wikimedia.org>
Wed, 1 Jun 2016 17:42:34 +0000 (10:42 -0700)
committerOri Livneh <ori@wikimedia.org>
Wed, 1 Jun 2016 17:44:22 +0000 (10:44 -0700)
Just because the file exists doesn't mean that we can run.
Use is_executable(), a one-shot check for both existence and executability.

Change-Id: I705010b01cd3a17c3950eebae3066d7b007f706e

includes/installer/Installer.php

index 85b1013..ae1a2a7 100644 (file)
@@ -1279,7 +1279,7 @@ abstract class Installer {
                        $command = $path . DIRECTORY_SEPARATOR . $name;
 
                        MediaWiki\suppressWarnings();
-                       $file_exists = file_exists( $command );
+                       $file_exists = is_executable( $command );
                        MediaWiki\restoreWarnings();
 
                        if ( $file_exists ) {