Jelajahi Sumber

merged branch iambrosi/issue2653 (PR #3564)

Commits
-------

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

Discussion
----------

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

Fixes #2653
Fabien Potencier 13 tahun lalu
induk
melakukan
b062cc78d4
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  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']);
         }