WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 10 years ago

#6699 closed defect (bug) (fixed)

get_temp_dir() should be more flexible

Reported by: RoyalKnight Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.5
Component: Administration Keywords: has-patch early
Focuses: Cc:
PR Number:

Description

Currently this function returns "/tmp/" even if there's another way to get the correct temp-path. So you should extend this function with "ini_get('upload_tmp_dir')" before you return "/tmp/" as the last way out. Of course it's possible to set "WP_TEMP_DIR" in config-file, but why don't do it the automatic way?

Attachments (1)

6699.diff (451 bytes) - added by Denis-de-Bernardy 10 years ago.

Download all attachments as: .zip

Change History (10)

#1 @DD32
12 years ago

  • Keywords needs-patch added
  • Milestone set to 2.6

Setting to 2.6 as its a change which is needed, and while it does not yet have a patch, one will be along soon enough.

#2 @Denis-de-Bernardy
10 years ago

I'm pretty certain there's a dup of this one somewhere.

#4 @Denis-de-Bernardy
10 years ago

  • Keywords has-patch 2nd-opinion added; needs-patch removed

#5 @sirzooro
10 years ago

On Windows usually there is no /tmp/ dir. You should check TEMP and TMP environment variables - if they exists, use them instead of returning /tmp.

#6 @Denis-de-Bernardy
10 years ago

true, but even now that part of the function never gets used, as far as I can tell.

#7 @ryan
10 years ago

  • Milestone changed from 2.9 to 3.0

Punting from 2.9 but marking for early 3.0 so we don't overlook this one again. Seems like a good fix.

#8 @dd32
10 years ago

  • Keywords early added; 2nd-opinion removed

#9 @automattor
10 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [12519]) Check upload_tmp_dir ini settings for a usable temporary path. Props Denis-de-Bernardy. fixes #6699

Note: See TracTickets for help on using tickets.