diff --git a/core/imageboard/image.php b/core/imageboard/image.php index 46b514bb..fbfcc1a2 100644 --- a/core/imageboard/image.php +++ b/core/imageboard/image.php @@ -579,7 +579,7 @@ class Image { throw new SCoreException('Tried to set zero tags'); } - if(implode(" ", $tags) != $this->get_tag_list()) { + if(Tag::implode($tags) != $this->get_tag_list()) { // delete old $this->delete_tags_from_image(); // insert each new tags @@ -619,7 +619,7 @@ class Image { ); } - log_info("core_image", "Tags for Image #{$this->id} set to: ".implode(" ", $tags), null, array("image_id" => $this->id)); + log_info("core_image", "Tags for Image #{$this->id} set to: ".Tag::implode($tags), null, array("image_id" => $this->id)); $database->cache->delete("image-{$this->id}-tags"); } } diff --git a/ext/admin/main.php b/ext/admin/main.php index 38cc6e4f..c240ea7b 100644 --- a/ext/admin/main.php +++ b/ext/admin/main.php @@ -120,7 +120,7 @@ class AdminPage extends Extension { public function onPostListBuilding(PostListBuildingEvent $event) { global $user; if($user->can("manage_admintools") && !empty($event->search_terms)) { - $event->add_control($this->theme->dbq_html(implode(" ", $event->search_terms))); + $event->add_control($this->theme->dbq_html(Tag::implode($event->search_terms))); } } diff --git a/ext/comment/theme.php b/ext/comment/theme.php index 2209b9fb..66c17226 100644 --- a/ext/comment/theme.php +++ b/ext/comment/theme.php @@ -207,7 +207,7 @@ class CommentListTheme extends Themelet { $next = $page_number + 1; //$search_terms = array('I','have','no','idea','what','this','does!'); - //$u_tags = url_escape(implode(" ", $search_terms)); + //$u_tags = url_escape(Tag::implode($search_terms)); //$query = empty($u_tags) ? "" : '/'.$u_tags; $h_prev = ($page_number <= 1) ? "Prev" : "Prev"; diff --git a/ext/handle_video/main.php b/ext/handle_video/main.php index 61fa15e8..ec3ad58f 100644 --- a/ext/handle_video/main.php +++ b/ext/handle_video/main.php @@ -64,7 +64,7 @@ class VideoFileHandler extends DataHandlerExtension { $orig_size = $this->video_size($inname); $scaled_size = get_thumbnail_size($orig_size[0], $orig_size[1]); - $cmd = escapeshellcmd(implode(" ", [ + $cmd = escapeshellcmd(Tag::implode([ escapeshellarg($ffmpeg), "-y", "-i", escapeshellarg($inname), "-vf", "scale={$scaled_size[0]}:{$scaled_size[1]}", @@ -89,7 +89,7 @@ class VideoFileHandler extends DataHandlerExtension { protected function video_size(string $filename) { global $config; $ffmpeg = $config->get_string("thumb_ffmpeg_path"); - $cmd = escapeshellcmd(implode(" ", [ + $cmd = escapeshellcmd(Tag::implode([ escapeshellarg($ffmpeg), "-y", "-i", escapeshellarg($filename), "-vstats" diff --git a/ext/index/main.php b/ext/index/main.php index c712708d..ba198d89 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -242,7 +242,7 @@ class Index extends Extension { $count_search_terms = count($search_terms); try { - #log_debug("index", "Search for ".implode(" ", $search_terms), false, array("terms"=>$search_terms)); + #log_debug("index", "Search for ".Tag::implode($search_terms), false, array("terms"=>$search_terms)); $total_pages = Image::count_pages($search_terms); if(SPEED_HAX && $count_search_terms === 0 && ($page_number < 10)) { // extra caching for the first few post/list pages $images = $database->cache->get("post-list:$page_number"); diff --git a/ext/index/theme.php b/ext/index/theme.php index 83f78969..4ac332cb 100644 --- a/ext/index/theme.php +++ b/ext/index/theme.php @@ -69,7 +69,7 @@ and of course start organising your images :-) $prev = $page_number - 1; $next = $page_number + 1; - $u_tags = url_escape(implode(" ", $search_terms)); + $u_tags = url_escape(Tag::implode($search_terms)); $query = empty($u_tags) ? "" : '/'.$u_tags; @@ -77,7 +77,7 @@ and of course start organising your images :-) $h_index = "Index"; $h_next = ($page_number >= $total_pages) ? "Next" : 'Next'; - $h_search_string = html_escape(implode(" ", $search_terms)); + $h_search_string = html_escape(Tag::implode($search_terms)); $h_search_link = make_link(); $h_search = "