Merge "Fix the Linter category subpage search when namespace field is blank"

This commit is contained in:
jenkins-bot 2024-07-19 06:50:34 +00:00 committed by Gerrit Code Review
commit 08fbe80da9

View file

@ -210,9 +210,11 @@ class SpecialLintErrors extends SpecialPage {
);
if ( $request->getCheck( 'wpNamespaceRestrictions' ) ) {
$namespaceRequestValues = $request->getRawVal( 'wpNamespaceRestrictions' );
$namespaceIDs = array_map( 'intval', explode( "\n", $namespaceRequestValues ) );
// Security measure: only allow active namespace IDs to reach the query
$namespaces = array_values( array_intersect( $activeNamespaces, $namespaceIDs ) );
if ( strlen( $namespaceRequestValues ) > 0 ) {
$namespaceIDs = array_map( 'intval', explode( "\n", $namespaceRequestValues ) );
// Security measure: only allow active namespace IDs to reach the query
$namespaces = array_values( array_intersect( $activeNamespaces, $namespaceIDs ) );
}
}
return $namespaces;
}