Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions htdocs/pages/administration/compta_journal.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
$formulaire = instancierFormulaire();

if ($action === 'modifier') {
$champsRecup = $compta->obtenir($_GET['id']);
$champsRecup = $compta->obtenir((int) $_GET['id']);

$champs['idcompte'] = $champsRecup['idcompte'];
$champs['date_saisie'] = $champsRecup['date_ecriture'];
Expand Down Expand Up @@ -373,7 +373,7 @@
elseif ($action === 'modifier_colonne') {
try {
// Bad request?
if (!isset($_POST['val']) || !isset($_GET['column']) || !isset($_GET['id']) || !($line = $compta->obtenir($_GET['id']))) {
if (!isset($_POST['val']) || !isset($_GET['column']) || !isset($_GET['id']) || !($line = $compta->obtenir((int) $_GET['id']))) {
throw new Exception("Please verify parameters", 400);
}

Expand Down Expand Up @@ -458,7 +458,7 @@
elseif ($action === 'upload_attachment') {
try {
// Bad request?
if (!isset($_GET['id']) || !($line = $compta->obtenir($_GET['id']))) {
if (!isset($_GET['id']) || !($line = $compta->obtenir((int) $_GET['id']))) {
throw new Exception("Please verify parameters", 400);
}

Expand Down Expand Up @@ -554,7 +554,7 @@
elseif ($action === 'download_attachment') {
try {
// Bad request?
if (!isset($_GET['id']) || !($line = $compta->obtenir($_GET['id']))) {
if (!isset($_GET['id']) || !($line = $compta->obtenir((int) $_GET['id']))) {
throw new Exception("Please verify parameters", 400);
}

Expand Down
2 changes: 1 addition & 1 deletion sources/Afup/Comptabilite/Comptabilite.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public function modifierConfig(string $table, string $id, string $champ, $valeur
return $this->_bdd->executer($requete);
}

public function obtenir(string $id)
public function obtenir(int $id)
{
$requete = 'SELECT';
$requete .= ' * ';
Expand Down