summaryrefslogtreecommitdiff
path: root/ext/standard/array.c
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2000-12-22 16:31:42 +0000
committerAndrei Zmievski <andrei@php.net>2000-12-22 16:31:42 +0000
commita1614b84117613d3a94a86fedd1c962670e4f1a8 (patch)
tree923585a38189bb3ca98e0a02f361f28a22513d29 /ext/standard/array.c
parentaa6d2ac5d0ee1d7cd608c6930ad0c57bc2953c47 (diff)
downloadphp-git-a1614b84117613d3a94a86fedd1c962670e4f1a8.tar.gz
(PHP preg_replace) Fix to allow proper escaping of captured subpattern
references in the replacement string. (PHP array_sum) Check that argument is an array.
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r--ext/standard/array.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index f1eca09fa3..f3ad659843 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2776,6 +2776,12 @@ PHP_FUNCTION(array_sum)
WRONG_PARAM_COUNT;
}
+ if (Z_TYPE_PP(input) != IS_ARRAY) {
+ php_error(E_WARNING, "The argument to %s() should be an array",
+ get_active_function_name());
+ return;
+ }
+
ZVAL_LONG(return_value, 0);
for (zend_hash_internal_pointer_reset(Z_ARRVAL_PP(input));