summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-08-19 10:22:38 +0200
committerOndřej Surý <ondrej@sury.org>2011-08-19 10:22:38 +0200
commitf452a2b3e4e4279b27594a8ddb66525442d59227 (patch)
treed05cb62c5515ada33076d3cc3e49b664733a478c /ext/gd
parent038ba12e8724d537040e88ec794354b0c063f0a6 (diff)
downloadphp-f452a2b3e4e4279b27594a8ddb66525442d59227.tar.gz
Imported Upstream version 5.3.7upstream/5.3.7
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/config.m414
-rw-r--r--ext/gd/gd.c4
-rw-r--r--ext/gd/tests/imageloadfont_error1.phpt15
-rw-r--r--ext/gd/tests/imageloadfont_error2.phpt15
4 files changed, 37 insertions, 11 deletions
diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
index 1997594ab..e10cbab31 100644
--- a/ext/gd/config.m4
+++ b/ext/gd/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4 281216 2009-05-27 08:18:24Z pajoye $
+dnl $Id: config.m4 310964 2011-05-12 08:19:37Z rasmus $
dnl
dnl
@@ -72,11 +72,11 @@ AC_DEFUN([PHP_GD_JPEG],[
if test "$PHP_JPEG_DIR" != "no"; then
for i in $PHP_JPEG_DIR /usr/local /usr; do
- test -f $i/$PHP_LIBDIR/libjpeg.$SHLIB_SUFFIX_NAME || test -f $i/$PHP_LIBDIR/libjpeg.a && GD_JPEG_DIR=$i && break
+ test -f $i/include/jpeglib.h && GD_JPEG_DIR=$i && break
done
if test -z "$GD_JPEG_DIR"; then
- AC_MSG_ERROR([libjpeg.(a|so) not found.])
+ AC_MSG_ERROR([jpeglib.h not found.])
fi
PHP_CHECK_LIBRARY(jpeg,jpeg_read_header,
@@ -97,21 +97,17 @@ AC_DEFUN([PHP_GD_PNG],[
if test "$PHP_PNG_DIR" != "no"; then
for i in $PHP_PNG_DIR /usr/local /usr; do
- test -f $i/$PHP_LIBDIR/libpng.$SHLIB_SUFFIX_NAME || test -f $i/$PHP_LIBDIR/libpng.a && GD_PNG_DIR=$i && break
+ test -f $i/include/png.h && GD_PNG_DIR=$i && break
done
if test -z "$GD_PNG_DIR"; then
- AC_MSG_ERROR([libpng.(a|so) not found.])
+ AC_MSG_ERROR([png.h not found.])
fi
if test "$PHP_ZLIB_DIR" = "no"; then
AC_MSG_ERROR([PNG support requires ZLIB. Use --with-zlib-dir=<DIR>])
fi
- if test ! -f $GD_PNG_DIR/include/png.h; then
- AC_MSG_ERROR([png.h not found.])
- fi
-
PHP_CHECK_LIBRARY(png,png_write_image,
[
PHP_ADD_INCLUDE($GD_PNG_DIR/include)
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 4c5faacec..cc2ae4a16 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c 306939 2011-01-01 02:19:59Z felipe $ */
+/* $Id: gd.c 313665 2011-07-25 11:42:53Z felipe $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -1045,7 +1045,7 @@ const zend_function_entry gd_functions[] = {
PHP_FE(imagefilter, arginfo_imagefilter)
PHP_FE(imageconvolution, arginfo_imageconvolution)
- {NULL, NULL, NULL}
+ PHP_FE_END
};
/* }}} */
diff --git a/ext/gd/tests/imageloadfont_error1.phpt b/ext/gd/tests/imageloadfont_error1.phpt
new file mode 100644
index 000000000..16d1a3c3a
--- /dev/null
+++ b/ext/gd/tests/imageloadfont_error1.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Testing that imageloadfont() breaks on non-string first parameter
+--CREDITS--
+Neveo Harrison <neveoo [at] gmail [dot] com> #testfest #tek11
+--SKIPIF--
+<?php
+ if (!extension_loaded("gd")) die("skip GD not present");
+?>
+--FILE--
+<?php
+var_dump( imageloadfont(array()) );
+?>
+--EXPECTF--
+Warning: imageloadfont() expects parameter 1 to be string, array given in %s on line %d
+NULL \ No newline at end of file
diff --git a/ext/gd/tests/imageloadfont_error2.phpt b/ext/gd/tests/imageloadfont_error2.phpt
new file mode 100644
index 000000000..459cb71f5
--- /dev/null
+++ b/ext/gd/tests/imageloadfont_error2.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Testing that imageloadfont() breaks on invalid file passed as first argument
+--CREDITS--
+Austin Drouare <austin.drouare [at] gmail [dot] com> #testfest #tek11
+--SKIPIF--
+<?php
+ if (!extension_loaded("gd")) die("skip GD not present");
+?>
+--FILE--
+<?php
+var_dump( imageloadfont('\src\invalidfile.font') );
+?>
+--EXPECTF--
+Warning: imageloadfont(\src\invalidfile.font): failed to open stream: No such file or directory in %s on line %d
+bool(false)