From caab1c20526b57b6eafe3d738c877cf04ae2d071 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 6 Feb 2019 16:38:06 +0000 Subject: [PATCH] fix #2584 @5 --- inc/ws/Controlleur/class.ws.flash.php | 8 +++++--- inc/ws/DAO/class.ws.dao.book.php | 9 ++++++++- inc/ws/DAO/class.ws.dao.document.php | 8 +++++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 21573451b..ece710c01 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -658,11 +658,11 @@ class wsFlash extends cubeFlashGateway if ($p->$param != '') { if ($specialName != 'archives') { $themeRoot = WS_THEMES . '/' . $theme->theme_id . '/'; - $dim = getimagesize($themeRoot . $p->$param); + $dim = CubeIT_Image::getimagesize($themeRoot . $p->$param); $url = 'https://' . $_SERVER['HTTP_HOST'] . WEBROOT . '/fluidbook/themes/' . $theme->theme_id . '/' . $p->$param; } else { $bookRoot = WS_BOOKS . '/working/' . $book->book_id . '/'; - $dim = getimagesize($bookRoot . $p->$param); + $dim = CubeIT_Image::getimagesize($bookRoot . $p->$param); $url = 'https://' . $_SERVER['HTTP_HOST'] . WEBROOT . '/fluidbook/books/working/' . $book->book_id . '/' . $p->$param; } @@ -682,10 +682,12 @@ class wsFlash extends cubeFlashGateway { global $core; + $this->outputXML = false; + $comments = isset($this->args['comments']) ? $this->args['comments'] : 'Saved from editor'; $dao = new wsDAODocument($core->con); - $dao->setLinksAndRulers($this->args['book_id'], $this->args['links'], $this->args['rulers'], $comments, $core->user->utilisateur_id); + $dao->setLinksAndRulers($this->args['book_id'], $this->args['links'], $this->args['rulers'], $comments, $core->user->utilisateur_id, false); $daoBook = new wsDAOBook($core->con); $daoBook->setSpecialLinksAndRulers($this->args['book_id'], $this->args['specialLinks'], $this->args['specialRulers']); diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 3c9165517..cf7049df0 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -615,7 +615,13 @@ class wsDAOBook extends commonDAO $rulers = json_encode(json_decode($rulers, false)); } - $links = wsLinks::encryptLinks($links); + + echo '1 : ' . print_r($links) . "
"; + + $links = wsLinks::encryptLinks(json_decode($links)); + + echo '2 : ' . print_r($links) . "
"; + if (is_array($links)) { $links = json_encode($links); @@ -624,6 +630,7 @@ class wsDAOBook extends commonDAO $rulers = json_encode($rulers); } + echo '3 : ' . $links . "
"; $c1->links = $c->specialLinks = $links; $c1->rulers = $c->specialRulers = $rulers; diff --git a/inc/ws/DAO/class.ws.dao.document.php b/inc/ws/DAO/class.ws.dao.document.php index 64cb80e0b..d65454a4e 100644 --- a/inc/ws/DAO/class.ws.dao.document.php +++ b/inc/ws/DAO/class.ws.dao.document.php @@ -116,7 +116,7 @@ class wsDAODocument extends commonDAO return implode("\n", $log); } - public function setLinksAndRulers($book_id, $links, $rulers, $comments = '', $user = 0) + public function setLinksAndRulers($book_id, $links, $rulers, $comments = '', $user = 0, $handleSpecials = true) { $daoBook = new wsDAOBook($this->con); $pages = $daoBook->getPagesOfBook($book_id, false); @@ -167,7 +167,7 @@ class wsDAODocument extends commonDAO $specialRulers = array(); foreach ($t as $page => $tt) { - if (!is_int($page)) { + if (!is_int($page) && $handleSpecials) { if (isset($tt['links'])) { $specialLinks = array_merge($specialLinks, $tt['links']); } @@ -202,7 +202,9 @@ class wsDAODocument extends commonDAO foreach ($links as $document_id => $dummy) { wsLinks::setDocumentLinks($document_id, json_encode($links[$document_id]), json_encode($rulers[$document_id]), $user, $comments, TIME); } - $daoBook->setSpecialLinksAndRulers($book_id, $specialLinks, $specialRulers); + if ($handleSpecials) { + $daoBook->setSpecialLinksAndRulers($book_id, $specialLinks, $specialRulers); + } $c = $this->con->openCursor('books'); $c->changedate = TIME; -- 2.39.5