diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2022-04-16 21:20:47 +0200 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2022-04-16 19:28:45 +0000 |
commit | 00bc7a2b28886d291bd4e2a69b00fec964a94910 (patch) | |
tree | 577e58dce0eaa04fb52938187d40fd98144afcd0 /includes/api/ApiQueryLogEvents.php | |
parent | 3444abf547d7863e032dff90056417340ec816b7 (diff) | |
download | mediawikicore-00bc7a2b28886d291bd4e2a69b00fec964a94910.tar.gz mediawikicore-00bc7a2b28886d291bd4e2a69b00fec964a94910.zip |
api: Report external titles in more places as apierror-invalidtitle
It is only useful to use local titles for various api parameters
Change-Id: Ife2a951e6b48b59e2b77d455c8343f79f1163b0a
Diffstat (limited to 'includes/api/ApiQueryLogEvents.php')
-rw-r--r-- | includes/api/ApiQueryLogEvents.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index c2087b35e47e..b065d4a17a5d 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -207,7 +207,7 @@ class ApiQueryLogEvents extends ApiQueryBase { $title = $params['title']; if ( $title !== null ) { $titleObj = Title::newFromText( $title ); - if ( $titleObj === null ) { + if ( $titleObj === null || $titleObj->isExternal() ) { $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $title ) ] ); } $this->addWhereFld( 'log_namespace', $titleObj->getNamespace() ); @@ -226,7 +226,7 @@ class ApiQueryLogEvents extends ApiQueryBase { } $title = Title::newFromText( $prefix ); - if ( $title === null ) { + if ( $title === null || $title->isExternal() ) { $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $prefix ) ] ); } $this->addWhereFld( 'log_namespace', $title->getNamespace() ); |