diff --git a/ext/index/theme.php b/ext/index/theme.php index d779406f..b977f070 100644 --- a/ext/index/theme.php +++ b/ext/index/theme.php @@ -145,7 +145,7 @@ and of course start organising your images :-) // only index the first pages of each term $page->add_html_header(''); } - $query = url_escape(implode(' ', $this->search_terms)); + $query = url_escape(Tag::caret(Tag::implode($this->search_terms))); $page->add_block(new Block("Images", $this->build_table($images, "#search=$query"), "main", 10, "image-list")); $this->display_paginator($page, "post/list/$query", null, $this->page_number, $this->total_pages, true); } else { diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index 0c16bc83..d084bbf7 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -163,12 +163,6 @@ class TagList extends Extension $event->panel->add_block($sb); } - private function tag_link(string $tag): string - { - $u_tag = url_escape($tag); - return make_link("post/list/$u_tag/1"); - } - /** * Get the minimum number of times a tag needs to be used * in order to be considered in the tag list. @@ -297,7 +291,7 @@ class TagList extends Extension foreach ($tag_data as $row) { $h_tag = html_escape($row['tag']); $size = sprintf("%.2f", (float)$row['scaled']); - $link = $this->tag_link($row['tag']); + $link = $this->theme->tag_link($row['tag']); if ($size<0.5) { $size = 0.5; } @@ -363,7 +357,7 @@ class TagList extends Extension $h_lastLetter = html_escape($lastLetter); $html .= "
$h_lastLetter
";
}
- $link = $this->tag_link($tag);
+ $link = $this->theme->tag_link($tag);
$h_tag = html_escape($tag);
$html .= "$h_tag ($count)\n";
}
@@ -410,7 +404,7 @@ class TagList extends Extension
$lastLog = $scaled;
$html .= "
$lastLog
";
}
- $link = $this->tag_link($row['tag']);
+ $link = $this->theme->tag_link($row['tag']);
$html .= "$h_tag ($count)\n";
}
diff --git a/ext/tag_list/theme.php b/ext/tag_list/theme.php
index 061ff6c8..b0af98bd 100644
--- a/ext/tag_list/theme.php
+++ b/ext/tag_list/theme.php
@@ -305,9 +305,9 @@ class TagListTheme extends Themelet
}
}
- protected function tag_link(string $tag): string
+ public function tag_link(string $tag): string
{
- $u_tag = url_escape($tag);
+ $u_tag = url_escape(Tag::caret($tag));
return make_link("post/list/$u_tag/1");
}
}
diff --git a/ext/view/main.php b/ext/view/main.php
index 076c4fd2..ff174cd2 100644
--- a/ext/view/main.php
+++ b/ext/view/main.php
@@ -19,7 +19,7 @@ class ViewImage extends Extension
$image_id = int_escape($event->get_arg(0));
if (isset($_GET['search'])) {
- $search_terms = explode(' ', $_GET['search']);
+ $search_terms = Tag::explode(Tag::decaret($_GET['search']));
$query = "#search=".url_escape($_GET['search']);
} else {
$search_terms = [];
diff --git a/ext/view/theme.php b/ext/view/theme.php
index ae8dbea6..862106c1 100644
--- a/ext/view/theme.php
+++ b/ext/view/theme.php
@@ -38,7 +38,7 @@ class ViewImageTheme extends Themelet
protected function build_pin(Image $image)
{
if (isset($_GET['search'])) {
- $query = "search=".url_escape($_GET['search']);
+ $query = "search=".url_escape(Tag::caret($_GET['search']));
} else {
$query = null;
}
diff --git a/themes/danbooru/index.theme.php b/themes/danbooru/index.theme.php
index d65a6bc8..5aa2f90f 100644
--- a/themes/danbooru/index.theme.php
+++ b/themes/danbooru/index.theme.php
@@ -13,8 +13,8 @@ class CustomIndexTheme extends IndexTheme
$query = null;
$page_title = $config->get_string(SetupConfig::TITLE);
} else {
- $search_string = implode(' ', $this->search_terms);
- $query = url_escape($search_string);
+ $search_string = Tag::implode($this->search_terms);
+ $query = url_escape(Tag::caret($search_string));
$page_title = html_escape($search_string);
}