We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c833746 commit 43710feCopy full SHA for 43710fe
1 file changed
src/OpCacheGUI/Format/Prefix.php
@@ -76,12 +76,18 @@ private function getPrefixLength(array $scripts)
76
*/
77
private function findLongestPrefix($prefix, $path)
78
{
79
- $prefixChars = str_split($prefix);
80
- $pathChars = str_split($path);
+ $prefixChars = str_split(str_replace('\\', '/', $prefix));
+ $pathChars = str_split(str_replace('\\', '/', $path));
81
+
82
+ $lastSlash = 0;
83
84
foreach ($prefixChars as $index => $char) {
85
+ if ($char === '/') {
86
+ $lastSlash = $index;
87
+ }
88
89
if ($char !== $pathChars[$index]) {
- return mb_substr($prefix, 0, $index);
90
+ return mb_substr($prefix, 0, $lastSlash);
91
}
92
93
0 commit comments