Project

General

Profile

Actions

Bug #18484

closed

creating a folder in filelist causes a PHP error

Added by Michael Raberger about 16 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-03-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Warning: parse_url(/typo3/typo3/file_list.php?id=D:/htdocs/web1/html/typo3/fileadmin/user_upload/media/oeueae_________/Test/test) [function.parse-url]: Unable to parse URL in D:\htdocs\web1\html\typo3\typo3\template.php on line 439

Warning: Cannot modify header information - headers already sent by (output started at D:\htdocs\web1\html\typo3\typo3\template.php:439) in D:\htdocs\web1\html\typo3\typo3\template.php on line 619

testet on a windows plattform

(issue imported from #M7910)


Files

7910_parse_url.diff (677 Bytes) 7910_parse_url.diff Administrator Admin, 2008-03-23 13:10

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #18407: file upload causes PHP errorClosed2008-03-09

Actions
Actions #1

Updated by Steffen Kamper about 16 years ago

I confirm this, but this is Windows only.

happens with
- file upload
- creating shortcut (critical, the shortcut is created and error appears on every next page, no chance to delete shortcut other than in DB)

Actions #2

Updated by Martin Kutschker about 16 years ago

Looking into template.php I see that REQUEST_URI is being parsed. But in your post I see that the query argument id (obviously the path) is not URL encoded. Why?

Actions #3

Updated by Martin Kutschker about 16 years ago

Ok, tracking it down to t3lib_div::getIndpEnv it is seen that REQUEST_URI is in some conditions derived.

If you use eg ISAPI_Rewriter for IIS it may be configure in $TYPO3_CONF_VARS[SYS][requestURIvar] to come from HTTP_X_REWRITE_URL (you need this for Real URL). Or if you use IIS and PHP as CGI. Then it is derived from SCRIPT_NAME and QUERY_STRING.

I wonder why - in the latter case - the URL is not encoded.

Actions #4

Updated by Steffen Kamper about 16 years ago

Hi Masi,

may be a misunderstood: This happens with xampp on Windows, not IIS.
The Url isn't encoded, but i get the error (is a warning):

Warning: parse_url(/t3/trunk/typo3/file_list.php?id=C:/web/x-htdocs/t3/trunk/fileadmin/_temp_) [function.parse-url]: Unable to parse URL in C:\web\x-htdocs\t3\trunk\typo3\template.php on line 439

using
$pathInfo = parse_url(urlencode(t3lib_div::getIndpEnv('REQUEST_URI')));
works. The question is why REQUEST_URI' isn't encoded.

Actions #5

Updated by Steffen Kamper about 16 years ago

patch with urlencode is attached

Actions #6

Updated by Martin Kutschker about 16 years ago

Steffen, there is no misunderstanding concerning IIS. Nobody bothered to tell anything about the setup besides "Windows". I can only hope that the "PHP 5.2" flag of this bug report is true and not a fake setting.

Anyway, your patch is - sorry - only a hack. urlencoding the complete (!) url may solve the local issue, but we both know that the query of the url should be encoded from the start.

Actions #7

Updated by Michael Raberger about 16 years ago

"PHP 5.2" is for sure true!

Complete PHP version: "PHP Version 5.2.3"

Actions #8

Updated by Steffen Kamper about 16 years ago

@Martin Kutschker

sure - i would be glad to know what really happens.
Calling file-module first time, REQUEST_URI is urlencoded. After file upload or creating a shortcut it isn't.
I tried in 4.1 as well, there is the url encoded all the time. As this is a Server-Var i don't know what happens and i would be glad if you have an idea.

Sure the patch is a hack which works on my local, but it's not the solution.
I also will debug this days to get an idea what really happens here.

ps: php 5.2.2 on my local system.

Actions #9

Updated by Michael Raberger about 16 years ago

i thing this bug is related to an other one reported by me: ID 0007801

Actions #10

Updated by Martin Kutschker about 16 years ago

I found one error. In t3lib/class.t3lib_clipboard.php (but also in TYPO3 4.1) in function linkItemText() the "id" parameter of the URL (set with "dirname($rec)") is not escaped with rawurlencode.

Actions #11

Updated by Steffen Kamper about 16 years ago

it seems that this is one reason
in tce_file.php, in finish
Header('Location: '.t3lib_div::locationHeaderUrl($this->redirect));
where id is not rawurlencoded

What i don't understand that looking to log file there is no change since 4.1, only ingmars change of EOL and Ingo's copyrights.

Actions #12

Updated by Steffen Kamper about 16 years ago

i really stumble ...

It's the returnurl. In file_list it's rawurlencoded
$this->script.'?id='.rawurlencode($this->path).'&imagemode='.$this->thumbs;

but in file_upload it's no more.
The only difference to 4.1 is that in 4.1 it was POST and now it is GET (see code of upload-button)

Actions #13

Updated by Xavier Perseguers about 12 years ago

  • Assignee deleted (Steffen Kamper)
  • Target version deleted (0)
Actions #14

Updated by Alexander Opitz almost 11 years ago

  • Status changed from Accepted to Needs Feedback

The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?

Actions #15

Updated by Alexander Opitz over 10 years ago

  • Status changed from Needs Feedback to Closed
  • Is Regression set to No

No feedback for over 90 days.

Actions

Also available in: Atom PDF