]> granicus.if.org Git - php/commitdiff
- MFH: Fixed detection of invalid class name
authorFelipe Pena <felipe@php.net>
Thu, 8 May 2008 18:51:28 +0000 (18:51 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 8 May 2008 18:51:28 +0000 (18:51 +0000)
Zend/tests/bug31720.phpt
Zend/zend_API.c
ext/standard/tests/array/array_filter_variation2.phpt
ext/standard/tests/array/array_map_variation17.phpt
ext/standard/tests/array/uasort_variation2.phpt

index 5b2644b58ed79b31f27bdf01028fa7ca6af5cdb6..c4680a4789e11c5d71f2e1d0016f01d1b9634e9e 100644 (file)
@@ -10,5 +10,5 @@ array_walk($array, array($nonesuchvar,'show'));
 --EXPECTF--
 Notice: Undefined variable: nonesuchvar in %s on line %d
 
-Warning: array_walk() expects parameter 2 to be a valid callback, second array member is not a valid method in %s on line %d
+Warning: array_walk() expects parameter 2 to be a valid callback, first array member is not a valid class name or object in %s on line %d
 ===DONE===
index 3676026d819b522ef8fdc204f24d11eb4559d921..22ba08e55f24d0a89368e8d8de99df4c0bbdf22f 100644 (file)
@@ -2571,7 +2571,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, char **
                                        }
                                } else {
                                        if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2) {
-                                               if (!obj) {
+                                               if (!obj || (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT)) {
                                                        if (error) zend_spprintf(error, 0, "first array member is not a valid class name or object");
                                                } else {
                                                        if (error) zend_spprintf(error, 0, "second array member is not a valid method");
index 6cb05e10556c2127db07e519e8c189e020cc392a..1aa262ba62b48a824e2040f00a3b7cdc39b18a3f 100644 (file)
@@ -134,7 +134,7 @@ NULL
 Warning: array_filter() expects parameter 2 to be a valid callback, array must have exactly two members in %s on line %d
 NULL
 -- Iteration 13 --
-Warning: array_filter() expects parameter 2 to be a valid callback, second array member is not a valid method in %s on line %d
+Warning: array_filter() expects parameter 2 to be a valid callback, first array member is not a valid class name or object in %s on line %d
 NULL
 -- Iteration 14 --
 Warning: array_filter() expects parameter 2 to be a valid callback, first array member is not a valid class name or object in %s on line %d
index 18682f3286a17e89c4288d2d3a43199faec4370d..d9440bb2c17c95add8dacc4440c7146bad2022af 100644 (file)
@@ -141,11 +141,11 @@ Warning: array_map() expects parameter 1 to be a valid callback, array must have
 NULL
 
 -- Iteration 17 --
-Warning: array_map() expects parameter 1 to be a valid callback, second array member is not a valid method in %s on line %d
+Warning: array_map() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d
 NULL
 
 -- Iteration 18 --
-Warning: array_map() expects parameter 1 to be a valid callback, second array member is not a valid method in %s on line %d
+Warning: array_map() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d
 NULL
 
 -- Iteration 19 --
index c106c1dfa0ca95e2786b1a89861d1da80d3de2c9..62832454106dbe2a95e8360580e49745f0868d80 100644 (file)
@@ -147,7 +147,7 @@ Warning: uasort() expects parameter 2 to be a valid callback, array must have ex
 NULL
 -- Iteration 13 --
 
-Warning: uasort() expects parameter 2 to be a valid callback, second array member is not a valid method in %s on line %d
+Warning: uasort() expects parameter 2 to be a valid callback, first array member is not a valid class name or object in %s on line %d
 NULL
 -- Iteration 14 --