Clean code
This commit is contained in:
parent
0b138167f6
commit
4e46c3f7a2
@ -8402,8 +8402,6 @@ abstract class CommonObject
|
|||||||
$photo = '';
|
$photo = '';
|
||||||
$file = $val['name'];
|
$file = $val['name'];
|
||||||
|
|
||||||
//if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
|
|
||||||
|
|
||||||
//if (dol_is_file($dir.$file) && image_format_supported($file) >= 0)
|
//if (dol_is_file($dir.$file) && image_format_supported($file) >= 0)
|
||||||
if (image_format_supported($file) >= 0) {
|
if (image_format_supported($file) >= 0) {
|
||||||
$nbphoto++;
|
$nbphoto++;
|
||||||
|
|||||||
@ -42,6 +42,34 @@
|
|||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
|
||||||
|
|
||||||
|
|
||||||
|
if (!function_exists('utf8_encode')) {
|
||||||
|
/**
|
||||||
|
* Implement utf8_encode for PHP that does not support it.
|
||||||
|
*
|
||||||
|
* @param mixed $elements PHP Object to json encode
|
||||||
|
* @return string Json encoded string
|
||||||
|
*/
|
||||||
|
function utf8_encode($elements)
|
||||||
|
{
|
||||||
|
return mb_convert_encoding($elements, 'UTF-8', 'ISO-8859-1');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!function_exists('utf8_decode')) {
|
||||||
|
/**
|
||||||
|
* Implement utf8_decode for PHP that does not support it.
|
||||||
|
*
|
||||||
|
* @param mixed $elements PHP Object to json encode
|
||||||
|
* @return string Json encoded string
|
||||||
|
*/
|
||||||
|
function utf8_decode($elements)
|
||||||
|
{
|
||||||
|
return mb_convert_encoding($elements, 'ISO-8859-1', 'UTF-8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return dolibarr global constant string value
|
* Return dolibarr global constant string value
|
||||||
* @param string $key key to return value, return '' if not set
|
* @param string $key key to return value, return '' if not set
|
||||||
|
|||||||
@ -2319,9 +2319,8 @@ class Ticket extends CommonObject
|
|||||||
if (is_resource($handle)) {
|
if (is_resource($handle)) {
|
||||||
while (($file = readdir($handle)) !== false) {
|
while (($file = readdir($handle)) !== false) {
|
||||||
if (!utf8_check($file)) {
|
if (!utf8_check($file)) {
|
||||||
$file = utf8_encode($file);
|
$file = utf8_encode($file); // To be sure data is stored in UTF8 in memory
|
||||||
}
|
}
|
||||||
// To be sure data is stored in UTF8 in memory
|
|
||||||
if (dol_is_file($dir.$file)) {
|
if (dol_is_file($dir.$file)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -885,7 +885,6 @@ if ($action == 'addcontainer' && $usercanedit) {
|
|||||||
} else {
|
} else {
|
||||||
// Clean some comment
|
// Clean some comment
|
||||||
//$tmpgeturl['content'] = dol_string_is_good_iso($tmpgeturl['content'], 1);
|
//$tmpgeturl['content'] = dol_string_is_good_iso($tmpgeturl['content'], 1);
|
||||||
//$tmpgeturl['content'] = utf8_encode(utf8_decode($tmpgeturl['content']));
|
|
||||||
//$tmpgeturl['content'] = mb_convert_encoding($tmpgeturl['content'], 'UTF-8', 'UTF-8');
|
//$tmpgeturl['content'] = mb_convert_encoding($tmpgeturl['content'], 'UTF-8', 'UTF-8');
|
||||||
//$tmpgeturl['content'] = remove_bs($tmpgeturl['content']);
|
//$tmpgeturl['content'] = remove_bs($tmpgeturl['content']);
|
||||||
//$tmpgeturl['content'] = str_replace('$screen-md-max', 'auto', $tmpgeturl['content']);
|
//$tmpgeturl['content'] = str_replace('$screen-md-max', 'auto', $tmpgeturl['content']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user