From 99db52cef668a5d49ecd37c07947d0191fa02cad Mon Sep 17 00:00:00 2001 From: Ben Nottelling Date: Mon, 6 Dec 2021 22:45:54 -0800 Subject: [PATCH] Rename htaccess file in source code and automatically name it when required during install --- build.xml | 2 +- src/{.htaccess => .htaccess.txt} | 0 src/install/install.php | 7 +++++++ 3 files changed, 8 insertions(+), 1 deletion(-) rename src/{.htaccess => .htaccess.txt} (100%) diff --git a/build.xml b/build.xml index 1c2cdfdfe..9864a76ef 100644 --- a/build.xml +++ b/build.xml @@ -18,7 +18,7 @@ - + diff --git a/src/.htaccess b/src/.htaccess.txt similarity index 100% rename from src/.htaccess rename to src/.htaccess.txt diff --git a/src/install/install.php b/src/install/install.php index bb1927e5d..18e8e52ff 100644 --- a/src/install/install.php +++ b/src/install/install.php @@ -39,6 +39,9 @@ define('BB_PATH_CONFIG', BB_PATH_ROOT . '/bb-config.php'); define('BB_PATH_CRON', BB_PATH_ROOT . '/bb-cron.php'); define('BB_PATH_LANGS', BB_PATH_ROOT . '/bb-locale'); +define('BB_PATH_HTACCESS', BB_PATH_ROOT . '/.htaccess'); +define('BB_PATH_HTACCESS_TEMPLATE', BB_PATH_ROOT . '/.htaccess.txt'); + // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, [ BB_PATH_LIBRARY, @@ -315,6 +318,10 @@ final class Box_Installer // E-mail was not sent, but that is not a problem error_log($e->getMessage()); } + + if(!file_exists(BB_PATH_HTACCESS) && file_exists(BB_PATH_HTACCESS_TEMPLATE)) { + rename(BB_PATH_HTACCESS_TEMPLATE, BB_PATH_HTACCESS); + } return true; }