]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - config/Installer.php
MediaWiki 1.16.1
[autoinstallsdev/mediawiki.git] / config / Installer.php
index 293a1a6c6f44ddd880c1daef5847081b64d75519..f00a850d7219d8156cc025332a62755944e3b2aa 100644 (file)
@@ -25,6 +25,7 @@ if( !defined( 'MEDIAWIKI_INSTALL' ) ) {
 
 error_reporting( E_ALL | E_STRICT );
 header( "Content-type: text/html; charset=utf-8" );
+header( 'X-Frame-Options: DENY' );
 @ini_set( "display_errors", true );
 
 # In case of errors, let output be clean.
@@ -47,6 +48,8 @@ require_once( "$IP/includes/Exception.php" );
 require_once( "$IP/includes/json/Services_JSON.php" );
 require_once( "$IP/includes/json/FormatJson.php" );
 
+$wgMaxShellMemory = 0;
+
 # If we get an exception, the user needs to know
 # all the details
 $wgShowExceptionDetails = true;
@@ -2148,7 +2151,7 @@ function locate_executable($loc, $names, $versioninfo = false) {
                                return $command;
 
                        $file = str_replace('$1', $command, $versioninfo[0]);
-                       if (strstr(`$file`, $versioninfo[1]) !== false)
+                       if ( strstr( wfShellExec( $file ), $versioninfo[1]) !== false )
                                return $command;
                }
        }
@@ -2239,12 +2242,12 @@ function getShellLocale( $wikiLang ) {
 
        # Get a list of available locales
        $lines = $ret = false;
-       exec( '/usr/bin/locale -a', $lines, $ret );
+       $lines = wfShellExec( '/usr/bin/locale -a', $ret, true );
        if ( $ret ) {
                return false;
        }
 
-       $lines = wfArrayMap( 'trim', $lines );
+       $lines = wfArrayMap( 'trim', explode( "\n", $lines ) );
        $candidatesByLocale = array();
        $candidatesByLang = array();
        foreach ( $lines as $line ) {