Skip to content

JsFooterPlugin sets Http Response content empty if PCRE limit reached #26026

Closed
@cundd

Description

@cundd

Preconditions (*)

  1. Magento 2.3.2-p2
  2. PHP 7.1
  3. pcre.backtrack_limit = 1000000 (Default)
  4. pcre.recursion_limit = 1000000 (Default)
  5. dev/js/move_script_to_bottom=enabled

Steps to reproduce (*)

  1. Build a huge HTML output (e.g. shopping cart with a lot of complex products)

Expected result (*)

  1. Output should be turned or error should be thrown

Actual result (*)

  1. A HTTP status code 200 without a response body is returned

The call to preg_replace_callback() in JsFooterPlugin will fail silently, resulting in a blank page. The reason for this is, that preg_replace_callback() will return NULL if one of it's limits is reached. NULL will further be used to set the content of the HTTP response.

A first step would be to check if the result of preg_replace_callback() is NULL and throw an appropriate exception (generated from preg_last_error()).

Metadata

Metadata

Assignees

Labels

Component: HTTPFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: 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 developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S2Major restrictions or short-term circumventions are required until a fix is available.Triage: DoneHas been reviewed and prioritized during Triage with Product Managers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions