--- a/include/Util.class.php +++ b/include/Util.class.php @@ -44,6 +44,11 @@ return (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); } + public static function NullFile() + { + return self::IsWindows() ? 'NUL' : '/dev/null'; + } + /** * Tests if this is a 64 bit machine * @@ -63,10 +68,10 @@ public static function MakeSlug($str) { $from = array( - '/' + '/&' ); $to = array( - '-' + '--' ); return str_replace($from, $to, $str); } @@ -162,6 +167,8 @@ else $baseurl = 'http://' . $baseurl; } + if (GitPHP_Util::IsWindows()) + $baseurl = rtrim($baseurl, "\\"); return rtrim($baseurl, "/"); }