Skip to content

Commit 0e2d92b

Browse files
committed
some update
1 parent e1abd62 commit 0e2d92b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

example/PageRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function rules()
2121
['test', 'number', 'when' => function($data) {
2222
return isset($data['status']) && $data['status'] > 2;
2323
}],
24-
['userId', 'number', 'scene' => 'other' ],
24+
['userId', 'number', 'on' => 'other' ],
2525
// ['userId', function($value){ return false;}],
2626
];
2727
}

src/StrainerList.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public static function inputMulti($type, array $filters=[])
3030
*/
3131
public static function trim($var)
3232
{
33-
return trim((string)$var);
33+
return is_array($var) ? array_walk_recursive(function(&$val){
34+
$value = trim((string)$val);
35+
}, $var) : trim((string)$var);
3436
}
3537

3638
/**
@@ -243,4 +245,4 @@ public static function callback($var, $callback)
243245
return filter_var($var, FILTER_CALLBACK,['options' => $callback]);
244246
}
245247

246-
}
248+
}

0 commit comments

Comments
 (0)