summaryrefslogtreecommitdiffstats
path: root/Http/HttpUtils.php
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2011-11-14 13:10:32 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2011-11-14 13:10:32 +0100
commit7f2e3570c00c06f45f9d960986f6096515f8b3f2 (patch)
tree1fcddce113472e663423042236be8e0ab0bfa845 /Http/HttpUtils.php
parent6b549aafe281d641b4677e74ca5fcce1bf35b183 (diff)
downloadsymfony-security-7f2e3570c00c06f45f9d960986f6096515f8b3f2.zip
symfony-security-7f2e3570c00c06f45f9d960986f6096515f8b3f2.tar.gz
symfony-security-7f2e3570c00c06f45f9d960986f6096515f8b3f2.tar.bz2
[Security] fixed HttpUtils::checkRequestPath() to not catch all exceptions (closes #2637)v2.0.6
Diffstat (limited to 'Http/HttpUtils.php')
-rw-r--r--Http/HttpUtils.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/Http/HttpUtils.php b/Http/HttpUtils.php
index 78d65c5..cac130e 100644
--- a/Http/HttpUtils.php
+++ b/Http/HttpUtils.php
@@ -16,6 +16,8 @@ use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\RouterInterface;
+use Symfony\Component\Routing\Exception\MethodNotAllowedException;
+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
/**
* Encapsulates the logic needed to create sub-requests, redirect the user, and match URLs.
@@ -108,7 +110,9 @@ class HttpUtils
$parameters = $this->router->match($request->getPathInfo());
return $path === $parameters['_route'];
- } catch (\Exception $e) {
+ } catch (MethodNotAllowedException $e) {
+ return false;
+ } catch (ResourceNotFoundException $e) {
return false;
}
}