diff --git a/ext/forms/element.c b/ext/forms/element.c index de10a3f86f4..11b0028218b 100644 --- a/ext/forms/element.c +++ b/ext/forms/element.c @@ -40,6 +40,7 @@ #include "kernel/concat.h" #include "kernel/file.h" #include "kernel/hash.h" +#include "kernel/string.h" /** * Phalcon\Forms\Element @@ -581,6 +582,7 @@ PHP_METHOD(Phalcon_Forms_Element, getLabel){ PHP_METHOD(Phalcon_Forms_Element, label){ zval *label, *attributes = NULL, *name = NULL, *html = NULL, *key = NULL, *value = NULL; + zval *escaped; HashTable *ah0; HashPosition hp0; zval **hd; @@ -603,8 +605,14 @@ PHP_METHOD(Phalcon_Forms_Element, label){ phalcon_read_property_this(&name, this_ptr, SL("_name"), PH_NOISY_CC); } + PHALCON_INIT_VAR(escaped); + phalcon_htmlspecialchars(escaped, name, NULL, NULL TSRMLS_CC); + PHALCON_INIT_VAR(html); - PHALCON_CONCAT_SVS(html, "