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;
}
$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;

View File

@ -316,16 +316,12 @@ function dol_buildpath($path, $type=0)
*
* @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)
{
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;
}