File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -115,10 +115,8 @@ public function createHttpRequest()
115115
116116 $ path = $ url ->getPath ();
117117 $ max = min (strlen ($ path ), strlen ($ script ));
118- for ($ i = 0 ; $ i < $ max ; $ i ++) {
119- if ($ path [$ i ] !== $ script [$ i ] && strcasecmp ($ path [$ i ], $ script [$ i ])) {
120- break ;
121- }
118+ for ($ i = 0 ; $ i < $ max && $ path [$ i ] === $ script [$ i ]; $ i ++) {
119+ // nothing
122120 }
123121 if ($ i === $ max && strlen ($ path ) === strlen ($ script )) {
124122 $ url ->setScriptPath ($ path );
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ test(function() use ($factory) {
2828 $ _SERVER = array (
2929 'REQUEST_URI ' => '/projects/modules-usage/www/default/add-item ' ,
3030 'SCRIPT_FILENAME ' => 'W:/projects/Modules-Usage/www/index.php ' ,
31- 'SCRIPT_NAME ' => '/projects/Modules-Usage /www/index.php ' ,
31+ 'SCRIPT_NAME ' => '/projects/modules-usage /www/index.php ' ,
3232 );
3333
3434 Assert::same ( '/projects/modules-usage/www/ ' , $ factory ->createHttpRequest ()->getUrl ()->getScriptPath () );
@@ -97,3 +97,13 @@ test(function() use ($factory) {
9797
9898 Assert::same ( '/configuration/ ' , $ factory ->createHttpRequest ()->getUrl ()->getScriptPath () );
9999});
100+
101+
102+ test (function () use ($ factory ) {
103+ $ _SERVER = array (
104+ 'REQUEST_URI ' => '/blog/WWW/ ' ,
105+ 'SCRIPT_NAME ' => '/blog/www/index.php ' ,
106+ );
107+
108+ Assert::same ( '/blog/ ' , $ factory ->createHttpRequest ()->getUrl ()->getScriptPath () );
109+ });
You can’t perform that action at this time.
0 commit comments