mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-07 10:08:27 +01:00
Qual: Make code simpler
This commit is contained in:
@@ -962,22 +962,11 @@ class CMailFile
|
|||||||
$this->html_images[$i]["name"] = $img;
|
$this->html_images[$i]["name"] = $img;
|
||||||
|
|
||||||
// Content type
|
// Content type
|
||||||
/*
|
if (preg_match('/^.+\.(\w{3,4})$/', $img, $reg))
|
||||||
* preg_replace /e modifier is deprecated in PHP 5.5
|
{
|
||||||
* but anonymous functions for use in preg_replace_callback are only available from 5.3.0
|
$ext=strtolower($reg[1]);
|
||||||
*/
|
|
||||||
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
|
|
||||||
$ext = preg_replace_callback(
|
|
||||||
'/^.*\.(\w{3,4})$/',
|
|
||||||
function ($m) {
|
|
||||||
return strtolower($m[1]);
|
|
||||||
},
|
|
||||||
$img
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$ext = preg_replace('/^.*\.(\w{3,4})$/e', 'strtolower("$1")', $img);
|
|
||||||
}
|
|
||||||
$this->html_images[$i]["content_type"] = $this->image_types[$ext];
|
$this->html_images[$i]["content_type"] = $this->image_types[$ext];
|
||||||
|
}
|
||||||
|
|
||||||
// cid
|
// cid
|
||||||
$this->html_images[$i]["cid"] = dol_hash(uniqid(time()));
|
$this->html_images[$i]["cid"] = dol_hash(uniqid(time()));
|
||||||
|
|||||||
Reference in New Issue
Block a user