getBridgeClassNames() as $bridgeClassName) { if (!$bridgeFactory->isWhitelisted($bridgeClassName)) { continue; } $bridge = $bridgeFactory->create($bridgeClassName); if ($bridge === false) { continue; } $bridgeParams = $bridge->detectParameters($targetURL); if (is_null($bridgeParams)) { continue; } $bridgeParams['bridge'] = $bridgeClassName; $bridgeParams['format'] = $format; header('Location: ?action=display&' . http_build_query($bridgeParams), true, 301); exit; } returnClientError('No bridge found for given URL: ' . $targetURL); } }