From c0f9c77902b48739282151f3b2dae5ede59dd7b6 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 25 Jun 2023 19:41:50 +0900 Subject: [PATCH] Revert "Display the current site's favicon if favicon.ico is requested" This reverts commit 9fcd472d3f7efe04f6762c12f64f43730a2461b8. --- common/framework/Router.php | 6 ------ modules/module/conf/module.xml | 13 ++++++------ modules/module/module.view.php | 38 ---------------------------------- 3 files changed, 6 insertions(+), 51 deletions(-) diff --git a/common/framework/Router.php b/common/framework/Router.php index 3908b864d..4a6c13710 100644 --- a/common/framework/Router.php +++ b/common/framework/Router.php @@ -64,12 +64,6 @@ class Router 'extra_vars' => ['act' => 'dispAdminRewriteTest'], 'priority' => 0, ), - 'favicon\.ico' => array( - 'regexp' => '#^favicon\.ico$#', - 'vars' => [], - 'extra_vars' => ['module' => 'module', 'act' => 'dispModuleCurrentSiteFavicon'], - 'priority' => 0, - ) ); /** diff --git a/modules/module/conf/module.xml b/modules/module/conf/module.xml index 4ea9c0fc6..01b315c99 100644 --- a/modules/module/conf/module.xml +++ b/modules/module/conf/module.xml @@ -6,18 +6,17 @@ - - + - + - + @@ -27,7 +26,7 @@ - + @@ -37,12 +36,12 @@ - + - + diff --git a/modules/module/module.view.php b/modules/module/module.view.php index a1eb7a6b9..b93143cc2 100644 --- a/modules/module/module.view.php +++ b/modules/module/module.view.php @@ -143,44 +143,6 @@ class ModuleView extends Module $this->setTemplateFile('filebox_add'); } - /** - * Display the current site's favicon - */ - public function dispModuleCurrentSiteFavicon() - { - $domain = ModuleModel::getSiteInfoByDomain($_SERVER['HTTP_HOST']) ?: ModuleModel::getDefaultDomainInfo(); - $domain_srl = $domain->domain_srl ?? 0; - $filename = \RX_BASEDIR . 'files/attach/xeicon/' . ($domain_srl ? ($domain_srl . '/') : '') . 'favicon.ico'; - - if (Rhymix\Framework\Storage::exists($filename)) - { - // Handle 304 Not Modified - if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) > filemtime($uploaded_filename)) - { - header('HTTP/1.1 304 Not Modified'); - exit(); - } - - // Clear buffer - while(ob_get_level()) ob_end_clean(); - - // Set headers - header('Content-Type: image/x-icon'); - header('Content-Length: ' . filesize($filename)); - header('Cache-Control: private; max-age=3600'); - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - - // Print icon and exit - readfile($filename); - exit(); - } - else - { - $this->stop('msg_not_founded'); - $this->setHttpStatusCode(404); - } - } - /** * Moved from mobile class */