Merge pull request #513 from SergiX44/support_php_82

This commit is contained in:
Sergio Brighenti 2023-05-23 23:03:21 +02:00 committed by GitHub
commit 91d05884b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 623 additions and 422 deletions

View file

@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.3", "7.4", "8.0"]
php-versions: ["7.3", "7.4", "8.0", "8.1", "8.2"]
steps:
- uses: actions/checkout@v2

View file

@ -4,7 +4,6 @@ namespace App\Controllers;
use App\Database\Repositories\UserRepository;
use App\Web\UA;
use GuzzleHttp\Psr7\Stream;
use Intervention\Image\Constraint;
use Intervention\Image\ImageManagerStatic as Image;
use League\Flysystem\FileNotFoundException;
@ -14,6 +13,7 @@ use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Exception\HttpBadRequestException;
use Slim\Exception\HttpNotFoundException;
use Slim\Exception\HttpUnauthorizedException;
use Slim\Psr7\Stream;
class MediaController extends Controller
{

View file

@ -2,7 +2,6 @@
namespace App\Middleware;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
@ -16,7 +15,7 @@ class AdminMiddleware extends Middleware
*
* @throws HttpUnauthorizedException
*
* @return Response
* @return ResponseInterface
*/
public function __invoke(Request $request, RequestHandler $handler): ResponseInterface
{

View file

@ -2,10 +2,10 @@
namespace App\Middleware;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
use Slim\Psr7\Factory\ResponseFactory;
class AuthMiddleware extends Middleware
{
@ -20,14 +20,14 @@ class AuthMiddleware extends Middleware
if (!$this->session->get('logged', false)) {
$this->session->set('redirectTo', (string) $request->getUri()->getPath());
return redirect(new Response(), route('login.show'));
return redirect((new ResponseFactory())->createResponse(), route('login.show'));
}
if (!$this->database->query('SELECT `id`, `active` FROM `users` WHERE `id` = ? LIMIT 1', [$this->session->get('user_id')])->fetch()->active) {
$this->session->alert(lang('account_disabled'), 'danger');
$this->session->set('logged', false);
return redirect(new Response(), route('login.show'));
return redirect((new ResponseFactory())->createResponse(), route('login.show'));
}
return $handler->handle($request);

View file

@ -1,7 +1,7 @@
{
"name": "sergix44/xbackbone",
"license": "AGPL-3.0-only",
"version": "3.6.1",
"version": "3.6.2",
"description": "A lightweight ShareX PHP backend",
"type": "project",
"require": {
@ -13,16 +13,16 @@
"ext-pdo": "*",
"ext-zip": "*",
"erusev/parsedown": "^1.7",
"guzzlehttp/psr7": "^1.8",
"intervention/image": "^2.6",
"league/flysystem": "^1.1.4",
"league/flysystem-aws-s3-v3": "^1.0",
"league/flysystem-azure-blob-storage": "^0.1.6",
"league/flysystem-azure-blob-storage": "^1.0",
"league/flysystem-cached-adapter": "^1.1",
"maennchen/zipstream-php": "^2.0",
"monolog/monolog": "^1.23",
"php-di/slim-bridge": "^3.0",
"sapphirecat/slim4-http-interop-adapter": "^1.0",
"slim/psr7": "^1.5",
"slim/slim": "^4.0",
"spatie/flysystem-dropbox": "^1.0",
"superbalist/flysystem-google-storage": "^7.2",

1026
composer.lock generated

File diff suppressed because it is too large Load diff