mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
4a48729438
libgd uses an incorrect absolute path check in gdft.c. It checks if either the path starts with a '/' (only valid on Posix btw), or whether it contains something of the form C:\ or C:/. However, this overlooks the possibility of using UNC paths on Windows. As we already do PHP-specific stuff with VCWD_ macros, use IS_ABSOLUTE_PATH to check for an absolute path which will take into account UNC paths as well. Closes GH-13241.
29 lines
585 B
PHP
29 lines
585 B
PHP
--TEST--
|
|
GH-10344 (imagettfbbox(): Could not find/open font UNC path)
|
|
--EXTENSIONS--
|
|
gd
|
|
--SKIPIF--
|
|
<?php
|
|
if (PHP_OS_FAMILY != 'Windows') {
|
|
die("skip windows only test");
|
|
}
|
|
if (!GD_BUNDLED) {
|
|
die("skip Not (yet) fixed in libgd itself");
|
|
}
|
|
if (!function_exists("imagettfbbox")) {
|
|
die("skip ttf support unavailable");
|
|
}
|
|
if (!is_readable("\\\\localhost\\c$\\Windows\\Fonts\\arial.ttf")) {
|
|
die("skip font not readable");
|
|
}
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$font = '\\\\localhost\\c$\\Windows\\Fonts\\arial.ttf';
|
|
var_dump(count(imagettfbbox(10, 0, $font, 'hello')));
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(8)
|