diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index a65d84eff..33c2e9d4d 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -834,12 +834,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "6ff84d044d7fa50c24736ac10a4d93384abe21c7" + "reference": "fdd8a98cc3538fecdea82378615ac65774100c62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/6ff84d044d7fa50c24736ac10a4d93384abe21c7", - "reference": "6ff84d044d7fa50c24736ac10a4d93384abe21c7", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/fdd8a98cc3538fecdea82378615ac65774100c62", + "reference": "fdd8a98cc3538fecdea82378615ac65774100c62", "shasum": "", "mirrors": [ { @@ -856,7 +856,7 @@ "ext-mbstring": "*", "topthink/framework": "^6.0" }, - "time": "2021-03-17T06:18:21+00:00", + "time": "2021-03-19T02:16:27+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index 7c33f6ec8..5ba5d6b19 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library', diff --git a/vendor/zoujingli/think-library/src/common.php b/vendor/zoujingli/think-library/src/common.php index c8b46f915..2757bbdd4 100644 --- a/vendor/zoujingli/think-library/src/common.php +++ b/vendor/zoujingli/think-library/src/common.php @@ -27,10 +27,11 @@ if (!function_exists('p')) { * @param mixed $data 输出的数据 * @param boolean $new 强制替换文件 * @param null|string $file 保存文件名称 + * @return false|int */ function p($data, $new = false, $file = null) { - SystemService::instance()->putDebug($data, $new, $file); + return SystemService::instance()->putDebug($data, $new, $file); } } if (!function_exists('auth')) { @@ -154,7 +155,10 @@ if (!function_exists('str2arr')) { $text = trim($text, $separ); $data = strlen($text) ? explode($separ, $text) : []; if (is_array($allow)) foreach ($data as $key => $item) { - if (!in_array($item, $allow) || $item === '') unset($data[$key]); + if (!in_array($item, $allow)) unset($data[$key]); + } + foreach ($data as $key => $item) { + if ($item === '') unset($data[$key]); } return $data; } @@ -170,7 +174,10 @@ if (!function_exists('arr2str')) { function arr2str(array $data, string $separ = ',', ?array $allow = null): string { if (is_array($allow)) foreach ($data as $key => $item) { - if (!in_array($item, $allow) || $item === '') unset($data[$key]); + if (!in_array($item, $allow)) unset($data[$key]); + } + foreach ($data as $key => $item) { + if ($item === '') unset($data[$key]); } return $separ . join($separ, $data) . $separ; }