hgweb_mod: use safehasattr instead of hasattr

This commit is contained in:
Augie Fackler 2011-07-25 16:27:08 -05:00
parent 8437ff81d4
commit caa4218c37

View File

@ -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 @@ class hgweb(object):
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 = ''