From 736453ff330e81b1d4af92bee1925a668df8a91a Mon Sep 17 00:00:00 2001 From: Chaim Date: Sat, 8 Aug 2020 16:18:22 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E9=97=A8=E9=9D=A2=E5=A2=9E=E5=8A=A0=E6=95=B0=E7=BB=84=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=A9=BA=E6=A0=BC=E5=87=BD=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ src/common.php | 2 +- src/helper/Arrays.php | 14 +++++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afa7671..ffe7099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v6.0.105 / 2020-08-08 +- 修复数组门面增加数组删除空格函数问题 + ## v6.0.104 / 2020-08-05 - 修复数组门面增加数组删除空格函数问题 diff --git a/src/common.php b/src/common.php index da0e9c0..9cc18f4 100644 --- a/src/common.php +++ b/src/common.php @@ -26,7 +26,7 @@ use think\db\exception\DbException; /** * 定义当前版本 */ -const VERSION = '6.0.104'; +const VERSION = '6.0.105'; if (!function_exists('get_ip_info')) { /** diff --git a/src/helper/Arrays.php b/src/helper/Arrays.php index 8f607ba..f0fd9f2 100644 --- a/src/helper/Arrays.php +++ b/src/helper/Arrays.php @@ -134,9 +134,21 @@ class Arrays if (is_array($value)) { $arr[$key] = $this->TrimArray($value); } else { - $arr[$key] = (new Strings)->trimAll(trim($value)); + $arr[$key] = $this->trimAll(trim($value)); } } return $arr; } + + /** + * 字符串删除空格 + * @param $str + * @return string|string[] + */ + private function trimAll($str) + { + $oldchar = array(" ", " ", "\t", "\n", "\r"); + $newchar = array("", "", "", "", ""); + return str_replace($oldchar, $newchar, $str); + } } -- GitLab