File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,8 @@ public function createHttpRequest()
8989 $ url ->setQuery (isset ($ tmp [1 ]) ? $ tmp [1 ] : '' );
9090
9191 // detect script path
92- $ path = strtolower ( $ path ) . '/ ' ;
92+ $ path .= '/ ' ;
9393 $ script = isset ($ _SERVER ['SCRIPT_NAME ' ]) ? $ _SERVER ['SCRIPT_NAME ' ] . '/ ' : '/ ' ;
94- $ script = strtolower ($ script );
9594 $ max = min (strlen ($ path ), strlen ($ script ));
9695 for ($ i = 0 ; $ i < $ max ; $ i ++) {
9796 if ($ path [$ i ] !== $ script [$ i ]) {
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ test(function() use ($factory) {
2626test (function () use ($ factory ) {
2727 $ _SERVER = array (
2828 'REQUEST_URI ' => '/projects/modules-usage/www/default/add-item ' ,
29- 'SCRIPT_NAME ' => '/projects/Modules-Usage /www/index.php ' ,
29+ 'SCRIPT_NAME ' => '/projects/modules-usage /www/index.php ' ,
3030 );
3131
3232 Assert::same ( '/projects/modules-usage/www/ ' , $ factory ->createHttpRequest ()->getUrl ()->getScriptPath () );
@@ -93,3 +93,13 @@ test(function() use ($factory) {
9393
9494 Assert::same ( '/configuration/ ' , $ factory ->createHttpRequest ()->getUrl ()->getScriptPath () );
9595});
96+
97+
98+ test (function () use ($ factory ) {
99+ $ _SERVER = array (
100+ 'REQUEST_URI ' => '/blog/WWW/ ' ,
101+ 'SCRIPT_NAME ' => '/blog/www/index.php ' ,
102+ );
103+
104+ Assert::same ( '/blog/ ' , $ factory ->createHttpRequest ()->getUrl ()->getScriptPath () );
105+ });
You can’t perform that action at this time.
0 commit comments