Commit d5f914ba authored by Fabian Galinski's avatar Fabian Galinski 😾
Browse files

[BUGFIX] The override mode isn't working with CDATA

parent 9f92df7f
......@@ -186,6 +186,12 @@ abstract class FileBaseService extends FileService {
return FALSE;
}
// Don't do this on a XML file, because the CDATA will be ignored, if it's done...
$fileParts = pathinfo($file);
if ($fileParts['extension'] === 'xml') {
return FALSE;
}
$fileContent = file_get_contents($file);
if (strpos($fileContent, '<generator>LFEditor</generator>') === FALSE) {
$fileContent = str_replace('<![CDATA[', '&lt;![CDATA[', $fileContent);
......
......@@ -265,8 +265,11 @@ class FileBaseXMLService extends FileBaseService {
ksort($localLang);
foreach ($localLang as $const => $value) {
$content['data'][$lang][$const] =
$value = str_replace("\r", '', $value);
if ($content['data'][$lang] === '') {
$content['data'][$lang] = [];
}
$content['data'][$lang][$const] = str_replace("\r", '', $value);
}
return $content;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment