From 41a205d24a962c806c4ae7e31f6538567f202fcd Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 9 Feb 2020 16:26:57 +0000 Subject: [PATCH] avoid having nice_urls as both system and admin setting --- core/sys_config.php | 1 - core/urls.php | 2 +- tests/bootstrap.php | 3 ++- tests/defines.php | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/sys_config.php b/core/sys_config.php index 29b0827f..3cd6258d 100644 --- a/core/sys_config.php +++ b/core/sys_config.php @@ -24,7 +24,6 @@ _d("CACHE_DSN", null); // string cache connection details _d("DEBUG", false); // boolean print various debugging details _d("COOKIE_PREFIX", 'shm'); // string if you run multiple galleries with non-shared logins, give them different prefixes _d("SPEED_HAX", false); // boolean do some questionable things in the name of performance -_d("NICE_URLS", false); // boolean force niceurl mode _d("WH_SPLITS", 1); // int how many levels of subfolders to put in the warehouse _d("VERSION", '2.8-dev'); // string shimmie version _d("TIMEZONE", null); // string timezone diff --git a/core/urls.php b/core/urls.php index c9ff9d87..72dc1b79 100644 --- a/core/urls.php +++ b/core/urls.php @@ -35,7 +35,7 @@ function make_link(?string $page=null, ?string $query=null): string } $install_dir = get_base_href(); - if (NICE_URLS || $config->get_bool('nice_urls', false)) { + if (SPEED_HAX || $config->get_bool('nice_urls', false)) { $base = $install_dir; } else { $base = "$install_dir/index.php?q="; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 1d74d27a..75860968 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -29,6 +29,7 @@ _load_theme_files(); $page = new Page(); _load_event_listeners(); $config->set_string("thumb_engine", "static"); # GD has less overhead per-call +$config->set_bool("nice_urls", true); send_event(new DatabaseUpgradeEvent()); send_event(new InitExtEvent()); $_tracer->end(); @@ -43,7 +44,7 @@ abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); - global $_tracer; + global $_tracer, $config; $_tracer->begin(get_called_class()); self::create_user(self::$admin_name); diff --git a/tests/defines.php b/tests/defines.php index 58a3d682..7d2ccca4 100644 --- a/tests/defines.php +++ b/tests/defines.php @@ -8,7 +8,6 @@ define("CACHE_DSN", null); define("DEBUG", false); define("COOKIE_PREFIX", 'shm'); define("SPEED_HAX", false); -define("NICE_URLS", true); define("WH_SPLITS", 1); define("VERSION", 'unit-tests'); define("TRACE_FILE", null);