⚓ T359294 MW allows bypassing file name restrictions when moving a file page
Page MenuHomePhabricator

MW allows bypassing file name restrictions when moving a file page
Closed, ResolvedPublic

Description

See parent task.

MW puts a limit of max file size of 240 bytes (Enforced in UploadBase::getTitle) this is more restrictive than normal page names.

UploadBase::getTitle also does some additional restrictions. Notably on windows it requires things to be ascii (Is that still needed? Who knows). It also replaces /, \ and : with -

According to https://commons.wikimedia.org/w/index.php?title=File:%D0%90%D0%BB%D1%84%D0%B0%D0%B2%D1%96%D1%82%D0%BD%D0%BE-%D0%BF%D1%80%D0%B5%D0%B4%D0%BC%D0%B5%D1%82%D0%BD%D0%B8%D0%B9_%D0%BF%D0%BE%D0%BA%D0%B0%D0%B6%D1%87%D0%B8%D0%BA_%D0%B7%D0%B0_1938_%D1%80%D1%96%D0%BA_%D0%B4%D0%BE_%D0%97%D0%B1%D1%96%D1%80%D0%BD%D0%B8%D0%BA%D0%B0_%D0%BF%D0%BE%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2_%D1%96_%D1%80%D0%BE%D0%B7%D0%BF%D0%BE%D1%80%D1%8F%D0%B4%D0%B6%D0%B5%D0%BD%D1%8C_%D0%A3%D1%80%D1%8F%D0%B4%D1%83_%D0%A3%D0%BA%D1%80%D0%B0%D1%97%D0%BD%D1%81%D1%8C%D0%BA%D0%BE%D1%97_%D0%A0%D0%B0%D0%B4%D1%8F%D0%BD%D1%81%D1%8C%D0%BA%D0%BE%D1%97_%D0%A1%D0%BE%D1%86%D1%96%D0%B0%D0%BB%D1%96%D1%81%D1%82%D0%B8%D1%87%D0%BD%D0%BE%D1%97_%D0%A0%D0%B5%D1%81%D0%BF%D1%83%D0%B1%D0%BB%D1%96%D0%BA%D0%B8.pdf&action=history

File:Алфавітно-предметний покажчик за 1938 рік до Збірника законів і розпоряджень робітничо-селянського уряду УРСР.pdf was renamed to File:Алфавітно-предметний покажчик за 1938 рік до Збірника постанов і розпоряджень Уряду Української Радянської Соціалістичної Республіки.pdf

The first one is a legal name, the second is not, so clearly something is missing in the code checking this.

Event Timeline

Change 1009223 had a related patch set uploaded (by Brian Wolff; author: Brian Wolff):

[mediawiki/core@master] Make sure MovePage::isValidFileMove matches UploadBase::getTitle

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

Change 1009223 merged by jenkins-bot:

[mediawiki/core@master] Make sure MovePage::isValidFileMove matches UploadBase::getTitle

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

Change 1009003 had a related patch set uploaded (by Reedy; author: Brian Wolff):

[mediawiki/core@REL1_41] Make sure MovePage::isValidFileMove matches UploadBase::getTitle

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

Change 1009004 had a related patch set uploaded (by Reedy; author: Brian Wolff):

[mediawiki/core@REL1_40] Make sure MovePage::isValidFileMove matches UploadBase::getTitle

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

Change 1009005 had a related patch set uploaded (by Reedy; author: Brian Wolff):

[mediawiki/core@REL1_39] Make sure MovePage::isValidFileMove matches UploadBase::getTitle

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

Change 1009005 merged by jenkins-bot:

[mediawiki/core@REL1_39] Make sure MovePage::isValidFileMove matches UploadBase::getTitle

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

Change 1009003 merged by jenkins-bot:

[mediawiki/core@REL1_41] Make sure MovePage::isValidFileMove matches UploadBase::getTitle

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

Change 1009004 merged by jenkins-bot:

[mediawiki/core@REL1_40] Make sure MovePage::isValidFileMove matches UploadBase::getTitle

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

Bawolff claimed this task.

It should be noted there are some files on commons with too long names. See parent task.