From: Brad Jorsch Date: Wed, 27 Mar 2013 16:53:14 +0000 (-0400) Subject: CoreParserFunctions::anchorencode should return a string X-Git-Tag: 1.31.0-rc.0~20204^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=5b17f233cdb6f746e81d8fbe6ae3f334904960c4;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ) {