From 5b17f233cdb6f746e81d8fbe6ae3f334904960c4 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 27 Mar 2013 12:53:14 -0400 Subject: [PATCH] CoreParserFunctions::anchorencode should return a string CoreParserFunctions::anchorencode incorrectly returns false rather than the empty string when passed an empty string. A simple cast fixes it; this likely wasn't noticed before since PHP was automatically doing the cast anyway when the return value was merged into wikitext. Bug: 46608 Change-Id: I97556dbc4dcc1f102f6fed499d43dada388cdc5d --- includes/parser/CoreParserFunctions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 6aef08ea23..36bfb48770 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -753,7 +753,7 @@ class CoreParserFunctions { */ static function anchorencode( $parser, $text ) { $text = $parser->killMarkers( $text ); - return substr( $parser->guessSectionNameFromWikiText( $text ), 1); + return (string)substr( $parser->guessSectionNameFromWikiText( $text ), 1 ); } static function special( $parser, $text ) { -- 2.20.1