ApiQueryRevisionsBase: Cast ctype_digit() param to string

Bug: T396766
Change-Id: I22f65e63269ad985f2442176387f2ca96f7609c5
(cherry picked from commit dddeb4e16fae4bae9cd5183548e6db7b3eff2b07)
This commit is contained in:
Reedy 2025-06-14 11:24:34 +01:00
parent 59f363f9a1
commit a18e6ca5e6

View file

@ -248,7 +248,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
if ( $params['diffto'] == 'cur' ) {
$params['diffto'] = 0;
}
if ( ( !ctype_digit( $params['diffto'] ) || $params['diffto'] < 0 )
if ( ( !ctype_digit( (string)$params['diffto'] ) || $params['diffto'] < 0 )
&& $params['diffto'] != 'prev' && $params['diffto'] != 'next'
) {
$p = $this->getModulePrefix();