dever 4 gadi atpakaļ
vecāks
revīzija
c461490a2d
1 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. 8 2
      lib/Store/Core.php

+ 8 - 2
lib/Store/Core.php

@@ -424,8 +424,14 @@ class Core
 			$info = Dever::db('upload/file')->one(array('name' => $this->name, 'upload' => $this->data['key']));
 			if ($info && $info['file'] && strstr($info['file'], $this->name)) {
 				# 如果存在,直接使用旧文件
-				$temp = explode($this->name, $info['file']);
-				$this->path = $temp[0];
+				if (strstr($info['file'], 'http')) {
+					$config = parse_url($info['file']);
+				} else {
+					$config['path'] = $info['file'];
+				}
+				
+				$temp = explode($this->name, $config['path']);
+				$this->path = ltrim($temp[0], '/');
 			}
 		}