bayrell / BayLang

BayLang compiler source code
https://bayrell.org/ru/docs/baylang
Apache License 2.0
4 stars 0 forks source link

%render must not escape #134

Closed ildar-ceo closed 9 months ago

ildar-ceo commented 9 months ago
%render this.renderField()

should generate:

$this->_t($__v0, $this->renderField());

And:

{{ this.item }}

should generate:

$this->_t($__v0, $this->_escape($this->item));
ildar-ceo commented 9 months ago

А _escape функция должна однозначно экранировать:

/**
 * Escape html
 */
string _escape(var s)
{
    if (rtl::isScalarValue(s)) return rs::htmlEscape(s);
    return "";
}