Commit a29dcc41 authored by Kevin Ditscheid's avatar Kevin Ditscheid

[BUGFIX] Check for existens of the id attribute before accessing it

parent 5073236c
......@@ -120,15 +120,17 @@ class FileBaseXLFService extends FileBaseService {
}
foreach ((array) $sourceData['trans-unit'] as $data) {
$constant = $data['@attributes']['id'];
if ($data['target']) {
$flatData[$constant] = $data['target'];
} else {
$flatData[$constant] = $data['source'];
}
if (isset($data['@attributes']['id'])) {
$constant = $data['@attributes']['id'];
if ($data['target']) {
$flatData[$constant] = $data['target'];
} else {
$flatData[$constant] = $data['source'];
}
if (empty($flatData[$constant])) {
$flatData[$constant] = '';
if (empty($flatData[$constant])) {
$flatData[$constant] = '';
}
}
}
......
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