From ca4489c3e3021779544c3e49ceb65acf80955ad6 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 1 Jan 2013 22:13:30 +0100 Subject: [PATCH] Don't use isset() to check whether an existing variable is null Change-Id: I7b4207e91b6fa33ba31b1308f5e71f923def687e --- includes/CategoryPage.php | 2 +- includes/EditPage.php | 2 +- includes/Export.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 32e270e8c1..3e69dd4f84 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -56,7 +56,7 @@ class CategoryPage extends Article { $diffOnly = $request->getBool( 'diffonly', $this->getContext()->getUser()->getOption( 'diffonly' ) ); - if ( isset( $diff ) && $diffOnly ) { + if ( $diff !== null && $diffOnly ) { parent::view(); return; } diff --git a/includes/EditPage.php b/includes/EditPage.php index ad6c98d110..cf2b87875f 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -610,7 +610,7 @@ class EditPage { // modified by subclasses wfProfileIn( get_class( $this ) . "::importContentFormData" ); $textbox1 = $this->importContentFormData( $request ); - if ( isset( $textbox1 ) ) { + if ( $textbox1 !== null ) { $this->textbox1 = $textbox1; } diff --git a/includes/Export.php b/includes/Export.php index 45a5366e1a..16c297ee5c 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -427,10 +427,10 @@ class WikiExporter { protected function outputPageStream( $resultset ) { $last = null; foreach ( $resultset as $row ) { - if ( is_null( $last ) || + if ( $last === null || $last->page_namespace != $row->page_namespace || $last->page_title != $row->page_title ) { - if ( isset( $last ) ) { + if ( $last !== null ) { $output = ''; if ( $this->dumpUploads ) { $output .= $this->writer->writeUploads( $last, $this->dumpUploadFileContents ); @@ -445,7 +445,7 @@ class WikiExporter { $output = $this->writer->writeRevision( $row ); $this->sink->writeRevision( $row, $output ); } - if ( isset( $last ) ) { + if ( $last !== null ) { $output = ''; if ( $this->dumpUploads ) { $output .= $this->writer->writeUploads( $last, $this->dumpUploadFileContents ); -- 2.20.1