From ffd2866f11ec49ebe8654b864d007090792b7f10 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 28 Nov 2023 12:00:12 +0300 Subject: [PATCH] Replaced some time() with TIMENOW constant (#1174) --- src/Legacy/Attach.php | 2 +- src/Sitemap.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Legacy/Attach.php b/src/Legacy/Attach.php index 6e817000e..0e7ecc3cf 100644 --- a/src/Legacy/Attach.php +++ b/src/Legacy/Attach.php @@ -847,7 +847,7 @@ class Attach $this->attach_filename = preg_replace('#([\xC2\xC3])([\x80-\xBF])#', 'chr(ord(\'$1\')<<6&0xC0|ord(\'$2\')&0x3F)', $this->attach_filename); $this->attach_filename = rawurlencode($this->attach_filename); $this->attach_filename = preg_replace("/(%[0-9A-F]{1,2})/i", '', $this->attach_filename); - $this->attach_filename = trim($this->attach_filename . '_' .make_rand_str(13)); + $this->attach_filename = trim($this->attach_filename . '_' . make_rand_str(13)); } $this->attach_filename = str_replace(['&', '&', ' '], '_', $this->attach_filename); $this->attach_filename = str_replace('php', '_php_', $this->attach_filename); diff --git a/src/Sitemap.php b/src/Sitemap.php index 7f81b1063..54fd44654 100644 --- a/src/Sitemap.php +++ b/src/Sitemap.php @@ -120,7 +120,7 @@ class Sitemap $sitemap = new STM(SITEMAP_DIR . '/sitemap_dynamic.xml'); foreach ($this->getForumUrls() as $forum) { - $sitemap->addItem(make_url($forum['url']), time(), STM::HOURLY, 0.7); + $sitemap->addItem(make_url($forum['url']), TIMENOW, STM::HOURLY, 0.7); } foreach ($this->getTopicUrls() as $topic) { @@ -144,7 +144,7 @@ class Sitemap $staticSitemap = new STM(SITEMAP_DIR . '/sitemap_static.xml'); foreach ($this->getStaticUrls() as $url) { - $staticSitemap->addItem($url['url'], time(), STM::WEEKLY, 0.5); + $staticSitemap->addItem($url['url'], TIMENOW, STM::WEEKLY, 0.5); } $staticSitemap->write();