Skip to content

Commit

Permalink
array数组在过滤null值错误问题
Browse files Browse the repository at this point in the history
使用`===` 过滤了空字符,但是忽略了  `null` 的问题

Fixed #35.
  • Loading branch information
helei112g committed Apr 22, 2017
1 parent bf406d5 commit c48c6e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Utils/ArrayUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static function paraFilter($para)
{
$paraFilter = [];
while (list($key, $val) = each($para)) {
if ($val === '' || is_null($val)) {
if ($val === '' || $val === null) {
continue;
} else {
if (! is_array($para[$key])) {
Expand Down Expand Up @@ -94,13 +94,13 @@ public static function createLinkstring($para)
}

reset($para);
$arg = "";
$arg = '';
while (list($key, $val) = each($para)) {
if (is_array($val)) {
continue;
}

$arg.=$key."=".urldecode($val)."&";
$arg.=$key.'='.urldecode($val).'&';
}
//去掉最后一个&字符
$arg = substr($arg, 0, count($arg) - 2);
Expand Down

0 comments on commit c48c6e1

Please sign in to comment.