From d5fc725b2e144a0576bc0ed3ed3be0aca7826fe4 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 29 Jul 2013 13:13:34 +0200 Subject: [PATCH] Fixed import of previously saved options --- .../lib/acp/form/OptionImportForm.class.php | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) 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) { -- 2.20.1