*/
public static function createSocialImage($fluidbook, $force = false)
{
+ if ($fluidbook->getPagesNumber() === 0) {
+ return false;
+ }
+
$id = $fluidbook->id;
$wid = $fluidbook->getAssetDir() . '/';
* @return array
* @throws \Exception
*/
- public static function getSocialImageSize($fluidbook, $image=null)
+ public static function getSocialImageSize($fluidbook, $image = null)
{
- $socialImage = self::socialImagePath($fluidbook->id,$image);
+ $socialImage = self::socialImagePath($fluidbook->id, $image);
if (!file_exists($socialImage)) {
return null;
}
{
PHP::neverStop(false);
+ if ($fluidbook->getPagesNumber() === 0) {
+ abort(404, __('Cette publication ne comporte aucune page'));
+ }
+
$isScorm = $version === 'scorm';
$dest = $fluidbook->getFinalPath($theme, $isScorm);
if ($page < 1) {
$page = 1;
}
+ if ($page > $this->getPagesNumber()) {
+ return null;
+ }
return self::_getDocument($this->getComposition()[$page][0]);
}
$page = 1;
}
$document = $this->getDocument($page);
+ if(null===$document){
+ return null;
+ }
return $document->getPageSize($this->getComposition()[$page][1]);
}