Skip to content
This repository was archived by the owner on Jan 4, 2020. It is now read-only.

Commit e1934a8

Browse files
committed
Merge pull request #415 from Jaggle/master
对DefineFC 的修改做一点小小的改进:布尔值或者对象不应该被应用到$function上
2 parents 3ed6b77 + 787fc9a commit e1934a8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ThinkPHP/Library/Think/Controller/RestController.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ protected function encodeData($data, $type = '')
225225
/**************************************************************
226226
*
227227
* 使用特定function对数组中所有元素做处理
228-
* @param string &$array 要处理的字符串
228+
* @param string|array &$array 要处理的字符串或者数组
229229
* @param string $function 要执行的函数
230230
* @return boolean $apply_to_keys_also 是否也应用到key上
231231
* @access protected
@@ -240,7 +240,7 @@ protected function arrayRecursive(&$array, $function, $apply_to_keys_also = fals
240240
foreach ($array as $key => $value) {
241241
if (is_array($value)) {
242242
$this->arrayRecursive($array[$key], $function, $apply_to_keys_also);
243-
} else {
243+
} elseif(is_string($value)) {
244244
$array[$key] = $function($value);
245245
}
246246

0 commit comments

Comments
 (0)