Page MenuHomePhabricator

Disable possibility to create extensionless File namespace pages
Open, NormalPublic

Description

While reporting T153862 I decided to check what is the situation with somewhat similar to the Commons-Datasets's Data namespace out-of-box File namespace, and I discovered that not only there's an edit button and no error message, but it is perfectly possible to create such pages (unless a wiki titleblacklisted them as Commons did): https://test.wikipedia.org/wiki/File:Example

I believe that such page creation should be prevented on engine level, similarly to how it is not possible to create extensionless Data namespace pages.

Perhaps it should be configurable with default to as requested. I can somewhat vaguely think on possible usages of such pages, but that is definitely not something to be desired by a majority.

TODO: Run a script/request to find all currently present 6th namespace extensionless pages.

Event Timeline

Base created this task.Dec 21 2016, 2:03 PM
Restricted Application added a project: Commons. · View Herald TranscriptDec 21 2016, 2:03 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Sooooo...

As a matter of principle on *WMF* wikis, I agree, this would be a useful change. *However*, I think it's worth noting that it's totally valid to create files without file extensions, and therefore, it should not *necessarily* be forbidden. I would much rather see us interpret the empty string ("") in the "allowed file extensions" configuration array as a "no extension" option, and disallow upload of no-extension files (ending in . or not having a period) if that is not present.

That said, those filetypes should almost definitely be interpreted as potentially dangerous.

As for creating a page in the file namespace, I may lack some context, but why is that even allowed without an upload? Is there some prevalent Commons cultural practice involving ritual altars and horn-shaped candles that I'm not aware of that also requires non-file File pages? Maybe we can just restrict or remove that possibility. On the other hand, we could also require that any file pages match the allowed file extensions.

MarkTraceur triaged this task as Normal priority.Dec 23 2016, 7:27 PM
MarkTraceur moved this task from Untriaged to Triaged on the Multimedia board.

As for creating a page in the file namespace, I may lack some context, but why is that even allowed without an upload? Is there some prevalent Commons cultural practice involving ritual altars and horn-shaped candles that I'm not aware of that also requires non-file File pages? Maybe we can just restrict or remove that possibility. On the other hand, we could also require that any file pages match the allowed file extensions.

I wouldn't rule out ritual altars, but at the very least it's possible to create redirects this way.

Tgr added a subscriber: Tgr.Jan 19 2017, 10:30 PM

{{prohibited name}} is used that way on Commons.

Change 337854 had a related patch set uploaded (by Matthias Mullie):
Disallow wikitext creation of invalid filenames in NS_FILE

https://gerrit.wikimedia.org/r/337854

If we were to flat out disallow creation of all NS_FILE titles that would be invalid filenames, would that affect too much? In other words: are there valid cases where we would like to support NS_FILE titles that are not valid filenames?

It is occasionally useful to create redirects under invalid filenames, when a file is linked to incorrectly in some external content. I don't have an example handy, but I could dig some up if you need.

FWIW, there are a lot of overlay.kml subpages of existing file pages. They aren't exactly extensionless, but I imagine they would fall under "invalid filenames" criteria.

brion added a subscriber: brion.Feb 15 2017, 4:19 PM

There was talk in the past about decoupling raw filenames from titles in the file: namespace so that extensions aren't exposed on new uploads, titles can contain funky chars, and file types can be upgraded without breaking usage.

I'll abandon my patch here. There's little reason to disallow creating extensionless titles, if we plan to make files extensionless at some point.

Change 337854 abandoned by Matthias Mullie:
Disallow wikitext creation of invalid filenames in NS_FILE

Reason:
No longer makes sense (see phab)

https://gerrit.wikimedia.org/r/337854