LSlang: fix handling backslash in export POT file

This commit is contained in:
Benjamin Renard 2023-05-26 11:01:49 +02:00
parent 1c900320db
commit b3cd453918
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -822,8 +822,8 @@ function _cli_output_php($fd) {
* @return string The cleaned string
*/
function _cli_clean_for_pot_file($val) {
$val = str_replace('"', '\\"', $val);
return str_replace("\n", "\\n", $val);
$val = preg_replace('/([^\\\\])"/', '$1\"', $val);
return str_replace("\n", '\n', $val);
}
/**