#43047 closed defect (bug) (duplicate)
WordPress does not allow UPLOADS to be an absolute path
| Reported by: |
|
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)
Note: See
TracTickets for help on using
tickets.
Duplicate of #37743.