$diff = $request->getVal( 'diff' );
$diffOnly = $request->getBool( 'diffonly', $this->getContext()->getUser()->getOption( 'diffonly' ) );
- if ( $this->getTitle()->getNamespace() != NS_FILE || ( isset( $diff ) && $diffOnly ) ) {
+ if ( $this->getTitle()->getNamespace() != NS_FILE || ( $diff !== null && $diffOnly ) ) {
parent::view();
return;
}
$this->loadFile();
if ( $this->getTitle()->getNamespace() == NS_FILE && $this->mPage->getFile()->getRedirected() ) {
- if ( $this->getTitle()->getDBkey() == $this->mPage->getFile()->getName() || isset( $diff ) ) {
+ if ( $this->getTitle()->getDBkey() == $this->mPage->getFile()->getName() || $diff !== null ) {
// mTitle is the same as the redirect target so ask Article
// to perform the redirect for us.
$request->setVal( 'diffonly', 'true' );
static function newFromUpload( $fieldname = "xmlimport" ) {
$upload =& $_FILES[$fieldname];
- if( !isset( $upload ) || !$upload['name'] ) {
+ if( $upload === null || !$upload['name'] ) {
return Status::newFatal( 'importnofile' );
}
if( !empty( $upload['error'] ) ) {
if ( isset( $fp['thumbnail'] ) || isset( $fp['framed'] ) || isset( $fp['frameless'] ) || !$hp['width'] ) {
global $wgThumbLimits, $wgThumbUpright;
- if ( !isset( $widthOption ) || !isset( $wgThumbLimits[$widthOption] ) ) {
+ if ( $widthOption === null || !isset( $wgThumbLimits[$widthOption] ) ) {
$widthOption = User::getDefaultOption( 'thumbsize' );
}
* @return MimeMagic
*/
public static function &singleton() {
- if ( !isset( self::$instance ) ) {
+ if ( self::$instance === null ) {
self::$instance = new MimeMagic;
}
return self::$instance;