summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--ext/opcache/tests/bug69281.phpt17
-rw-r--r--ext/opcache/tests/is_script_cached.phpt1
-rw-r--r--ext/opcache/zend_accelerator_module.c6
4 files changed, 23 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 6fcc697f9c..fc4544c74d 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ PHP NEWS
. Fixed bug #68740 (NULL Pointer Dereference). (Laruence)
- OPCache:
+ . Fixed bug #69281 (opcache_is_script_cached no longer works). (danack)
. Fixed bug #68677 (Use After Free). (CVE-2015-1351) (Laruence)
?? ??? 2015, PHP 5.5.24
diff --git a/ext/opcache/tests/bug69281.phpt b/ext/opcache/tests/bug69281.phpt
new file mode 100644
index 0000000000..4d68d5007b
--- /dev/null
+++ b/ext/opcache/tests/bug69281.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Test that script cached info is correct with validate_timestamps disabled
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.file_update_protection=0
+opcache.validate_timestamps=0
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+var_dump(opcache_is_script_cached(__FILE__));
+var_dump(opcache_is_script_cached("nonexistent.php"));
+?>
+--EXPECT--
+bool(true)
+bool(false)
diff --git a/ext/opcache/tests/is_script_cached.phpt b/ext/opcache/tests/is_script_cached.phpt
index 0560e98d88..bac561103f 100644
--- a/ext/opcache/tests/is_script_cached.phpt
+++ b/ext/opcache/tests/is_script_cached.phpt
@@ -4,6 +4,7 @@ Test that script cached info is correct
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
+opcache.validate_timestamps=1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index e29ff00304..3a6da3c8b6 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -320,14 +320,16 @@ static int filename_is_in_cache(char *filename, int filename_len TSRMLS_DC)
persistent_script = zend_accel_hash_find(&ZCSG(hash), filename, filename_len + 1);
if (persistent_script) {
return !persistent_script->corrupted &&
- validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
+ (!ZCG(accel_directives).validate_timestamps ||
+ validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS);
}
}
if ((key = accel_make_persistent_key_ex(&handle, filename_len, &key_length TSRMLS_CC)) != NULL) {
persistent_script = zend_accel_hash_find(&ZCSG(hash), key, key_length + 1);
return persistent_script && !persistent_script->corrupted &&
- validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
+ (!ZCG(accel_directives).validate_timestamps ||
+ validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS);
}
return 0;