mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Merge "Restore check for dividebyzero"
This commit is contained in:
commit
d53c84da36
|
@ -346,7 +346,7 @@ class AFPData {
|
|||
$a = $a->toNumber();
|
||||
$b = $b->toNumber();
|
||||
|
||||
if ( $op !== '*' && $b === 0 ) {
|
||||
if ( $op !== '*' && (float)$b === 0.0 ) {
|
||||
throw new AFPUserVisibleException( 'dividebyzero', $pos, [ $a ] );
|
||||
}
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@ class AFPDataTest extends MediaWikiTestCase {
|
|||
public function divideByZero() {
|
||||
return [
|
||||
[ '1/0', 'mulRel' ],
|
||||
[ '1/0.0', 'mulRel' ],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue