Merge pull request #1434 from marcosgdf/deprecated-code

Deprecated code
This commit is contained in:
Laurent Destailleur 2014-02-25 14:10:59 +01:00
commit c220d63c3e
2 changed files with 20 additions and 26 deletions

View File

@ -208,27 +208,25 @@ function IsImageValid( $filePath, $extension )
return -1; return -1;
} }
$imageCheckExtensions = array('gif', 'jpeg', 'jpg', 'png', 'swf', 'psd', 'bmp', 'iff'); $imageCheckExtensions = array(
'gif',
// version_compare is available since PHP4 >= 4.0.7 'jpeg',
if ( function_exists('version_compare') ) { 'jpg',
$sCurrentVersion = phpversion(); 'png',
if ( version_compare($sCurrentVersion, "4.2.0") >= 0 ) { 'swf',
$imageCheckExtensions[] = "tiff"; 'psd',
$imageCheckExtensions[] = "tif"; 'bmp',
} 'iff',
if ( version_compare($sCurrentVersion, "4.3.0") >= 0 ) { 'tiff',
$imageCheckExtensions[] = "swc"; 'tif',
} 'swc',
if ( version_compare($sCurrentVersion, "4.3.2") >= 0 ) { 'jpc',
$imageCheckExtensions[] = "jpc"; 'jp2',
$imageCheckExtensions[] = "jp2"; 'jpx',
$imageCheckExtensions[] = "jpx"; 'jb2',
$imageCheckExtensions[] = "jb2"; 'xbm',
$imageCheckExtensions[] = "xbm"; 'wbmp'
$imageCheckExtensions[] = "wbmp"; );
}
}
if (!in_array($extension, $imageCheckExtensions) ) { if (!in_array($extension, $imageCheckExtensions) ) {
return true; return true;

View File

@ -316,16 +316,12 @@ function dol_buildpath($path, $type=0)
* *
* @param object $object Object to clone * @param object $object Object to clone
* @return object Object clone * @return object Object clone
* @deprecated Dolibarr no longer supports PHP4, you can now use native function
*/ */
function dol_clone($object) function dol_clone($object)
{ {
dol_syslog("Functions.lib::dol_clone 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); $myclone=clone($object);
return $myclone; return $myclone;
} }