Dotclear


Ignore:
Timestamp:
10/06/16 15:55:18 (9 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Parents:
3356:d298544918cd (diff), 3354:a9db771a5a70 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge fixes commited on stable 2.10 branch

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.media.php

    r3354 r3357  
    393393          } 
    394394 
    395           $media_dir = $this->relpwd ? $this->relpwd : '.'; 
     395          $media_dir = $this->relpwd ?: '.'; 
    396396 
    397397          $strReq = 
     
    660660     protected function rebuildDB($pwd) 
    661661     { 
    662           $media_dir = $pwd ? $pwd : '.'; 
     662          $media_dir = $pwd ?: '.'; 
    663663 
    664664          $strReq = 
     
    919919     public function getDBDirs() 
    920920     { 
    921           $media_dir = $this->relpwd ? $this->relpwd : '.'; 
     921          $media_dir = $this->relpwd ?: '.'; 
    922922 
    923923          $strReq = 
  • inc/core/class.dc.media.php

    r3340 r3357  
    943943          $zip = new fileUnzip($f->file); 
    944944          $zip->setExcludePattern($this->exclude_pattern); 
    945           $zip->getList(false,'#(^|/)(__MACOSX|\.svn|\.DS_Store|\.directory|Thumbs\.db)(/|$)#'); 
     945          $list = $zip->getList(false,'#(^|/)(__MACOSX|\.svn|\.DS_Store|\.directory|Thumbs\.db)(/|$)#'); 
    946946 
    947947          if ($create_dir) 
     
    968968          $zip->unzipAll($target); 
    969969          $zip->close(); 
     970 
     971          // Clean-up all extracted filenames 
     972          $clean = function ($name) { 
     973               $n = text::deaccent($name); 
     974               $n = preg_replace('/^[.]/u','',$n); 
     975               return preg_replace('/[^A-Za-z0-9._\-\/]/u','_',$n); 
     976          }; 
     977          foreach ($list as $zk => $zv) { 
     978               // Check if extracted file exists 
     979               $zf = $target.'/'.$zk; 
     980               if (!$zv['is_dir'] && file_exists($zf)) { 
     981                    $zt = $clean($zf); 
     982                    if ($zt != $zf) { 
     983                         rename($zf,$zt); 
     984                    } 
     985               } 
     986          } 
     987 
    970988          return dirname($f->relname).'/'.$destination; 
    971989     } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map