Change a condition with == to something more precise

It can be both NULL and an empty string here.
Tests for both cases are added in the following patches:
Ia6c10419a7a92dac642db6ea21908927a5830b69
Ibb3bb1ab3450a34889dcd66b34542f2dd25fdc2b

Change-Id: Ia2b2b6545bb889de59a363a2c1d7569cbc971361
This commit is contained in:
Amir E. Aharoni 2015-07-07 15:26:35 +03:00 committed by Jdlrobson
parent 469217073a
commit adf113af86

View file

@ -299,12 +299,12 @@ class Cite {
# <ref ...></ref>. This construct is invalid if
# it's a contentful ref, but OK if it's a named duplicate and should
# be equivalent <ref ... />, for compatability with #tag.
if ( $key == false ) {
if ( is_string( $key ) && $key !== '' ) {
$str = null;
} else {
$this->mRefCallStack[] = false;
return $this->error( 'cite_error_ref_no_input' );
} else {
$str = null;
}
}