Param &$html for the "LinkBegin" hook needs to be null if $text is null
authorMarius Hoch <hoo@online.de>
Wed, 25 May 2016 19:25:12 +0000 (21:25 +0200)
committerMarius Hoch <hoo@online.de>
Wed, 25 May 2016 19:25:12 +0000 (21:25 +0200)
To keep b/c with the old implementation.

Change-Id: I5fff92f47babe890fe0d3726dba6f60cc75ee708

includes/linker/LinkRenderer.php

index 0261365..cb3acce 100644 (file)
@@ -213,7 +213,11 @@ class LinkRenderer {
                $ret = null;
                $dummy = new DummyLinker();
                $title = Title::newFromLinkTarget( $target );
-               $realHtml = $html = HtmlArmor::getHtml( $text );
+               if ( $text !== null ) {
+                       $realHtml = $html = HtmlArmor::getHtml( $text );
+               } else {
+                       $realHtml = $html = null;
+               }
                if ( !Hooks::run( 'LinkBegin',
                        [ $dummy, $title, &$html, &$extraAttribs, &$query, &$options, &$ret ] )
                ) {