Browse Source

improve array save

master
filesite 6 months ago
parent
commit
c2825f2a88
  1. 7
      plugins/Common.php

7
plugins/Common.php

@ -219,7 +219,13 @@ Class Common {
if (self::isMyFavDir($friends_cellphone, $current_username, $share_dir)) {return false;} if (self::isMyFavDir($friends_cellphone, $current_username, $share_dir)) {return false;}
$friends_dirs = self::getMyDirs($friends_cellphone, $current_username); $friends_dirs = self::getMyDirs($friends_cellphone, $current_username);
$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_diff($friends_dirs, array($share_dir));
$dirs_after_delete = array_values($dirs_after_delete);
}else {
return true;
}
try { try {
$my_id = self::getUserId($friends_cellphone); $my_id = self::getUserId($friends_cellphone);
@ -345,6 +351,7 @@ Class Common {
if (file_exists($cache_filename)) { if (file_exists($cache_filename)) {
$mapContent = file_get_contents($cache_filename); $mapContent = file_get_contents($cache_filename);
$map = json_decode($mapContent); $map = json_decode($mapContent);
$map = array_values($map);
} }
} }

Loading…
Cancel
Save