Skip to content

Merging / Bundling JS Files Production Mode breaks Regular Expressions #10562

@ulftietze

Description

@ulftietze

Preconditions

  1. Magento 2.1.X (explict tested with 2.1.2, also shouldn't work with all other versions)
  2. PHP 7.0.X
  3. Production Mode
  4. Enabled JS Bundling (Configuration > Advanced > Developer > JavaScript Settings)

Steps to reproduce

  1. Create a custom JS File which should do some Regular Expressions (e.g. Input Fields in Checkout)
  2. Inside if Validation e.g. do a /^([a-zA-ZßäöüÄÖÜ\s.]{3,})+$/
  3. Run php bin/magento setup:static-content:deploy

Expected result

  1. Regex should pass the following string: "Übergrößenträger"

Actual result

  1. Can't validate this string, because REGEX Validation is modified to:
    /^([a-zA-Z\u00c3\u009f\u00c3\u00a4\u00c3\u00b6\u00c3\u00bc\u00c3\u0084\u00c3\u0096\u00c3\u009c\s.]{3,})+$/
  2. This is after the json_encode of this string. Before Magento do this, here is the string that Magento creates: /^([a-zA-Z�äöü���\s.]{3,})+$/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions