Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Uninitialized string offset after upgrading to Symfony 4.1 #28240

Closed
bigfoot90 opened this issue Aug 22, 2018 · 1 comment
Closed

[BUG] Uninitialized string offset after upgrading to Symfony 4.1 #28240

bigfoot90 opened this issue Aug 22, 2018 · 1 comment

Comments

@bigfoot90
Copy link

Symfony version(s) affected: 4.1

Description
After merge of commit 6089290
I got the error An exception has been thrown during the rendering of a template ("Notice: Uninitialized string offset: 0")

How to reproduce
Render a Controller from a Twig template like this:
{{ render(controller('Infrastructure\\Symfony\\Controller\\CommonPartsController::quickSearch')) }}

Additional context

ErrorException
Notice: Uninitialized string offset: 0

in /srv/vendor/symfony/http-foundation/Request.php (line 1989)
in /srv/vendor/symfony/http-foundation/Request.php->normalizeAndFilterClientIps (line 1952)
in /srv/vendor/symfony/http-foundation/Request.php->getTrustedValues (line 780)
in /srv/vendor/symfony/http-foundation/Request.php->getClientIps (line 799)
in /srv/vendor/symfony/http-kernel/Profiler/Profiler.php->getClientIp (line 154)
in /srv/vendor/symfony/http-kernel/EventListener/ProfilerListener.php->collect (line 91)
in /srv/vendor/symfony/event-dispatcher/Debug/WrappedListener.php->onKernelResponse (line 104)
in /srv/vendor/symfony/event-dispatcher/EventDispatcher.php->__invoke (line 212)
in /srv/vendor/symfony/event-dispatcher/EventDispatcher.php->doDispatch (line 44)
in /srv/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php->dispatch (line 141)
in /srv/vendor/symfony/http-kernel/HttpKernel.php->dispatch (line 187)
in /srv/vendor/symfony/http-kernel/HttpKernel.php->filterResponse (line 169)
in /srv/vendor/symfony/http-kernel/HttpKernel.php->handleRaw (line 66)
in /srv/vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php->handle (line 81)
in /srv/vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php::handle (line 80)
in /srv/vendor/symfony/http-kernel/Fragment/FragmentHandler.php->render (line 87)
in /srv/vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php->render (line 45)
in /srv/vendor/symfony/twig-bridge/Extension/HttpKernelRuntime.php->render (line 46)
in /srv/var/cache/dev/twig/9e/9eb6412486206c3673e63daf0ce3c8f72ac9ecac27fc02c3dafad68618f3bab2.php->renderFragment (line 47)
in /srv/vendor/twig/twig/lib/Twig/Template.php->doDisplay (line 390)
in /srv/vendor/twig/twig/lib/Twig/Template.php->displayWithErrorHandling (line 367)
in /srv/var/cache/dev/twig/35/358e7a1e79bf54f792290ab080d44ef9dab359d175c5c363919ca784b3ecda3d.php->display (line 49)
in /srv/vendor/twig/twig/lib/Twig/Template.php->doDisplay (line 390)
in /srv/vendor/twig/twig/lib/Twig/Template.php->displayWithErrorHandling (line 367)
in /srv/var/cache/dev/twig/97/97a9c91193ffc1aad993506b278efab5329dea7ca3b768e986876e6643963797.php->display (line 44)
in /srv/vendor/twig/twig/lib/Twig/Template.php->doDisplay (line 390)
in /srv/vendor/twig/twig/lib/Twig/Template.php->displayWithErrorHandling (line 367)
in /srv/vendor/twig/twig/lib/Twig/Template.php->display (line 375)
in /srv/vendor/symfony/twig-bridge/TwigEngine.php->render (line 49)
in /srv/vendor/symfony/twig-bundle/TwigEngine.php->render (line 45)
in /srv/vendor/symfony/templating/DelegatingEngine.php->render (line 41)
in /srv/vendor/symfony/framework-bundle/Controller/ControllerTrait.php->render (line 222)
Controller->render('customer/index.html.twig', array('form' => object(FormView), 'customers' => array(object(Customer))))
in Symfony/Controller/Customer/IndexController.php (line 31)
in /srv/vendor/symfony/http-kernel/HttpKernel.php->index (line 149)
in /srv/vendor/symfony/http-kernel/HttpKernel.php->handleRaw (line 66)
in /srv/vendor/symfony/http-kernel/Kernel.php->handle (line 188)
Kernel->handle(object(Request))
in /srv/public/index.php (line 28)
@nicolas-grekas
Copy link
Member

Fixed in #28241

nicolas-grekas added a commit that referenced this issue Aug 24, 2018
…meters (nicolas-grekas)

This PR was merged into the 2.8 branch.

Discussion
----------

[HttpKernel] fix forwarding trusted headers as server parameters

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28233, #28226, #28225, #28240
| License       | MIT
| Doc PR        | -

Commits
-------

9295348 [HttpKernel] fix forwarding trusted headers as server parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants