Use WebRequest::getIntOrNull and avoid ctype_digit

This avoids the deprecation warning:
ctype_digit(): Argument of type null will be interpreted as string in the future

Bug: T322079
Change-Id: Id1e7ec7d73028339b53047ebfd6a975d23c3d180
(cherry picked from commit 698188afd4)
This commit is contained in:
Fomafix 2022-11-04 11:28:02 +00:00 committed by Reedy
parent d9b2447609
commit 5f353f8420

View file

@ -72,8 +72,7 @@ class SpecialNuke extends SpecialPage {
$reason = $this->getDeleteReason( $this->getRequest(), $target );
$limit = $req->getInt( 'limit', 500 );
$namespace = $req->getRawVal( 'namespace' );
$namespace = ctype_digit( $namespace ) ? (int)$namespace : null;
$namespace = $req->getIntOrNull( 'namespace' );
if ( $req->wasPosted()
&& $currentUser->matchEditToken( $req->getVal( 'wpEditToken' ) )