Review main Merged

88737[BUGFIX] Avoid PHP bug when a link was not created via HtmlWorker

Benni Mack CR +2 V +2 Easy +9 −2 updated 07/01/25, 05:27

Commit message

When using HtmlWorker (e.g. in Backend Login's system news),
there was a PHP error in DomDocument.

When a link was not possible to generate (example: a page
was deleted) then a "UnableToLinkException" is thrown
and just the contents of the <a> tag (incl. spans, strong etc)
are rendered.

However, as it turns out, the inner workings of replacing
this in DomElement (as done in HtmlWorker, whereas in
lib.parseFunc this is purely done with a string/array magic)
"in-place" causes a memory issue resulting in killing
PHP on ones' server (100% system load).

The solution is to clone the child nodes in DomDocument, and
append them before the element, then removing the actual
<a> tag ($element) in this case.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 913

  1. Benni Mack uploaded patch set 1 03/25/25, 12:23

  2. core-ci voted on patch set 1 V +1 03/25/25, 12:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76243

  3. Benni Mack updated the commit message in patch set 2 V +1 03/25/25, 12:55

  4. Benni Mack uploaded patch set 3 03/25/25, 13:00

  5. core-ci voted on patch set 2 V +1 03/25/25, 13:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76250

  6. Christian Kuhn uploaded patch set 4 03/25/25, 13:10

  7. Christian Kuhn voted on patch set 4 CR +1 V +1 03/25/25, 13:10

  8. core-ci voted on patch set 3 V -1 03/25/25, 13:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76252

  9. core-ci voted on patch set 4 V +1 03/25/25, 13:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76253

  10. Stefan Bürk voted on patch set 4 CR +1 V +1 03/25/25, 13:34

  11. Benni Mack voted on patch set 4 CR +2 V +2 03/25/25, 13:36

  12. Benni Mack merged patch set 5 03/25/25, 13:36

  13. Stefan Bürk commented on patch set 5 07/01/25, 05:27

    Late backport to 12.4 considered and made.