diff --git a/.htaccess b/.htaccess index a5c7eb9..0dc81bd 100644 --- a/.htaccess +++ b/.htaccess @@ -1,8 +1,8 @@ -Options -Indexes +Options -Indexes +SymLinksIfOwnerMatch RewriteEngine On RewriteRule ^(app|bin|bootstrap|resources|storage|vendor|logs|CHANGELOG.md)(/.*|)$ - [NC,F] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [QSA,L] - \ No newline at end of file + diff --git a/app/Controllers/AdminController.php b/app/Controllers/AdminController.php index 2a861ad..3e3acd5 100644 --- a/app/Controllers/AdminController.php +++ b/app/Controllers/AdminController.php @@ -81,7 +81,7 @@ class AdminController extends Controller $out = []; - $out['Default - Bootstrap 4 default theme'] = 'https://bootswatch.com/4/_vendor/bootstrap/dist/css/bootstrap.min.css'; + $out['Default - Bootstrap 4 default theme'] = self::DEFAULT_THEME_URL; foreach ($apiJson->themes as $theme) { $out["{$theme->name} - {$theme->description}"] = $theme->cssMin; } diff --git a/app/Controllers/Controller.php b/app/Controllers/Controller.php index 0d6e5c1..6135c8d 100644 --- a/app/Controllers/Controller.php +++ b/app/Controllers/Controller.php @@ -27,6 +27,8 @@ use Psr\Http\Message\ServerRequestInterface as Request; */ abstract class Controller { + protected const DEFAULT_THEME_URL = 'https://bootswatch.com/4/_vendor/bootstrap/dist/css/bootstrap.min.css'; + /** @var Container */ protected $container; diff --git a/app/Controllers/SettingController.php b/app/Controllers/SettingController.php index 4cc9103..bfe99cd 100644 --- a/app/Controllers/SettingController.php +++ b/app/Controllers/SettingController.php @@ -9,8 +9,6 @@ use Psr\Http\Message\ServerRequestInterface as Request; class SettingController extends Controller { - public const DEFAULT_THEME_URL = 'https://bootswatch.com/4/_vendor/bootstrap/dist/css/bootstrap.min.css'; - /** * @param Request $request * @param Response $response @@ -76,7 +74,8 @@ class SettingController extends Controller if (!is_writable(BASE_DIR.'static/bootstrap/css/bootstrap.min.css')) { $this->session->alert(lang('cannot_write_file'), 'danger'); } else { - file_put_contents(BASE_DIR.'static/bootstrap/css/bootstrap.min.css', file_get_contents(param($request, 'css'))); + file_put_contents(BASE_DIR.'static/bootstrap/css/bootstrap.min.css', + file_get_contents(param($request, 'css'))); } // if is default, remove setting @@ -95,9 +94,11 @@ class SettingController extends Controller private function updateSetting($key, $value = null) { if (!$this->database->query('SELECT `value` FROM `settings` WHERE `key` = '.$this->database->getPdo()->quote($key))->fetch()) { - $this->database->query('INSERT INTO `settings`(`key`, `value`) VALUES ('.$this->database->getPdo()->quote($key).', ?)', $value); + $this->database->query('INSERT INTO `settings`(`key`, `value`) VALUES ('.$this->database->getPdo()->quote($key).', ?)', + $value); } else { - $this->database->query('UPDATE `settings` SET `value`=? WHERE `key` = '.$this->database->getPdo()->quote($key), $value); + $this->database->query('UPDATE `settings` SET `value`=? WHERE `key` = '.$this->database->getPdo()->quote($key), + $value); } } } diff --git a/bootstrap/container.php b/bootstrap/container.php index daf684b..53acd2c 100644 --- a/bootstrap/container.php +++ b/bootstrap/container.php @@ -58,6 +58,7 @@ return [ 'region' => $config['storage']['region'], 'endpoint' => $config['storage']['endpoint'], 'version' => 'latest', + 'use_path_style_endpoint' => $config['storage']['use_path_style_endpoint'] ?? false, '@http' => ['stream' => true], ]);