diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index aaea8d21780..352e23c0431 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2525,8 +2525,8 @@ class Facture extends CommonInvoice $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; $sql .= " model_pdf=".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null").","; $sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null").","; - $sql .= " situation_cycle_ref=".(empty($this->situation_cycle_ref) ? "null" : (int) $this->situation_cycle_ref)."',"; - $sql .= " situation_counter=".(empty($this->situation_counter) ? "null" : (int) $this->situation_counter)."',"; + $sql .= " situation_cycle_ref=".(empty($this->situation_cycle_ref) ? "null" : (int) $this->situation_cycle_ref).","; + $sql .= " situation_counter=".(empty($this->situation_counter) ? "null" : (int) $this->situation_counter).","; $sql .= " situation_final=".(empty($this->situation_final) ? "0" : (int) $this->situation_final).","; $sql .= " retained_warranty=".(empty($this->retained_warranty) ? "0" : (float) $this->retained_warranty).","; $sql .= " retained_warranty_date_limit=".(strval($this->retained_warranty_date_limit) != '' ? "'".$this->db->idate($this->retained_warranty_date_limit)."'" : 'null').","; diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 202c3b6564e..1643f12afae 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -407,7 +407,7 @@ class CodingPhpTest extends CommonClassTest $found = ""; // $sql .= " field = ".(isset($this->field) ? $this->escape($this->field) : "null")... is KO // $sql .= " field = ".(isset($this->field) ? "'".$this->escape($this->field)."'" : "null")... is OK - /* + preg_match_all('/(\$sql|VALUES\()[^\'\n]*[^\'\n]"\s*\.\s*([^\n]+)\n/m', $filecontent, $matches, PREG_SET_ORDER); foreach ($matches as $key => $val) { if (! preg_match('/^(implode\(\' OR \', \$search|implode\(\' AND \', \$search|MAIN_DB_PREFIX|accountancy_code|\w+::|\$key|\$db->prefix|\$this->db->prefix|\$predefinedgroupwhere|\$db->sanitize|\$this->db->sanitize|\$db->ifsql|\$db->decrypt|\(int\)|\(float\)|\(\(int\)|\(\(float\)|\$conf->entity|getEntity|\$this->from)/', $val[2])) { @@ -445,7 +445,7 @@ class CodingPhpTest extends CommonClassTest } //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; $this->assertTrue($ok, 'Found non escaped or non casted string in building of a sql request (case 4) in '.$file['relativename'].': '.$found.' - Bad.'); - */ + // Checks with IN diff --git a/test/phpunit/phpunittest.xml b/test/phpunit/phpunittest.xml index ce189fe6326..7fa17448216 100644 --- a/test/phpunit/phpunittest.xml +++ b/test/phpunit/phpunittest.xml @@ -8,7 +8,7 @@ convertWarningsToExceptions="true" colors="true" processIsolation="false" - stopOnFailure="false"> + stopOnFailure="true">