Skip to content

Commit

Permalink
fix an issue by using addSlashes method before writing the value of …
Browse files Browse the repository at this point in the history
…a language line
  • Loading branch information
themsaid committed Apr 16, 2016
1 parent 5d96164 commit 8f911c6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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}',";
}
}
Expand Down

0 comments on commit 8f911c6

Please sign in to comment.