From: Alexander Ebert Date: Mon, 29 Jul 2013 11:13:34 +0000 (+0200) Subject: Fixed import of previously saved options X-Git-Tag: 2.0.0_Beta_6~27 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d5fc725b2e144a0576bc0ed3ed3be0aca7826fe4;p=GitHub%2FWoltLab%2FWCF.git Fixed import of previously saved options --- diff --git a/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php b/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php index 962a26d8ca..e072287a71 100755 --- a/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php @@ -63,24 +63,11 @@ class OptionImportForm extends AbstractForm { } try { - $xml = new XML($this->optionImport['tmp_name']); - $optionsXML = $xml->getElementTree('options'); - foreach ($optionsXML['children'] as $option) { - $name = $value = ''; - foreach ($option['children'] as $optionData) { - switch ($optionData['name']) { - case 'name': - $name = $optionData['cdata']; - break; - case 'value': - $value = $optionData['cdata']; - break; - } - } - - if (!empty($name)) { - $this->options[$name] = $value; - } + $xml = new XML(); + $xml->load($this->optionImport['tmp_name']); + $xpath = $xml->xpath(); + foreach ($xpath->query('/options/option') as $option) { + $this->options[ $xpath->query('name', $option)->item(0)->nodeValue ] = $xpath->query('value', $option)->item(0)->nodeValue; } } catch (SystemException $e) {