hgweb_mod: use safehasattr instead of hasattr
authorAugie Fackler <durin42@gmail.com>
Mon, 25 Jul 2011 16:27:08 -0500
changeset 14953 6ee6ecf1ee89
parent 14952 4c523a2af6e7
child 14954 ce7e3014fda7
hgweb_mod: use safehasattr instead of hasattr
mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Mon Jul 25 15:22:18 2011 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Mon Jul 25 16:27:08 2011 -0500
@@ -7,7 +7,7 @@
 # GNU General Public License version 2 or any later version.
 
 import os
-from mercurial import ui, hg, hook, error, encoding, templater
+from mercurial import ui, hg, hook, error, encoding, templater, util
 from common import get_stat, ErrorResponse, permhooks, caching
 from common import HTTP_OK, HTTP_NOT_MODIFIED, HTTP_BAD_REQUEST
 from common import HTTP_NOT_FOUND, HTTP_SERVER_ERROR
@@ -147,7 +147,7 @@
                 cmd = cmd[style + 1:]
 
             # avoid accepting e.g. style parameter as command
-            if hasattr(webcommands, cmd):
+            if util.safehasattr(webcommands, cmd):
                 req.form['cmd'] = [cmd]
             else:
                 cmd = ''