From 5f353f84209b767bff9f2b784f199f76364c15ee Mon Sep 17 00:00:00 2001 From: Fomafix Date: Fri, 4 Nov 2022 11:28:02 +0000 Subject: [PATCH] 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 698188afd44dfe5585af03710156d6e00f9e11a7) --- includes/SpecialNuke.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/SpecialNuke.php b/includes/SpecialNuke.php index c707d9be..8f4e6dbf 100644 --- a/includes/SpecialNuke.php +++ b/includes/SpecialNuke.php @@ -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' ) )