diff --git a/plugins/Common.php b/plugins/Common.php index 6fe3c11..5714635 100644 --- a/plugins/Common.php +++ b/plugins/Common.php @@ -222,7 +222,6 @@ Class Common { $dirs_after_delete = $friends_dirs; if (in_array($share_dir, $friends_dirs)) { $dirs_after_delete = array_diff($friends_dirs, array($share_dir)); - $dirs_after_delete = array_values($dirs_after_delete); }else { return true; } @@ -333,6 +332,16 @@ Class Common { return $username; } + public static function dictToArray($dict) { + $arr = array(); + + foreach($dict as $key => $value) { + array_push($arr, $value); + } + + return $arr; + } + //从自己的目录里获取收藏夹映射关系 //返回:数组 public static function getMyDirs($cellphone, $username){ @@ -351,7 +360,9 @@ Class Common { if (file_exists($cache_filename)) { $mapContent = file_get_contents($cache_filename); $map = json_decode($mapContent); - $map = array_values($map); + if (is_object($map)) { + $map = self::dictToArray($map); + } } }