From a83c2153f97d39c29c3a03c873e880c5d9579291 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Wed, 29 Aug 2007 06:26:30 +0000 Subject: - gd bug #102, alternative fix when an old library is used --- ext/gd/gd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- cgit v1.2.1