From: tonythomas01 <01tonythomas@gmail.com> Date: Thu, 6 Feb 2014 12:18:55 +0000 (+0530) Subject: Used DIRECTORY_SEPARATOR instead of '/' in GitInfo.php X-Git-Tag: 1.31.0-rc.0~16984 X-Git-Url: http://git.cyclocoop.org/%27.parametre_url%28%20%20%20generer_action_auteur%28%27charger_plugin%27%2C%20%27update_flux%27%29%2C%27update_flux%27%2C%20%27oui%27%29.%27?a=commitdiff_plain;h=3afc76a4b5ad2f73dd69a82ec08c0d0e4799f00f;p=lhc%2Fweb%2Fwiklou.git Used DIRECTORY_SEPARATOR instead of '/' in GitInfo.php Bug: 46482 Change-Id: If473bf60971b4c1a8c6a657d4cd7dd5a0bad659f --- diff --git a/includes/GitInfo.php b/includes/GitInfo.php index e0bd5cd043..1f465c7551 100644 --- a/includes/GitInfo.php +++ b/includes/GitInfo.php @@ -44,13 +44,13 @@ class GitInfo { * @param string $dir The root directory of the repo where the .git dir can be found */ public function __construct( $dir ) { - $this->basedir = "{$dir}/.git"; + $this->basedir = $dir . DIRECTORY_SEPARATOR . '.git'; if ( is_readable( $this->basedir ) && !is_dir( $this->basedir ) ) { $GITfile = file_get_contents( $this->basedir ); if ( strlen( $GITfile ) > 8 && substr( $GITfile, 0, 8 ) === 'gitdir: ' ) { $path = rtrim( substr( $GITfile, 8 ), "\r\n" ); $isAbsolute = $path[0] === '/' || substr( $path, 1, 1 ) === ':'; - $this->basedir = $isAbsolute ? $path : "{$dir}/{$path}"; + $this->basedir = $isAbsolute ? $path : $dir . DIRECTORY_SEPARATOR . $path; } } }