From ab58f2542072e6bf34acd862f6cfed84b33feb29 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 29 Sep 2020 15:00:11 +0200 Subject: Compatibility with PHP 8 --- application/config/ConfigJson.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'application/config/ConfigJson.php') diff --git a/application/config/ConfigJson.php b/application/config/ConfigJson.php index 4509357c..c0c0dab9 100644 --- a/application/config/ConfigJson.php +++ b/application/config/ConfigJson.php @@ -46,7 +46,7 @@ class ConfigJson implements ConfigIO // JSON_PRETTY_PRINT is available from PHP 5.4. $print = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0; $data = self::getPhpHeaders() . json_encode($conf, $print) . self::getPhpSuffix(); - if (!file_put_contents($filepath, $data)) { + if (empty($filepath) || !file_put_contents($filepath, $data)) { throw new \Shaarli\Exceptions\IOException( $filepath, t('Shaarli could not create the config file. '. -- cgit v1.2.3