Skip to content

Commit

Permalink
fix media saving
Browse files Browse the repository at this point in the history
  • Loading branch information
PhieF committed Aug 13, 2023
1 parent d6e6c64 commit 35276ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Controller/NoteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ public function deleteMediaFromOpenNote($id){
* @NoCSRFRequired
*/
public function addMediaToOpenNote($id){
$path = $_POST['path'];
$this->waitEndOfExtraction($id);
$cache = $this->getCacheFolder();
$folder = $cache->get("currentnote".$id);
Expand Down Expand Up @@ -1001,7 +1002,7 @@ public function addMediaToOpenNote($id){
}
if(!isset($meta['media']))
$meta['media'] = array();
if(!in_array($meta['media'],$media))
if(!in_array($media, $meta['media']))
array_push($meta['media'],$media);
$cache->addToCache($path, $meta, $mtime, $text);

Expand Down

0 comments on commit 35276ff

Please sign in to comment.