Review 11.5 Merged

74467[BUGFIX] Avoid returning invalid return type in AbstractOEmbedHelper

Stefan Bürk CR +2 V +2 Easy +13 −8 updated 05/04/22, 21:59

Commit message

"AbstractOEmbedHelper::getOEmbedData()" requests data and
decode it as json. json_decode() may fail and thus having
a invalid type decoded. In the complete chain this lead to
a "access array offset on value type bool" warning.

This patch checks the decoded value before returning, thus
ensure valid return type is "array" or "null". Furthermore
this avoids a signature change of the corresponding method
"AbstractOEmbedHelper::getOEmbedData()". Additionally this
paves the way for adding proper return type in a dedicated
patch. Streamline usage in VimeoHelper along the way.

Review

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

Issues 1

Files 2

Review log 34

  1. Stefan Bürk commented on patch set 1 05/04/22, 21:43

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 05/04/22, 21:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26849

  3. Stefan Bürk voted on patch set 1 V +2 CR +2 05/04/22, 21:58

  4. Stefan Bürk merged patch set 2 05/04/22, 21:59