only link to post/list when you actually want post/list, if you want just a default page, leave it empty
This commit is contained in:
parent
7f048ff6f2
commit
23e36b4349
9 changed files with 11 additions and 11 deletions
|
@ -27,7 +27,7 @@ class Link
|
|||
* 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
|
||||
{
|
||||
|
|
|
@ -116,7 +116,7 @@ class Approval extends Extension
|
|||
|
||||
if (!$this->check_permissions(($event->image))) {
|
||||
$page->set_mode(PageMode::REDIRECT);
|
||||
$page->set_redirect(make_link("post/list"));
|
||||
$page->set_redirect(make_link());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class CommentListTheme extends Themelet
|
|||
|
||||
$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>';
|
||||
|
||||
|
@ -186,7 +186,7 @@ class CommentListTheme extends Themelet
|
|||
//$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");
|
||||
|
|
|
@ -91,7 +91,7 @@ class ImageIO extends Extension
|
|||
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']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ class PrivateImage extends Extension
|
|||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ class Ratings extends Extension
|
|||
**/
|
||||
if (!$this->check_permissions($event->image)) {
|
||||
$page->set_mode(PageMode::REDIRECT);
|
||||
$page->set_redirect(make_link("post/list"));
|
||||
$page->set_redirect(make_link());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -394,7 +394,7 @@ class Ratings extends Extension
|
|||
# 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ class RegenThumb extends Extension
|
|||
}
|
||||
|
||||
$page->set_mode(PageMode::REDIRECT);
|
||||
$page->set_redirect(make_link("post/list"));
|
||||
$page->set_redirect(make_link());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ class Trash extends Extension
|
|||
|
||||
if (!$this->check_permissions(($event->image))) {
|
||||
$page->set_mode(PageMode::REDIRECT);
|
||||
$page->set_redirect(make_link("post/list"));
|
||||
$page->set_redirect(make_link());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -840,7 +840,7 @@ class UserPage extends Extension
|
|||
);
|
||||
|
||||
$page->set_mode(PageMode::REDIRECT);
|
||||
$page->set_redirect(make_link("post/list"));
|
||||
$page->set_redirect(make_link());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue