This commit is contained in:
Xinchen Hui 2015-01-05 00:26:33 -05:00
commit c234ca8e17
15 changed files with 84 additions and 5 deletions

View File

@ -114,9 +114,9 @@ If you fix some bugs, you should note the bug ID numbers in your
commit message. Bug ID should be prefixed by "#" for easier access to
bug report when developers are browsing CVS via LXR or Bonsai.
Example::
Example:
Fixed bug #14016 (pgsql notice handler double free crash bug.)
Fixed bug #14016 (pgsql notice handler double free crash bug.)
When you change the NEWS file for a bug fix, then please keep the bugs
sorted in decreasing order under the fixed version.

View File

@ -1173,7 +1173,7 @@ case $libdir in
libdir=$libdir/php
;;
esac
case $datadir in
case `eval echo $datadir` in
'${prefix}/share')
datadir=$datadir/php
;;
@ -1188,7 +1188,7 @@ old_libdir=$libdir
old_datadir=$datadir
exec_prefix=`eval echo $exec_prefix`
libdir=`eval echo $libdir`
datadir=`eval echo $datadir`
datadir=`eval eval echo $datadir`
dnl Build extension directory path

View File

@ -2,7 +2,7 @@
Bug #67248 (imageaffinematrixget missing check of parameters)
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available')}
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imageaffinematrixget')) die('skip imageaffinematrixget() not available');
?>
--FILE--

View File

@ -1,5 +1,9 @@
--TEST--
Testing null byte injection in imagegd2
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
?>
--CLEAN--
$tempdir = sys_get_temp_dir(). '/php-gdtest';
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }

View File

@ -1,5 +1,9 @@
--TEST--
Testing null byte injection in imagegd
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
?>
--CLEAN--
$tempdir = sys_get_temp_dir(). '/php-gdtest';
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }

View File

@ -6,6 +6,7 @@ foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
$support = gd_info();
if (!isset($support['GIF Create Support']) || $support['GIF Create Support'] === false) {
print 'skip gif support not available';

View File

@ -6,6 +6,7 @@ foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
$support = gd_info();
if (!isset($support['JPEG Support']) || $support['JPEG Support'] === false) {
print 'skip jpeg support not available';

View File

@ -0,0 +1,22 @@
--TEST--
does the imagepalettetotruecollor function realy converts the image palette?
--CREDITS--
Carlos André Ferrari <caferrari [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available.");
?>
--FILE--
<?php
$im = imagecreate(100, 100);
var_dump(is_resource($im));
var_dump(imageistruecolor($im));
var_dump(imagepalettetotruecolor($im));
var_dump(imageistruecolor($im));
imagedestroy($im);
?>
--EXPECT--
bool(true)
bool(false)
bool(true)
bool(true)

View File

@ -0,0 +1,14 @@
--TEST--
imagepalettetotruecollor must return an error if no resource is given
--CREDITS--
Carlos André Ferrari <caferrari [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available.");
?>
--FILE--
<?php
imagepalettetotruecolor();
?>
--EXPECTF--
Warning: imagepalettetotruecolor() expects exactly 1 parameter, 0 given in %s on line %d

View File

@ -0,0 +1,14 @@
--TEST--
imagepalettetotruecollor must return an error if not a resource is given
--CREDITS--
Carlos André Ferrari <caferrari [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available.");
?>
--FILE--
<?php
imagepalettetotruecolor("bla");
?>
--EXPECTF--
Warning: imagepalettetotruecolor() expects parameter 1 to be resource, string given in %s on line %d

View File

@ -0,0 +1,15 @@
--TEST--
imagepalettetotruecollor must return an error if not an image resource is given
--CREDITS--
Carlos André Ferrari <caferrari [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available.");
?>
--FILE--
<?php
$im = fopen('php://memory', 'w');
imagepalettetotruecolor($im);
?>
--EXPECTF--
Warning: imagepalettetotruecolor(): supplied resource is not a valid Image resource in %s on line %d

View File

@ -6,6 +6,7 @@ foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
$support = gd_info();
if (!isset($support['PNG Support']) || $support['PNG Support'] === false) {
print 'skip png support not available';

View File

@ -6,6 +6,7 @@ foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
$support = gd_info();
if (!isset($support['WBMP Support']) || $support['WBMP Support'] === false) {
print 'skip wbmp support not available';

View File

@ -6,6 +6,7 @@ foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
$support = gd_info();
if (!isset($support['WEBP Support']) || $support['WEBP Support'] === false) {
print 'skip webp support not available';

View File

@ -50,6 +50,7 @@
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
(defined(__ppc__) && defined(__APPLE__)) || \
defined(__x86_64) || defined(__x86_64__) || \
defined(__powerpc64__) || \
defined(__mc68020__)
#define PLATFORM_UNALIGNED_WORD_ACCESS
#endif