Skip to content

Commit

Permalink
make routematching 2.1.x compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Gladhon committed Aug 14, 2012
1 parent b1e2eed commit f348b5a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Extension/TwigExtension.php
Expand Up @@ -152,8 +152,16 @@ public static function generateMetaTagKey(\Symfony\Component\HttpFoundation\Requ
{

$pathinfo = $request->getPathInfo();
$infos = $router->match($pathinfo);
if (strpos($infos['_route'], \Ibrows\SimpleCMSBundle\Routing\RouteLoader::ROUTE_BEGIN) === 0) {

try{
$infos = $router->match($pathinfo);
}catch (\Symfony\Component\Routing\Exception\ResourceNotFoundException $e){
$infos = false;
}catch (\Symfony\Component\Routing\Exception\MethodNotAllowedException $e){
$infos = false;
}

if ($infos !== false && strpos($infos['_route'], \Ibrows\SimpleCMSBundle\Routing\RouteLoader::ROUTE_BEGIN) === 0) {

// allready alias, get the base pathinfo
$oldinfos = \Ibrows\SimpleCMSBundle\Routing\RouteLoader::getPathinfo($infos['_route']);
Expand Down

0 comments on commit f348b5a

Please sign in to comment.