Skip to content

Incorrect regexp pattern \\\ in method Presenter::formatLayoutTemplateFiles() #372

Description

@SlavaAurim

Version: 3.3.0

Bug Description

Incorrect preg_match pattern for checking $this->layout

Steps To Reproduce

PhpStrom show warning for code preg_match('#/|\\\#', $this->layout) - illegal escape sequence
in method Presenter::formatLayoutTemplateFiles():

if (is_string($this->layout) && preg_match('#/|\\\#', $this->layout)) {

Expected Behavior

There should be no warnings.

Possible Solution

There should probably be 4 backslashes in the pattern:
preg_match('#/|\\\\#', $this->layout)

See the docs: https://www.php.net/manual/en/regexp.reference.escape.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions