Skip to content
Snippets Groups Projects
Commit 86d1f36c authored by Thomas Hohn's avatar Thomas Hohn Committed by Christian Kuhn
Browse files

[TASK] Ensure type safety in YamlFileLoader

The method getFileContents has return type string. However it contains
a call to file_get_contents, that can return a boolean in case of failure.
Added a check for if the file is readable and a cast to string when
returning the value of the call to file_get_contents.
In case of failure it will return the empty string, which will be caught
properly in the method loadAndParse. Afterwards the error handling could
be improved in loadAndParse to be more specific.

Resolves: #100048
Releases: main, 11.5
Change-Id: Icf72332cdc2429318692682bf23e6d230109bdb6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77984


Tested-by: default avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 638f96a2
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment