EBernhardson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/279555

Change subject: Allow titles with falsy title text in suggestions
......................................................................

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
---
M includes/search/SearchSuggestion.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/279555/1

diff --git a/includes/search/SearchSuggestion.php 
b/includes/search/SearchSuggestion.php
index cd9062b..80a437b 100644
--- a/includes/search/SearchSuggestion.php
+++ b/includes/search/SearchSuggestion.php
@@ -84,7 +84,7 @@
         */
        public function setText( $text, $setTitle = true ) {
                $this->text = $text;
-               if ( $setTitle && $text ) {
+               if ( $setTitle && $text !== '' && $text !== null ) {
                        $this->setSuggestedTitle( Title::makeTitle( 0, $text ) 
);
                }
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/279555
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I938a7dfe294e979c19f720eadb6f96282b1c4588
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to