From 8f911c6b4f51158b62b6ae3a4a7e4d149828b79c Mon Sep 17 00:00:00 2001 From: Mohamed Said Date: Sat, 16 Apr 2016 16:27:53 +0000 Subject: [PATCH] fix an issue by using addSlashes method before writing the value of a language line --- src/Manager.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Manager.php b/src/Manager.php index 24fe5cf..4f202f2 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -149,10 +149,6 @@ public function fillKeys($fileName, array $keys) $newContent = array_replace_recursive($fileContent, $values); - array_walk_recursive($newContent, function ($value) { - return addslashes($value); - }); - $this->writeFile($filePath, $newContent); } } @@ -208,8 +204,11 @@ private function stringLineMaker($array, $prepend = '') foreach ($array as $key => $value) { if (is_array($value)) { $value = $this->stringLineMaker($value, $prepend.' '); + $output .= "\n{$prepend} '{$key}' => [{$value}\n{$prepend} ],"; } else { + $value = addslashes($value); + $output .= "\n{$prepend} '{$key}' => '{$value}',"; } }