[TASK] Use file_get_contents instead of getUrl() 09/47309/5
authorBenni Mack <benni@typo3.org>
Fri, 18 Mar 2016 07:53:32 +0000 (08:53 +0100)
committerBenni Mack <benni@typo3.org>
Tue, 29 Mar 2016 05:24:42 +0000 (07:24 +0200)
commit94a579e188343168cbb2faf8b7ad8c67e2af0756
tree502586bf95fe84c12d27d035ea8941dc46458a45
parent541382d2b46705a6e2b06e2ca64e8409d2f8318e
[TASK] Use file_get_contents instead of getUrl()

The method GeneralUtility::getUrl() is used a lot in the
core where only local files are allowed.

Most occurrences can be replaced by using the native
file_get_contents() PHP function.

file_get_contents() is now always used when

* is_file() is called
* only local paths (e.g. prefixed with PATH_site)
* absolute paths (GeneralUtility::getFileAbsFileName)
* ensured that files within extensions

are checked before. In these cases getUrl() MUST NOT BE
USED but built-in file_get_contents() must be used instead.

Resolves: #75178
Releases: master
Change-Id: Ia88879d8fa44fd88e604b3332c1a710c33e5d3ec
Reviewed-on: https://review.typo3.org/47309
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Daniel Gorges <daniel.gorges@b13.de>
Tested-by: Daniel Gorges <daniel.gorges@b13.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
30 files changed:
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaFlexFetch.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/core/Classes/Charset/CharsetConverter.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Messaging/AbstractStandaloneMessage.php
typo3/sysext/core/Classes/Page/PageRenderer.php
typo3/sysext/core/Classes/Resource/ResourceCompressor.php
typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/extensionmanager/Classes/Controller/UploadExtensionFileController.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/impexp/Classes/Export.php
typo3/sysext/impexp/Classes/Import.php
typo3/sysext/indexed_search/Classes/FileContentParser.php
typo3/sysext/install/Classes/Controller/Action/Ajax/ExtensionCompatibilityTester.php
typo3/sysext/install/Classes/Controller/Action/Tool/AllConfiguration.php
typo3/sysext/install/Classes/Service/SqlExpectedSchemaService.php
typo3/sysext/install/Classes/Updates/ExtensionManagerTables.php
typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php
typo3/sysext/lowlevel/Classes/CleanerCommand.php
typo3/sysext/rtehtmlarea/Classes/Extension/MicroDataSchema.php
typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php
typo3/sysext/t3editor/Classes/T3editor.php
typo3/sysext/version/Classes/Hook/PreviewHook.php