GitInfo: Don't try shelling out if it's disabled
[lhc/web/wiklou.git] / includes / GitInfo.php
index fb75c25..363d7b8 100644 (file)
@@ -227,6 +227,7 @@ class GitInfo {
                        $date = false;
                        if ( is_file( $wgGitBin ) &&
                                is_executable( $wgGitBin ) &&
+                               !Shell::isDisabled() &&
                                $this->getHead() !== false
                        ) {
                                $cmd = [
@@ -306,9 +307,9 @@ class GitInfo {
                        $config = "{$this->basedir}/config";
                        $url = false;
                        if ( is_readable( $config ) ) {
-                               MediaWiki\suppressWarnings();
+                               Wikimedia\suppressWarnings();
                                $configArray = parse_ini_file( $config, true );
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
                                $remote = false;
 
                                // Use the "origin" remote repo if available or any other repo if not.