- Fix some bugs in the XML config handling
[videosite.git] / videosite.pl
index 0a8ad3f..7803fa3 100644 (file)
@@ -97,7 +97,7 @@ sub check_for_link {
 sub cmd_save {
 
     open(CONF, '>'.$conffile);
-    print CONF XML::Simple::XMLout($conf, KeepRoot => 1, KeyAttr => ['module', 'key']);
+    print CONF XML::Simple::XMLout($conf, KeepRoot => 1, KeyAttr => {'config' => 'module', 'option' => 'key'});
     close(CONF);
 }
 
@@ -231,7 +231,7 @@ sub init_videosite {
 
     my $p;
 
-    unless(-r $conffile && defined($conf = XML::Simple::XMLin($conffile, ForceArray => ['config', 'option'], KeepRoot => 1, KeyAttr => ['module', 'key']))) {
+    unless(-r $conffile && defined($conf = XML::Simple::XMLin($conffile, ForceArray => ['config', 'option'], KeepRoot => 1, KeyAttr => {'config' => 'module', 'option' => 'key'}))) {
         # No config, start with an empty one
         write_debug(undef, 'No config found, using defaults');
         $conf = { 'videosite' => { 'getter' => '' }};