mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
hgweb_mod: use safehasattr instead of hasattr
This commit is contained in:
parent
8437ff81d4
commit
caa4218c37
@ -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 = ''
|
||||
|
Loading…
Reference in New Issue
Block a user