VMM/config: LazyConfig._get_section_option check for empty section/option names. v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Fri, 06 Aug 2010 02:15:16 +0000
branchv0.6.x
changeset 342 b0c971f943dc
parent 341 6709d0faf2f5
child 343 9232ed7e4d85
VMM/config: LazyConfig._get_section_option check for empty section/option names.
VirtualMailManager/config.py
--- a/VirtualMailManager/config.py	Thu Aug 05 23:26:23 2010 +0000
+++ b/VirtualMailManager/config.py	Fri Aug 06 02:15:16 2010 +0000
@@ -122,7 +122,7 @@
         """
         sect_opt = section_option.lower().split('.')
         # TODO: cache it
-        if len(sect_opt) != 2:  # do we need a regexp to check the format?
+        if len(sect_opt) != 2 or not sect_opt[0] or not sect_opt[1]:
             raise BadOptionError(_(u"Bad format: '%s' - expected: "
                                    u"section.option") %
                                  get_unicode(section_option))