Anomie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/191889
Change subject: API: Don't allow '#' in title-parts
......................................................................
API: Don't allow '#' in title-parts
As-is, this causes loss of a character from the passed-in title leading
to wrong output. But there should never be a '#' in a title-part anyway,
the best thing is to just disallow it completely.
Bug: T38358
Change-Id: Id90bfb9c63a5960e7d2d49350d3e0da0327d0e24
---
M includes/api/ApiQueryBase.php
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/89/191889/1
diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php
index 998cc91..7414913 100644
--- a/includes/api/ApiQueryBase.php
+++ b/includes/api/ApiQueryBase.php
@@ -513,7 +513,8 @@
*/
public function titlePartToKey( $titlePart, $namespace = NS_MAIN ) {
$t = Title::makeTitleSafe( $namespace, $titlePart . 'x' );
- if ( !$t ) {
+ if ( !$t || $t->hasFragment() ) {
+ // Invalid title (e.g. bad chars) or contained a '#'.
$this->dieUsageMsg( array( 'invalidtitle', $titlePart )
);
}
if ( $namespace != $t->getNamespace() || $t->isExternal() ) {
--
To view, visit https://gerrit.wikimedia.org/r/191889
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id90bfb9c63a5960e7d2d49350d3e0da0327d0e24
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits