Prompted by comments on https://gerrit.wikimedia.org/r/59050
which identified problems with code lifted directly from SpecialFilepath.
Change-Id: Iab8a5d3d007b3aca72b7c6c1145d830a74b4399e
$this->outputHeader();
$request = $this->getRequest();
- $file = !is_null( $par ) ? $par : $request->getText( 'file' );
+ $file = $par ?: $request->getText( 'file' );
$title = Title::newFromText( $file, NS_FILE );
- if ( ! $title instanceof Title || $title->getNamespace() != NS_FILE ) {
+ if ( !( $title instanceof Title ) || $title->getNamespace() != NS_FILE ) {
$this->showForm( $title );
} else {
$file = wfFindFile( $title );
}
/**
- * @param $title Title
+ * @param Title $title Title requested, or null.
*/
function showForm( $title ) {
global $wgScript;