@@ -11,12 +11,16 @@ discard block |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | define('_ESPACE_PRIVE', true); |
| 14 | -if (!defined('_ECRIRE_INC_VERSION')) include 'inc_version.php'; |
|
| 14 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 15 | + include 'inc_version.php'; |
|
| 16 | +} |
|
| 15 | 17 | |
| 16 | 18 | // Verification anti magic_quotes_sybase, pour qui addslashes("'") = "''" |
| 17 | 19 | // On prefere la faire ici plutot que dans inc_version, c'est moins souvent et |
| 18 | 20 | // si le reglage est modifie sur un site en prod, ca fait moins mal |
| 19 | -if (addslashes("'") !== "\\'") die('SPIP incompatible magic_quotes_sybase'); |
|
| 21 | +if (addslashes("'") !== "\\'") { |
|
| 22 | + die('SPIP incompatible magic_quotes_sybase'); |
|
| 23 | +} |
|
| 20 | 24 | |
| 21 | 25 | include_spip('inc/cookie'); |
| 22 | 26 | |
@@ -31,7 +35,9 @@ discard block |
||
| 31 | 35 | // alors il faut blinder les variables d'URL |
| 32 | 36 | // |
| 33 | 37 | if (autoriser_sans_cookie($exec)) { |
| 34 | - if (!isset($reinstall)) $reinstall = 'non'; |
|
| 38 | + if (!isset($reinstall)) { |
|
| 39 | + $reinstall = 'non'; |
|
| 40 | + } |
|
| 35 | 41 | set_request('transformer_xml'); |
| 36 | 42 | $var_auth = true; |
| 37 | 43 | } else { |
@@ -62,8 +68,10 @@ discard block |
||
| 62 | 68 | traiter_appels_inclusions_ajax() |
| 63 | 69 | OR |
| 64 | 70 | // cas des formulaires charger/verifier/traiter |
| 65 | - traiter_formulaires_dynamiques()) |
|
| 66 | - exit; // le hit est fini ! |
|
| 71 | + traiter_formulaires_dynamiques()) { |
|
| 72 | + exit; |
|
| 73 | + } |
|
| 74 | + // le hit est fini ! |
|
| 67 | 75 | } |
| 68 | 76 | // securiser les redirect du back-office |
| 69 | 77 | if (_request('redirect')) { |
@@ -82,8 +90,9 @@ discard block |
||
| 82 | 90 | if (!$reinstall=='oui' |
| 83 | 91 | AND !_AJAX |
| 84 | 92 | AND isset($GLOBALS['meta']['version_installee']) |
| 85 | -AND ($GLOBALS['spip_version_base'] != (str_replace(',','.',$GLOBALS['meta']['version_installee'])))) |
|
| 93 | +AND ($GLOBALS['spip_version_base'] != (str_replace(',','.',$GLOBALS['meta']['version_installee'])))) { |
|
| 86 | 94 | $exec = 'demande_mise_a_jour'; |
| 95 | +} |
|
| 87 | 96 | |
| 88 | 97 | // Quand une action d'administration est en cours (meta "admin"), |
| 89 | 98 | // refuser les connexions non-admin ou Ajax pour laisser la base intacte. |
@@ -92,8 +101,9 @@ discard block |
||
| 92 | 101 | // sinon c'est qu'elle a ete interrompue et il faut la reprendre |
| 93 | 102 | |
| 94 | 103 | elseif (isset($GLOBALS['meta']["admin"])) { |
| 95 | - if (preg_match('/^(.*)_(\d+)_/', $GLOBALS['meta']["admin"], $l)) |
|
| 96 | - list(,$var_f,$n) = $l; |
|
| 104 | + if (preg_match('/^(.*)_(\d+)_/', $GLOBALS['meta']["admin"], $l)) { |
|
| 105 | + list(,$var_f,$n) = $l; |
|
| 106 | + } |
|
| 97 | 107 | if (_AJAX |
| 98 | 108 | OR !( |
| 99 | 109 | isset($_COOKIE['spip_admin']) |
@@ -108,8 +118,9 @@ discard block |
||
| 108 | 118 | } |
| 109 | 119 | if ($n) { |
| 110 | 120 | list(,$var_f,$n) = $l; |
| 111 | - if (tester_url_ecrire("base_$var_f")) |
|
| 112 | - $var_f = "base_$var_f"; |
|
| 121 | + if (tester_url_ecrire("base_$var_f")) { |
|
| 122 | + $var_f = "base_$var_f"; |
|
| 123 | + } |
|
| 113 | 124 | if ($var_f != $exec) { |
| 114 | 125 | spip_log("Le script $var_f lance par auteur$n se substitue a l'exec $exec"); |
| 115 | 126 | $exec = $var_f; |
@@ -150,8 +161,7 @@ discard block |
||
| 150 | 161 | if ($var_f = tester_url_ecrire($exec)) { |
| 151 | 162 | $var_f = charger_fonction ($var_f); |
| 152 | 163 | $var_f(); // at last |
| 153 | -} |
|
| 154 | -else { |
|
| 164 | +} else { |
|
| 155 | 165 | // Rien de connu: rerouter vers exec=404 au lieu d'echouer |
| 156 | 166 | // ce qui permet de laisser la main a un plugin |
| 157 | 167 | $var_f = charger_fonction('404'); |
@@ -10,7 +10,9 @@ |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | // rien sauf les "~" et "-," |
| 16 | 18 | |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | // Correction typographique francaise |
| 16 | 18 | |
@@ -36,8 +38,9 @@ discard block |
||
| 36 | 38 | $chars_trans = implode(' ',array_map('chr',$chars_trans)); |
| 37 | 39 | $chars_trans = unicode2charset(charset2unicode($chars_trans, 'iso-8859-1', 'forcer')); |
| 38 | 40 | $chars_trans = explode(" ",$chars_trans); |
| 39 | - foreach($chars as $k=>$r) |
|
| 40 | - $trans[$chars_trans[$k]] = $r; |
|
| 41 | + foreach($chars as $k=>$r) { |
|
| 42 | + $trans[$chars_trans[$k]] = $r; |
|
| 43 | + } |
|
| 41 | 44 | } |
| 42 | 45 | |
| 43 | 46 | $letexte = strtr($letexte, $trans); |
@@ -7,7 +7,9 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | |
| 10 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 10 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 11 | + return; |
|
| 12 | +} |
|
| 11 | 13 | |
| 12 | 14 | // Fonction appelee par divers pipelines |
| 13 | 15 | // http://doc.spip.org/@notifications_instituerarticle_dist |
@@ -24,19 +26,22 @@ discard block |
||
| 24 | 26 | $modele = ""; |
| 25 | 27 | if ($options['statut'] == 'publie') { |
| 26 | 28 | if ($GLOBALS['meta']["post_dates"]=='non' |
| 27 | - AND strtotime($options['date'])>time()) |
|
| 28 | - $modele = "notifications/article_valide"; |
|
| 29 | - else |
|
| 30 | - $modele = "notifications/article_publie"; |
|
| 29 | + AND strtotime($options['date'])>time()) { |
|
| 30 | + $modele = "notifications/article_valide"; |
|
| 31 | + } else { |
|
| 32 | + $modele = "notifications/article_publie"; |
|
| 33 | + } |
|
| 31 | 34 | } |
| 32 | 35 | |
| 33 | - if ($options['statut'] == 'prop' AND $options['statut_ancien'] != 'publie') |
|
| 34 | - $modele = "notifications/article_propose"; |
|
| 36 | + if ($options['statut'] == 'prop' AND $options['statut_ancien'] != 'publie') { |
|
| 37 | + $modele = "notifications/article_propose"; |
|
| 38 | + } |
|
| 35 | 39 | |
| 36 | 40 | if ($modele){ |
| 37 | 41 | $destinataires = array(); |
| 38 | - if ($GLOBALS['meta']["suivi_edito"] == "oui") |
|
| 39 | - $destinataires = explode(',',$GLOBALS['meta']["adresse_suivi"]); |
|
| 42 | + if ($GLOBALS['meta']["suivi_edito"] == "oui") { |
|
| 43 | + $destinataires = explode(',',$GLOBALS['meta']["adresse_suivi"]); |
|
| 44 | + } |
|
| 40 | 45 | |
| 41 | 46 | |
| 42 | 47 | $destinataires = pipeline('notifications_destinataires', |
@@ -10,7 +10,9 @@ |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | /** |
| 16 | 18 | * Un exec d'erreur |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | include_spip('inc/actions'); |
| 16 | 18 | include_spip('inc/headers'); |
@@ -20,8 +22,9 @@ discard block |
||
| 20 | 22 | { |
| 21 | 23 | |
| 22 | 24 | global $spip_version_base; |
| 23 | - if (!_FILE_CONNECT) |
|
| 24 | - redirige_url_ecrire("install"); |
|
| 25 | + if (!_FILE_CONNECT) { |
|
| 26 | + redirige_url_ecrire("install"); |
|
| 27 | + } |
|
| 25 | 28 | |
| 26 | 29 | // Si reinstallation necessaire, message ad hoc |
| 27 | 30 | if (_request('reinstall')=='oui'){ |
@@ -34,29 +37,32 @@ discard block |
||
| 34 | 37 | array('connect' => '<tt>'._FILE_CONNECT.'</tt>')) |
| 35 | 38 | .generer_form_ecrire('upgrade', "<input type='hidden' name='reinstall' value='non' />", '', _T('bouton_relancer_installation'))); |
| 36 | 39 | echo $r; |
| 37 | - } |
|
| 38 | - elseif (_request('fin')) { |
|
| 40 | + } elseif (_request('fin')) { |
|
| 39 | 41 | include_spip('inc/plugin'); |
| 40 | 42 | actualise_plugins_actifs(); |
| 41 | 43 | include_spip('inc/headers'); |
| 42 | 44 | $res = generer_url_ecrire('admin_plugin','var_mode=recalcul'); |
| 43 | 45 | echo redirige_formulaire($res); |
| 44 | - } |
|
| 45 | - else { |
|
| 46 | + } else { |
|
| 46 | 47 | |
| 47 | - if (!isset($GLOBALS['meta']['version_installee'])) |
|
| 48 | - $GLOBALS['meta']['version_installee'] = 0.0; |
|
| 49 | - else $GLOBALS['meta']['version_installee'] = |
|
| 48 | + if (!isset($GLOBALS['meta']['version_installee'])) { |
|
| 49 | + $GLOBALS['meta']['version_installee'] = 0.0; |
|
| 50 | + } else { |
|
| 51 | + $GLOBALS['meta']['version_installee'] = |
|
| 50 | 52 | (double)str_replace(',', '.', $GLOBALS['meta']['version_installee']); |
| 53 | + } |
|
| 51 | 54 | # NB: str_replace car, sur club-internet, il semble que version_installe soit |
| 52 | 55 | # enregistree au format '1,812' et non '1.812' |
| 53 | 56 | |
| 54 | 57 | // Erreur downgrade |
| 55 | 58 | // (cas de double installation de fichiers SPIP sur une meme base) |
| 56 | - if ($spip_version_base<$GLOBALS['meta']['version_installee']) |
|
| 57 | - $commentaire = _T('info_mise_a_niveau_base_2'); |
|
| 59 | + if ($spip_version_base<$GLOBALS['meta']['version_installee']) { |
|
| 60 | + $commentaire = _T('info_mise_a_niveau_base_2'); |
|
| 61 | + } |
|
| 58 | 62 | // Commentaire standard upgrade |
| 59 | - else $commentaire = _T('texte_mise_a_niveau_base_1'); |
|
| 63 | + else { |
|
| 64 | + $commentaire = _T('texte_mise_a_niveau_base_1'); |
|
| 65 | + } |
|
| 60 | 66 | |
| 61 | 67 | $commentaire .= "<br />[".$GLOBALS['meta']['version_installee']."/".$spip_version_base."]"; |
| 62 | 68 | |
@@ -64,9 +70,9 @@ discard block |
||
| 64 | 70 | include_spip('inc/headers'); |
| 65 | 71 | $admin = charger_fonction('admin', 'inc'); |
| 66 | 72 | $res = $admin('upgrade', _T('info_mise_a_niveau_base'), $commentaire); |
| 67 | - if ($res) |
|
| 68 | - echo $res; |
|
| 69 | - else { |
|
| 73 | + if ($res) { |
|
| 74 | + echo $res; |
|
| 75 | + } else { |
|
| 70 | 76 | // effacer les alea pour forcer leur relecture |
| 71 | 77 | // si jamais ils ont change pendant l'upgrade |
| 72 | 78 | unset($GLOBALS['meta']['alea_ephemere']); |
@@ -10,7 +10,9 @@ |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | include_spip('inc/minipres'); |
| 16 | 18 | include_spip('inc/install'); |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | include_spip('inc/actions'); |
| 16 | 18 | |
@@ -25,11 +27,15 @@ discard block |
||
| 25 | 27 | $do = _request('do'); |
| 26 | 28 | |
| 27 | 29 | if (preg_match('/^\w*$/', $do)) { |
| 28 | - if (!$do) $do = 'aff'; |
|
| 30 | + if (!$do) { |
|
| 31 | + $do = 'aff'; |
|
| 32 | + } |
|
| 29 | 33 | |
| 30 | 34 | $informer = charger_fonction('informer', 'inc'); |
| 31 | 35 | $res = $informer($id, $col, $exclus, _request('rac'), _request('type'), $do); |
| 32 | - } else $res = ''; |
|
| 36 | + } else { |
|
| 37 | + $res = ''; |
|
| 38 | + } |
|
| 33 | 39 | ajax_retour($res); |
| 34 | 40 | } |
| 35 | 41 | ?> |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | /** |
| 16 | 18 | * Un exec d'acces interdit |
@@ -29,8 +31,7 @@ discard block |
||
| 29 | 31 | if (_request('var_zajax')) { |
| 30 | 32 | include_spip('inc/actions'); |
| 31 | 33 | ajax_retour($contenu); |
| 32 | - } |
|
| 33 | - else { |
|
| 34 | + } else { |
|
| 34 | 35 | include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
| 35 | 36 | |
| 36 | 37 | $commencer_page = charger_fonction('commencer_page','inc'); |