diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-04-29 02:23:29 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-04-29 02:23:29 +0200 |
commit | 7370dee913a63a2f7d4bc09bd4e5605eac2eb382 (patch) | |
tree | 950a1fc6997daf4a3e3aae778ca3ed6f7f835ede /app/class | |
parent | 3075127e848150da8b8d19b45325460346c415c6 (diff) | |
download | wcms-7370dee913a63a2f7d4bc09bd4e5605eac2eb382.tar.gz wcms-7370dee913a63a2f7d4bc09bd4e5605eac2eb382.zip |
fix bookmark construction in user
fix colortag file creation
by fixing fn access media
Diffstat (limited to 'app/class')
-rw-r--r-- | app/class/Modelmedia.php | 4 | ||||
-rw-r--r-- | app/class/User.php | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/app/class/Modelmedia.php b/app/class/Modelmedia.php index 4da7707..89a2305 100644 --- a/app/class/Modelmedia.php +++ b/app/class/Modelmedia.php @@ -376,9 +376,13 @@ class Modelmedia extends Model { try { accessfile($oldname); + accessfile($newname); } catch (InvalidArgumentException $e) { throw new InvalidArgumentException($e->getMessage()); } + if (!file_exists($oldname)) { + throw new InvalidArgumentException("File : $oldname does not exist"); + } return rename($oldname, $newname); } } diff --git a/app/class/User.php b/app/class/User.php index efd89ae..e78c10c 100644 --- a/app/class/User.php +++ b/app/class/User.php @@ -202,9 +202,13 @@ class User extends Item if (is_array($bookmark)) { $bookmark = array_map( function ($datas) { - try { - return new Bookmark($datas); - } catch (RuntimeException $e) { + if (is_array($datas)) { + try { + return new Bookmark($datas); + } catch (RuntimeException $e) { + return false; + } + } else { return false; } }, |