diff --git a/htdocs/mrp/class/moline.class.php b/htdocs/mrp/class/moline.class.php index 8103d96ff52..f33d00a4d80 100644 --- a/htdocs/mrp/class/moline.class.php +++ b/htdocs/mrp/class/moline.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2020 Lenin Rivas * Copyright (C) 2023-2025 Frédéric France - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2026 MDW * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify @@ -274,7 +274,7 @@ class MoLine extends CommonObjectLine * @param string $sortfield Sort field * @param int $limit limit * @param int $offset Offset - * @param string|array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) + * @param string|array $filter Filter array. Example array('field'=>'valueforlike', ...) * @param string $filtermode Filter mode (AND or OR) * @return MoLine[]|int int <0 if KO, array of pages if OK */ @@ -305,7 +305,7 @@ class MoLine extends CommonObjectLine } elseif (strpos($key, 'date') !== false) { $sqlwhere[] = $this->db->sanitize($key)." = '".$this->db->idate((int) $value)."'"; } else { - $sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'"; + $sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike((string) $value))."%'"; } } } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index f0e8aa75e96..1705e871fc2 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Alexandre Spangaro - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2026 MDW * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -64,7 +64,7 @@ $cancel = GETPOST('cancel'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'mocard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$TBomLineId = GETPOST('bomlineid', 'array'); +$TBomLineId = GETPOST('bomlineid', 'array:int'); $lineid = GETPOSTINT('lineid'); $socid = GETPOSTINT("socid"); @@ -168,13 +168,13 @@ if (empty($reshook)) { foreach ($TBomLineId as $id_bom_line) { $object = new Mo($db); // modified by the actions_addupdatedelete.inc.php - $objectbomchildline->fetch($id_bom_line); + $objectbomchildline->fetch((int) $id_bom_line); // Find the consume line of the parent MO generated from this BOM line. // The lookup must be scoped to the parent MO and use an exact match on origin_id/origin_type, // otherwise the default 'origin_id LIKE %..%' filter can return an unrelated line (or none), // which would let the child MO be created from the leftover parent POST data (duplicate MO). - $TMoLines = $moline->fetchAll('DESC', 'rowid', 1, 0, array('fk_mo' => $mo_parent->id, 'origin_id' => $id_bom_line, 'origin_type' => 'bomline')); + $TMoLines = $moline->fetchAll('DESC', 'rowid', 1, 0, array('fk_mo' => $mo_parent->id, 'origin_id' => (int) $id_bom_line, 'origin_type' => 'bomline')); if (empty($TMoLines)) { continue;