summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2009-06-05 04:46:49 +0000
committerGreg Beaver <cellog@php.net>2009-06-05 04:46:49 +0000
commitfb86c3f7a271f7c0c42b3224cde2ab3240acbb45 (patch)
tree8388bee2037deaeb9f290988ec0a8a76239e7f03 /ext
parenta8e7103bbee78b1e7b04518e45b3d803e7b7c169 (diff)
downloadphp-git-fb86c3f7a271f7c0c42b3224cde2ab3240acbb45.tar.gz
MFH: fixed isset() on sub-directories (isset("blah") if file "blah/foo.php" exists)
Diffstat (limited to 'ext')
-rwxr-xr-xext/phar/phar_object.c3
-rw-r--r--ext/phar/tests/phar_oo_011.phpt8
2 files changed, 8 insertions, 3 deletions
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index 6b03e62a45..a529c50eab 100755
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -3526,6 +3526,9 @@ PHP_METHOD(Phar, offsetExists)
}
RETURN_TRUE;
} else {
+ if (zend_hash_exists(&phar_obj->arc.archive->virtual_dirs, fname, (uint) fname_len)) {
+ RETURN_TRUE;
+ }
RETURN_FALSE;
}
}
diff --git a/ext/phar/tests/phar_oo_011.phpt b/ext/phar/tests/phar_oo_011.phpt
index 236009b7e4..cfbab702ad 100644
--- a/ext/phar/tests/phar_oo_011.phpt
+++ b/ext/phar/tests/phar_oo_011.phpt
@@ -16,9 +16,10 @@ require_once 'files/phar_oo_test.inc';
$phar = new Phar($fname);
$phar->setInfoClass('SplFileObject');
-$phar['f.php'] = 'hi';
-var_dump(isset($phar['f.php']));
-echo $phar['f.php'];
+$phar['hi/f.php'] = 'hi';
+var_dump(isset($phar['hi']));
+var_dump(isset($phar['hi/f.php']));
+echo $phar['hi/f.php'];
echo "\n";
?>
@@ -30,5 +31,6 @@ __halt_compiler();
?>
--EXPECT--
bool(true)
+bool(true)
hi
===DONE===