Browse Source

Sets _format attribute only if it wasn't set previously by the user

Ismael Ambrosi 13 years ago
parent
commit
aa53b887d1
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/Symfony/Bundle/FrameworkBundle/HttpKernel.php

+ 5 - 1
src/Symfony/Bundle/FrameworkBundle/HttpKernel.php

@@ -133,7 +133,11 @@ class HttpKernel extends BaseHttpKernel
             }
         } else {
             $options['attributes']['_controller'] = $controller;
-            $options['attributes']['_format'] = $request->getRequestFormat();
+
+            if (!isset($options['attributes']['_format'])) {
+                $options['attributes']['_format'] = $request->getRequestFormat();
+            }
+
             $options['attributes']['_route'] = '_internal';
             $subRequest = $request->duplicate($options['query'], null, $options['attributes']);
         }