From db403769a2262371421c03c22cb73eb6a98d7836 Mon Sep 17 00:00:00 2001 From: dreamsxin Date: Wed, 23 Apr 2014 08:13:18 +0800 Subject: [PATCH] Fix #2375 Add check messages is object in Phalcon\Validation::appendMessage --- ext/validation.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/validation.c b/ext/validation.c index 3499e7eade5..1130f3a0b81 100644 --- a/ext/validation.c +++ b/ext/validation.c @@ -436,7 +436,9 @@ PHP_METHOD(Phalcon_Validation, appendMessage){ phalcon_fetch_params(1, 1, 0, &message); messages = phalcon_fetch_nproperty_this(this_ptr, SL("_messages"), PH_NOISY TSRMLS_CC); - PHALCON_CALL_METHOD(NULL, messages, "appendmessage", message); + if (Z_TYPE_P(messages) == IS_OBJECT) { + PHALCON_CALL_METHOD(NULL, messages, "appendmessage", message); + } RETURN_THIS(); }