Skip to content

Commit 2c5df2d

Browse files
author
Phalcon
committed
Merge pull request #1019 from sjinks/issue-1018
[BUG] Phalcon\Element::addFilter() prepends inserts NULL as the first element
2 parents d39cfb9 + 5922abc commit 2c5df2d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/forms/element.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,11 @@ PHP_METHOD(Phalcon_Forms_Element, addFilter){
188188
} else {
189189
PHALCON_INIT_VAR(new_filters);
190190
array_init_size(new_filters, 2);
191-
phalcon_array_append(&new_filters, filters, PH_SEPARATE);
192-
phalcon_array_append(&new_filters, filter, PH_SEPARATE);
191+
if (Z_TYPE_P(filters) == IS_STRING) {
192+
phalcon_array_append(&new_filters, filters, 0);
193+
}
194+
195+
phalcon_array_append(&new_filters, filter, 0);
193196
phalcon_update_property_this(this_ptr, SL("_filters"), new_filters TSRMLS_CC);
194197
}
195198

0 commit comments

Comments
 (0)