File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1531,8 +1531,9 @@ PHP_FUNCTION(imagecreatefromstring)
1531
1531
}
1532
1532
1533
1533
if (ZSTR_LEN (data ) < sizeof (sig )) {
1534
- zend_argument_value_error (1 , "cannot be empty" );
1535
- RETURN_THROWS ();
1534
+ /* Handle this the same way as an unknown image type. */
1535
+ php_error_docref (NULL , E_WARNING , "Data is not in a recognized format" );
1536
+ RETURN_FALSE ;
1536
1537
}
1537
1538
1538
1539
memcpy (sig , ZSTR_VAL (data ), sizeof (sig ));
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ $im = imagecreatefromstring(' asdf jklp foo');
62
62
--EXPECTF--
63
63
createfromstring truecolor png: ok
64
64
createfromstring palette png: ok
65
- imagecreatefromstring(): Argument #1 ($data) cannot be empty
66
65
67
- Warning: imagecreatefromstring(): Data is not in a recognized format in %screatefromstring.php on line %d
66
+ Warning: imagecreatefromstring(): Data is not in a recognized format in %s on line %d
67
+
68
+ Warning: imagecreatefromstring(): Data is not in a recognized format in %s on line %d
You can’t perform that action at this time.
0 commit comments