X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Factions%2FRawAction.php;h=be10ae47d707f934885494c57e608ed3fb40569f;hb=be0d9f587138a79e8f18bc7b26dd297d708b72c4;hp=5bf24f60e683ccb0b3393d7310aa4b13d3619c6f;hpb=a5be382adfdad4678eec18413c6a118cb3284daf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php index 5bf24f60e6..be10ae47d7 100644 --- a/includes/actions/RawAction.php +++ b/includes/actions/RawAction.php @@ -108,7 +108,9 @@ class RawAction extends FormlessAction { $response->statusHeader( 404 ); } - if ( !Hooks::run( 'RawPageViewBeforeOutput', [ &$this, &$text ] ) ) { + // Avoid PHP 7.1 warning of passing $this by reference + $rawAction = $this; + if ( !Hooks::run( 'RawPageViewBeforeOutput', [ &$rawAction, &$text ] ) ) { wfDebug( __METHOD__ . ": RawPageViewBeforeOutput hook broke raw page output.\n" ); } @@ -234,7 +236,13 @@ class RawAction extends FormlessAction { } } - $allowedCTypes = [ 'text/x-wiki', 'text/javascript', 'text/css', 'application/x-zope-edit' ]; + $allowedCTypes = [ + 'text/x-wiki', + 'text/javascript', + 'text/css', + 'application/x-zope-edit', + 'application/json' + ]; if ( $ctype == '' || !in_array( $ctype, $allowedCTypes ) ) { $ctype = 'text/x-wiki'; }