#10224 closed enhancement (fixed)
wptempnam() returns odd filenames when urls have parameters
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.9 | Priority: | low |
Severity: | minor | Version: | 2.8 |
Component: | Filesystem API | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
it still works fine, but...
var_dump(wp_tempnam('http://foo.com/bar.zip?foo=bar&foo2=bar2')); // /path/to/wp-content/bar.zipfoobarfoo2bar2
Attachments (2)
Change History (9)
#2
@
16 years ago
What difference does it make with the file extension?
Chances are, If the url has url args, Its going to be a dynamic file anyway..
Its a temporary file.. It could be md5(time()) in reality
#3
@
16 years ago
- Keywords has-patch needs-review added; needs-patch removed
- Milestone changed from Future Release to 2.9
not much difference in practice, it's just ugly in the wp-content folder.
attached file makes them all .tmp
#4
@
16 years ago
attachment 10224.2.diff added
- My version of the patch
- Uses the .tmp file extension
- Converts 'http://./.../test.php?test' to 'test.tmp'
- Converts 'file.zip' to 'file.tmp'
not much difference in practice, it's just ugly in the wp-content folder.
The temporary files should be deleted from the wp-content folder as well, So the end user shouldnt really ever see it..
#5
@
16 years ago
- Keywords commit added; needs-review removed
- Milestone changed from 2.9 to 2.8.1
- Version set to 2.8
Still, there probably are cases that we've missed where they're not deleted. This would be nice to have in 2.8.1.
Note: See
TracTickets for help on using
tickets.
we might want to change sanitize_filename in such a way that when a ? is encountered, it turns the likes of bar.zip?foo=bar&foo2=bar2 into bar.foo.bar.foo2.bar2.zip. That way we at least get the extension right.