From b7e0ee0614a47ffbed4b00375d32846ec0d5c1b0 Mon Sep 17 00:00:00 2001
From: Daniel Hoffmann <d.hoffmann@mac.com>
Date: Mon, 25 Jul 2011 08:45:42 +0200
Subject: [PATCH] [BUGFIX] Fix isAbsPath() on Windows

Paths starting with a slash are absolute on Windows, too.

Change-Id: Ie34449b8fc9f5e5a203044457baa64283412cf66
Resolves: #16798
Releases: 4.5, 4.6
Reviewed-on: http://review.typo3.org/3712
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
---
 t3lib/class.t3lib_div.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/t3lib/class.t3lib_div.php b/t3lib/class.t3lib_div.php
index 76f73efe4c97..420bedd6ad5e 100644
--- a/t3lib/class.t3lib_div.php
+++ b/t3lib/class.t3lib_div.php
@@ -3911,7 +3911,13 @@ final class t3lib_div {
 	 * @return boolean
 	 */
 	public static function isAbsPath($path) {
-		return TYPO3_OS == 'WIN' ? substr($path, 1, 2) == ':/' : substr($path, 0, 1) == '/';
+			// on Windows also a path starting with a drive letter is absolute: X:/
+		if (TYPO3_OS === 'WIN' && substr($path, 1, 2) === ':/') {
+			return TRUE;
+		}
+
+			// path starting with a / is always absolute, on every system
+		return (substr($path, 0, 1) === '/');
 	}
 
 	/**
-- 
GitLab