changeset 1557:60067807cf9a

Allow empty strings for ua_spiders.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Mon, 18 Sep 2006 00:15:35 +0200
parents 8151bed0e987
children f0f228749435
files MoinMoin/config/multiconfig.py MoinMoin/request/__init__.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Sun Sep 17 23:57:49 2006 +0200
+++ b/MoinMoin/config/multiconfig.py	Mon Sep 18 00:15:35 2006 +0200
@@ -551,7 +551,7 @@
         self.cache.page_dict_regex = re.compile(self.page_dict_regex, re.UNICODE)
         self.cache.page_group_regex = re.compile(self.page_group_regex, re.UNICODE)
         self.cache.page_template_regex = re.compile(self.page_template_regex, re.UNICODE)
-        self.cache.ua_spiders = re.compile(self.ua_spiders, re.I)
+        self.cache.ua_spiders = self.ua_spiders and re.compile(self.ua_spiders, re.I)
 
         self._check_directories()
 
--- a/MoinMoin/request/__init__.py	Sun Sep 17 23:57:49 2006 +0200
+++ b/MoinMoin/request/__init__.py	Mon Sep 18 00:15:35 2006 +0200
@@ -884,7 +884,7 @@
         """ check if the user agent for current request is a spider/bot """
         isSpider = False
         ua = self.getUserAgent()
-        if ua:
+        if ua and self.cfg.cache.ua_spiders:
             isSpider = self.cfg.cache.ua_spiders.search(ua) is not None
         return isSpider