Fix regression from
9af38c046c86, which made 'from' a required
non-empty parameter where previously an empty value was allowed.
The rollback links always include a 'from' parameter, but it is
set to an empty string by Revision::getUserText if the current
revision has its username hidden.
Test plan:
* Go to action=history, tick latest revision and "Change visibility".
* Tick "Editor's username" and apply the change.
* Hit "rollback" on the history page.
* Before: "missing parameter" error.
After: Success.
Bug: T141985
Change-Id: I20d23e2aeec858f82231910c030c14ffa3af656f
$user = $this->getUser();
$from = $request->getVal( 'from' );
$rev = $this->page->getRevision();
- if ( $from === null || $from === '' ) {
+ if ( $from === null ) {
throw new ErrorPageError( 'rollbackfailed', 'rollback-missingparam' );
}
if ( !$rev ) {
page = mw.util.getParamValue( 'title', url ),
user = mw.util.getParamValue( 'from', url );
- if ( !page || !user ) {
+ if ( !page || user === null ) {
// Let native browsing handle the link
return true;
}