From ee73a638ba8e20def202ec7cade2c24177d36c5a Mon Sep 17 00:00:00 2001 From: joyqi Date: Sat, 21 Dec 2013 09:58:26 +0800 Subject: [PATCH] fixed #142 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 尼玛,写反了。。。 --- var/Typecho/Validate.php | 3 ++- var/Widget/Options/General.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/var/Typecho/Validate.php b/var/Typecho/Validate.php index f186c0d9..f5e8fab0 100644 --- a/var/Typecho/Validate.php +++ b/var/Typecho/Validate.php @@ -110,7 +110,8 @@ class Typecho_Validate // Cycle through the rules and test for errors foreach ($rules as $key => $rules) { $this->_key = $key; - $data[$key] = (0 == strlen($data[$key])) ? NULL : $data[$key]; + $data[$key] = (is_array($data[$key]) ? 0 == count($data[$key]) + : 0 == strlen($data[$key])) ? NULL : $data[$key]; foreach ($rules as $params) { $method = $params[0]; diff --git a/var/Widget/Options/General.php b/var/Widget/Options/General.php index 66c69705..5d0bced3 100644 --- a/var/Widget/Options/General.php +++ b/var/Widget/Options/General.php @@ -148,7 +148,7 @@ class Widget_Options_General extends Widget_Abstract_Options implements Widget_I } $settings = $this->request->from('title', 'siteUrl', 'description', 'keywords', 'allowRegister', 'timezone', 'attachmentTypes'); - $settings['siteUrl'] = rtrim('/', $settings['siteUrl']); + $settings['siteUrl'] = rtrim($settings['siteUrl'], '/'); $attachmentTypes = array(); if ($this->isEnableByCheckbox($settings['attachmentTypes'], '@image@')) {