Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#6073 closed defect (bug) (fixed)

wp_upload_dir() produces incorrect URL if upload_path is empty

Reported by: tellyworth Owned by:
Milestone: 2.5 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:


There was a bug in the patch at #5953. If the upload_path option is empty, it produces attachment URLs like http://example.com//2008/03/foo.jpg instead of http://example.com/wp-content/uploads/2008/03/foo.jpg. The filesystem path is correct, just the URL is broken. The enclosed patch fixes it.

I added a new unit test for the specific case, test_upload_dir_empty():


Attachments (1)

wp_upload_dir_bug-r7133.patch (1.0 KB) - added by tellyworth 8 years ago.

Download all attachments as: .zip

Change History (2)

#1 @DD32
8 years ago

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

Fixed in:

[7134] Deal correctly with empty upload_path option. Hat tip: tellyworth.

Note: See TracTickets for help on using tickets.