From: vincent@cubedesigners.com Date: Thu, 4 Oct 2018 10:03:02 +0000 (+0000) Subject: fix #2287 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=89ca02127f7add3b51b27aac68bb635379e7643a;p=cubeextranet.git fix #2287 @1 --- diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index 9a798d35d..166f75029 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -350,7 +350,7 @@ class wsServices extends cubeFlashGateway } if (is_null($book)) { - return; + return false; } // Normalize range @@ -371,11 +371,11 @@ class wsServices extends cubeFlashGateway $baseDocument = $this->getPDFComplexBaseDocument($book); if (!file_exists($baseDocument)) { - return; + return false; } if (!count($range)) { - return; + return false; } @@ -425,7 +425,7 @@ class wsServices extends cubeFlashGateway switch ($book->parametres->bookmarkUsePDF) { case 'download': - return WS_BOOKS . '/working/' . $book->book_id . '/' . $book->parametres->pdfName; + return WS_BOOKS . '/working/' . $book->book_id . '/' . $book->parametres->pdfReplace; break; case 'thumbnails': return WS_BOOKS . '/working/' . $book->book_id . '/' . $book->parametres->pdfThumbnails; @@ -473,6 +473,11 @@ class wsServices extends cubeFlashGateway $dest = $this->getPDFComplex($book, $this->args['range']); + if ($dest === false) { + http_response_code(404); + exit; + } + if (!$print) { // Return the url of the resulting pdf http::redirect($dest['url']);