Fix remove warnings

This commit is contained in:
Laurent Destailleur 2017-07-09 20:31:27 +02:00
parent e3943155f3
commit 10cb7b2524
10 changed files with 74 additions and 46 deletions

View File

@ -55,7 +55,7 @@ if ($action == 'setvalue' && $user->admin)
$result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity); $result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity);
if ($result < 0) $error++; if ($result < 0) $error++;
if (! $error) if (! $error && is_array($_POST))
{ {
//var_dump($_POST); //var_dump($_POST);
foreach($_POST as $key => $val) foreach($_POST as $key => $val)

View File

@ -53,11 +53,13 @@ function printBookmarksList($aDb, $aLangs)
// No urlencode, all param $url will be urlencoded later // No urlencode, all param $url will be urlencoded later
if ($sortfield) $tmpurl.=($tmpurl?'&':'').'sortfield='.$sortfield; if ($sortfield) $tmpurl.=($tmpurl?'&':'').'sortfield='.$sortfield;
if ($sortorder) $tmpurl.=($tmpurl?'&':'').'sortorder='.$sortorder; if ($sortorder) $tmpurl.=($tmpurl?'&':'').'sortorder='.$sortorder;
if (is_array($_POST))
{
foreach($_POST as $key => $val) foreach($_POST as $key => $val)
{ {
if (preg_match('/^search_/', $key) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val; if (preg_match('/^search_/', $key) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val;
} }
}
$url.=($tmpurl?'?'.$tmpurl:''); $url.=($tmpurl?'?'.$tmpurl:'');
} }

View File

@ -129,11 +129,14 @@ $hookmanager->initHooks(array('agenda'));
if (GETPOST("viewlist") || $action == 'show_list') if (GETPOST("viewlist") || $action == 'show_list')
{ {
$param=''; $param='';
if (is_array($_POST))
{
foreach($_POST as $key => $val) foreach($_POST as $key => $val)
{ {
if ($key=='token') continue; if ($key=='token') continue;
$param.='&'.$key.'='.urlencode($val); $param.='&'.$key.'='.urlencode($val);
} }
}
//print $param; //print $param;
header("Location: ".DOL_URL_ROOT.'/comm/action/listactions.php?'.$param); header("Location: ".DOL_URL_ROOT.'/comm/action/listactions.php?'.$param);
exit; exit;
@ -142,11 +145,14 @@ if (GETPOST("viewlist") || $action == 'show_list')
if (GETPOST("viewperuser") || $action == 'show_peruser') if (GETPOST("viewperuser") || $action == 'show_peruser')
{ {
$param=''; $param='';
if (is_array($_POST))
{
foreach($_POST as $key => $val) foreach($_POST as $key => $val)
{ {
if ($key=='token') continue; if ($key=='token') continue;
$param.='&'.$key.'='.urlencode($val); $param.='&'.$key.'='.urlencode($val);
} }
}
//print $param; //print $param;
header("Location: ".DOL_URL_ROOT.'/comm/action/peruser.php?'.$param); header("Location: ".DOL_URL_ROOT.'/comm/action/peruser.php?'.$param);
exit; exit;

View File

@ -120,10 +120,13 @@ $hookmanager->initHooks(array('agendalist'));
if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday")) if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday"))
{ {
$param=''; $param='';
if (is_array($_POST))
{
foreach($_POST as $key => $val) foreach($_POST as $key => $val)
{ {
$param.='&'.$key.'='.urlencode($val); $param.='&'.$key.'='.urlencode($val);
} }
}
//print $param; //print $param;
header("Location: ".DOL_URL_ROOT.'/comm/action/index.php?'.$param); header("Location: ".DOL_URL_ROOT.'/comm/action/index.php?'.$param);
exit; exit;

View File

@ -32,6 +32,8 @@ if ($action == 'setModuleOptions')
$db->begin(); $db->begin();
// Process common param fields // Process common param fields
if (is_array($_POST))
{
foreach($_POST as $key => $val) foreach($_POST as $key => $val)
{ {
if (preg_match('/^param(\d*)$/', $key, $reg)) // Works for POST['param'], POST['param1'], POST['param2'], ... if (preg_match('/^param(\d*)$/', $key, $reg)) // Works for POST['param'], POST['param1'], POST['param2'], ...
@ -45,6 +47,7 @@ if ($action == 'setModuleOptions')
} }
} }
} }
}
// Process upload fields // Process upload fields
if (GETPOST('upload','alpha') && GETPOST('keyforuploaddir','aZ09')) if (GETPOST('upload','alpha') && GETPOST('keyforuploaddir','aZ09'))

View File

@ -345,12 +345,15 @@ if (! $error && $db->connected)
if (! $error && $db->connected && $action == "set") if (! $error && $db->connected && $action == "set")
{ {
umask(0); umask(0);
if (is_array($_POST))
{
foreach($_POST as $key => $value) foreach($_POST as $key => $value)
{ {
if (! preg_match('/^db_pass/i', $key)) { if (! preg_match('/^db_pass/i', $key)) {
dolibarr_install_syslog("step1: choice for " . $key . " = " . $value); dolibarr_install_syslog("step1: choice for " . $key . " = " . $value);
} }
} }
}
// Show title of step // Show title of step
print '<h3><img class="valigntextbottom" src="../theme/common/octicons/lib/svg/gear.svg" width="20" alt="Configuration"> '.$langs->trans("ConfigurationFile").'</h3>'; print '<h3><img class="valigntextbottom" src="../theme/common/octicons/lib/svg/gear.svg" width="20" alt="Configuration"> '.$langs->trans("ConfigurationFile").'</h3>';

View File

@ -1498,10 +1498,12 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
{ {
$qs=dol_escape_htmltag($_SERVER["QUERY_STRING"]); $qs=dol_escape_htmltag($_SERVER["QUERY_STRING"]);
if (is_array($_POST))
{
foreach($_POST as $key=>$value) { foreach($_POST as $key=>$value) {
if ($key!=='action' && !is_array($value)) $qs.='&'.$key.'='.urlencode($value); if ($key!=='action' && !is_array($value)) $qs.='&'.$key.'='.urlencode($value);
} }
}
$qs.=(($qs && $morequerystring)?'&':'').$morequerystring; $qs.=(($qs && $morequerystring)?'&':'').$morequerystring;
$text ='<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank">'; $text ='<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank">';
//$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"'); //$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');

View File

@ -200,6 +200,8 @@ if ($action == 'addtime' && $user->rights->projet->lire)
{ {
$timespent_duration=array(); $timespent_duration=array();
if (is_array($_POST))
{
foreach($_POST as $key => $time) foreach($_POST as $key => $time)
{ {
if (intval($time) > 0) if (intval($time) > 0)
@ -219,6 +221,7 @@ if ($action == 'addtime' && $user->rights->projet->lire)
} }
} }
} }
}
if (count($timespent_duration) > 0) if (count($timespent_duration) > 0)
{ {

View File

@ -25,6 +25,9 @@ CKEDITOR.editorConfig = function( config )
config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)'; config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)';
//config.contentsCss = '/css/mysitestyles.css'; //config.contentsCss = '/css/mysitestyles.css';
config.image_previewText=' '; // Must no be empty config.image_previewText=' '; // Must no be empty
//config.autoParagraph = false;
//config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd'; // See also rules on this.dataProcessor.writer.setRules
//config.forcePasteAsPlainText = true;
config.toolbar_Full = config.toolbar_Full =
[ [

View File

@ -25,6 +25,9 @@ CKEDITOR.editorConfig = function( config )
config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)'; config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)';
//config.contentsCss = '/css/mysitestyles.css'; //config.contentsCss = '/css/mysitestyles.css';
config.image_previewText=' '; // Must no be empty config.image_previewText=' '; // Must no be empty
//config.autoParagraph = false;
//config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd'; // See also rules on this.dataProcessor.writer.setRules
//config.forcePasteAsPlainText = true;
config.toolbar_Full = config.toolbar_Full =
[ [