mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ImageMap
synced 2024-11-27 15:40:03 +00:00
Use is_numeric instead of ctype_digit for 'poly' validation
Duplicates the logic from tokenizeCoords which is used by 'rect' & 'circle'. Bug: T217087 Change-Id: I7c59bb9ea410bae8800922356829bca669d2e69c
This commit is contained in:
parent
70a6b723c7
commit
fb20685b48
|
@ -207,8 +207,7 @@ class ImageMap {
|
|||
$coords = [];
|
||||
$coord = strtok( " \t" );
|
||||
while ( $coord !== false ) {
|
||||
// T217087: protect against non-numeric values with a zero default
|
||||
if ( !ctype_digit( $coord ) ) {
|
||||
if ( !is_numeric( $coord ) || $coord > 1e9 || $coord < 0 ) {
|
||||
return self::error( 'imagemap_invalid_coord', $lineNum );
|
||||
}
|
||||
$coords[] = $coord;
|
||||
|
|
Loading…
Reference in a new issue