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@')) {