Deprecate specialized file errors in OutputPage and fix escaping
authorBrian Wolff <bawolff+wn@gmail.com>
Mon, 16 Oct 2017 05:53:30 +0000 (05:53 +0000)
committerBrian Wolff <bawolff+wn@gmail.com>
Wed, 11 Jul 2018 18:57:24 +0000 (18:57 +0000)
commitcb57179a01ca0979bea7a8e32572481d81626858
tree19c5eb1cfd20fffb99bc208cb0be00d9b47988f2
parent88f469624df1c65546d923e62b4550415826c458
Deprecate specialized file errors in OutputPage and fix escaping

OutputPage has a number of specialized error reporting methods
related to file handling. With exception of showFileDeleteError,
they are all unused. In my opinion such specialized error handling
does not belong in OutputPage, but in whatever class is generating
the error.

Futhermore, these functions do not appropriately escape their
arguments or their i18n messages. I replaced the one usage
in SpecialUpload with an equivalent that does escape properly.
This is not exploitable as the attacker is not in control of
the temporary file name, but it is very bad practice.

This deprecates the following methods:
* OutputPage::showFileDeleteError()
* OutputPage::showFileNotFoundError()
* OutputPage::showFileRenameError()
* OutputPage::showFileCopyError()
* OutputPage::showUnexpectedValueError()

[Discovered with the help of an experimental phan plugin]

Change-Id: I9e7aaa59ded66f32c78cfdfed1e59e073ffd5051
RELEASE-NOTES-1.32
includes/OutputPage.php
includes/specials/SpecialUpload.php