From cfe1f7914ed83127584bd0422ffb686b4ac4087f Mon Sep 17 00:00:00 2001 From: gpenverne Date: Thu, 23 Jan 2020 15:27:25 +0100 Subject: [PATCH] handle empty file --- _class/locale.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/_class/locale.class.php b/_class/locale.class.php index 345343b..e37c926 100644 --- a/_class/locale.class.php +++ b/_class/locale.class.php @@ -65,7 +65,9 @@ static public function load($code) $handle = fopen($file, 'r'); while (!feof($handle)) { $line = fgetcsv($handle); - if (count($line)!=2) continue; + if (!$line || count($line) != 2) { + continue; + } self::$_list[trim($line[0])] = trim($line[1]); } fclose($handle); @@ -93,4 +95,4 @@ static public function get($key, $default='######') { return (isset(self::$_list[$key]) ? self::$_list[$key] : $default); } -} \ No newline at end of file +}