Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/Horde/Core/Factory/ActiveSyncBackend.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Horde\Http\ServerRequest;
use Horde\Injector\NotFoundException as InjectorNotFoundException;

/**
* @category Horde
Expand All @@ -15,7 +16,13 @@ public function create(Horde_Injector $injector)
// Get PSR-7 ServerRequest from injector
try {
$serverRequest = $injector->get(ServerRequest::class);
} catch (Horde_Exception_NotFound $e) {
} catch (Horde_Exception_NotFound | InjectorNotFoundException $e) {
// Injector throws Horde\Injector\NotFoundException when ServerRequest is
// unbound; legacy code threw Horde_Exception_NotFound. Both must use the
// superglobal fallback (PHP 7.4: no union catch).
if (!$e instanceof Horde_Exception_NotFound && !$e instanceof InjectorNotFoundException) {
throw $e;
}
// Fallback: Create from PHP superglobals
$serverRequest = new ServerRequest(
$_SERVER['REQUEST_METHOD'] ?? 'GET',
Expand Down
Loading