From e0a9a267e3d99bfbc308a0f965c7859a309915df Mon Sep 17 00:00:00 2001 From: printempw Date: Mon, 4 Apr 2016 08:37:40 +0800 Subject: [PATCH] remove slash if site_url is ended with slash --- admin/options.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/admin/options.php b/admin/options.php index f15c56ea..acb6a323 100644 --- a/admin/options.php +++ b/admin/options.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-03-18 22:50:25 * @Last Modified by: printempw - * @Last Modified time: 2016-04-03 20:58:06 + * @Last Modified time: 2016-04-04 08:36:45 */ require "../libraries/session.inc.php"; if (!$user->is_admin) Utils::redirect('../index.php?msg=看起来你并不是管理员'); @@ -36,6 +36,10 @@ $db = new Database\Database('users'); // pre-set user_can_register because it will not be posted if not checked if (!isset($_POST['user_can_register'])) $_POST['user_can_register'] = '0'; foreach ($_POST as $key => $value) { + // remove slash if site_url is ended with slash + if ($key == "site_url" && ereg("/$", $value)) { + $value = substr($value, 0, -1); + } if ($key != "option" && $key != "submit") { Option::set($key, $value); } @@ -56,7 +60,7 @@ $db = new Database\Database('users'); - + 站点地址(URL)