Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#43047 closed defect (bug) (duplicate)

WordPress does not allow UPLOADS to be an absolute path

Reported by: issactrotts's profile issactrotts Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: Upload Keywords:
Focuses: Cc:

Description

The environment where I'm running WordPress does not allow writing to the app's directory tree after it has been deployed. However /tmp is writable, so I tried putting this line in my wp-config.php:

define('UPLOADS', '/tmp');

It didn't work though because WordPress prepends ABSPATH to it. Here are the places where that happens in the WordPress source code:

$ git clone https://github.com/WordPress/WordPress.git
$ grep -n '\$dir = .*UPLOADS' $(find . -name \*.php)
./wp-includes/functions.php:2033:               $dir = ABSPATH . UPLOADS;
./wp-includes/functions.php:2077:                               $dir = ABSPATH . UPLOADS;

Currently I'm working around this by running the following perl one-liner on the WordPress sources:

perl -pi -e 's/ABSPATH \. UPLOADS/UPLOADS/g' $(find wordpress -name \*.php)

Change History (2)

#1 @issactrotts
8 years ago

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

Duplicate of #37743.

#2 @dd32
8 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.