From e612a737fe2fbd2017d5f991e54dec4228a63d84 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 27 Apr 2021 13:43:38 +0000 Subject: [PATCH] wait #4428 @0.5 --- inc/ws/Controlleur/class.ws.flash.php | 8 ++------ inc/ws/Metier/class.ws.book.php | 4 ++-- inc/ws/Util/class.ws.util.php | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index da40f93fd..36b32541b 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -258,8 +258,8 @@ class wsFlash extends cubeFlashGateway public function uploadLinkContent() { global $core; - $daoBook=new wsDAOBook($core->con); - $book=$daoBook->selectById($this->args['book_id'] ); + $daoBook = new wsDAOBook($core->con); + $book = $daoBook->selectById($this->args['book_id']); foreach ($_FILES as $varname => $infos) { if ($infos['error']) { @@ -272,10 +272,6 @@ class wsFlash extends cubeFlashGateway $dir = ''; } - if ($dir != '') { - $dir = $dir . '/'; - } - $fname = cubeFiles::tidyName($infos['name']); $dir = $book->getAssetDir($dir); if (!file_exists($dir)) { diff --git a/inc/ws/Metier/class.ws.book.php b/inc/ws/Metier/class.ws.book.php index 7e4fd5a86..5049d22ee 100644 --- a/inc/ws/Metier/class.ws.book.php +++ b/inc/ws/Metier/class.ws.book.php @@ -98,7 +98,7 @@ class wsBook extends cubeMetier public function getThumbFile($page, $format) { - $thumbpdf = $this->getAssetDir(). $this->parametres->pdfThumbnails; + $thumbpdf = $this->getAssetDir() . $this->parametres->pdfThumbnails; if ($this->parametres->pdfThumbnails && file_exists($thumbpdf)) { return wsPDFConvert::getThumbFromPDF($thumbpdf, $page, $format); } @@ -112,7 +112,7 @@ class wsBook extends cubeMetier public function getAssetDirId() { - return $this->parametres->assetsDir === '' ? $this->book_id : trim($this->parametres->assetsDir); + return !$this->parametres->assetsDir ? $this->book_id : trim($this->parametres->assetsDir); } public static function getAssetDirOfBook($book_id, $sub = '') diff --git a/inc/ws/Util/class.ws.util.php b/inc/ws/Util/class.ws.util.php index 397f80f5b..6b97fd336 100644 --- a/inc/ws/Util/class.ws.util.php +++ b/inc/ws/Util/class.ws.util.php @@ -355,7 +355,7 @@ class wsUtil if ($book->parametres->pdfReplace) { - $replace = WS_BOOKS . '/working/' . $book->book_id . '/' . $book->parametres->pdfReplace; + $replace = $book->getAssetDir().$book->parametres->pdfReplace; if (file_exists($replace) && filesize($replace) > 0) { if (!file_exists($normalPDF) || filemtime($normalPDF) < filemtime($replace) || filesize($normalPDF) != filesize($replace)) { self::copy($replace, $normalPDF); -- 2.39.5