Skip to content

Commit 3b7c0da

Browse files
author
Mikhail Galanin
committed
Invalidate path even if the file was deleted
1 parent 14b8270 commit 3b7c0da

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,9 @@ zend_result zend_accel_invalidate(zend_string *filename, bool force)
13991399
realpath = accelerator_orig_zend_resolve_path(filename);
14001400

14011401
if (!realpath) {
1402-
return FAILURE;
1402+
//file could have been deleted, but we still need to invalidate it.
1403+
//so instead of failing, just use the provided filename for the lookup
1404+
realpath = zend_string_copy(filename);
14031405
}
14041406

14051407
if (ZCG(accel_directives).file_cache) {

ext/opcache/tests/issue0128.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ var_dump(opcache_invalidate('1'));
1212
var_dump("okey");
1313
?>
1414
--EXPECT--
15-
bool(false)
15+
bool(true)
1616
string(4) "okey"

0 commit comments

Comments
 (0)