From cd58008a0f667e97122d6c0e3b164df7979ade3f Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 25 May 2020 00:09:06 +0200 Subject: [PATCH] Rewrite towns support for TFS 1.3 Won't show warning anymore --- system/init.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/system/init.php b/system/init.php index 25d12427..9242fe61 100644 --- a/system/init.php +++ b/system/init.php @@ -180,7 +180,8 @@ else { // load towns from database (TFS 1.3) // //////////////////////////////////////// -$towns = array(); +$tmp = ''; +$towns = []; if($cache->enabled() && $cache->fetch('towns', $tmp)) { $towns = unserialize($tmp); } @@ -197,16 +198,13 @@ else { $cache->set('towns', serialize($towns), 600); } } - else if($cache->enabled()) { - $cache->set('towns', serialize(array()), 600); + else { + $towns = config('towns'); } -} -$configTowns = config('towns'); -if($configTowns !== null && (!isset($configTowns[1]) || $configTowns[1] !== 'Sample town')) { - $towns = array_replace( - $towns, $configTowns - ); + if($cache->enabled()) { + $cache->set('towns', serialize($towns), 600); + } } config(['towns', $towns]);