[wp-trac] [WordPress Trac] #43047: WordPress does not allow UPLOADS to be an absolute path

WordPress Trac noreply at wordpress.org
Mon Jan 8 22:03:55 UTC 2018


#43047: WordPress does not allow UPLOADS to be an absolute path
--------------------------+-----------------------------
 Reporter:  issactrotts   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Upload        |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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)
 }}}

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


More information about the wp-trac mailing list