From: jens1o Date: Sun, 23 Jul 2017 14:02:54 +0000 (+0200) Subject: Use HTTP/1.1 in header() calls X-Git-Tag: 3.1.0_Alpha_1~195 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=73331307630cd0b10e06b1ea8b3800612e0789fd;p=GitHub%2FWoltLab%2FWCF.git Use HTTP/1.1 in header() calls Using HTTP/1.0 forces mod_php into compatibility mode, HTTP/1.1 uses default handling. Closes #2351 --- diff --git a/wcfsetup/install/files/lib/form/SearchForm.class.php b/wcfsetup/install/files/lib/form/SearchForm.class.php index 4c535248ff..8bb51aa6bf 100644 --- a/wcfsetup/install/files/lib/form/SearchForm.class.php +++ b/wcfsetup/install/files/lib/form/SearchForm.class.php @@ -295,7 +295,7 @@ class SearchForm extends AbstractCaptchaForm { * Throws a NamedUserException on search failure. */ public function throwNoMatchesException() { - @header('HTTP/1.0 404 Not Found'); + @header('HTTP/1.1 404 Not Found'); if (empty($this->query)) { throw new NamedUserException(WCF::getLanguage()->get('wcf.search.error.user.noMatches')); diff --git a/wcfsetup/install/files/lib/page/MembersListPage.class.php b/wcfsetup/install/files/lib/page/MembersListPage.class.php index 95e6d36c80..8fbcdeef5b 100644 --- a/wcfsetup/install/files/lib/page/MembersListPage.class.php +++ b/wcfsetup/install/files/lib/page/MembersListPage.class.php @@ -158,7 +158,7 @@ class MembersListPage extends SortablePage { ]); if (count($this->objectList) === 0) { - @header('HTTP/1.0 404 Not Found'); + @header('HTTP/1.1 404 Not Found'); } } } diff --git a/wcfsetup/install/files/lib/page/TaggedPage.class.php b/wcfsetup/install/files/lib/page/TaggedPage.class.php index 3f39738a17..828b3b9b63 100644 --- a/wcfsetup/install/files/lib/page/TaggedPage.class.php +++ b/wcfsetup/install/files/lib/page/TaggedPage.class.php @@ -128,7 +128,7 @@ class TaggedPage extends MultipleLinkPage { ]); if (count($this->objectList) === 0) { - @header('HTTP/1.0 404 Not Found'); + @header('HTTP/1.1 404 Not Found'); } } } diff --git a/wcfsetup/install/files/lib/page/TrophyListPage.class.php b/wcfsetup/install/files/lib/page/TrophyListPage.class.php index c097febf22..fc66926596 100644 --- a/wcfsetup/install/files/lib/page/TrophyListPage.class.php +++ b/wcfsetup/install/files/lib/page/TrophyListPage.class.php @@ -104,7 +104,7 @@ class TrophyListPage extends MultipleLinkPage { ]); if (count($this->objectList) === 0) { - @header('HTTP/1.0 404 Not Found'); + @header('HTTP/1.1 404 Not Found'); } } } diff --git a/wcfsetup/install/files/lib/page/TrophyPage.class.php b/wcfsetup/install/files/lib/page/TrophyPage.class.php index bacca17432..4b533e02b9 100644 --- a/wcfsetup/install/files/lib/page/TrophyPage.class.php +++ b/wcfsetup/install/files/lib/page/TrophyPage.class.php @@ -142,7 +142,7 @@ class TrophyPage extends MultipleLinkPage { ]); if (count($this->objectList) === 0) { - @header('HTTP/1.0 404 Not Found'); + @header('HTTP/1.1 404 Not Found'); } } } diff --git a/wcfsetup/install/files/lib/system/exception/AJAXException.class.php b/wcfsetup/install/files/lib/system/exception/AJAXException.class.php index d94c74e315..332bac446e 100644 --- a/wcfsetup/install/files/lib/system/exception/AJAXException.class.php +++ b/wcfsetup/install/files/lib/system/exception/AJAXException.class.php @@ -90,30 +90,30 @@ class AJAXException extends LoggedException { $statusHeader = ''; switch ($errorType) { case self::MISSING_PARAMETERS: - $statusHeader = 'HTTP/1.0 400 Bad Request'; + $statusHeader = 'HTTP/1.1 400 Bad Request'; $responseData['exceptionID'] = $exceptionID; $responseData['message'] = WCF::getLanguage()->get('wcf.ajax.error.badRequest'); break; case self::SESSION_EXPIRED: - $statusHeader = 'HTTP/1.0 409 Conflict'; + $statusHeader = 'HTTP/1.1 409 Conflict'; break; case self::INSUFFICIENT_PERMISSIONS: - $statusHeader = 'HTTP/1.0 403 Forbidden'; + $statusHeader = 'HTTP/1.1 403 Forbidden'; break; case self::BAD_PARAMETERS: - $statusHeader = 'HTTP/1.0 431 Bad Parameters'; + $statusHeader = 'HTTP/1.1 431 Bad Parameters'; $responseData['exceptionID'] = $exceptionID; break; default: case self::INTERNAL_ERROR: - //header('HTTP/1.0 418 I\'m a Teapot'); - header('HTTP/1.0 503 Service Unavailable'); + //header('HTTP/1.1 418 I\'m a Teapot'); + header('HTTP/1.1 503 Service Unavailable'); $responseData['code'] = self::INTERNAL_ERROR; $responseData['exceptionID'] = $exceptionID; diff --git a/wcfsetup/install/files/lib/system/exception/IllegalLinkException.class.php b/wcfsetup/install/files/lib/system/exception/IllegalLinkException.class.php index 21c67f0a73..87a035caf2 100644 --- a/wcfsetup/install/files/lib/system/exception/IllegalLinkException.class.php +++ b/wcfsetup/install/files/lib/system/exception/IllegalLinkException.class.php @@ -22,7 +22,7 @@ class IllegalLinkException extends NamedUserException { * @inheritDoc */ public function show() { - @header('HTTP/1.0 404 Not Found'); + @header('HTTP/1.1 404 Not Found'); WCF::getTPL()->assign([ 'title' => WCF::getLanguage()->getDynamicVariable('wcf.page.error.illegalLink.title') diff --git a/wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php b/wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php index 2a6435f11f..2b0cf43108 100644 --- a/wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php +++ b/wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php @@ -33,7 +33,7 @@ class PermissionDeniedException extends UserException { } SessionHandler::getInstance()->disableTracking(); - @header('HTTP/1.0 403 Forbidden'); + @header('HTTP/1.1 403 Forbidden'); WCF::getTPL()->assign([ 'name' => get_class($this), diff --git a/wcfsetup/install/files/lib/util/HeaderUtil.class.php b/wcfsetup/install/files/lib/util/HeaderUtil.class.php index 955450cf8d..5ca4c8ac7e 100644 --- a/wcfsetup/install/files/lib/util/HeaderUtil.class.php +++ b/wcfsetup/install/files/lib/util/HeaderUtil.class.php @@ -160,7 +160,7 @@ final class HeaderUtil { public static function redirect($location, $sendStatusCode = false, $temporaryRedirect = true) { if ($sendStatusCode) { if ($temporaryRedirect) @header('HTTP/1.1 307 Temporary Redirect'); - else @header('HTTP/1.0 301 Moved Permanently'); + else @header('HTTP/1.1 301 Moved Permanently'); } header('Location: '.$location);