Project

General

Profile

Actions

Task #75178

closed

Use file_get_contents instead of getUrl()

Added by Benni Mack over 8 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Miscellaneous
Target version:
Start date:
2016-03-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #79320: ResourceCompressor treats protocol-relative URLs as local filesRejected2017-01-13

Actions
Actions

Also available in: Atom PDF