Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Twig render helper doesn't work on IIS7 #6936

Closed
@apt-thomas

Description

@apt-thomas

{{ render('foo') }} returns current action and render current template instend of action requested.

This happens because Symfony\Component\HttpFoundation\Request doesn't overwrite 'HTTP_X_ORIGINAL_URL', only 'REQUEST_URI'.

This can be fixed adding 'HTTP_X_ORIGINAL_URL' to the array used to overwrite the server variables:

Symfony\Component\HttpFoundation\Request line: 338:

$server = array_replace($defaults, $server, array(
    'REQUEST_METHOD' => strtoupper($method),
    'PATH_INFO'      => '',
    'REQUEST_URI'    => $uri,
    'QUERY_STRING'   => $queryString,
));

fix:

$server = array_replace($defaults, $server, array(
    'REQUEST_METHOD' => strtoupper($method),
    'PATH_INFO'      => '',
    'REQUEST_URI'    => $uri,
    'HTTP_X_ORIGINAL_URL' => $uri,
    'QUERY_STRING'   => $queryString,
 ));

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions