Skip to content

[Formatting Bug]: ?> Problem #1013

@gilney-canaltelecom

Description

@gilney-canaltelecom

Platform

Windows

Template before formatting

@php
    function stripSpecificTags(string $input, array $tags)
    {
        foreach ($tags as $tag) {
            $input = preg_replace(
                "/<\\/?{$tag}(.|\\s)*?>/",
                "",
                $input
            );
        }
        return $input;
    }
@endphp

Template after formatting

@php
    function stripSpecificTags(string $input, array $tags)
    {
        foreach ($tags as $tag) {
        $input = preg_replace("/<\\/?{$tag}(.|\\s)*@endphp/", '', $input);
    }
    return $input;
}
?>

Expected Behaviour

It seems that this extension really doesn't like the ?> inside the regex...

Tbh, just putting ?> anywhere in the code reproduces the problem, like below:

@php
    $var = "?>";
@endphp

Relevant log output

Metadata

Metadata

Labels

StaleStale labelbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions