From 5ff23f02b80ec6ddee28dee869171ee8e3656b7c Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 20 Jun 2016 18:30:37 +0200 Subject: Add closing PHP tags to JSON config files --- application/config/ConfigJson.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'application/config') diff --git a/application/config/ConfigJson.php b/application/config/ConfigJson.php index 94693c86..d07fefee 100644 --- a/application/config/ConfigJson.php +++ b/application/config/ConfigJson.php @@ -17,6 +17,7 @@ class ConfigJson implements ConfigIO } $data = file_get_contents($filepath); $data = str_replace(self::getPhpHeaders(), '', $data); + $data = str_replace(self::getPhpSuffix(), '', $data); $data = json_decode($data, true); if ($data === null) { $error = json_last_error(); @@ -32,7 +33,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); + $data = self::getPhpHeaders() . json_encode($conf, $print) . self::getPhpSuffix(); if (!file_put_contents($filepath, $data)) { throw new IOException( $filepath, @@ -62,4 +63,16 @@ class ConfigJson implements ConfigIO { return ''; + } } -- cgit v1.2.3