mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #78189: file cache strips last character of uname hash
This commit is contained in:
commit
2b4fc9eb9c
22
ext/opcache/tests/bug78189.phpt
Normal file
22
ext/opcache/tests/bug78189.phpt
Normal file
@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #78189 (file cache strips last character of uname hash)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('Zend OPcache')) die('skip opcache extension not available');
|
||||
if (substr(PHP_OS, 0, 3) !== 'WIN') die('skip this test is for Windows platforms only');
|
||||
?>
|
||||
--INI--
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
opcache.file_cache={TMP}
|
||||
opcache.file_cache_only=1
|
||||
--FILE--
|
||||
<?php
|
||||
$tmpdir = sys_get_temp_dir();
|
||||
$pattern = $tmpdir . '/*/*/' . str_replace(':', '', __DIR__) . '/bug78189.php.bin';
|
||||
foreach (glob($pattern) as $filename) {
|
||||
var_dump(preg_match('~/[0-9a-f]{32}/~', substr($filename, strlen($tmpdir), 34)));
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
@ -856,7 +856,7 @@ static char *zend_file_cache_get_bin_file_path(zend_string *script_path)
|
||||
memcpy(filename, ZCG(accel_directives).file_cache, len);
|
||||
filename[len] = '\\';
|
||||
memcpy(filename + 1 + len, md5uname, 32);
|
||||
len += 32;
|
||||
len += 1 + 32;
|
||||
filename[len] = '\\';
|
||||
|
||||
memcpy(filename + len + 1, accel_system_id, 32);
|
||||
|
Loading…
Reference in New Issue
Block a user