summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2004-07-19 07:19:50 +0000
committerAndi Gutmans <andi@php.net>2004-07-19 07:19:50 +0000
commit56f8195fe592e79d90c78fb015f39bffa7f39422 (patch)
tree6a1bf69bc9cd23fab98c4d3d6c12368b56d26079 /ext/gd
parent599ae4b1b53d46e10447dab8fb4faa2d0517370a (diff)
downloadphp-git-56f8195fe592e79d90c78fb015f39bffa7f39422.tar.gz
- Nuke empty_string. It is a reminanent from the time where RETURN_FALSE()
used to return "" and not bool(false). It's not worth keeping it because STR_FREE() and zval_dtor() always have to check for it and it slows down the general case. In addition, it seems that empty_string has been abused quite a lot, and was used not only for setting zval's but generally in PHP code instead of "", which wasn't the intention. Last but not least, nuking empty_string should improve stability as I doubt every place correctly checked if they are not mistakenly erealloc()'ing it or calling efree() on it. NOTE: Some code is probably broken. Each extension maintainer should check and see that my changes are OK. Also, I haven't had time to touch PECL yet. Will try and do it tomorrow.
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/gd.c6
-rw-r--r--ext/gd/gd_ctx.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 9627d2cdf3..1476e5ee38 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1709,7 +1709,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
}
if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
- if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) {
+ if (!fn || php_check_open_basedir(fn TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn);
RETURN_FALSE;
}
@@ -3825,13 +3825,13 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
}
/* Check origin file */
- if (!fn_org || fn_org == empty_string || php_check_open_basedir(fn_org TSRMLS_CC)) {
+ if (!fn_org || php_check_open_basedir(fn_org TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid origin filename '%s'", fn_org);
RETURN_FALSE;
}
/* Check destination file */
- if (!fn_dest || fn_dest == empty_string || php_check_open_basedir(fn_dest TSRMLS_CC)) {
+ if (!fn_dest || php_check_open_basedir(fn_dest TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid destination filename '%s'", fn_dest);
RETURN_FALSE;
}
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 6fb7b84ce4..b27ee45856 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -82,7 +82,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
}
if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
- if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) {
+ if (!fn || php_check_open_basedir(fn TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn);
RETURN_FALSE;
}