Commit 0f4bfe56 authored by Fabian Galinski's avatar Fabian Galinski 😾
Browse files

Merge branch 'bugfix_override_mode_fix' into 'master'

Bugfix override mode fix

See merge request !12
parents b21414e0 ae7fa04f
......@@ -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;
......
......@@ -101,10 +101,16 @@ class FileOverrideService extends FileBaseXMLService {
if (empty($langData)) {
continue;
}
foreach ($langData as $costKey => $constValue) {
if (isset($this->localLang[$lang][$costKey]) && $this->localLang[$lang][$costKey] !== $constValue) {
continue;
}
if (!is_array($this->localLang[$lang])) {
$this->localLang[$lang] = [];
}
$this->localLang[$lang][$costKey] = $constValue;
}
}
......
......@@ -4,7 +4,7 @@
"description": "Language File Editor",
"homepage": "https://www.sgalinski.de",
"license": ["GPL-2.0+"],
"version": "4.0.5",
"version": "4.0.6",
"support": {
"issues": "https://forge.typo3.org/projects/extension-lfeditor",
"source": "https://gitlab.sgalinski.de/typo3/lfeditor/"
......
......@@ -18,7 +18,7 @@ Following functions are implemented in this module:
* Meta information handling
* Backups, recovering and diff view',
'category' => 'module',
'version' => '4.0.5',
'version' => '4.0.6',
'state' => 'stable',
'uploadfolder' => 0,
'createDirs' => '',
......
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