mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
parent
54aef7216f
commit
a51626840e
1 changed files with 10 additions and 1 deletions
|
@ -200,7 +200,16 @@ class Xml {
|
|||
continue;
|
||||
}
|
||||
if ($key[0] !== '@' && $format === 'tags') {
|
||||
$child = $dom->createElement($key, $value);
|
||||
$child = null;
|
||||
if (!is_numeric($value)) {
|
||||
// Escape special characters
|
||||
// http://www.w3.org/TR/REC-xml/#syntax
|
||||
// https://bugs.php.net/bug.php?id=36795
|
||||
$child = $dom->createElement($key, '');
|
||||
$child->appendChild(new DOMText($value));
|
||||
} else {
|
||||
$child = $dom->createElement($key, $value);
|
||||
}
|
||||
$node->appendChild($child);
|
||||
} else {
|
||||
if ($key[0] === '@') {
|
||||
|
|
Loading…
Add table
Reference in a new issue