[BUGFIX] Avoid returning invalid return type in AbstractOEmbedHelper
"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. Resolves: #97428 Releases: main, 11.5 Change-Id: Icda6b2baa88ddcbf070ceae75eafcb2e9ccb41f1 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74467 Tested-by:core-ci <typo3@b13.com> Tested-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Stefan Bürk <stefan@buerk.tech>
Showing
- typo3/sysext/core/Classes/Resource/OnlineMedia/Helpers/AbstractOEmbedHelper.php 7 additions, 4 deletions...ses/Resource/OnlineMedia/Helpers/AbstractOEmbedHelper.php
- typo3/sysext/core/Classes/Resource/OnlineMedia/Helpers/VimeoHelper.php 6 additions, 4 deletions...core/Classes/Resource/OnlineMedia/Helpers/VimeoHelper.php
Please register or sign in to comment