]> granicus.if.org Git - php/commitdiff
Always lowercase function names for lookup in phpdbg -p
authorBob Weinand <bobwei9@hotmail.com>
Wed, 22 Jul 2015 13:33:44 +0000 (15:33 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Wed, 22 Jul 2015 13:33:44 +0000 (15:33 +0200)
sapi/phpdbg/phpdbg_print.c

index 5e485b3611d2eef42516955effbca80fb4267eb3..ccf561148cb570fbf0556210a50fc554d61a91db 100644 (file)
@@ -400,14 +400,20 @@ PHPDBG_API void phpdbg_print_opcodes(char *function)
                                phpdbg_print_opcodes_ce(ce);
                        }
                } ZEND_HASH_FOREACH_END();
-       } else if (strstr(function, "::") == NULL) {
-               phpdbg_print_opcodes_function(function, strlen(function));
        } else {
-               char *method_name, *class_name = strtok(function, "::");
-               if ((method_name = strtok(NULL, "::")) == NULL) {
-                       phpdbg_print_opcodes_class(class_name);
+               function = zend_str_tolower_dup(function, strlen(function));
+
+               if (strstr(function, "::") == NULL) {
+                       phpdbg_print_opcodes_function(function, strlen(function));
                } else {
-                       phpdbg_print_opcodes_method(class_name, method_name);
+                       char *method_name, *class_name = strtok(function, "::");
+                       if ((method_name = strtok(NULL, "::")) == NULL) {
+                               phpdbg_print_opcodes_class(class_name);
+                       } else {
+                               phpdbg_print_opcodes_method(class_name, method_name);
+                       }
                }
+
+               efree(function);
        }
 }