mirror of
https://github.com/php/php-src.git
synced 2025-01-27 06:03:45 +08:00
Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar file)
This commit is contained in:
parent
e20baee136
commit
8c92442b49
4
NEWS
4
NEWS
@ -19,6 +19,10 @@ PHP NEWS
|
||||
. Fixed bug #76704 (mb_detect_order return value varies based on argument
|
||||
type). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar
|
||||
file). (Laruence)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #76595 (phpdbg man page contains outdated information).
|
||||
(Kevin Abel)
|
||||
|
@ -1216,6 +1216,13 @@ static void zend_accel_add_key(char *key, unsigned int key_length, zend_accel_ha
|
||||
}
|
||||
}
|
||||
|
||||
static zend_always_inline zend_bool is_phar_file(zend_string *filename)
|
||||
{
|
||||
return filename && ZSTR_LEN(filename) >= sizeof(".phar") &&
|
||||
!memcmp(ZSTR_VAL(filename) + ZSTR_LEN(filename) - (sizeof(".phar")-1), ".phar", sizeof(".phar")-1) &&
|
||||
!strstr(ZSTR_VAL(filename), "://");
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPCACHE_FILE_CACHE
|
||||
static zend_persistent_script *store_script_in_file_cache(zend_persistent_script *new_persistent_script)
|
||||
{
|
||||
@ -1240,10 +1247,7 @@ static zend_persistent_script *store_script_in_file_cache(zend_persistent_script
|
||||
|
||||
zend_shared_alloc_destroy_xlat_table();
|
||||
|
||||
new_persistent_script->is_phar =
|
||||
new_persistent_script->script.filename &&
|
||||
strstr(ZSTR_VAL(new_persistent_script->script.filename), ".phar") &&
|
||||
!strstr(ZSTR_VAL(new_persistent_script->script.filename), "://");
|
||||
new_persistent_script->is_phar = is_phar_file(new_persistent_script->script.filename);
|
||||
|
||||
/* Consistency check */
|
||||
if ((char*)new_persistent_script->mem + new_persistent_script->size != (char*)ZCG(mem)) {
|
||||
@ -1359,10 +1363,7 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
|
||||
|
||||
zend_shared_alloc_destroy_xlat_table();
|
||||
|
||||
new_persistent_script->is_phar =
|
||||
new_persistent_script->script.filename &&
|
||||
strstr(ZSTR_VAL(new_persistent_script->script.filename), ".phar") &&
|
||||
!strstr(ZSTR_VAL(new_persistent_script->script.filename), "://");
|
||||
new_persistent_script->is_phar = is_phar_file(new_persistent_script->script.filename);
|
||||
|
||||
/* Consistency check */
|
||||
if ((char*)new_persistent_script->mem + new_persistent_script->size != (char*)ZCG(mem)) {
|
||||
|
Loading…
Reference in New Issue
Block a user