From d69939b7b1190c7c13cf605e763ad6bc8c3860c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 25 Feb 2014 04:27:36 +0100 Subject: [PATCH 1/3] Function dol_clone is now a deprecated function --- htdocs/core/lib/functions.lib.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3e73d4320c3..f5e41ae9e8d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -314,6 +314,7 @@ function dol_buildpath($path, $type=0) * Create a clone of instance of object (new instance with same properties) * This function works for both PHP4 and PHP5 * + * @deprecated Dolibarr no longer supports PHP4, you can now use native function * @param object $object Object to clone * @return object Object clone */ @@ -321,11 +322,6 @@ function dol_clone($object) { dol_syslog("Functions.lib::dol_clone Clone object"); - // We create dynamically a clone function, making a = - if (version_compare(phpversion(), '5.0') < 0 && ! function_exists('clone')) - { - eval('function clone($object){return($object);}'); - } $myclone=clone($object); return $myclone; } From 4fe8e00601bc45dfc48efcd5cc80731f906f5ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 25 Feb 2014 04:29:34 +0100 Subject: [PATCH 2/3] Removed deprecated code --- .../filemanagerdol/connectors/php/util.php | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/htdocs/core/filemanagerdol/connectors/php/util.php b/htdocs/core/filemanagerdol/connectors/php/util.php index 4f479c1ce7b..d221c936fbf 100644 --- a/htdocs/core/filemanagerdol/connectors/php/util.php +++ b/htdocs/core/filemanagerdol/connectors/php/util.php @@ -208,27 +208,25 @@ function IsImageValid( $filePath, $extension ) return -1; } - $imageCheckExtensions = array('gif', 'jpeg', 'jpg', 'png', 'swf', 'psd', 'bmp', 'iff'); - - // version_compare is available since PHP4 >= 4.0.7 - if ( function_exists('version_compare') ) { - $sCurrentVersion = phpversion(); - if ( version_compare($sCurrentVersion, "4.2.0") >= 0 ) { - $imageCheckExtensions[] = "tiff"; - $imageCheckExtensions[] = "tif"; - } - if ( version_compare($sCurrentVersion, "4.3.0") >= 0 ) { - $imageCheckExtensions[] = "swc"; - } - if ( version_compare($sCurrentVersion, "4.3.2") >= 0 ) { - $imageCheckExtensions[] = "jpc"; - $imageCheckExtensions[] = "jp2"; - $imageCheckExtensions[] = "jpx"; - $imageCheckExtensions[] = "jb2"; - $imageCheckExtensions[] = "xbm"; - $imageCheckExtensions[] = "wbmp"; - } - } + $imageCheckExtensions = array( + 'gif', + 'jpeg', + 'jpg', + 'png', + 'swf', + 'psd', + 'bmp', + 'iff', + 'tiff', + 'tif', + 'swc', + 'jpc', + 'jp2', + 'jpx', + 'jb2', + 'xbm', + 'wbmp' + ); if (!in_array($extension, $imageCheckExtensions) ) { return true; From e963f555933754f9b745e83ea017b3479136db7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 25 Feb 2014 13:34:33 +0100 Subject: [PATCH 3/3] Corrected CS error --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f5e41ae9e8d..caad40910aa 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -314,9 +314,9 @@ function dol_buildpath($path, $type=0) * Create a clone of instance of object (new instance with same properties) * This function works for both PHP4 and PHP5 * - * @deprecated Dolibarr no longer supports PHP4, you can now use native function * @param object $object Object to clone * @return object Object clone + * @deprecated Dolibarr no longer supports PHP4, you can now use native function */ function dol_clone($object) {