summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/fopen_wrappers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 0291ef7cbb..fb39544f1f 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -327,7 +327,8 @@ PHPAPI FILE *php_fopen_primary_script(void)
#endif
#ifdef PHP_WIN32
if (PG(doc_root) && path_info && (IS_SLASH(*PG(doc_root))
- || strstr(PG(doc_root),":\\") || strstr(PG(doc_root),":/"))) {
+ /* Check for absolute path. This should also use virtual cwd macros */
+ || (PG(doc_root)[1] == ':' && IS_SLASH(PG(doc_root)[2]))) {
#else
if (PG(doc_root) && path_info && IS_SLASH(*PG(doc_root))) {
#endif