Bug #36380

t3lib_div::getUrl() with local file throws a warning while file does not exists

Added by rengaw83 over 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-04-20
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When using t3lib_div::getUrl() to get content of a file on the filesystem which does not exists, a php warning is issued.

excample calls:
t3lib_div::getUrl(t3lib_extMgm::extPath('myqxt').'ext_tables.sql');
t3lib_div::getUrl(t3lib_extMgm::extPath('myqxt').'templates\list.html');

This error occurs since verion 4.5.15 by fixing issue 35847.
In previous versions t3lib_div::getUrl() returns false, if the file does not exists.


Related issues

Related to TYPO3 Core - Bug #35847: t3lib_div::getUrl() providing wrong error informationClosedIngo Renner2012-04-11

Actions
Related to TYPO3 Core - Bug #36976: PHP warning when a language pack does not existClosedXavier Perseguers2012-05-09

Actions
#1

Updated by Philipp Gampe over 10 years ago

I think this is a change in behavior which was not needed. I will push a fix.

#2

Updated by Gerrit Code Review over 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10659

#3

Updated by Ingo Renner over 10 years ago

  • Status changed from Under Review to Rejected

rengaw wrote:

When using t3lib_div::getUrl() to get content of a file on the filesystem which does not exists, a php warning is issued.

please use file_exists() http://de2.php.net/manual/en/function.file-exists.php

#4

Updated by rengaw83 over 10 years ago

I can use is_readable befor i call getURL. But there are other extension in TER, wich use getURL without this check (for example phpunit). Becouse, it was not previously necessary.

The getURL call is unnecessary, when he does not handle the error. why the $report, when i has to use file_exists?

#5

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Rejected to Under Review

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/10854

#6

Updated by Gerrit Code Review over 10 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/10868

#7

Updated by Philipp Gampe over 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#8

Updated by Gerrit Code Review about 10 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/13245

#9

Updated by Wouter Wolters almost 10 years ago

Please close this issue. All affected branches are up to date 4.5 and 4.6

#10

Updated by Stefan Galinski almost 10 years ago

  • Status changed from Under Review to Closed

Also available in: Atom PDF