1.修复后台无法退出的bug

2.更新tp内核
This commit is contained in:
2016-09-12 10:21:09 +08:00
parent 0234fb3d95
commit 1f544d0d59
17 changed files with 274 additions and 213 deletions

View File

@@ -11,6 +11,7 @@
namespace think;
use think\File;
use think\Request;
use think\Session;
@@ -562,10 +563,10 @@ class Validate
$result = is_array($value);
break;
case 'file':
$result = $value instanceof \think\File;
$result = $value instanceof File;
break;
case 'image':
$result = $value instanceof \think\File && in_array($this->getImageType($value->getRealPath()), [1, 2, 3, 6]);
$result = $value instanceof File && in_array($this->getImageType($value->getRealPath()), [1, 2, 3, 6]);
break;
case 'token':
$result = $this->token($value, '__token__', $data);
@@ -629,7 +630,7 @@ class Validate
*/
protected function fileExt($file, $rule)
{
if (!($file instanceof \think\File)) {
if (!($file instanceof File)) {
return false;
}
if (is_string($rule)) {
@@ -656,7 +657,7 @@ class Validate
*/
protected function fileMime($file, $rule)
{
if (!($file instanceof \think\File)) {
if (!($file instanceof File)) {
return false;
}
if (is_string($rule)) {
@@ -683,7 +684,7 @@ class Validate
*/
protected function fileSize($file, $rule)
{
if (!($file instanceof \think\File)) {
if (!($file instanceof File)) {
return false;
}
if (is_array($file)) {
@@ -707,7 +708,7 @@ class Validate
*/
protected function image($file, $rule)
{
if (!($file instanceof \think\File)) {
if (!($file instanceof File)) {
return false;
}
$rule = explode(',', $rule);
@@ -946,7 +947,7 @@ class Validate
{
if (is_array($value)) {
$length = count($value);
} elseif ($value instanceof \think\File) {
} elseif ($value instanceof File) {
$length = $value->getSize();
} else {
$length = mb_strlen((string) $value);
@@ -973,7 +974,7 @@ class Validate
{
if (is_array($value)) {
$length = count($value);
} elseif ($value instanceof \think\File) {
} elseif ($value instanceof File) {
$length = $value->getSize();
} else {
$length = mb_strlen((string) $value);
@@ -992,7 +993,7 @@ class Validate
{
if (is_array($value)) {
$length = count($value);
} elseif ($value instanceof \think\File) {
} elseif ($value instanceof File) {
$length = $value->getSize();
} else {
$length = mb_strlen((string) $value);