]> _ Git - cubeextranet.git/commitdiff
wait #5013 @0.25
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 11 Jan 2022 11:15:57 +0000 (11:15 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 11 Jan 2022 11:15:57 +0000 (11:15 +0000)
inc/ws/Util/html5/master/class.ws.html5.links.php

index c07495b9dc14bae431ec5dd9a0cc091c9bc01dab..ed136ea2e9644b1aad6a0da49c2111e0e3d41dba 100644 (file)
@@ -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));