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

+ 3 - 3
lib/Store/Core.php

@@ -163,7 +163,7 @@ class Core
 	 */
 	private function check_size()
 	{
-		if (!$this->limit && !$this->base64 && ($this->ext == '.jpg' || $this->ext == '.gif' || $this->ext == '.png')) {
+		if (!$this->limit && !$this->base64 && ($this->ext == '.jpg' || $this->ext == '.gif' || $this->ext == '.png') && is_file($this->data['file']['tmp_name'])) {
 			$this->limit = getimagesize($this->data['file']['tmp_name']);
 		}
 
@@ -176,10 +176,10 @@ class Core
 			if (($size < $this->data['file']['size']) && $size > 0) {
 				$this->output['status'] = -1;
 				$this->output['message'] = '文件不能超过'.(($size/1024)/1024).'MB';
-			} elseif ($this->limit && $this->config['setwh'] == 2 && $this->limit[0] < $this->limit[1]) {
+			} elseif ($this->limit && isset($this->config['setwh']) && $this->config['setwh'] == 2 && $this->limit[0] < $this->limit[1]) {
 				$this->output['status'] = -1;
 				$this->output['message'] = '图片高度不能超过图片宽度';
-			} elseif ($this->limit && $this->config['setwh'] == 3 && $this->limit[0] > $this->limit[1]) {
+			} elseif ($this->limit && isset($this->config['setwh']) &&  $this->config['setwh'] == 3 && $this->limit[0] > $this->limit[1]) {
 				$this->output['status'] = -1;
 				$this->output['message'] = '图片宽度不能超过图片高度';
 			} elseif ($this->limit && $this->config['width'] > 0 && $this->config['width'] < $this->limit[0]) {