diff options
author | GamaC0de <nitzo2001@yahoo.com> | 2016-03-22 01:41:59 +0100 |
---|---|---|
committer | GamaC0de <nitzo2001@yahoo.com> | 2016-03-22 01:41:59 +0100 |
commit | e5b69006811275b28a282c053ad3e851e4a13cab (patch) | |
tree | 0e59f9beafb2c833154f40eab0df0b9ef023704f /module | |
parent | [New Cypter] CryptCat - fix #2273 (diff) | |
download | pyload-e5b69006811275b28a282c053ad3e851e4a13cab.tar.xz |
[misc] parse_html_form() include submit button
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/misc.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/module/plugins/internal/misc.py b/module/plugins/internal/misc.py index dc2aa4517..911359548 100644 --- a/module/plugins/internal/misc.py +++ b/module/plugins/internal/misc.py @@ -38,7 +38,7 @@ except ImportError: class misc(object): __name__ = "misc" __type__ = "plugin" - __version__ = "0.30" + __version__ = "0.31" __status__ = "stable" __pattern__ = r'^unmatchable$' @@ -752,15 +752,20 @@ def parse_html_form(attr_str, html, input_names={}): inputs = {} action = parse_html_tag_attr_value("action", form.group('TAG')) - for inputtag in re.finditer(r'(<(input|textarea).*?>)([^<]*(?=</\2)|)', - re.sub(re.compile(r'<!--.+?-->', re.I | re.S), "", form.group('CONTENT')), re.I | re.S): + for inputtag in re.finditer(r'(<(input|textarea|button).*?>)([^<]*(?=</\2)|)', + re.sub(re.compile(r'<!--.+?-->', re.I | re.S), "", form.group('CONTENT')), + re.I | re.S): name = parse_html_tag_attr_value("name", inputtag.group(1)) if name: - value = parse_html_tag_attr_value("value", inputtag.group(1)) - if not value: - inputs[name] = inputtag.group(3) or "" + if inputtag.group(2).lower() == "button": + if parse_html_tag_attr_value("type", inputtag.group(1)).lower() == "submit": + inputs[name] = "" else: - inputs[name] = value + value = parse_html_tag_attr_value("value", inputtag.group(1)) + if not value: + inputs[name] = inputtag.group(3) or "" + else: + inputs[name] = value if not input_names: #: No attribute check |