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
*/
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 ) {