Skip to content

PHP tag inside a pair of quotes in script tag under enabling minifyJS #679

@kylehon

Description

@kylehon

I found a bug when putting PHP tag <?php ?> inside a pair of single/double quotes in script tag <script>

Before compressed:

<script>
$('#element').myPlugin({
    key: '<?php ?>'
});
</script>
<script>
$('#element').myPlugin({
    key: "<?php ?>"
});
</script>

Actual (after compressed):

<script>$("#element").myPlugin({key:"\t\t"})</script>
<script>$("#element").myPlugin({key:"\t\t"})</script>

Expected:

<script>$("#element").myPlugin({key:""})</script>
<script>$("#element").myPlugin({key:""})</script>

I tried adding some regex in ignoreCustomFragments but it doesn't help.

I guess these lines may be related to my issue: 0960482

Or would there be any may that by-pass/escape this issue?

Thank you!

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