Don't use isset() to check for null
Fixes in includes/specials Change-Id: I6c382aeaa92372bc11220694c479006e3c658362
This commit is contained in:
parent
5705b0aed9
commit
ad86d32875
6 changed files with 9 additions and 10 deletions
|
|
@ -296,7 +296,7 @@ class SpecialAllpages extends IncludableSpecialPage {
|
|||
$bottomLinks = array();
|
||||
|
||||
# Do we put a previous link ?
|
||||
if ( isset( $prevTitle ) && $pt = $prevTitle->getText() ) {
|
||||
if ( $prevTitle && $pt = $prevTitle->getText() ) {
|
||||
$query = array( 'from' => $prevTitle->getText() );
|
||||
|
||||
if ( $namespace ) {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class SpecialChangePassword extends FormSpecialPage {
|
|||
$request = $this->getRequest();
|
||||
|
||||
$oldpassMsg = $this->mOldPassMsg;
|
||||
if ( !isset( $oldpassMsg ) ) {
|
||||
if ( $oldpassMsg === null ) {
|
||||
$oldpassMsg = $user->isLoggedIn() ? 'oldpassword' : 'resetpass-temp-password';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class FileDuplicateSearchPage extends QueryPage {
|
|||
$this->setHeaders();
|
||||
$this->outputHeader();
|
||||
|
||||
$this->filename = isset( $par ) ? $par : $this->getRequest()->getText( 'filename' );
|
||||
$this->filename = $par !== null ? $par : $this->getRequest()->getText( 'filename' );
|
||||
$this->file = null;
|
||||
$this->hash = '';
|
||||
$title = Title::newFromText( $this->filename, NS_FILE );
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ class LinkSearchPage extends QueryPage {
|
|||
global $wgMiserMode;
|
||||
$params = array();
|
||||
$params['target'] = $this->mProt . $this->mQuery;
|
||||
if ( isset( $this->mNs ) && !$wgMiserMode ) {
|
||||
if ( $this->mNs !== null && !$wgMiserMode ) {
|
||||
$params['namespace'] = $this->mNs;
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ class LinkSearchPage extends QueryPage {
|
|||
'options' => array( 'USE INDEX' => $clause )
|
||||
);
|
||||
|
||||
if ( isset( $this->mNs ) && !$wgMiserMode ) {
|
||||
if ( $this->mNs !== null && !$wgMiserMode ) {
|
||||
$retval['conds']['page_namespace'] = $this->mNs;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class SpecialPrefixindex extends SpecialAllpages {
|
|||
);
|
||||
|
||||
$showme = '';
|
||||
if ( isset( $par ) ) {
|
||||
if ( $par !== null ) {
|
||||
$showme = $par;
|
||||
} elseif ( $prefix != '' ) {
|
||||
$showme = $prefix;
|
||||
|
|
@ -167,6 +167,7 @@ class SpecialPrefixindex extends SpecialAllpages {
|
|||
$fromList = $this->getNamespaceKeyAndText( $namespace, $from );
|
||||
$prefixList = $this->getNamespaceKeyAndText( $namespace, $prefix );
|
||||
$namespaces = $wgContLang->getNamespaces();
|
||||
$res = null;
|
||||
|
||||
if ( !$prefixList || !$fromList ) {
|
||||
$out = $this->msg( 'allpagesbadtitle' )->parseAsBlock();
|
||||
|
|
@ -261,9 +262,7 @@ class SpecialPrefixindex extends SpecialAllpages {
|
|||
'</td>
|
||||
<td id="mw-prefixindex-nav-form" class="mw-prefixindex-nav">';
|
||||
|
||||
if ( isset( $res ) && $res && ( $n == $this->maxPerPage ) &&
|
||||
( $s = $res->fetchObject() )
|
||||
) {
|
||||
if ( $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
|
||||
$query = array(
|
||||
'from' => $s->page_title,
|
||||
'prefix' => $prefix,
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
|
|||
$opts->validateIntBounds( 'limit', 0, 5000 );
|
||||
|
||||
// Give precedence to subpage syntax
|
||||
if ( isset( $par ) ) {
|
||||
if ( $par !== null ) {
|
||||
$opts->setValue( 'target', $par );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue