diff --git a/tests/phpstan.neon b/tests/phpstan.neon index 2a379a7f0..9faf61e30 100644 --- a/tests/phpstan.neon +++ b/tests/phpstan.neon @@ -4,6 +4,6 @@ parameters: - ../core - ../ext - ../tests - - ../themes/default + - ../themes ignoreErrors: - '#Access to an undefined property Shimmie2\\Image::\$#' diff --git a/themes/rule34v2/index.theme.php b/themes/rule34v2/index.theme.php index 94793bad0..f7ec7622f 100644 --- a/themes/rule34v2/index.theme.php +++ b/themes/rule34v2/index.theme.php @@ -6,6 +6,8 @@ class CustomIndexTheme extends IndexTheme { + public static array $_search_query = []; + protected function build_table(array $images, ?string $query): string { global $user; @@ -27,7 +29,7 @@ public function display_page(Page $page, $images) $nav = $this->build_navigation($this->page_number, $this->total_pages, $this->search_terms); if (!empty($this->search_terms)) { - $page->_search_query = $this->search_terms; + static::$_search_query = $this->search_terms; } $page->add_block(new Block("Navigation", $nav, "left", 0)); diff --git a/themes/rule34v2/page.class.php b/themes/rule34v2/page.class.php index 94c84eca2..6a1e9d8b3 100644 --- a/themes/rule34v2/page.class.php +++ b/themes/rule34v2/page.class.php @@ -53,7 +53,7 @@ public function render() } } - $query = !empty($this->_search_query) ? html_escape(Tag::implode($this->_search_query)) : ""; + $query = !empty(CustomIndexTheme::$_search_query) ? html_escape(Tag::implode(CustomIndexTheme::$_search_query)) : ""; assert(!is_null($query)); # used in header.inc, do not remove :P $flash_html = $this->flash ? "".nl2br(html_escape(implode("\n", $this->flash)))."" : ""; $generated = autodate(date('c'));