We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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.



98.9k

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?



98.9k
Accepted
answer

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 :)