diff options
author | Fomafix <fomafix@googlemail.com> | 2019-10-04 16:11:29 +0200 |
---|---|---|
committer | Fomafix <fomafix@googlemail.com> | 2019-10-05 22:57:30 +0200 |
commit | 2a2c7bb7ff3d68d4c5c8bf147df18d6a32875700 (patch) | |
tree | 69ae3672ecebaef6fbdfd7b567cb4444fca77e20 /img_auth.php | |
parent | c128fc95bba4ab0e1016dd6cfe10f30a5a222802 (diff) | |
download | mediawikicore-2a2c7bb7ff3d68d4c5c8bf147df18d6a32875700.tar.gz mediawikicore-2a2c7bb7ff3d68d4c5c8bf147df18d6a32875700.zip |
Use Mustache template in img_auth.php
Let the template do the output encoding.
Change-Id: I01fc60f10f98c032c5104d3a2f4b44cdfbeee51c
Diffstat (limited to 'img_auth.php')
-rw-r--r-- | img_auth.php | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/img_auth.php b/img_auth.php index 05c63ce0ecb0..dc50a6015600 100644 --- a/img_auth.php +++ b/img_auth.php @@ -203,9 +203,9 @@ function wfForbidden( $msg1, $msg2, ...$args ) { $args = ( isset( $args[0] ) && is_array( $args[0] ) ) ? $args[0] : $args; - $msgHdr = wfMessage( $msg1 )->escaped(); + $msgHdr = wfMessage( $msg1 )->text(); $detailMsgKey = $wgImgAuthDetails ? $msg2 : 'badaccess-group0'; - $detailMsg = wfMessage( $detailMsgKey, $args )->escaped(); + $detailMsg = wfMessage( $detailMsgKey, $args )->text(); wfDebugLog( 'img_auth', "wfForbidden Hdr: " . wfMessage( $msg1 )->inLanguage( 'en' )->text() . " Msg: " . @@ -215,17 +215,9 @@ function wfForbidden( $msg1, $msg2, ...$args ) { HttpStatus::header( 403 ); header( 'Cache-Control: no-cache' ); header( 'Content-Type: text/html; charset=utf-8' ); - echo <<<ENDS -<!DOCTYPE html> -<html> -<head> -<meta charset="UTF-8" /> -<title>$msgHdr</title> -</head> -<body> -<h1>$msgHdr</h1> -<p>$detailMsg</p> -</body> -</html> -ENDS; + $templateParser = new TemplateParser(); + echo $templateParser->processTemplate( 'ImageAuthForbidden', [ + 'msgHdr' => $msgHdr, + 'detailMsg' => $detailMsg, + ] ); } |