Skip to content

Commit

Permalink
only link to post/list when you actually want post/list, if you want …
Browse files Browse the repository at this point in the history
…just a default page, leave it empty
  • Loading branch information
shish committed Aug 18, 2023
1 parent 7f048ff commit 23e36b4
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/urls.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function make_link(): string
* Figure out the correct way to link to a page, taking into account
* things like the nice URLs setting.
*
* eg make_link("post/list") becomes "/v2/index.php?q=post/list"
* eg make_link("foo/bar") becomes "/v2/index.php?q=foo/bar"
*/
function make_link(?string $page=null, ?string $query=null, ?string $fragment=null): string
{
Expand Down
2 changes: 1 addition & 1 deletion ext/approval/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function onDisplayingImage(DisplayingImageEvent $event)

if (!$this->check_permissions(($event->image))) {
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/list"));
$page->set_redirect(make_link());
}
}

Expand Down
4 changes: 2 additions & 2 deletions ext/comment/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function display_comment_list(array $images, int $page_number, int $total

$h_prev = ($page_number <= 1) ? "Prev" :
'<a href="'.make_link('comment/list/'.$prev).'">Prev</a>';
$h_index = "<a href='".make_link("post/list")."'>Index</a>";
$h_index = "<a href='".make_link()."'>Index</a>";
$h_next = ($page_number >= $total_pages) ? "Next" :
'<a href="'.make_link('comment/list/'.$next).'">Next</a>';

Expand Down Expand Up @@ -186,7 +186,7 @@ public function display_all_user_comments(array $comments, int $page_number, int
//$query = empty($u_tags) ? "" : '/'.$u_tags;

$h_prev = ($page_number <= 1) ? "Prev" : "<a href='$prev'>Prev</a>";
$h_index = "<a href='".make_link("post/list")."'>Index</a>";
$h_index = "<a href='".make_link()."'>Index</a>";
$h_next = ($page_number >= $total_pages) ? "Next" : "<a href='$next'>Next</a>";

$page->set_title(html_escape($user->name)."'s comments");
Expand Down
2 changes: 1 addition & 1 deletion ext/image/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function onPageRequest(PageRequestEvent $event)
redirect_to_next_image($image);
} else {
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(referer_or(make_link("post/list"), ['post/view']));
$page->set_redirect(referer_or(make_link(), ['post/view']));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ext/private_image/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function onDisplayingImage(DisplayingImageEvent $event)

if ($event->image->private===true && $event->image->owner_id!=$user->id && !$user->can(Permissions::SET_OTHERS_PRIVATE_IMAGES)) {
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/list"));
$page->set_redirect(make_link());
}
}

Expand Down
4 changes: 2 additions & 2 deletions ext/rating/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function onDisplayingImage(DisplayingImageEvent $event)
**/
if (!$this->check_permissions($event->image)) {
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/list"));
$page->set_redirect(make_link());
}
}

Expand Down Expand Up @@ -394,7 +394,7 @@ public function onPageRequest(PageRequestEvent $event)
# on image_tags.tag_id = tags.id where tags.tag = :tag);
# ", ['rating'=>$_POST["rating"], 'tag'=>$_POST["tag"]]);
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/list"));
$page->set_redirect(make_link());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ext/regen_thumb/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function onPageRequest(PageRequestEvent $event)
}

$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/list"));
$page->set_redirect(make_link());
}
}

Expand Down
2 changes: 1 addition & 1 deletion ext/trash/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function onDisplayingImage(DisplayingImageEvent $event)

if (!$this->check_permissions(($event->image))) {
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/list"));
$page->set_redirect(make_link());
}
}

Expand Down
2 changes: 1 addition & 1 deletion ext/user/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ private function delete_user(Page $page, bool $with_images=false, bool $with_com
);

$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/list"));
$page->set_redirect(make_link());
}
}
}

0 comments on commit 23e36b4

Please sign in to comment.