File tree 2 files changed +13
-5
lines changed 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -115,10 +115,8 @@ public function createHttpRequest()
115
115
116
116
$ path = $ url ->getPath ();
117
117
$ 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
122
120
}
123
121
if ($ i === $ max && strlen ($ path ) === strlen ($ script )) {
124
122
$ url ->setScriptPath ($ path );
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ test(function() use ($factory) {
28
28
$ _SERVER = array (
29
29
'REQUEST_URI ' => '/projects/modules-usage/www/default/add-item ' ,
30
30
'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 ' ,
32
32
);
33
33
34
34
Assert::same ( '/projects/modules-usage/www/ ' , $ factory ->createHttpRequest ()->getUrl ()->getScriptPath () );
@@ -97,3 +97,13 @@ test(function() use ($factory) {
97
97
98
98
Assert::same ( '/configuration/ ' , $ factory ->createHttpRequest ()->getUrl ()->getScriptPath () );
99
99
});
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