Skip to content

Commit

Permalink
Corrections suite à la PR #1609 (#1621)
Browse files Browse the repository at this point in the history
  • Loading branch information
stakovicz authored Feb 10, 2025
1 parent 69d7bbe commit 63e2ee1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sources/Afup/Association/Cotisations.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public function validerReglementEnLigne($cmd, $total, string $autorisation, stri
$date_fin_precedente = $cotisation === false ? 0 : $cotisation['date_fin'];

if ($date_fin_precedente > 0) {
$date_debut = strtotime('+1day', $date_fin_precedente);
$date_debut = strtotime('+1day', (int) $date_fin_precedente);
}

$date_fin = $this->finProchaineCotisation($cotisation)->format('U');
Expand Down
15 changes: 12 additions & 3 deletions sources/Afup/Corporate/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,21 @@ public function charger(): void
$requete = 'SELECT *
FROM afup_site_article
WHERE id = ' . $this->bdd->echapper($this->id);
$this->remplir($this->bdd->obtenirEnregistrement($requete));
$data = $this->bdd->obtenirEnregistrement($requete);
if ($data) {
$this->remplir($data);
}
}

public function chargerDepuisRaccourci($raccourci): void
{
$requete = 'SELECT *
FROM afup_site_article
WHERE CONCAT(id, "-", raccourci) = ' . $this->bdd->echapper($raccourci);
$this->remplir($this->bdd->obtenirEnregistrement($requete));
$data = $this->bdd->obtenirEnregistrement($requete);
if ($data) {
$this->remplir($data);
}
}

public function charger_dernier_depuis_rubrique(): void
Expand All @@ -199,7 +205,10 @@ public function charger_dernier_depuis_rubrique(): void
FROM afup_site_article
WHERE id_site_rubrique = ' . $this->bdd->echapper($this->id_site_rubrique) .
' ORDER BY date DESC LIMIT 1';
$this->remplir($this->bdd->obtenirEnregistrement($requete));
$data = $this->bdd->obtenirEnregistrement($requete);
if ($data) {
$this->remplir($data);
}
}

public function remplir(array $article): void
Expand Down
4 changes: 4 additions & 0 deletions sources/PlanetePHP/FeedCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public function crawl(): void
foreach ($feeds as $feed) {
echo $feed->getFeed() . ' : début...<br />', PHP_EOL;
$rss = fetch_rss($feed->getFeed());
if (!$rss->items) {
echo $feed->getFeed(), ' : vide fin !<br /><br/>', PHP_EOL, PHP_EOL;
continue;
}
$rss->items = array_reverse($rss->items);
foreach ($rss->items as $item) {
if (empty($item['id'])) {
Expand Down

0 comments on commit 63e2ee1

Please sign in to comment.