Ticket #5984: 5984.userConfiguredTempDir.diff

File 5984.userConfiguredTempDir.diff, 1.1 kB (added by hansengel, 9 months ago)

Allows user to set value of const WPTEMPDIR in wp-config.php

  • wp-config-sample.php

    old new  
    2121// to enable German language support. 
    2222define ('WPLANG', ''); 
    2323 
     24// WordPress wil store temporary files in this directory. Using an empty 
     25// directory is recommended. 
     26define('WPTEMPDIR', '/tmp'); 
     27 
    2428/* That's all, stop editing! Happy blogging. */ 
    2529 
    2630define('ABSPATH', dirname(__FILE__).'/'); 
  • wp-admin/includes/file.php

    old new  
    182182        if( ! $url ) 
    183183                return false; 
    184184 
    185         $tmpfname = tempnam('/tmp', 'wpupdate'); 
     185        $tmpfname = tempnam(WPTEMPDIR, 'wpupdate'); 
    186186        if( ! $tmpfname ) 
    187187                return false; 
    188188 
     
    288288} 
    289289 
    290290function get_filesystem_method() { 
    291         $tempFile = tempnam('/tmp', 'WPU'); 
     291        $tempFile = tempnam(WPTEMPDIR, 'WPU'); 
    292292 
    293293        if ( getmyuid() == fileowner($tempFile) ) { 
    294294                unlink($tempFile);