]> _ Git - cubeextranet.git/commitdiff
wait #5110 @1.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 17 Feb 2022 17:09:04 +0000 (17:09 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 17 Feb 2022 17:09:04 +0000 (17:09 +0000)
inc/ws/Metier/class.ws.document.php

index 4e637c18df3b6d93da35b0105c4f9c7cf410ac78..0fbb8911a9177cd4b5e90bf38ae7f85346552778 100644 (file)
@@ -431,7 +431,7 @@ class wsDocument extends cubeMetier
     public function getFile($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $version = 'html', $force = false)
     {
         $this->getFilesData();
-        $cacheKey = $page . '_' . $format . '_' . $resolution . '_' . ($withText ? '1' : '0') . '_' . ($withGraphics ? '1' : '0') . '_' . $version;
+        $cacheKey = md5($page . '||' . $format . '//' . $resolution . '""' . ($withText ? '1' : '0') . '---' . ($withGraphics ? '1' : '0') . '%%' . $version);
         if (!isset($this->filesdata[$cacheKey]) || $force) {
             $this->filesdata[$cacheKey] = $this->_getFile($page, $format, $resolution, $withText, $withGraphics, $version, $force);
         }
@@ -472,7 +472,6 @@ class wsDocument extends cubeMetier
                 $file = $dir . 'p' . $page . '.' . $format;
             } else {
                 $file = $dir . $prefix . $page . '-' . $resolution . '.' . $format;
-                $alt = $dir . $prefix . $resolution . '-' . $page . '.' . $format;
             }
         } else if ($format === 'swf') {
             $file = $dir . 'p' . $page . '.' . $format;
@@ -480,12 +479,7 @@ class wsDocument extends cubeMetier
 
         $do = false;
         if (!file_exists($file)) {
-            if (isset($alt) && file_exists($alt) && filesize($alt) > $minsize) {
-                rename($alt, $file);
-                $do = false;
-            } else {
-                $do = true;
-            }
+            $do = true;
         } else if (filesize($file) < $minsize) {
             $do = true;
         } else if (isset($reffile) && filemtime($file) < filemtime($reffile)) {