aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGanesh Kandu <kanduganesh@gmail.com>2020-10-27 18:08:14 +0530
committerGitHub <noreply@github.com>2020-10-27 18:08:14 +0530
commite69e3fef7bbdc7299ae01aa0e0258395d2e49818 (patch)
treebcfaa7c95f1e9017f557c7107a100185a7fbcf4f
parent42a72c02fa4b6a5eb9d26a7a3a990e497fc10df3 (diff)
downloadShaarli-e69e3fef7bbdc7299ae01aa0e0258395d2e49818.tar.gz
Shaarli-e69e3fef7bbdc7299ae01aa0e0258395d2e49818.tar.zst
Shaarli-e69e3fef7bbdc7299ae01aa0e0258395d2e49818.zip
Removed PHP_EOL
just replace "*/ ?>" and "<?php /*" with '' and "Trim" output whatever is EOF will trimmed out.
-rw-r--r--application/config/ConfigJson.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/application/config/ConfigJson.php b/application/config/ConfigJson.php
index eaa4ee3f..23b22269 100644
--- a/application/config/ConfigJson.php
+++ b/application/config/ConfigJson.php
@@ -19,7 +19,7 @@ class ConfigJson implements ConfigIO
19 $data = file_get_contents($filepath); 19 $data = file_get_contents($filepath);
20 $data = str_replace(self::getPhpHeaders(), '', $data); 20 $data = str_replace(self::getPhpHeaders(), '', $data);
21 $data = str_replace(self::getPhpSuffix(), '', $data); 21 $data = str_replace(self::getPhpSuffix(), '', $data);
22 $data = json_decode($data, true); 22 $data = json_decode(trim($data), true);
23 if ($data === null) { 23 if ($data === null) {
24 $errorCode = json_last_error(); 24 $errorCode = json_last_error();
25 $error = sprintf( 25 $error = sprintf(
@@ -73,7 +73,7 @@ class ConfigJson implements ConfigIO
73 */ 73 */
74 public static function getPhpHeaders() 74 public static function getPhpHeaders()
75 { 75 {
76 return '<?php /*'. "\n"; 76 return '<?php /*';
77 } 77 }
78 78
79 /** 79 /**
@@ -85,6 +85,6 @@ class ConfigJson implements ConfigIO
85 */ 85 */
86 public static function getPhpSuffix() 86 public static function getPhpSuffix()
87 { 87 {
88 return "\n" . '*/ ?>'; 88 return '*/ ?>';
89 } 89 }
90} 90}