Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2673,6 +2673,8 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
RETURN_THROWS();
}
NPOINTS /= 2;
} else {
php_error_docref(NULL, E_DEPRECATED, "Using the $num_points parameter is deprecated");
}

im = php_gd_libgdimageptr_from_zval_p(IM);
Expand Down
5 changes: 4 additions & 1 deletion ext/gd/tests/bug55005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ trycatch_dump(
fn () => imagepolygon($g, array(200,10, 200,100, 280,100), 2, $fgnd)
);
?>
--EXPECT--
--EXPECTF--
Deprecated: imagefilledpolygon(): Using the $num_points parameter is deprecated in %s on line %d
!! [ValueError] imagefilledpolygon(): Argument #3 ($num_points_or_color) must be greater than or equal to 3

Deprecated: imagepolygon(): Using the $num_points parameter is deprecated in %s on line %d
!! [ValueError] imagepolygon(): Argument #3 ($num_points_or_color) must be greater than or equal to 3