Permalink
Browse files

Fixed bug partial module name took

  • Loading branch information...
1 parent 6a9b197 commit c07cb77bbfe7dca92f9f6063281d707693309310 @laruence committed Dec 2, 2012
Showing with 4 additions and 3 deletions.
  1. +2 −1 tests/036.phpt
  2. +2 −2 yaf_application.c
View
3 tests/036.phpt
@@ -9,7 +9,7 @@ $url = array(
"/", "/foo", "/foo/", "/foo///bar", "foo/bar", "/foo/bar/",
"/foo/bar/dummy", "/foo///bar/dummy/", "foo/bar/dummy/",
"/my", "/my/", "/my/foo", "/my/foo/", "my/foo/bar", "my/foo/bar/",
- "/my/foo/bar/dummy/1", "my/foo/bar/dummy/1/a/2/////",
+ "/m/index/index", "/my/foo/bar/dummy/1", "my/foo/bar/dummy/1/a/2/////",
"/my/index/index", "my/index", "/foo/index", "index/foo",
);
@@ -73,6 +73,7 @@ foo/bar/dummy/ : m=> c=>foo a=>bar args=>dummy->,
/my/foo/ : m=> c=>my a=>foo
my/foo/bar : m=>my c=>foo a=>bar
my/foo/bar/ : m=>my c=>foo a=>bar
+/m/index/index : m=> c=>m a=>index args=>index->,
/my/foo/bar/dummy/1 : m=>my c=>foo a=>bar args=>dummy->1,
my/foo/bar/dummy/1/a/2///// : m=>my c=>foo a=>bar args=>dummy->1,a->2,
/my/index/index : m=>my c=>index a=>index
View
4 yaf_application.c
@@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: yaf_application.c 327732 2012-09-21 13:45:28Z laruence $ */
+/* $Id: yaf_application.c 328604 2012-12-02 05:47:27Z laruence $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -102,7 +102,7 @@ int yaf_application_is_module_name(char *name, int len TSRMLS_DC) {
ht = Z_ARRVAL_P(modules);
zend_hash_internal_pointer_reset(ht);
while (zend_hash_get_current_data(ht, (void **)&ppzval) == SUCCESS) {
- if (Z_TYPE_PP(ppzval) == IS_STRING
+ if (Z_TYPE_PP(ppzval) == IS_STRING && Z_STRLEN_PP(ppzval) == len
&& strncasecmp(Z_STRVAL_PP(ppzval), name, len) == 0) {
return 1;
}

0 comments on commit c07cb77

Please sign in to comment.