Skip to content

Regex meta char escape using preg_quote #59

Open
@ranvis

Description

@ranvis

When using preg_match('@...@'), preg_quote($rule, '@') is expected to be used to escape input.
Currently one of the following warnings occurs when a path contains some meta character:

PHP Warning: preg_match(): Compilation failed: missing ) at offset 15 in /path/to/vendor/t1gor/robots-txt-parser/source/robotstxtparser.php on line 836
PHP Warning: preg_match(): Compilation failed: unmatched parentheses at offset 1 in /path/to/vendor/t1gor/robots-txt-parser/source/robotstxtparser.php on line 836

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions