| @@ -8,9 +8,9 @@ | ||
| 8 | 8 | * <code>popup='page'</code> is set |
| 9 | 9 | */ |
| 10 | 10 | class Template { |
| 11 | 11 | public function __construct() { |
| 12 | - add_filter('the_content', [&$this, 'load_gallery'], 100, 1); | |
| 12 | + add_filter('the_content', [&$this, 'load_gallery'], 100); | |
| 13 | 13 | add_filter('the_title', [&$this, 'set_header_title'], 10, 2); |
| 14 | 14 | |
| 15 | 15 | /* |
| 16 | 16 | add_filter('wp_title', [&$this, 'set_meta_title'], 10, 3); |
| @@ -31,9 +31,9 @@ | ||
| 31 | 31 | global $photonic_page_title, $photonic_gallery_template_page; |
| 32 | 32 | if (!empty($id)) { |
| 33 | 33 | if (!empty($photonic_gallery_template_page) && is_page($photonic_gallery_template_page) && 'replace-if-available' === $photonic_page_title && absint($photonic_gallery_template_page) === absint($id)) { |
| 34 | 34 | if (isset($_REQUEST['photonic_gallery_title'])) { // phpcs:ignore WordPress.Security.NonceVerification |
| 35 | - return wptexturize(stripslashes_deep(wp_kses_post($_REQUEST['photonic_gallery_title']))); // phpcs:ignore WordPress.Security.NonceVerification | |
| 35 | + return wptexturize(stripslashes_deep(wp_kses_data($_REQUEST['photonic_gallery_title']))); // phpcs:ignore WordPress.Security.NonceVerification | |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | return $title; |
| @@ -41,10 +41,11 @@ | ||
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Changes the title of the template page to the title of the album being displayed. |
| 44 | 44 | * |
| 45 | - * @param $title | |
| 46 | - * @param $id | |
| 45 | + * @param $title | |
| 46 | + * @param string $seperator | |
| 47 | + * @param string $location | |
| 47 | 48 | * @return string|void |
| 48 | 49 | */ |
| 49 | 50 | public function set_meta_title($title, $seperator = ' – ', $location = 'right') { |
| 50 | 51 | global $photonic_page_meta_title, $photonic_gallery_template_page; |
| @@ -72,9 +73,9 @@ | ||
| 72 | 73 | * |
| 73 | 74 | * @param $content |
| 74 | 75 | * @return string |
| 75 | 76 | */ |
| 76 | - public function load_gallery($content) { | |
| 77 | + public function load_gallery($content): string { | |
| 77 | 78 | global $photonic_gallery_template_page; |
| 78 | 79 | if (!empty($photonic_gallery_template_page) && is_page($photonic_gallery_template_page)) { |
| 79 | 80 | // Cannot check nonce for front-end gallery, but will vet the request fully |
| 80 | 81 | if (isset($_REQUEST['photonic_gallery'])) { // phpcs:ignore WordPress.Security.NonceVerification |