Changeset 3357:9bbeb2691a23 for inc/core/class.dc.media.php
- Timestamp:
- 10/06/16 15:55:18 (9 years ago)
- 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. - Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.media.php
r3354 r3357 393 393 } 394 394 395 $media_dir = $this->relpwd ? $this->relpwd: '.';395 $media_dir = $this->relpwd ?: '.'; 396 396 397 397 $strReq = … … 660 660 protected function rebuildDB($pwd) 661 661 { 662 $media_dir = $pwd ? $pwd: '.';662 $media_dir = $pwd ?: '.'; 663 663 664 664 $strReq = … … 919 919 public function getDBDirs() 920 920 { 921 $media_dir = $this->relpwd ? $this->relpwd: '.';921 $media_dir = $this->relpwd ?: '.'; 922 922 923 923 $strReq = -
inc/core/class.dc.media.php
r3340 r3357 943 943 $zip = new fileUnzip($f->file); 944 944 $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)(/|$)#'); 946 946 947 947 if ($create_dir) … … 968 968 $zip->unzipAll($target); 969 969 $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 970 988 return dirname($f->relname).'/'.$destination; 971 989 }
Note: See TracChangeset
for help on using the changeset viewer.