diff --git a/ecrire/inc/agenda.php b/ecrire/inc/agenda.php index d21624693be2c125877f1e1cc88f29ef20d8f3f1..0483344c3ebf3410b5ce6c58be50c5277f3e08e7 100644 --- a/ecrire/inc/agenda.php +++ b/ecrire/inc/agenda.php @@ -84,7 +84,7 @@ function calendrier_href($script, $annee, $mois, $jour, $type, $fin, $ancre, $im $t = ($titre ? " title=\"$titre\"" : ''); $s = ($style ? " style=\"$style\"" : ''); - $moi = preg_match("/exec=" . $GLOBALS['exec'] .'$/', $script); + $moi = preg_match("/exec=" . _request('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 || !$moi || (_SPIP_AJAX !== 1 )) @@ -252,7 +252,7 @@ function http_calendrier_mois_navigation($annee, $mois, $premier_jour, $dernier_ "\n<tr><td colspan='7'>" . http_calendrier_navigation($annee, $mois, - $jour, + 0, $echelle, $partie_cal, $periode, diff --git a/ecrire/inc/boutons.php b/ecrire/inc/boutons.php index 8285ff31dd5db49dd7b85cfc729511fc2b4595eb..ae7fad504563b27c0ba44a31a5ab0caeab67df22 100644 --- a/ecrire/inc/boutons.php +++ b/ecrire/inc/boutons.php @@ -13,8 +13,8 @@ if (!defined("_ECRIRE_INC_VERSION")) return; define('_LARGEUR_ICONES_BANDEAU', - (($GLOBALS['spip_display'] == 3) ? 60 : 80) - + (($GLOBALS['spip_ecran'] == 'large') ? 30 : 0) + ((@$GLOBALS['spip_display'] == 3) ? 60 : 80) + + ((@$GLOBALS['spip_ecran'] == 'large') ? 30 : 0) + (($GLOBALS['connect_toutes_rubriques']) ? 0 : 30)); /** diff --git a/ecrire/inc/charsets.php b/ecrire/inc/charsets.php index 14bb788485e6008073738376d96d8fa234da8e01..200c6ac465a60c3e9aaf389db23b30b76c224858 100644 --- a/ecrire/inc/charsets.php +++ b/ecrire/inc/charsets.php @@ -648,7 +648,7 @@ function transcoder_page($texte, $headers='') { // charset de la reponse http else if (preg_match(',charset=([-_a-z0-9]+),i', $headers, $regs)) $charset = trim(strtolower($regs[1])); - + else $charset = ''; // normaliser les noms du shif-jis japonais if (preg_match(',^(x|shift)[_-]s?jis$,i', $charset)) $charset = 'shift-jis'; diff --git a/ecrire/inc/editer_mot.php b/ecrire/inc/editer_mot.php index 8a17a94e9849a6b181a71c47d37206723129b9cc..493bea00c3b83ece4e787ccf7537ae088823a179 100644 --- a/ecrire/inc/editer_mot.php +++ b/ecrire/inc/editer_mot.php @@ -320,14 +320,14 @@ function formulaire_mots_cles($id_groupes_vus, $id_objet, $les_mots, $table, $ta $res .= "<div style='float:$spip_lang_right; width:280px;position:relative;display:inline;'>" . $ajouter ."</div>\n" ; - } + } else $message =''; if (autoriser('modifier','groupemots')) { $titre = _request('cherche_mot') ? "&titre=".rawurlencode(_request('cherche_mot')) : ''; $bouton_ajouter = icone_horizontale(_T('icone_creer_mot_cle'), generer_url_ecrire("mots_edit","new=oui&ajouter_id_article=$id_objet&table=$table&table_id=$table_id$titre&redirect=" . generer_url_retour($url_base, "$table_id=$id_objet")), "mot-cle-24.gif", "creer.gif", false) . "\n"; - } + } else $bouton_ajouter = ''; if ($message OR $bouton_ajouter) { $res .= "<div style='width:170px;'>$message diff --git a/ecrire/index.php b/ecrire/index.php index 7da696081f7c01db750b926c21b66b4a77c57f7e..d4866778679e9413a5444d57153f7cd62ac30c8b 100644 --- a/ecrire/index.php +++ b/ecrire/index.php @@ -118,7 +118,7 @@ AND ($GLOBALS['spip_version'] != (str_replace(',','.',$GLOBALS['meta']['version_ // Si interruption d'une longue restauration // detourner le script demande pour qu'il reprenne le boulot // mais virer les Ajax pour eviter plusieurs restaurations en parallele -elseif ($_COOKIE['spip_admin'] +elseif (isset($_COOKIE['spip_admin']) AND isset($GLOBALS['meta']["import_all"])) { if (isset($var_ajaxcharset)) exit; $exec = 'import_all'; diff --git a/ecrire/public/boucles.php b/ecrire/public/boucles.php index 9fab9da0694a9d73ca846380165e2752fe62ce7e..e840cf0c2c5cbe44e71203e114c122a79d7acd81 100644 --- a/ecrire/public/boucles.php +++ b/ecrire/public/boucles.php @@ -58,7 +58,7 @@ function boucle_ARTICLES_dist($id_boucle, &$boucles) { $mstatut = $id_table .'.statut'; // Restreindre aux elements publies - if (!$boucle->modificateur['criteres']['statut']) { + if (!isset($boucle->modificateur['criteres']['statut'])) { if (!$GLOBALS['var_preview']) { $boucle->where[]= array("'='", "'$mstatut'", "'\"publie\"'"); if ($GLOBALS['meta']["post_dates"] == 'non') @@ -80,7 +80,7 @@ function boucle_AUTEURS_dist($id_boucle, &$boucles) { $mstatut = $id_table .'.statut'; // Restreindre aux elements publies - if (!$boucle->modificateur['criteres']['statut']) { + if (!isset($boucle->modificateur['criteres']['statut'])) { // Si pas de lien avec un article, selectionner // uniquement les auteurs d'un article publie if (!$GLOBALS['var_preview']) @@ -110,7 +110,7 @@ function boucle_BREVES_dist($id_boucle, &$boucles) { $mstatut = $id_table .'.statut'; // Restreindre aux elements publies - if (!$boucle->modificateur['criteres']['statut']) { + if (!isset($boucle->modificateur['criteres']['statut'])) { if (!$GLOBALS['var_preview']) $boucle->where[]= array("'='", "'$mstatut'", "'\"publie\"'"); else @@ -193,7 +193,7 @@ function boucle_RUBRIQUES_dist($id_boucle, &$boucles) { $mstatut = $id_table .'.statut'; // Restreindre aux elements publies - if (!$boucle->modificateur['criteres']['statut']) { + if (!isset($boucle->modificateur['criteres']['statut'])) { if (!$GLOBALS['var_preview']) if (!isset($boucle->modificateur['tout'])) $boucle->where[]= array("'='", "'$mstatut'", "'\"publie\"'"); @@ -244,7 +244,7 @@ function boucle_SYNDICATION_dist($id_boucle, &$boucles) { // Restreindre aux elements publies - if (!$boucle->modificateur['criteres']['statut']) { + if (!isset($boucle->modificateur['criteres']['statut'])) { if (!$GLOBALS['var_preview']) { $boucle->where[]= array("'='", "'$mstatut'", "'\"publie\"'"); } else diff --git a/ecrire/public/compiler.php b/ecrire/public/compiler.php index 8b42255f40ffd3576068f6e737155618c0ac27a9..318a2a6f7fcf6a3892aa8a35ad20e4ea273c1320 100644 --- a/ecrire/public/compiler.php +++ b/ecrire/public/compiler.php @@ -94,14 +94,11 @@ function calculer_inclure($struct, $descr, &$boucles, $id_boucle) { $_contexte = argumenter_inclure($struct, $descr, $boucles, $id_boucle); // Critere d'inclusion {env} (et {self} pour compatibilite ascendante) - if (isset($_contexte['env']) - || isset($_contexte['self']) - ) { - $flag_env = true; + if ($env = (isset($_contexte['env'])|| isset($_contexte['self']))) { unset($_contexte['env']); } $contexte = 'array(' . join(",\n\t", $_contexte) .')'; - if ($flag_env) { + if ($env) { $contexte = "array_merge('.spip_var_export(\$Pile[0]).',$contexte)"; } diff --git a/ecrire/public/criteres.php b/ecrire/public/criteres.php index d32d1da06d2797b9fc7c882a9ed42d5f162bfcdd..9f5bc72ce90b2114d4d2ecbb4527b8385ed17b77 100644 --- a/ecrire/public/criteres.php +++ b/ecrire/public/criteres.php @@ -547,7 +547,7 @@ function calculer_critere_parties_aux($idb, &$boucles, $param) { } else { preg_match(',^ *(([0-9]+)|n) *(- *([0-9]+)? *)?$,', $param[0]->texte, $m); $a1 = $m[1]; - if (!$m[3]) + if (!@$m[3]) return array($a1, 0); elseif ($m[4]) return array($a1, $m[4]); @@ -693,7 +693,7 @@ function calculer_critere_infixe($idb, &$boucles, $crit) { } // Cas particulier : expressions de date - else if ($table_date[$type] + else if (isset($table_date[$type]) AND preg_match(",^((age|jour|mois|annee)_relatif|date|mois|annee|jour|heure|age)(_[a-z]+)?$,", $col, $regs)) { list($col, $table) = @@ -841,10 +841,11 @@ function calculer_jointure(&$boucle, $depart, $arrivee, $col='', $cond=false) // et operateur d'egalite (http://trac.rezo.net/trac/spip/ticket/477) if ($pk = (count($boucle->from) == 1) && !$cond) { - if ($pk = $a[1]['key']['PRIMARY KEY']) { - $pk=preg_match("/^$id_primary, *$col$/", $pk) OR - preg_match("/^$col, *$id_primary$/", $pk); - } + if ($pk = $a[1]['key']['PRIMARY KEY']) { + $id_primary = $ddesc['key']['PRIMARY KEY']; + $pk = preg_match("/^$id_primary, *$col$/", $pk) OR + preg_match("/^$col, *$id_primary$/", $pk); + } } // la clause Group by est en conflit avec ORDER BY, a completer @@ -1043,7 +1044,7 @@ function calculer_critere_infixe_ops($idb, &$boucles, $crit) if (count($params)==1 AND count($params[0]==3) AND $params[0][0]->type == 'texte' - AND $params[0][2]->type == 'texte' + AND @$params[0][2]->type == 'texte' AND ($p=$params[0][0]->texte) == $params[0][2]->texte AND (($p == "'") OR ($p == '"')) AND $params[0][1]->type == 'champ' ) { diff --git a/ecrire/public/parametrer.php b/ecrire/public/parametrer.php index e8e1b0b1516175e7281190ca5432ee24df56d3c0..6220dec32e3485a096ca712fb6df54e9498cbf45 100644 --- a/ecrire/public/parametrer.php +++ b/ecrire/public/parametrer.php @@ -99,8 +99,7 @@ function sql_rubrique_fond($contexte) { $row = spip_abstract_fetsel(array('lang'), array('spip_rubriques'), array("id_rubrique=$id")); - if ($row['lang']) - $lang = $row['lang']; + $lang = isset($row['lang']) ? $row['lang'] : ''; return array ($id, $lang); } @@ -110,8 +109,7 @@ function sql_rubrique_fond($contexte) { array('spip_breves'), array("id_breve=$id")); $id_rubrique_fond = $row['id_rubrique']; - if ($row['lang']) - $lang = $row['lang']; + $lang = isset($row['lang']) ? $row['lang'] : ''; return array($id_rubrique_fond, $lang); } @@ -124,8 +122,7 @@ function sql_rubrique_fond($contexte) { $row = spip_abstract_fetsel(array('lang'), array('spip_rubriques'), array("id_rubrique='$id_rubrique_fond'")); - if ($row['lang']) - $lang = $row['lang']; + $lang = isset($row['lang']) ? $row['lang'] : ''; return array($id_rubrique_fond, $lang); } @@ -135,8 +132,7 @@ function sql_rubrique_fond($contexte) { array('spip_articles'), array("id_article=$id")); $id_rubrique_fond = $row['id_rubrique']; - if ($row['lang']) - $lang = $row['lang']; + $lang = isset($row['lang']) ? $row['lang'] : ''; return array($id_rubrique_fond, $lang); } } diff --git a/ecrire/public/phraser_html.php b/ecrire/public/phraser_html.php index c2bcc7bb3a13e391115722f23fa28e9a39a8a645..cd231e0ac6cc087ff0d9de8f4b2e85c05f079265 100644 --- a/ecrire/public/phraser_html.php +++ b/ecrire/public/phraser_html.php @@ -468,7 +468,7 @@ function phraser_criteres($params, &$result) { } elseif (preg_match(',^(' . CHAMP_SQL_PLUS_FONC . ')[[:space:]]*(\??)(!?)(<=?|>=?|==?|\b(?:IN|LIKE)\b)(.*)$,is', $param, $m)) { $a2 = trim($m[7]); - if (($a2{0}=="'" OR $a2{0}=='"') AND ($a2{0}==substr($a2,-1))) + if ($a2 AND ($a2[0]=="'" OR $a2[0]=='"') AND ($a2[0]==substr($a2,-1))) $a2 = substr($a2,1,-1); $crit = phraser_critere_infixe($m[1], $a2, $v, (($m[1] == 'lang_select') ? $m[1] : $m[6]),