IAlex has uploaded a new change for review. https://gerrit.wikimedia.org/r/63631
Change subject: Fix fatal error when $wgValidateAllHtml is enabled and apache_request_headers() does not exists ...................................................................... Fix fatal error when $wgValidateAllHtml is enabled and apache_request_headers() does not exists $wgValidateAllHtml requires apache_request_headers() to know what is the content type of the response. This feature is now disabled if that function does not exist. Change-Id: Ia52f5a0d12db0680aa03b57dd45c974291e88af9 --- M RELEASE-NOTES-1.22 M includes/DefaultSettings.php M includes/OutputHandler.php 3 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/31/63631/1 diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index cf50bb8..c800de5 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -94,6 +94,8 @@ strings will now start with digits 0 and 8-f as often as they should. * (bug 45371) Removed Parser_LinkHooks and CoreLinkFunctions classes. * (bug 41545) Allow <kbd>, <samp>, and <var> to be nested like allowed in html. +* (bug 48342) Fixed a fatal error when $wgValidateAllHtml is set to true and + the function apache_request_headers() function is not available. === API changes in 1.22 === * (bug 46626) xmldoublequote parameter was removed. Because of a bug, the diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index bcc4ae4..7bba6a9 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2638,6 +2638,8 @@ /** * Validate the overall output using tidy and refuse * to display the page if it's not valid. + * + * This is ignored if the apache_request_headers() function is not available. */ $wgValidateAllHtml = false; diff --git a/includes/OutputHandler.php b/includes/OutputHandler.php index e7928cc..b44f800 100644 --- a/includes/OutputHandler.php +++ b/includes/OutputHandler.php @@ -30,7 +30,7 @@ function wfOutputHandler( $s ) { global $wgDisableOutputCompression, $wgValidateAllHtml; $s = wfMangleFlashPolicy( $s ); - if ( $wgValidateAllHtml ) { + if ( $wgValidateAllHtml && function_exists( 'apache_response_headers' ) ) { $headers = apache_response_headers(); $isHTML = true; foreach ( $headers as $name => $value ) { -- To view, visit https://gerrit.wikimedia.org/r/63631 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia52f5a0d12db0680aa03b57dd45c974291e88af9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: IAlex <coderev...@emsenhuber.ch> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits