Skip to content

Commit 6c93e5f

Browse files
bug fix
1 parent d55de57 commit 6c93e5f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Frontend/related-viewer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ function GetNavigator($contentPath){
190190
}
191191

192192
function CountSteps($pathFrom, $pathTo){
193+
// Debug::Log($pathFrom);
194+
// Debug::Log($pathTo);
193195

194196
$steps = 0;
195197
$current = $pathFrom;
@@ -204,7 +206,7 @@ function CountSteps($pathFrom, $pathTo){
204206
//
205207
// ./Master/Contents/Writing/Writing
206208
// ./Master/Contents/Writing/Writing/Method/WritingMethod
207-
while(strpos($pathTo, $current . '/') !== 0 || $pathTo == $current){
209+
while(strpos($pathTo, $current . '/') !== 0 && $pathTo != $current){
208210
$current = dirname($current);
209211
$steps++;
210212

@@ -220,5 +222,6 @@ function CountSteps($pathFrom, $pathTo){
220222
$steps++;
221223
}
222224

225+
// Debug::Log($steps);
223226
return $steps;
224227
}

0 commit comments

Comments
 (0)