Skip to content

Commit

Permalink
Correction du type pour les IDs (#1633)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mopolo authored Feb 16, 2025
1 parent 75b8768 commit 6923905
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 6923905

Please sign in to comment.