From 6544175cf291d500d8bac386b7bc2aa39cfdf79a Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Thu, 22 Dec 2016 16:50:45 +0100 Subject: [PATCH 1/3] prevent error with realpath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if some bad caracters are present in the name of file ( ° by exemple) --- htdocs/core/lib/images.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 9cf745a0da0..201394612bc 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -78,6 +78,9 @@ function dol_getImageSize($file, $url = false) if (!$url) { $fichier = realpath($file); // Chemin canonique absolu de l'image + // if problem with realpath + if ($fichier == false) + return $ret; $dir = dirname($file); // Chemin du dossier contenant l'image } From ed5ac9c6179d9851902cac4648c89c34f765c7aa Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 23 Dec 2016 07:11:35 +0100 Subject: [PATCH 2/3] Update images.lib.php --- htdocs/core/lib/images.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 201394612bc..2fe99bf779a 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -77,7 +77,7 @@ function dol_getImageSize($file, $url = false) $fichier = $file; if (!$url) { - $fichier = realpath($file); // Chemin canonique absolu de l'image + $fichier = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image // if problem with realpath if ($fichier == false) return $ret; From 972a31ebe9f9728336597c13f14472ebf04a52ab Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Thu, 12 Jan 2017 16:03:07 +0100 Subject: [PATCH 3/3] Update images.lib.php in fact $dir is not used in the function --- htdocs/core/lib/images.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 2fe99bf779a..e3121745300 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -81,7 +81,6 @@ function dol_getImageSize($file, $url = false) // if problem with realpath if ($fichier == false) return $ret; - $dir = dirname($file); // Chemin du dossier contenant l'image } $infoImg = getimagesize($fichier); // Recuperation des infos de l'image