From 8a022fb19db8ef2abb7af18408ee3ef28ad02ed2 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 15 Jul 2016 16:58:26 +0200 Subject: [PATCH 1/4] NEW Do not use Function Aliases --- dev/initdata/import-products.php | 3 ++- dev/initdata/import-thirdparties.php | 3 ++- dev/initdata/import-users.php | 3 ++- dev/initdata/purge-data.php | 8 ++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php index 3c467fbfff5..a08e3b6066e 100755 --- a/dev/initdata/import-products.php +++ b/dev/initdata/import-products.php @@ -1,6 +1,7 @@ #!/usr/bin/env php + * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -56,7 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".join(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',',$argv)); $mode = $argv[1]; $filepath = $argv[2]; diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php index 199807473f8..08ad248ecc0 100755 --- a/dev/initdata/import-thirdparties.php +++ b/dev/initdata/import-thirdparties.php @@ -1,6 +1,7 @@ #!/usr/bin/env php + * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -56,7 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".join(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',',$argv)); $mode = $argv[1]; $filepath = $argv[2]; diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php index 355f41e9886..3aaa9c11a4a 100755 --- a/dev/initdata/import-users.php +++ b/dev/initdata/import-users.php @@ -1,6 +1,7 @@ #!/usr/bin/env php + * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -56,7 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".join(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',',$argv)); $mode = $argv[1]; $filepath = $argv[2]; diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 232ab1b5c41..f89a3ba2698 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -1,7 +1,7 @@ #!/usr/bin/env php - * + * Copyright (C) 2016 Juanjo Menent * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -146,7 +146,7 @@ $sqls=array( @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".join(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',',$argv)); $mode = $argv[1]; $option = $argv[2]; @@ -154,14 +154,14 @@ $option = $argv[2]; if (empty($mode) || ! in_array($mode,array('test','confirm'))) { print "Usage: $script_file (test|confirm) (all|option)\n"; print "\n"; - print "option can be ".join(',',array_keys($sqls))."\n"; + print "option can be ".implode(',',array_keys($sqls))."\n"; exit(-1); } if (empty($option) || ! in_array($option, array_merge(array('all'),array_keys($sqls))) ) { print "Usage: $script_file (test|confirm) (all|option)\n"; print "\n"; - print "option can be ".join(',',array_keys($sqls))."\n"; + print "option can be ".implode(',',array_keys($sqls))."\n"; exit(-1); } From 88d12618ce4ab69d830509e9d1e615337eae9d2a Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 15 Jul 2016 17:10:13 +0200 Subject: [PATCH 2/4] NEW Do not use Functions Aliases --- dev/skeletons/skeleton_class.class.php | 14 +++++++------- dev/skeletons/skeleton_list.php | 4 ++-- dev/translation/autotranslator.class.php | 2 +- dev/translation/sanity_check_en_langfiles.php | 7 ++++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index 2858e791ce8..080a2c5220e 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) ---Put here your own copyright and developer email--- @@ -116,7 +116,7 @@ class Skeleton_Class extends CommonObject if (!$resql) { $error ++; $this->errors[] = 'Error ' . $this->db->lasterror(); - dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); } if (!$error) { @@ -189,7 +189,7 @@ class Skeleton_Class extends CommonObject } } else { $this->errors[] = 'Error ' . $this->db->lasterror(); - dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); return - 1; } @@ -256,7 +256,7 @@ class Skeleton_Class extends CommonObject return $num; } else { $this->errors[] = 'Error ' . $this->db->lasterror(); - dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); return - 1; } @@ -301,7 +301,7 @@ class Skeleton_Class extends CommonObject if (!$resql) { $error ++; $this->errors[] = 'Error ' . $this->db->lasterror(); - dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); } if (!$error && !$notrigger) { @@ -362,7 +362,7 @@ class Skeleton_Class extends CommonObject if (!$resql) { $error ++; $this->errors[] = 'Error ' . $this->db->lasterror(); - dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); } } @@ -410,7 +410,7 @@ class Skeleton_Class extends CommonObject if ($result < 0) { $error ++; $this->errors = $object->errors; - dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); } // End diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php index f1413bb3712..4a2e26856dc 100644 --- a/dev/skeletons/skeleton_list.php +++ b/dev/skeletons/skeleton_list.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2014-2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -292,7 +292,7 @@ if ($resql) if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall); + print $langs->trans("FilterOnInto", $all) . implode(', ',$fieldstosearchall); } $moreforfilter = ''; diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index 584d3971b3f..47d6a25ec15 100644 --- a/dev/translation/autotranslator.class.php +++ b/dev/translation/autotranslator.class.php @@ -300,7 +300,7 @@ class autoTranslator //setting language pair $lang_pair = $src_lang.'|'.$dest_lang; - $src_text_to_translate=preg_replace('/%s/','SSSSS',join('',$src_texts)); + $src_text_to_translate=preg_replace('/%s/','SSSSS',implode('',$src_texts)); $src_text_to_translate=preg_replace('/'.preg_quote('\n\n').'/',' NNNNN ',$src_text_to_translate); // Define GET URL v1 diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index 1912c8b4142..df833bb394e 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -1,7 +1,8 @@ #!/usr/bin/env php - * Copyright (c) 2015 Laurent Destailleur +/* Copyright (c) 2015 Tommaso Basilici + * Copyright (c) 2015 Laurent Destailleur + * Copyright (C) 2014-2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -359,7 +360,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a { $filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang'; print "Strings in en_US that are never used are saved into file ".$filetosave.":\n"; - file_put_contents($filetosave, join("",$unused)); + file_put_contents($filetosave, implode("",$unused)); print "To remove from original file, run command :\n"; if (($argv[2]?$argv[2]:"")) print 'cd htdocs/langs/en_US; mv '.($argv[2]?$argv[2]:"")." ".($argv[2]?$argv[2]:"").".tmp; "; print "diff ".($argv[2]?$argv[2]:"").".tmp ".$filetosave." | grep \< | cut -b 3- > ".($argv[2]?$argv[2]:""); From e5372e5636fba92b88b3f962a5290deffb20130d Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 15 Jul 2016 17:31:44 +0200 Subject: [PATCH 3/4] NEW Do not use Functions Aliases --- htdocs/adherents/class/adherent.class.php | 3 ++- htdocs/adherents/list.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index e12c49732dd..7604c4fe02c 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Frederic France * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -353,7 +354,7 @@ class Adherent extends CommonObject if (count($this->errors)) { - dol_syslog(get_class($this)."::create ".join(',',$this->errors), LOG_ERR); + dol_syslog(get_class($this)."::create ".implode(',',$this->errors), LOG_ERR); $this->db->rollback(); return -3; } diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 5878aac2755..03d100f9e8e 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -3,6 +3,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2013-2015 Raphaël Doursenaud + * Copyright (C) 2014-2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -328,7 +329,7 @@ if ($resql) if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + print $langs->trans("FilterOnInto", $sall) . implode(', ',$fieldstosearchall); } // Filter on categories From 62c1302a276f94626fda182af1f8be1da532e4ff Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 15 Jul 2016 17:58:14 +0200 Subject: [PATCH 4/4] NEW Do not use Functions Aliases --- htdocs/admin/dict.php | 4 ++-- htdocs/admin/ihm.php | 21 +++++++++++---------- htdocs/admin/ldap_users.php | 4 ++-- htdocs/admin/system/phpinfo.php | 9 +++++---- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 353389c98a8..b147159b3cb 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García @@ -1085,7 +1085,7 @@ if ($id) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail=new FormMail($db); $tmp=$formmail->getAvailableSubstitKey('form'); - print join(', ', $tmp); + print implode(', ', $tmp); print ''; } diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 51d0a6174c8..cc1e1792f01 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -75,28 +76,28 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); - $val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())))); + $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())),'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', implode(',',colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())),'chaine',0,'',$conf->entity); - $val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())))); + $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', join(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())),'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())),'chaine',0,'',$conf->entity); - $val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())))); + $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', implode(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity); - $val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())))); + $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', join(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())),'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())),'chaine',0,'',$conf->entity); if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_del_const($db, "THEME_ELDY_USE_HOVER", $conf->entity); else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); - $val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())))); + $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', join(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())),'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_SHORTLISTE_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index dbed44ca5d0..45043b8a52b 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Regis Houssin * Copyright (C) 2006-2011 Laurent Destailleur - * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2011-2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -437,7 +437,7 @@ if (function_exists("ldap_connect")) print "search: *
\n"; print "userDN: ".$conf->global->LDAP_USER_DN."
\n"; print "useridentifier: ".$conf->global->LDAP_KEY_USERS."
\n"; - print "required_fields: ".join(',',$required_fields)."
\n"; + print "required_fields: ".implode(',',$required_fields)."
\n"; print "=> ".count($liste)." records
\n"; print "\n
"; } diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index dfb897ba27c..ffba92fd4fa 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2002 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -87,9 +88,9 @@ foreach($phparray as $key => $value) $valtoshow=$keyvalue; if ($keyparam == 'X-ChromePhp-Data') $valtoshow=dol_trunc($keyvalue,80); print ''; - if ($keyparam == 'Path') $valtoshow=join('; ',explode(';',trim($valtoshow))); - if ($keyparam == 'PATH') $valtoshow=join('; ',explode(';',trim($valtoshow))); - if ($keyparam == '_SERVER["PATH"]') $valtoshow=join('; ',explode(';',trim($valtoshow))); + if ($keyparam == 'Path') $valtoshow=implode('; ',explode(';',trim($valtoshow))); + if ($keyparam == 'PATH') $valtoshow=implode('; ',explode(';',trim($valtoshow))); + if ($keyparam == '_SERVER["PATH"]') $valtoshow=implode('; ',explode(';',trim($valtoshow))); print $valtoshow; print ''; print ''; @@ -104,7 +105,7 @@ foreach($phparray as $key => $value) { print ''; $valtoshow=$keyvalue2; - if ($keyparam == 'disable_functions') $valtoshow=join(', ',explode(',',trim($valtoshow))); + if ($keyparam == 'disable_functions') $valtoshow=implode(', ',explode(',',trim($valtoshow))); //print $keyparam; print $valtoshow; $i++;