Allow negative coordinates in poly image maps

Previous attempts to clean this up followed similar logic to the
circle and rect types of imagemaps. However, in reality, we have
many image maps in our content that have negative values for poly
coordinates. While this isn't logical, breaking them so loudly
in the page isn't desirable.

This change then removes the check for positive value and passes
along the negative coordinate.

Bug: T217087
Change-Id: I0ee84f059dacde79a7e4fb0a172ac6937360d864
This commit is contained in:
Alex Ezell 2019-04-10 16:34:28 -04:00
parent 223b87c5c4
commit 9f962fbad1

View file

@ -207,7 +207,7 @@ class ImageMap {
$coords = [];
$coord = strtok( " \t" );
while ( $coord !== false ) {
if ( !is_numeric( $coord ) || $coord > 1e9 || $coord < 0 ) {
if ( !is_numeric( $coord ) || $coord > 1e9 ) {
return self::error( 'imagemap_invalid_coord', $lineNum );
}
$coords[] = $coord;