Skip to content

Open tag parsing error and fix #11

@mijuskovic

Description

@mijuskovic

For example, if the config file contains line <FilesMatch "\.(cgi|shtml|phtml|php)$">,
method ParseApacheConfig._return_conf_list() throws an exception pyparsing.ParseException on the line 311 of parse_config.py.

Error occurs because of incorrectly defined LITERAL_TAG, and solution is to add missing characters to definition. Please change this:

LITERAL_TAG = OneOrMore(Word(
    alphanums + '*:' + '/' + '"-' + '.' + " " + "^" + "_" + "!" + "[]?$" + "'" + '\\'
))

to this:

LITERAL_TAG = OneOrMore(Word(
    alphanums + '*:' + '/' + '"-' + '.' + " " + "^" + "_" + "!" + "[]?$" + "'" + '\\' + '"' + "|" + "(" + ")")
)

I'm not completely sure that this addition will prevent this type of error for every possible apache conf file, but it will work for the most common cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions