Qual: Fix SqlInjection notices in scripts (#39214)
This commit is contained in:
parent
5db08a3151
commit
679c6eaf29
3 changed files with 8 additions and 8 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
|
||||||
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
|
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
@ -261,7 +261,7 @@ if ($resql) {
|
||||||
$sql2 = "SELECT sum(b.amount) as amount";
|
$sql2 = "SELECT sum(b.amount) as amount";
|
||||||
$sql2 .= " FROM ".MAIN_DB_PREFIX."bank as b";
|
$sql2 .= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||||
$sql2 .= " WHERE b.num_releve < '".$db->escape($objp->num_releve)."'";
|
$sql2 .= " WHERE b.num_releve < '".$db->escape($objp->num_releve)."'";
|
||||||
$sql2 .= " AND b.fk_account = ".$objp->bankid;
|
$sql2 .= " AND b.fk_account = ".((int) $objp->bankid);
|
||||||
$resql2 = $db->query($sql2);
|
$resql2 = $db->query($sql2);
|
||||||
if ($resql2) {
|
if ($resql2) {
|
||||||
$obj2 = $db->fetch_object($resql2);
|
$obj2 = $db->fetch_object($resql2);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
* Copyright (C) 2013 Florian Henry <forian.henry@open-concept.pro
|
* Copyright (C) 2013 Florian Henry <forian.henry@open-concept.pro
|
||||||
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
* Copyright (C) 2025-2026 MDW <mdeweerd@users.noreply.github.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -219,7 +219,7 @@ if (function_exists('posix_kill') && function_exists('posix_get_last_error')) {
|
||||||
|
|
||||||
$sqlu = "UPDATE ".MAIN_DB_PREFIX."cronjob";
|
$sqlu = "UPDATE ".MAIN_DB_PREFIX."cronjob";
|
||||||
$sqlu .= " SET processing = 0, pid = NULL, datelastresult = '".$db->idate($nowcleanup)."', lastresult = '-1', lastoutput = '".$db->escape($msg)."'";
|
$sqlu .= " SET processing = 0, pid = NULL, datelastresult = '".$db->idate($nowcleanup)."', lastresult = '-1', lastoutput = '".$db->escape($msg)."'";
|
||||||
$sqlu .= " WHERE rowid = ".((int) $obj->rowid)." AND processing = 1 AND pid = ".$pid." AND datelastresult IS NULL";
|
$sqlu .= " WHERE rowid = ".((int) $obj->rowid)." AND processing = 1 AND pid = ".((int) $pid)." AND datelastresult IS NULL";
|
||||||
$db->query($sqlu);
|
$db->query($sqlu);
|
||||||
|
|
||||||
dol_syslog("cron_run_jobs.php unlocked stuck job id=".$obj->rowid." (stale pid ".$pid.")", LOG_WARNING);
|
dol_syslog("cron_run_jobs.php unlocked stuck job id=".$obj->rowid." (stale pid ".$pid.")", LOG_WARNING);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -153,7 +153,7 @@ if ($resql) {
|
||||||
$id = $emailing->id;
|
$id = $emailing->id;
|
||||||
$subject = $emailing->sujet;
|
$subject = $emailing->sujet;
|
||||||
$message = $emailing->body;
|
$message = $emailing->body;
|
||||||
$from = $emailing->email_from;
|
$email_from = $emailing->email_from;
|
||||||
$replyto = $emailing->email_replyto;
|
$replyto = $emailing->email_replyto;
|
||||||
$errorsto = $emailing->email_errorsto;
|
$errorsto = $emailing->email_errorsto;
|
||||||
// Le message est-il en html
|
// Le message est-il en html
|
||||||
|
|
@ -173,7 +173,7 @@ if ($resql) {
|
||||||
if (getDolGlobalInt('MAILING_LIMIT_SENDBYCLI') > 0 && empty($max)) {
|
if (getDolGlobalInt('MAILING_LIMIT_SENDBYCLI') > 0 && empty($max)) {
|
||||||
$sql2 .= " LIMIT " . getDolGlobalInt('MAILING_LIMIT_SENDBYCLI');
|
$sql2 .= " LIMIT " . getDolGlobalInt('MAILING_LIMIT_SENDBYCLI');
|
||||||
} elseif (getDolGlobalInt('MAILING_LIMIT_SENDBYCLI') > 0 && $max > 0) {
|
} elseif (getDolGlobalInt('MAILING_LIMIT_SENDBYCLI') > 0 && $max > 0) {
|
||||||
$sql2 .= " LIMIT ".min(getDolGlobalInt('MAILING_LIMIT_SENDBYCLI'), $max);
|
$sql2 .= " LIMIT ".min(getDolGlobalInt('MAILING_LIMIT_SENDBYCLI'), ((int) $max));
|
||||||
} elseif ($max > 0) {
|
} elseif ($max > 0) {
|
||||||
$sql2 .= " LIMIT ".((int) $max);
|
$sql2 .= " LIMIT ".((int) $max);
|
||||||
}
|
}
|
||||||
|
|
@ -336,7 +336,7 @@ if ($resql) {
|
||||||
// Fabrication du mail
|
// Fabrication du mail
|
||||||
$trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid;
|
$trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid;
|
||||||
$upload_dir_tmp = $upload_dir;
|
$upload_dir_tmp = $upload_dir;
|
||||||
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing', '', $upload_dir_tmp);
|
$mail = new CMailFile($newsubject, $sendto, $email_from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing', '', $upload_dir_tmp);
|
||||||
|
|
||||||
if ($mail->error) {
|
if ($mail->error) {
|
||||||
$res = 0;
|
$res = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue