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

Is escape_attr behaving as expected?

I'm using escape_attr in a Volt template and the behaviour seems to have changed in 1.2.0

In version 1.1.0 escaping an integer either had no effect or cast it to a String so I was able to do this: href="{{url('controller/action')}}/{{ mymodel.getId()|escape_attr }}"

But in version 1.2.0 the integer returned by getId is stripped so I have to do this: href="{{url('controller/action')}}/{{ mymodel.getIdAsString()|escape_attr }}"

Is this expected behaviour?



98.9k

I think this is a bug, I'm going to fix it in 1.2.1



98.9k

This is fixed in 1.2.1, can you try with that version (master on github)?



11.3k

I checked it earlier this evening, works fine now, thank you!