more encoding

This commit is contained in:
Shish 2020-01-30 22:10:51 +00:00
parent da42b19d6b
commit af733b53ca
6 changed files with 10 additions and 16 deletions

View file

@ -145,7 +145,7 @@ and of course start organising your images :-)
// only index the first pages of each term // only index the first pages of each term
$page->add_html_header('<meta name="robots" content="noindex, nofollow">'); $page->add_html_header('<meta name="robots" content="noindex, nofollow">');
} }
$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")); $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); $this->display_paginator($page, "post/list/$query", null, $this->page_number, $this->total_pages, true);
} else { } else {

View file

@ -163,12 +163,6 @@ class TagList extends Extension
$event->panel->add_block($sb); $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 * Get the minimum number of times a tag needs to be used
* in order to be considered in the tag list. * in order to be considered in the tag list.
@ -297,7 +291,7 @@ class TagList extends Extension
foreach ($tag_data as $row) { foreach ($tag_data as $row) {
$h_tag = html_escape($row['tag']); $h_tag = html_escape($row['tag']);
$size = sprintf("%.2f", (float)$row['scaled']); $size = sprintf("%.2f", (float)$row['scaled']);
$link = $this->tag_link($row['tag']); $link = $this->theme->tag_link($row['tag']);
if ($size<0.5) { if ($size<0.5) {
$size = 0.5; $size = 0.5;
} }
@ -363,7 +357,7 @@ class TagList extends Extension
$h_lastLetter = html_escape($lastLetter); $h_lastLetter = html_escape($lastLetter);
$html .= "<p>$h_lastLetter<br>"; $html .= "<p>$h_lastLetter<br>";
} }
$link = $this->tag_link($tag); $link = $this->theme->tag_link($tag);
$h_tag = html_escape($tag); $h_tag = html_escape($tag);
$html .= "<a href='$link'>$h_tag&nbsp;($count)</a>\n"; $html .= "<a href='$link'>$h_tag&nbsp;($count)</a>\n";
} }
@ -410,7 +404,7 @@ class TagList extends Extension
$lastLog = $scaled; $lastLog = $scaled;
$html .= "<p>$lastLog<br>"; $html .= "<p>$lastLog<br>";
} }
$link = $this->tag_link($row['tag']); $link = $this->theme->tag_link($row['tag']);
$html .= "<a href='$link'>$h_tag&nbsp;($count)</a>\n"; $html .= "<a href='$link'>$h_tag&nbsp;($count)</a>\n";
} }

View file

@ -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"); return make_link("post/list/$u_tag/1");
} }
} }

View file

@ -19,7 +19,7 @@ class ViewImage extends Extension
$image_id = int_escape($event->get_arg(0)); $image_id = int_escape($event->get_arg(0));
if (isset($_GET['search'])) { if (isset($_GET['search'])) {
$search_terms = explode(' ', $_GET['search']); $search_terms = Tag::explode(Tag::decaret($_GET['search']));
$query = "#search=".url_escape($_GET['search']); $query = "#search=".url_escape($_GET['search']);
} else { } else {
$search_terms = []; $search_terms = [];

View file

@ -38,7 +38,7 @@ class ViewImageTheme extends Themelet
protected function build_pin(Image $image) protected function build_pin(Image $image)
{ {
if (isset($_GET['search'])) { if (isset($_GET['search'])) {
$query = "search=".url_escape($_GET['search']); $query = "search=".url_escape(Tag::caret($_GET['search']));
} else { } else {
$query = null; $query = null;
} }

View file

@ -13,8 +13,8 @@ class CustomIndexTheme extends IndexTheme
$query = null; $query = null;
$page_title = $config->get_string(SetupConfig::TITLE); $page_title = $config->get_string(SetupConfig::TITLE);
} else { } else {
$search_string = implode(' ', $this->search_terms); $search_string = Tag::implode($this->search_terms);
$query = url_escape($search_string); $query = url_escape(Tag::caret($search_string));
$page_title = html_escape($search_string); $page_title = html_escape($search_string);
} }