Merge "HTML escape parameter 'text' of hook 'SkinEditSectionLinks'"
[lhc/web/wiklou.git] / includes / skins / Skin.php
index ac41c46..a34e833 100644 (file)
@@ -755,7 +755,10 @@ abstract class Skin extends ContextSource {
                        return $subpages;
                }
 
-               if ( $out->isArticle() && MWNamespace::hasSubpages( $title->getNamespace() ) ) {
+               if (
+                       $out->isArticle() && MediaWikiServices::getInstance()->getNamespaceInfo()->
+                               hasSubpages( $title->getNamespace() )
+               ) {
                        $ptext = $title->getPrefixedText();
                        if ( strpos( $ptext, '/' ) !== false ) {
                                $links = explode( '/', $ptext );
@@ -1620,7 +1623,7 @@ abstract class Skin extends ContextSource {
 
                $links = [
                        'editsection' => [
-                               'text' => $this->msg( 'editsection' )->inLanguage( $lang )->escaped(),
+                               'text' => $this->msg( 'editsection' )->inLanguage( $lang )->text(),
                                'targetTitle' => $nt,
                                'attribs' => $attribs,
                                'query' => [ 'action' => 'edit', 'section' => $section ],
@@ -1636,7 +1639,7 @@ abstract class Skin extends ContextSource {
                foreach ( $links as $k => $linkDetails ) {
                        $linksHtml[] = Linker::link(
                                $linkDetails['targetTitle'],
-                               $linkDetails['text'],
+                               htmlspecialchars( $linkDetails['text'] ),
                                $linkDetails['attribs'],
                                $linkDetails['query'],
                                $linkDetails['options']