Last modified: 2012-11-28 14:06:02 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42652, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40652 - Invalid titles can be saved as sitelinks
Invalid titles can be saved as sitelinks
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Normal major (vote)
: ---
Assigned To: Wikidata bugs
: need-volunteer
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-01 08:46 UTC by Daniel Kinzler
Modified: 2012-11-28 14:06 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel Kinzler 2012-10-01 08:46:29 UTC
It is possible to save invalid titles as sitelink targets. While saving non-existing but valid titles (like "blablablablabla") causes an errors, the following can be saved, even though the target page does not (and can not!) exist: 

"<>", e.g. http://wikidata-test-repo.wikimedia.de/w/index.php?title=Q321&diff=prev&oldid=34182

"[]", e.g. http://wikidata-test-repo.wikimedia.de/w/index.php?title=Q321&diff=next&oldid=34182

Even stranger, trying to save "|" results in an empty string as the target title, but does not remove the sitelink: http://wikidata-test-repo.wikimedia.de/w/index.php?title=Q321&diff=next&oldid=34183

Note that some illegal titles, like "#", did get rejected with an error.

Another strange instance of this behavior appears to be this edit: http://wikidata-test-repo.wikimedia.de/w/index.php?title=Q321&curid=9133&diff=34123&oldid=34101

Here, a fill URL was used as the target page title.
Comment 1 jeblad 2012-10-15 20:32:58 UTC
Seems like the "missing" key is not checked or is not generated in these cases.
Comment 2 jeblad 2012-10-15 20:33:40 UTC
A fix for this should probably be backported to the beta branch.
Comment 3 jeblad 2012-10-15 21:24:15 UTC
In addition to "missing" the marker for "invalid" should be checked and also generate a failed lookup.

http://localhost/repo/api.php?action=query&prop=info&redirects=1&converttitles=1&format=jsonfm&titles=badbadbad
{
	"query": {
		"normalized": [
			{
				"from": "badbadbad",
				"to": "Badbadbad"
			}
		],
		"pages": {
			"-1": {
				"ns": 0,
				"title": "Badbadbad",
				"missing": ""
			}
		}
	},

http://localhost/repo/api.php?action=query&prop=info&redirects=1&converttitles=1&format=jsonfm&titles=%3C%3E
{
	"query": {
		"pages": {
			"-1": {
				"title": "<>",
				"invalid": ""
			}
		}
	},
Comment 4 jeblad 2012-10-16 10:57:04 UTC
Change I86d432e8: Reject invalid titles as sitelinks
Comment 5 Daniel Kinzler 2012-10-16 16:34:44 UTC
merged I86d432e8

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links