X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialExpandTemplates.php;h=72e881f96729eaf592d292d3850772599548a801;hb=9579fb0605dd490f55e7d2bec5216951ada6dde8;hp=ceba987f8a1cac7cd4f579887f361bc390b280d6;hpb=af7ae6c804be8629fe2305e3a088f03e1af2fa9b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialExpandTemplates.php b/includes/specials/SpecialExpandTemplates.php index ceba987f8a..72e881f967 100644 --- a/includes/specials/SpecialExpandTemplates.php +++ b/includes/specials/SpecialExpandTemplates.php @@ -83,8 +83,10 @@ class SpecialExpandTemplates extends SpecialPage { $dom = $parser->preprocessToDom( $input ); if ( method_exists( $dom, 'saveXML' ) ) { + // @phan-suppress-next-line PhanUndeclaredMethod $xml = $dom->saveXML(); } else { + // @phan-suppress-next-line PhanUndeclaredMethod $xml = $dom->__toString(); } } @@ -271,7 +273,10 @@ class SpecialExpandTemplates extends SpecialPage { // allowed and a valid edit token is not provided (T73111). However, MediaWiki // does not currently provide logged-out users with CSRF protection; in that case, // do not show the preview unless anonymous editing is allowed. - if ( $user->isAnon() && !$user->isAllowed( 'edit' ) ) { + if ( $user->isAnon() && !MediaWikiServices::getInstance() + ->getPermissionManager() + ->userHasRight( $user, 'edit' ) + ) { $error = [ 'expand_templates_preview_fail_html_anon' ]; } elseif ( !$user->matchEditToken( $request->getVal( 'wpEditToken' ), '', $request ) ) { $error = [ 'expand_templates_preview_fail_html' ]; @@ -280,7 +285,7 @@ class SpecialExpandTemplates extends SpecialPage { } if ( $error ) { - $out->wrapWikiMsg( "
\n$1\n
", $error ); + $out->wrapWikiMsg( "
\n$1\n
", $error ); return; } }