Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2019-08-17 18:03:54 +0300
committerPhie <phie@phie.ovh>2019-08-17 18:03:54 +0300
commitb0c8de086f72791512b4776dc03eda46834c6750 (patch)
tree315f6d13c961ce55b0b026509a6cfcb2a5141501
parentef547dded8e7216c8c63b58a28abc227a8dff6e8 (diff)
don't crash when no metadata file
-rwxr-xr-xlib/Controller/NoteController.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php
index 9df37ae..006ef61 100755
--- a/lib/Controller/NoteController.php
+++ b/lib/Controller/NoteController.php
@@ -843,7 +843,9 @@
file_put_contents($tmppath,$this->CarnetFolder->get($path)->fopen("r"));
$zipFile = new MyZipFile();
$zipFile->openFile($tmppath);
- $data['metadata'] = json_decode($zipFile['metadata.json']);
+ try{
+ $data['metadata'] = json_decode($zipFile['metadata.json']);
+ } catch(\PhpZip\Exception\ZipNotFoundEntry $e){}
$data['html'] = $zipFile['index.html'];
unlink($tmppath);
shell_exec('php occ carnet:opennote '.escapeshellarg($this->userId).' '.escapeshellarg($path).' '.escapeshellarg($editUniqueID).'> /dev/null 2>/dev/null &');