Bug #17184
closed
t3lib_div::tempnam('anything_'); returns invalid path
Added by Andreas Balzer over 17 years ago.
Updated about 6 years ago.
Description
If you use t3lib_div::tempnam('anything_'); on Windows Vista 64 Bit (didn't check for other systems), you'll recieve an invalid path.
e.g.: C:/Program Files (x86)/typo3/htdocs/typo3wamp/typo3temp/\abcD974.tmp
notice that "/\"
Why does this happen and how can it be solved? Shouldn't there only be \'s on a Windows computer?
OS: Windows Vista 64 Bit Ultimate
executables like csstidy.exe (see sf.net) don't work with such a filename
(issue imported from #M5352)
I have no such CPU here, so please debug, and make sure it's not a PHP problem.
1) Check what t3lib_div::tempnam() is doing
2) Paste the contents into a separate PHP file and try the same again
3) As you will see, the PHP function tempnam() is simply called with a path prefix. So you should check how this path looks like...
I have found the position of the 'problem'..
In t3lib/class.t3lib_div.php there's the function function tempnam($filePrefix)
The function returns the path, including "typo3temp/"
PHP adds "\" and the filename.. So one slash comes from T3, the other from PHP. Maybe there should be a check, whether there's a slash in the PHP return..
Look here to see how tempnam() should work: http://ch2.php.net/tempnam
Especially watch the comment of "lreilly at lanl dot gov" at the end of the page.
To me this doesn't look like a TYPO3 issue at all..
right, but as M$ won't fix such a thing, it could be implemented into T3. As this seems to be a very important function of T3 it might be useful.. wouldn't it?
It's not a Microsoft bug, it rather seems like a PHP bug!
Resolved, no change required:
- No further feedback for a long time
- Not a TYPO3 bug
Please reopen if this still happens in recent TYPO3 & PHP & Win versions to investigate further.
- Status changed from Resolved to Closed
Also available in: Atom
PDF