diff options
author | Pierre Joye <pajoye@php.net> | 2007-08-29 06:26:30 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2007-08-29 06:26:30 +0000 |
commit | a83c2153f97d39c29c3a03c873e880c5d9579291 (patch) | |
tree | 9cbef7f1f07d80da4c9868883107db548c845751 | |
parent | 3b32190c91e01815f09a34aa6dd39a4981d16ef5 (diff) | |
download | php-git-a83c2153f97d39c29c3a03c873e880c5d9579291.tar.gz |
- gd bug #102, alternative fix when an old library is used
-rw-r--r-- | ext/gd/gd.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c index f880b69905..8dbdcdd4f1 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -4353,6 +4353,9 @@ PHP_FUNCTION(imagepsloadfont) { zval **file; int f_ind, *font; +#ifdef PHP_WIN32 + struct stat st; +#endif if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); @@ -4360,6 +4363,13 @@ PHP_FUNCTION(imagepsloadfont) convert_to_string_ex(file); +#ifdef PHP_WIN32 + if (VCWD_STAT(Z_STRVAL_PP(file), &st) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Font file not found (%s)", Z_STRVAL_PP(file)); + RETURN_FALSE; + } +#endif + f_ind = T1_AddFont(Z_STRVAL_PP(file)); if (f_ind < 0) { |