aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryLogEvents.php
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2022-04-16 21:20:47 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2022-04-16 19:28:45 +0000
commit00bc7a2b28886d291bd4e2a69b00fec964a94910 (patch)
tree577e58dce0eaa04fb52938187d40fd98144afcd0 /includes/api/ApiQueryLogEvents.php
parent3444abf547d7863e032dff90056417340ec816b7 (diff)
downloadmediawikicore-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.php4
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() );