]> _ Git - cubeextranet.git/commitdiff
wait #5494 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 25 Oct 2022 17:37:37 +0000 (17:37 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 25 Oct 2022 17:37:37 +0000 (17:37 +0000)
inc/ws/Controlleur/class.ws.flash.php
inc/ws/Metier/class.ws.document.php

index cac91a883a7d60850eb8dfda54cd65f8c0c0c7ff..e390f610726be3eb9b6f8533a783e096266d307c 100644 (file)
@@ -242,6 +242,7 @@ class wsFlash extends cubeFlashGateway
                 mkdir($dir, 0777, true);
             }
             $dest = $dir . $fname;
+            $this->_rmSymLink($dest);
             move_uploaded_file($infos['tmp_name'], $dest);
             if (stripos($dir, 'commerce') === false) {
                 switch (strtolower(files::getExtension($dest))) {
@@ -256,6 +257,9 @@ class wsFlash extends cubeFlashGateway
                         $orig = str_replace('.svg', '.o.svg', $dest);
                         rename($dest, $orig);
                         $png = str_replace('.svg', '.png', $dest);
+                        $this->_rmSymLink($orig);
+                        $this->_rmSymLink($dest);
+                        $this->_rmSymLink($png);
                         `/usr/local/bin/svgcleaner $orig $dest`;
                         if (!file_exists($dest)) {
                             copy($orig, $dest);
@@ -272,6 +276,13 @@ class wsFlash extends cubeFlashGateway
         }
     }
 
+    protected function _rmSymLink($path)
+    {
+        if (file_exists($path) && is_link($path)) {
+            unlink($path);
+        }
+    }
+
     public function testDocuments()
     {
         global $core;
index 83b3d83d96e0c4f9a10034ca7147d6842d32bb20..b49badb6e8bd9a6111d5cd6c1e936fc3add93293 100644 (file)
@@ -520,7 +520,7 @@ class wsDocument extends cubeMetier
     public static function isFarmUser()
     {
         global $core;
-        $farmTesters = [1, 2, 3, 5];
+        $farmTesters = [1, 2, 3, 5, 446, 4135];
         if (!$core->user) {
             return false;
         }