Last modified: 2012-09-16 07:13:30 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 T30577, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28577 - Allow API to test if page title is blacklisted (or is invalid for other reasons)
Allow API to test if page title is blacklisted (or is invalid for other reasons)
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 29327 (view as bug list)
Depends on:
Blocks: 24758
  Show dependency treegraph
 
Reported: 2011-04-16 17:54 UTC by MZMcBride
Modified: 2012-09-16 07:13 UTC (History)
7 users (show)

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


Attachments

Description MZMcBride 2011-04-16 17:54:26 UTC
The MediaWiki API should be able to be given a sample input string and return whether the string would be a valid title. For example, the string "abc" would return True while the string "aB{" would return False (as "{" isn't allowed in page titles).

This would essentially be a dry-run mode of action=edit, but would allow for some sanity checks when, for example, testing whether strings are valid template parameter names.

Optionally, this test could check against other restrictions such as the local title and global blacklists or the AbuseFilter to see if a specific string matches (though this possibly opens up an attack vector).
Comment 1 db [inactive,noenotif] 2011-04-17 08:09:47 UTC
For the first part, you can use: http://en.wikipedia.org/w/api.php?action=query&titles=abc|abc{
Comment 2 Roan Kattouw 2011-04-17 08:31:32 UTC
(In reply to comment #0)
> The MediaWiki API should be able to be given a sample input string and return
> whether the string would be a valid title. For example, the string "abc" would
> return True while the string "aB{" would return False (as "{" isn't allowed in
> page titles).
> 
Like duplicatebug says, validity can already be checked.

> Optionally, this test could check against other restrictions such as the local
> title and global blacklists or the AbuseFilter to see if a specific string
> matches (though this possibly opens up an attack vector).
IIRC Neil is interested in and may already have written some code for the blacklist thing, CCing him.
Comment 3 MZMcBride 2011-04-17 17:58:49 UTC
(In reply to comment #1)
> For the first part, you can use:
> http://en.wikipedia.org/w/api.php?action=query&titles=abc|abc{

Huh. I never would've thought to use the query module for that. Thanks for pointing that out! Probably needs a bit better documentation somewhere.

(In reply to comment #2)
>> Optionally, this test could check against other restrictions such as the local
>> title and global blacklists or the AbuseFilter to see if a specific string
>> matches (though this possibly opens up an attack vector).
> IIRC Neil is interested in and may already have written some code for the
> blacklist thing, CCing him.

Yes, he said as much to me, I think. There are a few features that can block page creation (create-protection, title blacklists, AbuseFilter); having a dry-run mode of action=edit might be nice. I would think the people doing unit tests would need something like this (if they ever test on a live site). It's easy enough to create test pages on your own wiki, I suppose, but creating nearly invalid titles on a live project usually causes screams. :-)
Comment 4 Neil Kandalgaonkar 2011-04-18 01:36:52 UTC
yes, it's on my agenda -- I made one of the UploadWizard bugs block here so I update both.
Comment 5 Neil Kandalgaonkar 2011-06-10 20:52:58 UTC
*** Bug 29327 has been marked as a duplicate of this bug. ***
Comment 6 Thehelpfulone 2012-06-22 19:41:00 UTC
Reassigning to wikibugs-l per bug 37789
Comment 7 db [inactive,noenotif] 2012-09-16 07:13:30 UTC
A titleblacklist module exist:

http://en.wikipedia.org/w/api.php?action=titleblacklist&tbtitle=Bar&tbaction=create

For the absuefilter check, please add a new bug.

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


Navigation
Links