From 5dc9654668d214d6fd803be8b23cd52c0275729b Mon Sep 17 00:00:00 2001
From: Cerdic <cedric@yterium.com>
Date: Mon, 16 Oct 2006 10:16:27 +0000
Subject: [PATCH] eviter des warnings polluants quand le cookie n'est pas la

---
 ecrire/inc/agenda.php  | 2 +-
 ecrire/inc/gadgets.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ecrire/inc/agenda.php b/ecrire/inc/agenda.php
index 5a3299bcc4..d11738ce39 100644
--- a/ecrire/inc/agenda.php
+++ b/ecrire/inc/agenda.php
@@ -87,7 +87,7 @@ function calendrier_href($script, $annee, $mois, $jour, $type, $fin, $ancre, $im
 	$moi = preg_match("/exec=" . $GLOBALS['exec'] .'$/', $script);
 	if ($img) $clic =  http_img_pack($img, ($alt ? $alt : $titre), $c);
 	  // pas d'Ajax pour l'espace public pour le moment ou si indispo
-	if (_DIR_RESTREINT || ($_COOKIE['spip_accepte_ajax'] != 1 ) || !$moi)
+	if (_DIR_RESTREINT  || !$moi || (isset($_COOKIE['spip_accepte_ajax']) && ($_COOKIE['spip_accepte_ajax'] != 1 )))
 
 		return http_href("$h$a", $clic, $titre, $style, $class, $evt);
 	else {
diff --git a/ecrire/inc/gadgets.php b/ecrire/inc/gadgets.php
index 637384dd8b..30193cb27b 100644
--- a/ecrire/inc/gadgets.php
+++ b/ecrire/inc/gadgets.php
@@ -472,7 +472,7 @@ function gadget_messagerie() {
 
 // http://doc.spip.org/@repercuter_gadgets
 function repercuter_gadgets($id_rubrique) {
-	if ($_COOKIE['spip_accepte_ajax'] == -1) return '';
+	if (isset($_COOKIE['spip_accepte_ajax']) && ($_COOKIE['spip_accepte_ajax'] == -1)) return '';
 
 	$rub = $id_rubrique ? "\\x26id_rubrique=$id_rubrique" : '';
 
-- 
GitLab