From 0b4c9569216c251d8561e5c0830d4594e9b09103 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 25 Oct 2022 17:37:37 +0000 Subject: [PATCH] wait #5494 @1 --- inc/ws/Controlleur/class.ws.flash.php | 11 +++++++++++ inc/ws/Metier/class.ws.document.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index cac91a883..e390f6107 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -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; diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 83b3d83d9..b49badb6e 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -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; } -- 2.39.5