diff options
| author | Appleman1234 <applemansigloo@gmail.com> | 2022-09-25 13:30:13 +1000 |
|---|---|---|
| committer | Appleman1234 <applemansigloo@gmail.com> | 2022-09-25 13:30:13 +1000 |
| commit | 2c69095a1edf7474073451285238659d0f62ce3f (patch) | |
| tree | 5dee476605402c66dc2853d0836b29f6aedae62b /templates/themes/sitemap/theme.php | |
| parent | e9a61e2fbbd930eaa80d6a5f33420cedc59d748c (diff) | |
PHP8.1 fixes from Rector
Diffstat (limited to 'templates/themes/sitemap/theme.php')
| -rw-r--r-- | templates/themes/sitemap/theme.php | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php index 6bc035bb..a04b9f7c 100644 --- a/templates/themes/sitemap/theme.php +++ b/templates/themes/sitemap/theme.php @@ -23,26 +23,21 @@ } } - $action = generation_strategy('sb_sitemap', array()); + $action = generation_strategy('sb_sitemap', []); if ($action == 'delete') { file_unlink($settings['path']); } elseif ($action == 'rebuild') { - $boards = explode(' ', $settings['boards']); + $boards = explode(' ', (string) $settings['boards']); - $threads = array(); + $threads = []; foreach ($boards as $board) { $query = query(sprintf("SELECT `id`, `id` AS `thread_id`, `slug`, (SELECT `time` FROM ``posts_%s`` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM ``posts_%s`` WHERE `thread` IS NULL", $board, $board)) or error(db_error()); $threads[$board] = $query->fetchAll(PDO::FETCH_ASSOC); } - file_write($settings['path'], Element('themes/sitemap/sitemap.xml', Array( - 'settings' => $settings, - 'config' => $config, - 'threads' => $threads, - 'boards' => $boards, - ))); + file_write($settings['path'], Element('themes/sitemap/sitemap.xml', ['settings' => $settings, 'config' => $config, 'threads' => $threads, 'boards' => $boards])); } } |
