Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Strange problem with View

The code below throws a 502 Nginx error without any report to log on one of my servers

$this->view->setVar('email', $user->email);

Where: $user->email — is valid string value $this->view — is valid instance of \Phalcon\Mvc\View

If I pass a number or boolean value, error doesn't throw, but in template 'email' variable is empty.

Phalcon 1.1.0 (last version) CentOS 6 x64 PHP 5.4.16 (php54w php54w-cli php54w-common php54w-devel php54w-fpm php54w-gd php54w-imap php54w-intl php54w-mbstring php54w-mcrypt php54w-mysql php54w-pdo php54w-pecl-apc php54w-pecl-memcache php54w-xml)

Please help me.


To properly diagnose the problem, we need a complete script to be able to reproduce the bug ourselves. Can you please provide a test?

Problem is in template:

{{ email|e }}

Filters 'e' and 'escape' throws error, but others (like 'trim', 'upper', 'json_encode', 'escape_attr' and so on) doesn't.

What magic in escape filter may cause this behavior?


This was fixed some weeks ago in 1.2.0, can you try with that version?

In current version of 1.2.0 this filter works fine. Thanks!

Also special thanks for customizable Submit label in 1.2.0 :)