@@ -75,8 +75,14 @@ public function listen()
7575 */
7676 private function removePhpUrl ($ url )
7777 {
78- $ result = substr ($ url , strpos ($ url , ".php " ) + 4 );
79- return substr ($ result , 0 , strpos ($ result , "? " ));
78+ $ result = $ url ; // org url
79+ if (strpos ($ url , ".php " )) {
80+ $ result = substr ($ url , strpos ($ url , ".php " ) + 4 );
81+ }
82+ if (strpos ($ result , "? " )) {
83+ $ result = substr ($ result , 0 , strpos ($ result , "? " ));
84+ }
85+ return $ result ;
8086 }
8187
8288 /*
@@ -85,13 +91,8 @@ private function removePhpUrl($url)
8591 */
8692 private function convertParm ($ parm )
8793 {
88- // If Same parm
89- if (strcmp ($ _SERVER ['REQUEST_URI ' ], $ parm )) {
90- return $ parm ;
91- }
92-
9394 $ replaceParm = $ parm ;
94- $ count = preg_match_all ('/{/u ' , $ parm );
95+ $ count = preg_match_all ('/{/u ' , $ replaceParm );
9596 for ($ dataEnd = 0 , $ end = 0 , $ i = 0 ; $ i < $ count ; ++$ i ) {
9697 // parm spread
9798 $ start = strpos ($ parm , "{ " , $ end ) + 1 ;
@@ -113,6 +114,8 @@ private function convertParm($parm)
113114 public function get ($ parm , $ function )
114115 {
115116 $ parm = $ this ->convertParm ($ parm );
117+ // echo $this->removePhpUrl($_SERVER['REQUEST_URI']) . "===" . $parm . "<br/>";
118+
116119 if ($ _SERVER ['REQUEST_METHOD ' ] !== 'GET ' ) {
117120 return ;
118121 } else if (strcmp ($ this ->removePhpUrl ($ _SERVER ['REQUEST_URI ' ]), $ parm )) {
0 commit comments