From: Erik Bernhardson Date: Thu, 24 Mar 2016 23:35:54 +0000 (-0700) Subject: Allow titles with falsy title text in suggestions X-Git-Tag: 1.31.0-rc.0~7508^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22brouteur%22%2C%28%24id_rubrique%20?a=commitdiff_plain;h=489fa6fca231ba3927e51ff154acbf8ae15756b1;p=lhc%2Fweb%2Fwiklou.git Allow titles with falsy title text in suggestions A valid title, such as 0, would end up being ignored in this clause and not providing a title. Make the empty string check stricter to allow these titles through. Change-Id: I938a7dfe294e979c19f720eadb6f96282b1c4588 --- diff --git a/includes/search/SearchSuggestion.php b/includes/search/SearchSuggestion.php index cd9062b16f..80a437b6c9 100644 --- a/includes/search/SearchSuggestion.php +++ b/includes/search/SearchSuggestion.php @@ -84,7 +84,7 @@ class SearchSuggestion { */ public function setText( $text, $setTitle = true ) { $this->text = $text; - if ( $setTitle && $text ) { + if ( $setTitle && $text !== '' && $text !== null ) { $this->setSuggestedTitle( Title::makeTitle( 0, $text ) ); } }