Merge branch '5.5'
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 31 May 2022 14:32:58 +0000 (16:32 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 31 May 2022 14:32:58 +0000 (16:32 +0200)
1  2 
wcfsetup/install/files/lib/http/middleware/CheckSystemEnvironment.class.php
wcfsetup/install/files/lib/system/WCF.class.php

index a88ff17ec0ef11cdd7a2df90474bbf35581bebad,0000000000000000000000000000000000000000..87515c90d33168f17e3c7923998858e8cd0b29a6
mode 100644,000000..100644
--- /dev/null
@@@ -1,39 -1,0 +1,39 @@@
-     
 +<?php
 +
 +namespace wcf\http\middleware;
 +
 +use Psr\Http\Message\ResponseInterface;
 +use Psr\Http\Message\ServerRequestInterface;
 +use Psr\Http\Server\MiddlewareInterface;
 +use Psr\Http\Server\RequestHandlerInterface;
 +use wcf\system\exception\NamedUserException;
 +use wcf\system\request\RequestHandler;
 +use wcf\system\WCF;
 +
 +/**
 + * Checks whether the system environment is unacceptable and prevents processing in that case.
 + *
 + * @author  Tim Duesterhus
 + * @copyright   2001-2022 WoltLab GmbH
 + * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 + * @package WoltLabSuite\Core\Http\Middleware
 + * @since   5.6
 + */
 +final class CheckSystemEnvironment implements MiddlewareInterface
 +{
 +    /**
 +     * @inheritDoc
 +     */
 +    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
 +    {
 +        if (!RequestHandler::getInstance()->isACPRequest()) {
 +            if (!(80100 <= \PHP_VERSION_ID && \PHP_VERSION_ID <= 80199)) {
 +                \header('HTTP/1.1 500 Internal Server Error');
++
 +                throw new NamedUserException(WCF::getLanguage()->get('wcf.global.incompatiblePhpVersion'));
 +            }
 +        }
 +
 +        return $handler->handle($request);
 +    }
 +}