summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-07-22 15:33:44 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-07-22 15:33:44 +0200
commitd6415ae47344207efc0fff762e55f596cddd1154 (patch)
tree69d8de52d5cb6eeff92672d767abf69143dd9038
parent264bed40a75e78e263a9999bd3d39bd09f2865c3 (diff)
downloadphp-git-d6415ae47344207efc0fff762e55f596cddd1154.tar.gz
Always lowercase function names for lookup in phpdbg -p
-rw-r--r--sapi/phpdbg/phpdbg_print.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index 5e485b3611..ccf561148c 100644
--- a/sapi/phpdbg/phpdbg_print.c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -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);
}
}