-
';
diff --git a/ext/numeric_score/main.php b/ext/numeric_score/main.php
index fbdc4e3e1..e2366c709 100644
--- a/ext/numeric_score/main.php
+++ b/ext/numeric_score/main.php
@@ -119,11 +119,10 @@ public function onUserPageBuilding(UserPageBuildingEvent $event)
$this->theme->get_nuller($event->display_user);
}
- $u_name = url_escape($event->display_user->name);
$n_up = Image::count_images(["upvoted_by={$event->display_user->name}"]);
- $link_up = make_link("post/list/upvoted_by=$u_name/1");
+ $link_up = search_link(["upvoted_by={$event->display_user->name}"]);
$n_down = Image::count_images(["downvoted_by={$event->display_user->name}"]);
- $link_down = make_link("post/list/downvoted_by=$u_name/1");
+ $link_down = search_link(["downvoted_by={$event->display_user->name}]"]);
$event->add_stats("
$n_up Upvotes /
$n_down Downvotes");
}
diff --git a/ext/rating/theme.php b/ext/rating/theme.php
index c9078482d..13408bcb1 100644
--- a/ext/rating/theme.php
+++ b/ext/rating/theme.php
@@ -18,11 +18,10 @@ public function get_selection_rater_html(string $name = "rating", array $ratings
public function get_rater_html(int $image_id, string $rating, bool $can_rate): HTMLElement
{
- $u_rating = url_escape(Tag::caret($rating));
return SHM_POST_INFO(
"Rating",
$can_rate,
- A(["href"=>make_link("post/list/rating=$u_rating/1")], Ratings::rating_to_human($rating)),
+ A(["href"=>search_link(["rating=$rating"])], Ratings::rating_to_human($rating)),
$this->get_selection_rater_html("rating", selected_options: [$rating])
);
}
diff --git a/ext/relationships/theme.php b/ext/relationships/theme.php
index 67cecc6a3..78b78f89d 100644
--- a/ext/relationships/theme.php
+++ b/ext/relationships/theme.php
@@ -22,7 +22,7 @@ public function relationship_info(Image $image)
if (bool_escape($image->has_children)) {
$ids = $database->get_col("SELECT id FROM images WHERE parent_id = :iid", ["iid"=>$image->id]);
- $html = "This post has
id.'/1')."'>".(count($ids) > 1 ? "child posts" : "a child post")."";
+ $html = "This post has
".(count($ids) > 1 ? "child posts" : "a child post")."";
$html .= " (post ";
foreach ($ids as $id) {
$html .= "#
{$id}, ";
diff --git a/ext/tag_edit/main.php b/ext/tag_edit/main.php
index dc510a20a..0fe2905ea 100644
--- a/ext/tag_edit/main.php
+++ b/ext/tag_edit/main.php
@@ -152,7 +152,7 @@ public function onPageRequest(PageRequestEvent $event)
if ($user->can(Permissions::MASS_TAG_EDIT) && isset($_POST['tags']) && isset($_POST['source'])) {
$this->mass_source_edit($_POST['tags'], $_POST['source']);
$page->set_mode(PageMode::REDIRECT);
- $page->set_redirect(make_link("post/list"));
+ $page->set_redirect(search_link());
}
}
}
diff --git a/ext/tag_edit/theme.php b/ext/tag_edit/theme.php
index 9b9e8010c..a27885001 100644
--- a/ext/tag_edit/theme.php
+++ b/ext/tag_edit/theme.php
@@ -47,9 +47,8 @@ public function get_tag_editor_html(Image $image): HTMLElement
$tag_links = [];
foreach ($image->get_tag_array() as $tag) {
- $u_tag = url_escape($tag);
$tag_links[] = A([
- "href" => make_link("post/list/$u_tag/1"),
+ "href" => search_link([$tag]),
"class" => "tag",
"title" => "View all posts tagged $tag"
], $tag);
diff --git a/ext/tag_history/theme.php b/ext/tag_history/theme.php
index c6ea43b42..5beb37808 100644
--- a/ext/tag_history/theme.php
+++ b/ext/tag_history/theme.php
@@ -119,7 +119,7 @@ protected function history_entry(array $fields, bool $selected): string
$current_tags = Tag::explode($current_tags);
$taglinks = SPAN();
foreach ($current_tags as $tag) {
- $taglinks->appendChild(A(["href"=>make_link("post/list/$tag/1")], $tag));
+ $taglinks->appendChild(A(["href"=>search_link([$tag])], $tag));
$taglinks->appendChild(" ");
}
diff --git a/ext/tag_list/theme.php b/ext/tag_list/theme.php
index 27cc8e54b..38b5f6a60 100644
--- a/ext/tag_list/theme.php
+++ b/ext/tag_list/theme.php
@@ -298,7 +298,6 @@ protected function get_subtract_link(array $tags, string $tag): string
public function tag_link(string $tag): string
{
- $u_tag = url_escape(Tag::caret($tag));
- return make_link("post/list/$u_tag/1");
+ return search_link([$tag]);
}
}
diff --git a/ext/trash/main.php b/ext/trash/main.php
index 55537bb96..5fc70a50f 100644
--- a/ext/trash/main.php
+++ b/ext/trash/main.php
@@ -97,7 +97,7 @@ public function onUserBlockBuilding(UserBlockBuildingEvent $event)
{
global $user;
if ($user->can(Permissions::VIEW_TRASH)) {
- $event->add_link("Trash", make_link("/post/list/in%3Atrash/1"), 60);
+ $event->add_link("Trash", search_link(["in:trash"]), 60);
}
}
diff --git a/ext/upload/test.php b/ext/upload/test.php
index 60d2361b2..a45bb445d 100644
--- a/ext/upload/test.php
+++ b/ext/upload/test.php
@@ -45,7 +45,7 @@ public function testRawUpload()
];
$page = $this->post_page("upload", ["tags0"=>"foo bar"]);
$this->assert_response(302);
- $this->assertStringStartsWith("/test/post/list/poster=test/1", $page->redirect);
+ $this->assertStringStartsWith("/test/post/list/poster%3Dtest/1", $page->redirect);
$this->assertEquals(4, $database->get_one("SELECT COUNT(*) FROM images"));
}
diff --git a/ext/upload/theme.php b/ext/upload/theme.php
index a7fd00f42..2d3c770f2 100644
--- a/ext/upload/theme.php
+++ b/ext/upload/theme.php
@@ -300,7 +300,7 @@ public function display_upload_status(Page $page, array $image_ids): void
$page->set_redirect(make_link("post/view/{$image_ids[0]}"));
} else {
$page->set_mode(PageMode::REDIRECT);
- $page->set_redirect(make_link("post/list/poster={$user->name}/1"));
+ $page->set_redirect(search_link(["poster={$user->name}"]));
}
}
}
diff --git a/ext/user/main.php b/ext/user/main.php
index f0c3db78d..a3a923242 100644
--- a/ext/user/main.php
+++ b/ext/user/main.php
@@ -38,7 +38,7 @@ public function __construct()
public function display(array $row): HTMLElement
{
- return A(["href"=>make_link("post/list/user={$row['name']}/1")], "Posts");
+ return A(["href"=>search_link(["user={$row['name']}"])], "Posts");
}
}
diff --git a/themes/danbooru/comment.theme.php b/themes/danbooru/comment.theme.php
index ec3fb85d6..525fb2617 100644
--- a/themes/danbooru/comment.theme.php
+++ b/themes/danbooru/comment.theme.php
@@ -45,8 +45,7 @@ public function display_comment_list(array $images, int $page_number, int $total
$un = $image->get_owner()->name;
$t = "";
foreach ($image->get_tag_array() as $tag) {
- $u_tag = url_escape($tag);
- $t .= "
".html_escape($tag)." ";
+ $t .= "
".html_escape($tag)." ";
}
$p = autodate($image->posted);
diff --git a/themes/danbooru2/comment.theme.php b/themes/danbooru2/comment.theme.php
index d61b0786b..dd43860eb 100644
--- a/themes/danbooru2/comment.theme.php
+++ b/themes/danbooru2/comment.theme.php
@@ -45,8 +45,7 @@ public function display_comment_list(array $images, int $page_number, int $total
$un = $image->get_owner()->name;
$t = "";
foreach ($image->get_tag_array() as $tag) {
- $u_tag = url_escape($tag);
- $t .= "
".html_escape($tag)." ";
+ $t .= "
".html_escape($tag)." ";
}
$p = autodate($image->posted);