File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 22
33namespace App \Utils ;
44
5+ use Illuminate \Support \Str ;
6+
57class UrlUtils {
68 /**
79 * When serving multiple applications (also already spacialist + thesaurex)
@@ -21,15 +23,8 @@ static function getSubPath(string $url) : string {
2123 if (!$ doesMatch || !isset ($ matches [1 ])) {
2224 return '/ ' ;
2325 }
24- $ trimDefaultCharacters = " \n\r\t\v\0" ;
25- // Remove all irrelevant characters from the subpath
26- // including all leading and trailing slashes.
27- $ subPathUrl = trim ($ matches [1 ], $ trimDefaultCharacters . '/ ' );
28- if (empty ($ subPathUrl )) {
29- return '/ ' ;
30- }
31-
32- // Add leading slash to the subpath.
33- return '/ ' . $ subPathUrl ;
26+
27+ $ subpathUrl = trim ($ matches [1 ]);
28+ return Str::start (trim ($ subpathUrl , '/ ' ), '/ ' );
3429 }
3530}
You can’t perform that action at this time.
0 commit comments