This bugtracker is archived (announcement). New tickets are created on github.com. See all framework issues, cms issues, and search the module listings for more specific bugtrackers.

Ticket #5547: 2.4.1-FileUpload-2.diff

File 2.4.1-FileUpload-2.diff, 1.4 KB (added by charden, 4 years ago)

Yet another patch to solve the problem, this time by removing the open_basedir-fix located in AssetAdmin?.

  • cms/code/AssetAdmin.php

    diff -Nur silverstripe-official/cms/code/AssetAdmin.php silverstripe-charden/cms/code/AssetAdmin.php
    old new  
    220220                        } 
    221221                 
    222222                        if($tmpFile['tmp_name']) { 
    223                                 // Workaround open_basedir problems 
    224                                 if(ini_get("open_basedir")) { 
    225                                         $newtmp = TEMP_FOLDER . '/' . $tmpFile['name']; 
    226                                         move_uploaded_file($tmpFile['tmp_name'], $newtmp); 
    227                                         $tmpFile['tmp_name'] = $newtmp; 
    228                                 } 
    229                                  
    230223                                // validate files (only if not logged in as admin) 
    231224                                if(!File::$apply_restrictions_to_admin && Permission::check('ADMIN')) { 
    232225                                        $valid = true; 
  • sapphire/filesystem/Folder.php

    diff -Nur silverstripe-official/sapphire/filesystem/Folder.php silverstripe-charden/sapphire/filesystem/Folder.php
    old new  
    247247                 
    248248                if (move_uploaded_file($tmpFile['tmp_name'], "$base/$file$ext")) { 
    249249                        // Update with the new image 
     250                        chmod("$base/$file$ext", Filesystem::$file_create_mask); 
    250251                        return $this->constructChild(basename($file . $ext)); 
    251252                } else { 
    252253                        if(!file_exists($tmpFile['tmp_name'])) user_error("Folder::addUploadToFolder: '$tmpFile[tmp_name]' doesn't exist", E_USER_ERROR);