Skip to content

Commit

Permalink
Fix #1413
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Oct 22, 2013
1 parent 1c198a6 commit b4938ea
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
20 changes: 18 additions & 2 deletions ext/forms/element.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,26 @@ PHP_METHOD(Phalcon_Forms_Element, clear){
*/
PHP_METHOD(Phalcon_Forms_Element, __toString){


PHALCON_MM_GROW();

phalcon_call_method(return_value, this_ptr, "render");
if (phalcon_call_method_params(return_value, this_ptr, SL("render"), 0, NULL, zend_inline_hash_func(SS("render")), 1 TSRMLS_CC) == FAILURE) {
if (EG(exception)) {
zval *e = EG(exception);
zval *m = zend_read_property(Z_OBJCE_P(e), e, SL("message"), 1 TSRMLS_CC);

Z_ADDREF_P(m);
if (Z_TYPE_P(m) != IS_STRING) {
convert_to_string_ex(&m);
}

zend_clear_exception(TSRMLS_C);
zend_error(E_ERROR, "%s", Z_STRVAL_P(m));
zval_ptr_dtor(&m);
}

return;
}

RETURN_MM();
}

9 changes: 9 additions & 0 deletions ext/tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ static void phalcon_tag_write_attributes(zval *code, zval *attributes TSRMLS_DC)

PHALCON_OBS_VAR(escaper);
phalcon_tag_get_escaper(&escaper, attributes TSRMLS_CC);
if (EG(exception)) {
RETURN_MM();
}

if (escaper) {
for (
Expand Down Expand Up @@ -629,6 +632,9 @@ PHP_METHOD(Phalcon_Tag, _inputField){

PHALCON_OBS_VAR(escaper);
phalcon_tag_get_escaper(&escaper, params TSRMLS_CC);
if (EG(exception)) {
RETURN_MM();
}

phalcon_array_update_string(&params, SL("type"), &type, PH_COPY | PH_SEPARATE);

Expand Down Expand Up @@ -1163,6 +1169,9 @@ PHP_METHOD(Phalcon_Tag, textArea){

PHALCON_OBS_VAR(escaper);
phalcon_tag_get_escaper(&escaper, params TSRMLS_CC);
if (EG(exception)) {
RETURN_MM();
}

if (escaper) {
PHALCON_INIT_VAR(escaped);
Expand Down

0 comments on commit b4938ea

Please sign in to comment.