From: vincent@cubedesigners.com Date: Tue, 11 Jan 2022 11:15:57 +0000 (+0000) Subject: wait #5013 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1a09a1031883aa7bf3e3ab374f9c35c3b0ada51b;p=cubeextranet.git wait #5013 @0.25 --- diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index c07495b9d..ed136ea2e 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -410,9 +410,9 @@ class wsHTML5Link protected static function _isScormLink($url) { - if (strpos($url, 'http://') !==false || strpos($url, 'https://') !==false) { - $res= false; - }else { + if (strpos($url, 'http://') !== false || strpos($url, 'https://') !== false) { + $res = false; + } else { $res = stristr($url, 'scorm'); } return $res; @@ -3095,14 +3095,15 @@ class articlePDFLink extends articleLink array_pop($e); $name = implode('.', $e); $pdffile = $this->wdir . $this->to; + $mtime = filemtime($pdffile); $htmlfile = $this->wdir . $name . '.html'; - if (!file_exists($htmlfile)) { + if (!file_exists($htmlfile) || filemtime($htmlfile) < $mtime) { $cmd = "pdftotext -f 1 -l 1 -htmlmeta $pdffile $htmlfile"; `$cmd`; } $infosfile = $this->wdir . $name . '.nfo'; - if (!file_exists($infosfile)) { + if (!file_exists($infosfile) || filemtime($infosfile) < $mtime) { $i = `pdfinfo -f 1 -l 1 -box $pdffile`; if (preg_match('/Page\s+1\s+size:\s+([0-9\.]+) x ([0-9\.]+)/', $i, $matches)) { $infos = ['width' => $matches[1], 'height' => $matches[2]]; @@ -3115,7 +3116,7 @@ class articlePDFLink extends articleLink $cut = $this->wdir . $name . '.c.pdf'; $size = $this->wdir . $name . '.s.pdf'; $sinfos = $this->wdir . $name . '.s.nfo'; - if (!file_exists($cut) || !file_exists($size) || !file_exists($sinfos) || filesize($sinfos) === 0) { + if (!file_exists($cut) || !file_exists($size) || !file_exists($sinfos) || filesize($sinfos) === 0 || filemtime($size) < $mtime) { // Cut the pdf in many pages $ratio = $infos->width / $infos->height; $nb = max(1, ceil(0.707071 / $ratio));