[wp-trac] [WordPress Trac] #34938: Allow filtering the temporary file name generated by wp_tempnam

WordPress Trac noreply at wordpress.org
Wed Dec 9 16:35:49 UTC 2015


#34938: Allow filtering the temporary file name generated by wp_tempnam
-------------------------+-----------------------------
 Reporter:  mihaimihai   |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  HTTP API     |    Version:  4.4
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The wp_tempnam() function is located in wp-admin/includes/file.php

 When you use download_url() to download a zip file from a url that has
 many GET parameters

 e.g. http://example.com/?arg1=val1&arg2=val2&arg3=val3 ...... argn=valn,

 wp_tmpnam() will generate a name for the temporary file from the list of
 args.

 e.g. arg1val1arg2val2arg3val3......argn=valn.tmp

 If this is long enough, on an Windows environment, it can weigh a lot to
 the limitation of maximum 256 chars for a path.

 When copying the contents of the zip file to the wp-content/upgrade folder
 for instance if the path of the WordPress install + the folder name + any
 path inside the zip file is longer then 256 chars an error will occur.
 "Could not create directory"

 Suggestion: allow the returned value of wp_tempnam() to be filtered. This
 will help with avoiding the long path issue with Windows

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34938>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list