Skip to content

Commit 8f911c6

Browse files
committed
fix an issue by using addSlashes method before writing the value of a language line
1 parent 5d96164 commit 8f911c6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Manager.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ public function fillKeys($fileName, array $keys)
149149

150150
$newContent = array_replace_recursive($fileContent, $values);
151151

152-
array_walk_recursive($newContent, function ($value) {
153-
return addslashes($value);
154-
});
155-
156152
$this->writeFile($filePath, $newContent);
157153
}
158154
}
@@ -208,8 +204,11 @@ private function stringLineMaker($array, $prepend = '')
208204
foreach ($array as $key => $value) {
209205
if (is_array($value)) {
210206
$value = $this->stringLineMaker($value, $prepend.' ');
207+
211208
$output .= "\n{$prepend} '{$key}' => [{$value}\n{$prepend} ],";
212209
} else {
210+
$value = addslashes($value);
211+
213212
$output .= "\n{$prepend} '{$key}' => '{$value}',";
214213
}
215214
}

0 commit comments

Comments
 (0)