Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct Prev/Next navigation permissions #12

Merged
merged 1 commit into from Feb 2, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+26 −18
Diff settings

Always

Just for now

Correct Prev/Next navigation permissions

Apply permission restrictions to both previous and next header
navigation elements.
  • Loading branch information...
luislavena committed Feb 1, 2019
commit 348788387fb2ff17cb155d51fe38ef4cb34174f4
@@ -1440,16 +1440,20 @@ public function previous_link_or_span($name, $directory_name, $link_id, $class)
$items = Subfolio::$filebrowser->get_parent_file_folder_list(null, true);
$items = Subfolio::$filebrowser->sort($items);
$items = Subfolio::$filebrowser->prev_next_sort($items);
$prev = Subfolio::$filebrowser->get_prev($items, $folder);
$prev = Subfolio::$filebrowser->get_prev($items, $folder);
if ($prev <> "") {
$link = Filebrowser::double_encode_specialcharacters(urlencode($prev->name));
$link = str_replace('%2F', '/', $link);
$response = "<span id='$link_id' class='".$class."'>".$directory_name."</span>";
return "<a id='$link_id' href='$link'>$directory_name</a>";
} else {
return "<span id='$link_id' class='".$class."'>".$directory_name."</span>";
}
if ($prev <> "") {
if (!$prev->is_restricted()) {
$link = Filebrowser::double_encode_specialcharacters(urlencode($prev->name));
$link = str_replace('%2F', '/', $link);
$response = "<a id='$link_id' href='$link'>$directory_name</a>";
}
}
return $response;
}
}
}
@@ -1478,18 +1482,22 @@ public function next_link_or_span($name, $directory_name, $link_id, $class) {
$items = Subfolio::$filebrowser->get_parent_file_folder_list(null, true);
$items = Subfolio::$filebrowser->sort($items);
$items = Subfolio::$filebrowser->prev_next_sort($items);
$next = Subfolio::$filebrowser->get_next($items, $folder);
$next = Subfolio::$filebrowser->get_next($items, $folder);
if ($next <> "") {
$link = Filebrowser::double_encode_specialcharacters(urlencode($next->name));
$link = str_replace('%2F', '/', $link);
$response = "<span id='$link_id' class='".$class."'>".$directory_name."</span>";
return "<a id='$link_id' href='$link'>$directory_name</a>";
} else {
return "<span id='$link_id' class='".$class."'>".$directory_name."</span>";
}
}
}
if ($next <> "") {
if (!$next->is_restricted()) {
$link = Filebrowser::double_encode_specialcharacters(urlencode($next->name));
$link = str_replace('%2F', '/', $link);
$response = "<a id='$link_id' href='$link'>$directory_name</a>";
}
}
return $response;
}
}
}
public function updated_since_link_or_span($type)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.