diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-03-17 17:38:15 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-03-17 17:38:15 +0400 |
commit | 355b136466ae41eccd25e5a4f1ce16be9c9b9fd9 (patch) | |
tree | 073ef9c488443c0935f8954246fddb32b6ff7689 /ext/ereg | |
parent | 62c448ab8b0f38489af4b9c02061506b65b00c91 (diff) | |
download | php-git-355b136466ae41eccd25e5a4f1ce16be9c9b9fd9.tar.gz |
Fixed ext/ereg problems
Diffstat (limited to 'ext/ereg')
-rw-r--r-- | ext/ereg/ereg.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index c5ad085bfa..45ab9f5739 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -350,6 +350,10 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase) } match_len = 1; + if (array && Z_ISREF_P(array)) { + array = Z_REFVAL_P(array); + } + if (array && err != REG_NOMATCH) { match_len = (int) (subs[0].rm_eo - subs[0].rm_so); string_len = findin_len + 1; @@ -669,7 +673,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Regular Expression"); zend_hash_destroy(Z_ARRVAL_P(return_value)); - efree(Z_ARRVAL_P(return_value)); + efree(Z_ARR_P(return_value)); RETURN_FALSE; } else { /* On a real match */ @@ -696,7 +700,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase) php_ereg_eprint(err, &re TSRMLS_CC); regfree(&re); zend_hash_destroy(Z_ARRVAL_P(return_value)); - efree(Z_ARRVAL_P(return_value)); + efree(Z_ARR_P(return_value)); RETURN_FALSE; } |