@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | # attention toutefois seuls '' et '=' figurent dans les modes de compatibilite |
| 24 | 24 | define('_separateur_urls_page', ''); |
| 25 | 25 | # on peut indiquer '' si on a installe le .htaccess |
| 26 | -define('_debut_urls_page', get_spip_script('./') . '?'); |
|
| 26 | +define('_debut_urls_page', get_spip_script('./').'?'); |
|
| 27 | 27 | ####### |
| 28 | 28 | |
| 29 | 29 | |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - $url = \_debut_urls_page . $objet . \_separateur_urls_page |
|
| 50 | - . $id . \_terminaison_urls_page; |
|
| 49 | + $url = \_debut_urls_page.$objet.\_separateur_urls_page |
|
| 50 | + . $id.\_terminaison_urls_page; |
|
| 51 | 51 | |
| 52 | 52 | if ($args) { |
| 53 | 53 | $args = strpos($url, '?') ? "&$args" : "?$args"; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return _DIR_RACINE . $url . $args . ($ancre ? "#$ancre" : ''); |
|
| 56 | + return _DIR_RACINE.$url.$args.($ancre ? "#$ancre" : ''); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $result = sql_select( |
| 44 | 44 | 'id_rubrique, id_parent, titre, descriptif, lang', |
| 45 | 45 | 'spip_rubriques', |
| 46 | - 'id_parent=' . intval($collection), |
|
| 46 | + 'id_parent='.intval($collection), |
|
| 47 | 47 | '', |
| 48 | 48 | '0+titre,titre', |
| 49 | 49 | "$debut,$limite" |
@@ -74,19 +74,18 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' : |
|
| 78 | - http_img_pack( |
|
| 77 | + $lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' : http_img_pack( |
|
| 79 | 78 | 'auteur-0minirezo-16.png', |
| 80 | 79 | '', |
| 81 | 80 | " width='16' height='16'", |
| 82 | 81 | _T('image_administrer_rubrique') |
| 83 | - )) . |
|
| 84 | - " <a class='titremlien' dir='$lang_dir'" . |
|
| 85 | - ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='" . $row['lang'] . "'" : '') . |
|
| 86 | - " href='" . |
|
| 87 | - generer_objet_url($id_rubrique, 'rubrique') . |
|
| 88 | - "'><span class='titre'>" . |
|
| 89 | - $rang . $titre |
|
| 82 | + )). |
|
| 83 | + " <a class='titremlien' dir='$lang_dir'". |
|
| 84 | + ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='".$row['lang']."'" : ''). |
|
| 85 | + " href='". |
|
| 86 | + generer_objet_url($id_rubrique, 'rubrique'). |
|
| 87 | + "'><span class='titre'>". |
|
| 88 | + $rang.$titre |
|
| 90 | 89 | . '</span>' |
| 91 | 90 | . (is_string($logo) ? $logo : '') |
| 92 | 91 | . '</a>'; |
@@ -96,8 +95,8 @@ discard block |
||
| 96 | 95 | ; |
| 97 | 96 | |
| 98 | 97 | $res[] = |
| 99 | - debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre) . |
|
| 100 | - $les_sous_enfants . |
|
| 98 | + debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre). |
|
| 99 | + $les_sous_enfants. |
|
| 101 | 100 | fin_cadre_sous_rub(); |
| 102 | 101 | } |
| 103 | 102 | } |
@@ -116,7 +115,7 @@ discard block |
||
| 116 | 115 | * Le contenu du bloc dépliable |
| 117 | 116 | */ |
| 118 | 117 | function sous_enfant_rub($collection2) { |
| 119 | - $nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($collection2)); |
|
| 118 | + $nb = sql_countsel('spip_rubriques', 'id_parent='.intval($collection2)); |
|
| 120 | 119 | |
| 121 | 120 | $retour = ''; |
| 122 | 121 | $pagination = ''; |
@@ -128,23 +127,23 @@ discard block |
||
| 128 | 127 | * Si > 500 on affiche une pagination |
| 129 | 128 | */ |
| 130 | 129 | if ($nb > $limite) { |
| 131 | - $debut = _request('debut_rubrique' . $collection2) ?: $debut; |
|
| 130 | + $debut = _request('debut_rubrique'.$collection2) ?: $debut; |
|
| 132 | 131 | $pagination = chercher_filtre('pagination'); |
| 133 | - $pagination = '<p class="pagination">' . $pagination( |
|
| 132 | + $pagination = '<p class="pagination">'.$pagination( |
|
| 134 | 133 | $nb, |
| 135 | - '_rubrique' . $collection2, |
|
| 134 | + '_rubrique'.$collection2, |
|
| 136 | 135 | $debut, |
| 137 | 136 | $limite, |
| 138 | 137 | true, |
| 139 | 138 | 'prive' |
| 140 | - ) . '</p>'; |
|
| 139 | + ).'</p>'; |
|
| 141 | 140 | $limite = $debut + $limite; |
| 142 | 141 | } |
| 143 | 142 | |
| 144 | 143 | $result = sql_select( |
| 145 | 144 | 'id_rubrique, id_parent, titre, lang', |
| 146 | 145 | 'spip_rubriques', |
| 147 | - 'id_parent=' . intval($collection2), |
|
| 146 | + 'id_parent='.intval($collection2), |
|
| 148 | 147 | '', |
| 149 | 148 | '0+titre,titre', |
| 150 | 149 | "$debut,$limite" |
@@ -164,14 +163,14 @@ discard block |
||
| 164 | 163 | changer_typo($row['lang']); |
| 165 | 164 | $lang_dir = lang_dir($row['lang']); |
| 166 | 165 | if (autoriser('voir', 'rubrique', $id_rubrique2)) { |
| 167 | - $retour .= "\n<li class='item' dir='$lang_dir'><a href='" . generer_objet_url( |
|
| 166 | + $retour .= "\n<li class='item' dir='$lang_dir'><a href='".generer_objet_url( |
|
| 168 | 167 | $id_rubrique2, |
| 169 | 168 | 'rubrique' |
| 170 | - ) . "'>" . $rang2 . $titre2 . "</a></li>\n"; |
|
| 169 | + )."'>".$rang2.$titre2."</a></li>\n"; |
|
| 171 | 170 | } |
| 172 | 171 | } |
| 173 | 172 | |
| 174 | - $retour = $pagination . $retour . $pagination; |
|
| 173 | + $retour = $pagination.$retour.$pagination; |
|
| 175 | 174 | |
| 176 | 175 | if (!$retour) { |
| 177 | 176 | return ''; |
@@ -180,7 +179,7 @@ discard block |
||
| 180 | 179 | return debut_block_depliable($debut > 0 ? true : false, "enfants$collection2") |
| 181 | 180 | . "\n<ul class='liste-items sous-sous-rub'>\n" |
| 182 | 181 | . $retour |
| 183 | - . "</ul>\n" . fin_block() . "\n\n"; |
|
| 182 | + . "</ul>\n".fin_block()."\n\n"; |
|
| 184 | 183 | } |
| 185 | 184 | |
| 186 | 185 | /** |
@@ -199,13 +198,13 @@ discard block |
||
| 199 | 198 | $debut = 0; |
| 200 | 199 | $limite = 500; |
| 201 | 200 | |
| 202 | - $nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique)); |
|
| 201 | + $nb = sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)); |
|
| 203 | 202 | |
| 204 | 203 | if ($nb > $limite) { |
| 205 | - $debut = _request('debut_rubrique' . $id_rubrique) ?: $debut; |
|
| 204 | + $debut = _request('debut_rubrique'.$id_rubrique) ?: $debut; |
|
| 206 | 205 | $pagination = chercher_filtre('pagination'); |
| 207 | - $pagination = '<br class="nettoyeur"><p class="pagination">' . |
|
| 208 | - $pagination($nb, '_rubrique' . $id_rubrique, $debut, $limite, true, 'prive') . |
|
| 206 | + $pagination = '<br class="nettoyeur"><p class="pagination">'. |
|
| 207 | + $pagination($nb, '_rubrique'.$id_rubrique, $debut, $limite, true, 'prive'). |
|
| 209 | 208 | '</p>'; |
| 210 | 209 | } |
| 211 | 210 | |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | // on renvoi un 401 qui fait echouer la requete ajax silencieusement |
| 40 | 40 | if (!autoriser('ecrire')) { |
| 41 | 41 | $retour = |
| 42 | - '<ul class="deroulant__sous-menu" data-profondeur="1">' . |
|
| 43 | - '<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">' . |
|
| 44 | - '<a class="deroulant__lien" href="' . generer_url_ecrire('accueil') . '" data-profondeur="1">' . |
|
| 45 | - '<span class="libelle">' . _T('public:lien_connecter') . '</span>' . |
|
| 46 | - '</a>' . |
|
| 47 | - '</li>' . |
|
| 42 | + '<ul class="deroulant__sous-menu" data-profondeur="1">'. |
|
| 43 | + '<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">'. |
|
| 44 | + '<a class="deroulant__lien" href="'.generer_url_ecrire('accueil').'" data-profondeur="1">'. |
|
| 45 | + '<span class="libelle">'._T('public:lien_connecter').'</span>'. |
|
| 46 | + '</a>'. |
|
| 47 | + '</li>'. |
|
| 48 | 48 | '</ul>'; |
| 49 | 49 | include_spip('inc/actions'); |
| 50 | 50 | ajax_retour($retour); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if ($date = intval(_request('date'))) { |
| 55 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $date) . ' GMT'); |
|
| 55 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', $date).' GMT'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $r = gen_liste_rubriques(); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | and !strstr($_SERVER['SERVER_SOFTWARE'], 'IIS/') |
| 63 | 63 | ) { |
| 64 | 64 | include_spip('inc/headers'); |
| 65 | - header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']); |
|
| 65 | + header('Content-Type: text/html; charset='.$GLOBALS['meta']['charset']); |
|
| 66 | 66 | http_response_code(304); |
| 67 | 67 | exit; |
| 68 | 68 | } else { |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | **/ |
| 86 | 86 | function menu_rubriques($complet = true) { |
| 87 | 87 | $ret = '<li class="deroulant__item deroulant__item_tout toutsite" data-profondeur="1">' |
| 88 | - . '<a class="deroulant__lien" href="' . generer_url_ecrire('plan') . '" data-profondeur="1">' |
|
| 89 | - . '<span class="libelle">' . _T('info_tout_site') . '</span>' |
|
| 88 | + . '<a class="deroulant__lien" href="'.generer_url_ecrire('plan').'" data-profondeur="1">' |
|
| 89 | + . '<span class="libelle">'._T('info_tout_site').'</span>' |
|
| 90 | 90 | . '</a>' |
| 91 | 91 | . '</li>'; |
| 92 | 92 | |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | static $zmax = 6; |
| 146 | 146 | $profondeur_next = $profondeur + 1; |
| 147 | 147 | |
| 148 | - $nav = '<a class="deroulant__lien" href="' . generer_objet_url($id_rubrique, 'rubrique', '', '', false) . "\" data-profondeur=\"$profondeur\">" |
|
| 149 | - . '<span class="libelle">' . supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)) . '</span>' |
|
| 148 | + $nav = '<a class="deroulant__lien" href="'.generer_objet_url($id_rubrique, 'rubrique', '', '', false)."\" data-profondeur=\"$profondeur\">" |
|
| 149 | + . '<span class="libelle">'.supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)).'</span>' |
|
| 150 | 150 | . "</a>\n"; |
| 151 | 151 | |
| 152 | 152 | // Limiter volontairement le nombre de sous-menus |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $res['message_ok'] = _T('info_modification_enregistree'); |
| 101 | 101 | if ($retour) { |
| 102 | 102 | if (strncmp($retour, 'javascript:', 11) == 0) { |
| 103 | - $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>'; |
|
| 103 | + $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>'; |
|
| 104 | 104 | $res['editable'] = true; |
| 105 | 105 | } else { |
| 106 | 106 | $res['redirect'] = parametre_url($retour, $id_table_objet, $id); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | if (!isset($erreurs[$champ])) { |
| 141 | 141 | $erreurs[$champ] = ''; |
| 142 | 142 | } |
| 143 | - $erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>'; |
|
| 143 | + $erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | if ( |
| 219 | 219 | $config_fonc |
| 220 | 220 | and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
| 221 | - and $config_fonc !== $table_objet . '_edit_config' |
|
| 221 | + and $config_fonc !== $table_objet.'_edit_config' |
|
| 222 | 222 | ) { |
| 223 | 223 | if ( |
| 224 | 224 | $args = test_formulaire_inclus_par_modele() |
@@ -233,12 +233,12 @@ discard block |
||
| 233 | 233 | // Appel direct dans un squelette |
| 234 | 234 | if (!$row) { |
| 235 | 235 | if (!$new or $lier_trad) { |
| 236 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 236 | + if ($select = charger_fonction('precharger_'.$type, 'inc', true)) { |
|
| 237 | 237 | $row = $select($id, $id_parent, $lier_trad); |
| 238 | 238 | // si on a une fonction precharger, elle pu faire un reglage de langue |
| 239 | 239 | $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
| 240 | 240 | } else { |
| 241 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 241 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id)); |
|
| 242 | 242 | } |
| 243 | 243 | if (!$new) { |
| 244 | 244 | $md5 = controles_md5($row ?? []); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | if ($config_fonc) { |
| 289 | 289 | $contexte['config'] = $config = $config_fonc($contexte); |
| 290 | 290 | if (!$lang_default) { |
| 291 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 291 | + $lang_default = $config['langue'] ?? session_get('lang'); |
|
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | $config = $config + [ |
@@ -312,13 +312,12 @@ discard block |
||
| 312 | 312 | unset($contexte['lang']); |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 316 | - (!$lier_trad ? '' : |
|
| 317 | - ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 318 | - $lier_trad . |
|
| 319 | - "' />" . |
|
| 320 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 321 | - $lang_default . |
|
| 315 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n". |
|
| 316 | + (!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='". |
|
| 317 | + $lier_trad. |
|
| 318 | + "' />". |
|
| 319 | + "\n<input type='hidden' name='changer_lang' value='". |
|
| 320 | + $lang_default. |
|
| 322 | 321 | "' />")) |
| 323 | 322 | . $hidden |
| 324 | 323 | . ($md5 ?? ''); |
@@ -358,14 +357,14 @@ discard block |
||
| 358 | 357 | $aider = charger_fonction('aider', 'inc'); |
| 359 | 358 | if (strlen($texte) > 28 * 1024) { |
| 360 | 359 | $texte = str_replace("\r\n", "\n", $texte); |
| 361 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 360 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 362 | 361 | if ($pos > 0 and $pos < 32 * 1024) { |
| 363 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 362 | + $debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n"; |
|
| 364 | 363 | $suite = substr($texte, $pos + 2); |
| 365 | 364 | } else { |
| 366 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 365 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 367 | 366 | if (!($pos > 0 and $pos < 32 * 1024)) { |
| 368 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 367 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 369 | 368 | $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
| 370 | 369 | } else { |
| 371 | 370 | $decalage = 1; |
@@ -396,13 +395,13 @@ discard block |
||
| 396 | 395 | } |
| 397 | 396 | |
| 398 | 397 | include_spip('inc/barre'); |
| 399 | - $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 398 | + $textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n"; |
|
| 400 | 399 | $nombre = 0; |
| 401 | 400 | |
| 402 | 401 | while (strlen($texte) > 29 * 1024) { |
| 403 | 402 | $nombre++; |
| 404 | 403 | [$texte1, $texte] = coupe_trop_long($texte); |
| 405 | - $textes_supplement .= '<br />' . |
|
| 404 | + $textes_supplement .= '<br />'. |
|
| 406 | 405 | "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
| 407 | 406 | } |
| 408 | 407 | |
@@ -485,7 +484,7 @@ discard block |
||
| 485 | 484 | $ctr = []; |
| 486 | 485 | foreach ($data as $key => $val) { |
| 487 | 486 | $m = md5($val ?? ''); |
| 488 | - $k = $prefixe . $key; |
|
| 487 | + $k = $prefixe.$key; |
|
| 489 | 488 | |
| 490 | 489 | switch ($format) { |
| 491 | 490 | case 'html': |
@@ -498,7 +497,7 @@ discard block |
||
| 498 | 497 | } |
| 499 | 498 | |
| 500 | 499 | if ($format === 'html') { |
| 501 | - return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 500 | + return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n"; |
|
| 502 | 501 | } else { |
| 503 | 502 | return $ctr; |
| 504 | 503 | } |
@@ -650,7 +649,7 @@ discard block |
||
| 650 | 649 | // On elimine les donnees non modifiees par le formulaire (mais |
| 651 | 650 | // potentiellement modifiees entre temps par un autre utilisateur) |
| 652 | 651 | foreach ($champs as $key => $val) { |
| 653 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 652 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 654 | 653 | if (is_scalar($val) and $m == md5($val)) { |
| 655 | 654 | unset($champs[$key]); |
| 656 | 655 | } |
@@ -679,7 +678,7 @@ discard block |
||
| 679 | 678 | // de conflit. |
| 680 | 679 | $ctrh = $ctrq = $conflits = []; |
| 681 | 680 | foreach (array_keys($champs) as $key) { |
| 682 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 681 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 683 | 682 | $ctrh[$key] = $m; |
| 684 | 683 | $ctrq[] = $key; |
| 685 | 684 | } |
@@ -713,9 +712,9 @@ discard block |
||
| 713 | 712 | */ |
| 714 | 713 | function display_conflit_champ($x) { |
| 715 | 714 | if (strstr($x, "\n") or strlen($x) > 80) { |
| 716 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 715 | + return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n"; |
|
| 717 | 716 | } else { |
| 718 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 717 | + return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n"; |
|
| 719 | 718 | } |
| 720 | 719 | } |
| 721 | 720 | |
@@ -755,11 +754,11 @@ discard block |
||
| 755 | 754 | ) : $champ; |
| 756 | 755 | |
| 757 | 756 | $diffs[] = "<h2>$titre</h2>\n" |
| 758 | - . '<h3>' . _T('info_conflit_edition_differences') . "</h3>\n" |
|
| 759 | - . "<div style='max-height:8em; overflow: auto; width:99%;'>" . $d . "</div>\n" |
|
| 760 | - . '<h4>' . _T('info_conflit_edition_votre_version') . '</h4>' |
|
| 757 | + . '<h3>'._T('info_conflit_edition_differences')."</h3>\n" |
|
| 758 | + . "<div style='max-height:8em; overflow: auto; width:99%;'>".$d."</div>\n" |
|
| 759 | + . '<h4>'._T('info_conflit_edition_votre_version').'</h4>' |
|
| 761 | 760 | . display_conflit_champ($a['post']) |
| 762 | - . '<h4>' . _T('info_conflit_edition_version_enregistree') . '</h4>' |
|
| 761 | + . '<h4>'._T('info_conflit_edition_version_enregistree').'</h4>' |
|
| 763 | 762 | . display_conflit_champ($base); |
| 764 | 763 | } |
| 765 | 764 | |
@@ -767,16 +766,16 @@ discard block |
||
| 767 | 766 | $id = uniqid(random_int(0, mt_getrandmax())); |
| 768 | 767 | $redirect = "<form action='$redirect' method='get' |
| 769 | 768 | id='$id' |
| 770 | - style='float:" . $GLOBALS['spip_lang_right'] . "; margin-top:2em;'>\n" |
|
| 769 | + style='float:".$GLOBALS['spip_lang_right']."; margin-top:2em;'>\n" |
|
| 771 | 770 | . form_hidden($redirect) |
| 772 | - . "<input type='submit' value='" . _T('icone_retour') . "' /> |
|
| 771 | + . "<input type='submit' value='"._T('icone_retour')."' /> |
|
| 773 | 772 | </form>\n"; |
| 774 | 773 | |
| 775 | 774 | // pour les documents, on est probablement en ajax : il faut ajaxer |
| 776 | 775 | if (_AJAX) { |
| 777 | 776 | $redirect .= '<script type="text/javascript">' |
| 778 | - . 'setTimeout(function(){$("#' . $id . '") |
|
| 779 | - .ajaxForm({target:$("#' . $id . '").parent()}); |
|
| 777 | + . 'setTimeout(function(){$("#'.$id.'") |
|
| 778 | + .ajaxForm({target:$("#' . $id.'").parent()}); |
|
| 780 | 779 | }, 200);' |
| 781 | 780 | . "</script>\n"; |
| 782 | 781 | } |
@@ -795,9 +794,9 @@ discard block |
||
| 795 | 794 | .diff-para-deplace .diff-supprime { background: #ffb8b8; border: 1px solid #808080; } |
| 796 | 795 | .diff-para-deplace .diff-deplace { background: #b8b8ff; border: 1px solid #808080; } |
| 797 | 796 | </style>' |
| 798 | - . '<p>' . _T('info_conflit_edition_avis_non_sauvegarde') . '</p>' |
|
| 799 | - . '<p>' . _T('texte_conflit_edition_correction') . '</p>' |
|
| 800 | - . "<div style='text-align:" . $GLOBALS['spip_lang_left'] . ";'>" |
|
| 797 | + . '<p>'._T('info_conflit_edition_avis_non_sauvegarde').'</p>' |
|
| 798 | + . '<p>'._T('texte_conflit_edition_correction').'</p>' |
|
| 799 | + . "<div style='text-align:".$GLOBALS['spip_lang_left'].";'>" |
|
| 801 | 800 | . join("\n", $diffs) |
| 802 | 801 | . "</div>\n" |
| 803 | 802 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | ) { |
| 204 | 204 | $r = nettoyer_url_page($url, $contexte); |
| 205 | 205 | if ($r) { |
| 206 | - [$contexte, $type, , , $suite] = $r; |
|
| 206 | + [$contexte, $type,,, $suite] = $r; |
|
| 207 | 207 | $_id = id_table_objet($type); |
| 208 | 208 | $id_objet = $contexte[$_id]; |
| 209 | 209 | $url_propre = generer_objet_url($id_objet, $type); |
@@ -274,9 +274,9 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | function nettoyer_url_page($url, $contexte = []) { |
| 276 | 276 | $url_objets = urls_liste_objets(); |
| 277 | - $raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 278 | - $raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 279 | - $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,'; |
|
| 277 | + $raccourci_url_page_html = ',^(?:[^?]*/)?('.$url_objets.')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 278 | + $raccourci_url_page_id = ',^(?:[^?]*/)?('.$url_objets.')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 279 | + $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$url_objets.')([0-9]+)=?(&.*)?$,'; |
|
| 280 | 280 | |
| 281 | 281 | if ( |
| 282 | 282 | preg_match($raccourci_url_page_html, $url, $regs) |
@@ -314,11 +314,11 @@ discard block |
||
| 314 | 314 | $id = intval($id); |
| 315 | 315 | if (!isset($furls[$objet])) { |
| 316 | 316 | if ( |
| 317 | - function_exists($f = 'generer_' . $objet . '_url_ecrire') |
|
| 317 | + function_exists($f = 'generer_'.$objet.'_url_ecrire') |
|
| 318 | 318 | // ou definie par un plugin |
| 319 | 319 | or $f = charger_fonction($f, 'urls', true) |
| 320 | 320 | // deprecated |
| 321 | - or function_exists($f = 'generer_url_ecrire_' . $objet) or $f = charger_fonction($f, 'urls', true) |
|
| 321 | + or function_exists($f = 'generer_url_ecrire_'.$objet) or $f = charger_fonction($f, 'urls', true) |
|
| 322 | 322 | ) { |
| 323 | 323 | $furls[$objet] = $f; |
| 324 | 324 | } else { |
@@ -336,12 +336,12 @@ discard block |
||
| 336 | 336 | if ($public or $connect) { |
| 337 | 337 | return generer_objet_url_absolue($id, $objet, $args, $ancre, $public, '', $connect); |
| 338 | 338 | } |
| 339 | - $a = id_table_objet($objet) . '=' . intval($id); |
|
| 339 | + $a = id_table_objet($objet).'='.intval($id); |
|
| 340 | 340 | if (!function_exists('objet_info')) { |
| 341 | 341 | include_spip('inc/filtres'); |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | - return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : ''); |
|
| 344 | + return generer_url_ecrire(objet_info($objet, 'url_voir'), $a.($args ? "&$args" : '')).($ancre ? "#$ancre" : ''); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | asort($liste_plugins); |
| 65 | 65 | $exposed = urldecode(_request('plugin') ?? ''); |
| 66 | 66 | |
| 67 | - $block_par_lettre = false;//count($liste_plugins)>10; |
|
| 67 | + $block_par_lettre = false; //count($liste_plugins)>10; |
|
| 68 | 68 | $fast_liste_plugins_actifs = []; |
| 69 | 69 | $fast_liste_plugins_checked = []; |
| 70 | 70 | if (is_array($liste_plugins_actifs)) { |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | $actif = isset($fast_liste_plugins_actifs[$plug]); |
| 90 | 90 | $checked = isset($fast_liste_plugins_checked[$plug]); |
| 91 | 91 | $block_actif = $block_actif | $actif; |
| 92 | - $expose = ($exposed and ($exposed == $plug or $exposed == $dir_plugins . $plug or $exposed == substr( |
|
| 92 | + $expose = ($exposed and ($exposed == $plug or $exposed == $dir_plugins.$plug or $exposed == substr( |
|
| 93 | 93 | $dir_plugins, |
| 94 | 94 | strlen(_DIR_RACINE) |
| 95 | - ) . $plug)); |
|
| 96 | - $block .= $ligne_plug($url_page, $plug, $checked, $actif, $expose, 'item', $dir_plugins) . "\n"; |
|
| 95 | + ).$plug)); |
|
| 96 | + $block .= $ligne_plug($url_page, $plug, $checked, $actif, $expose, 'item', $dir_plugins)."\n"; |
|
| 97 | 97 | } |
| 98 | 98 | $res .= $block_par_lettre ? affiche_block_initiale($initiale, $block, $block_actif) : $block; |
| 99 | 99 | $class = basename($dir_plugins); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | include_fichiers_fonctions(); |
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 99 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 100 | 100 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 101 | 101 | // fonction ou name\space\fonction |
| 102 | 102 | if (is_callable($f)) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | // affichage "GIT [master: abcdef]" |
| 224 | 224 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 225 | 225 | if ($desc['branch']) { |
| 226 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 226 | + $commit = $desc['branch'].': '.$commit; |
|
| 227 | 227 | } |
| 228 | 228 | return "{$desc['vcs']} [$commit]"; |
| 229 | 229 | } |
@@ -242,9 +242,9 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // version installee par GIT |
| 245 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 245 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 246 | 246 | $currentHead = trim(substr($c, 4)); |
| 247 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 247 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 248 | 248 | return [ |
| 249 | 249 | 'vcs' => 'GIT', |
| 250 | 250 | 'branch' => basename($currentHead), |
@@ -271,8 +271,8 @@ discard block |
||
| 271 | 271 | $dir = '.'; |
| 272 | 272 | } |
| 273 | 273 | // version installee par SVN |
| 274 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 275 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 274 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 275 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 276 | 276 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 277 | 277 | if ($result) { |
| 278 | 278 | $row = $result->fetchArray(); |
@@ -290,12 +290,12 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 292 | 292 | // et laisser passer les fonctions personnelles baptisees image_... |
| 293 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 294 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 295 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 296 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 297 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 298 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 293 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 294 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 295 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 296 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 297 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 298 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 299 | 299 | |
| 300 | 300 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 301 | 301 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -454,8 +454,8 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | function filtre_debug($val, $key = null) { |
| 456 | 456 | $debug = ( |
| 457 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 458 | - ) . var_export($val, true); |
|
| 457 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 458 | + ).var_export($val, true); |
|
| 459 | 459 | |
| 460 | 460 | include_spip('inc/autoriser'); |
| 461 | 461 | if (autoriser('webmestre')) { |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | $is_file = false; |
| 510 | 510 | } |
| 511 | 511 | if ($is_file) { |
| 512 | - $is_local_file = function ($path) { |
|
| 512 | + $is_local_file = function($path) { |
|
| 513 | 513 | if (strpos($path, '?') !== false) { |
| 514 | 514 | $path = supprimer_timestamp($path); |
| 515 | 515 | // remove ?24px added by find_in_theme on .svg files |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 562 | 562 | $srcover = $match[1]; |
| 563 | 563 | array_shift($args); |
| 564 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 564 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 565 | 565 | $srcover_filter = call_user_func_array($filtre, $args); |
| 566 | 566 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 567 | 567 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | if (!$srcHeight) { |
| 638 | 638 | $hauteur_img[$src] = $srcHeight = $imagesize[1]; |
| 639 | 639 | } |
| 640 | - if (!$srcSize){ |
|
| 640 | + if (!$srcSize) { |
|
| 641 | 641 | $poids_img[$src] = filesize($src); |
| 642 | 642 | } |
| 643 | 643 | } |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | if (!$srcHeight) { |
| 652 | 652 | $hauteur_img[$src] = $srcHeight = $height; |
| 653 | 653 | } |
| 654 | - if (!$srcSize){ |
|
| 654 | + if (!$srcSize) { |
|
| 655 | 655 | $poids_img[$src] = $srcSize = strlen($src); |
| 656 | 656 | } |
| 657 | 657 | } |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | if (!$srcHeight) { |
| 670 | 670 | $hauteur_img[$src] = $srcHeight = $valeurs['hauteur_dest']; |
| 671 | 671 | } |
| 672 | - if (!$srcSize){ |
|
| 672 | + if (!$srcSize) { |
|
| 673 | 673 | $poids_img[$src] = $srcSize = 0; |
| 674 | 674 | } |
| 675 | 675 | } |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | return $infos['poids']; |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | -function taille_image($img, $force_refresh = false){ |
|
| 698 | +function taille_image($img, $force_refresh = false) { |
|
| 699 | 699 | $infos = infos_image($img, $force_refresh); |
| 700 | 700 | return [$infos['hauteur'], $infos['largeur']]; |
| 701 | 701 | } |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | // " -> " et tout ce genre de choses |
| 965 | 965 | $u = $GLOBALS['meta']['pcre_u']; |
| 966 | 966 | $texte = str_replace(' ', ' ', $texte); |
| 967 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 967 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 968 | 968 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 969 | 969 | $texte = entites_html($texte, false, false); |
| 970 | 970 | // mais bien echapper les double quotes ! |
@@ -1024,7 +1024,7 @@ discard block |
||
| 1024 | 1024 | **/ |
| 1025 | 1025 | function supprimer_numero($texte) { |
| 1026 | 1026 | return preg_replace( |
| 1027 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1027 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1028 | 1028 | '', |
| 1029 | 1029 | $texte |
| 1030 | 1030 | ); |
@@ -1052,7 +1052,7 @@ discard block |
||
| 1052 | 1052 | function recuperer_numero($texte) { |
| 1053 | 1053 | if ( |
| 1054 | 1054 | preg_match( |
| 1055 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1055 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1056 | 1056 | $texte, |
| 1057 | 1057 | $regs |
| 1058 | 1058 | ) |
@@ -1143,8 +1143,8 @@ discard block |
||
| 1143 | 1143 | **/ |
| 1144 | 1144 | function textebrut($texte) { |
| 1145 | 1145 | $u = $GLOBALS['meta']['pcre_u']; |
| 1146 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1147 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1146 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1147 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1148 | 1148 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1149 | 1149 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1150 | 1150 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | ) |
| 1179 | 1179 | ) { |
| 1180 | 1180 | foreach ($liens[0] as $a) { |
| 1181 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1181 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1182 | 1182 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1183 | 1183 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1184 | 1184 | $texte = str_replace($a, $ablank, $texte); |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | foreach ($regs[0] as $a) { |
| 1204 | 1204 | $rel = extraire_attribut($a, 'rel'); |
| 1205 | 1205 | if (strpos($rel, 'nofollow') === false) { |
| 1206 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1206 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1207 | 1207 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1208 | 1208 | $texte = str_replace($a, $anofollow, $texte); |
| 1209 | 1209 | } |
@@ -1232,7 +1232,7 @@ discard block |
||
| 1232 | 1232 | $u = $GLOBALS['meta']['pcre_u']; |
| 1233 | 1233 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1234 | 1234 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1235 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1235 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1236 | 1236 | |
| 1237 | 1237 | return $texte; |
| 1238 | 1238 | } |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | return $texte; |
| 1264 | 1264 | } |
| 1265 | 1265 | include_spip('inc/texte'); |
| 1266 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1266 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1267 | 1267 | 'div' : 'span'; |
| 1268 | 1268 | |
| 1269 | 1269 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | } |
| 1376 | 1376 | $u = $GLOBALS['meta']['pcre_u']; |
| 1377 | 1377 | if ($textebrut) { |
| 1378 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1378 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1379 | 1379 | } |
| 1380 | 1380 | $texte = texte_backend($texte); |
| 1381 | 1381 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1410,7 +1410,7 @@ discard block |
||
| 1410 | 1410 | # un message pour abs_url |
| 1411 | 1411 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1412 | 1412 | $url = trim($url); |
| 1413 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1413 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1414 | 1414 | |
| 1415 | 1415 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1416 | 1416 | } |
@@ -1614,14 +1614,14 @@ discard block |
||
| 1614 | 1614 | if (strpos($texte, '<') !== false) { |
| 1615 | 1615 | include_spip('inc/lien'); |
| 1616 | 1616 | if (defined('_PREG_MODELE')) { |
| 1617 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1617 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1618 | 1618 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1619 | 1619 | } |
| 1620 | 1620 | } |
| 1621 | 1621 | |
| 1622 | 1622 | $debut = ''; |
| 1623 | 1623 | $suite = $texte; |
| 1624 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1624 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1625 | 1625 | $debut .= substr($suite, 0, $t - 1); |
| 1626 | 1626 | $suite = substr($suite, $t); |
| 1627 | 1627 | $car = substr($suite, 0, 1); |
@@ -1639,11 +1639,11 @@ discard block |
||
| 1639 | 1639 | $suite = substr($suite, strlen($regs[0])); |
| 1640 | 1640 | } |
| 1641 | 1641 | } |
| 1642 | - $texte = $debut . $suite; |
|
| 1642 | + $texte = $debut.$suite; |
|
| 1643 | 1643 | |
| 1644 | 1644 | $texte = echappe_retour($texte); |
| 1645 | 1645 | |
| 1646 | - return $texte . $fin; |
|
| 1646 | + return $texte.$fin; |
|
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | 1649 | |
@@ -1705,7 +1705,7 @@ discard block |
||
| 1705 | 1705 | } |
| 1706 | 1706 | |
| 1707 | 1707 | foreach ($regs as $reg) { |
| 1708 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1708 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1709 | 1709 | $desc = $traduire($cle, $lang, true); |
| 1710 | 1710 | $l = $desc->langue; |
| 1711 | 1711 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1819,9 +1819,9 @@ discard block |
||
| 1819 | 1819 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1820 | 1820 | include_spip('inc/texte'); |
| 1821 | 1821 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1822 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1822 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1823 | 1823 | if ($mode === 'div') { |
| 1824 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1824 | + $trad = rtrim($trad)."\n\n"; |
|
| 1825 | 1825 | } |
| 1826 | 1826 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1827 | 1827 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -2017,7 +2017,7 @@ discard block |
||
| 2017 | 2017 | if (is_array($balise)) { |
| 2018 | 2018 | array_walk( |
| 2019 | 2019 | $balise, |
| 2020 | - function (&$a, $key, $t) { |
|
| 2020 | + function(&$a, $key, $t) { |
|
| 2021 | 2021 | $a = extraire_attribut($a, $t); |
| 2022 | 2022 | }, |
| 2023 | 2023 | $attribut |
@@ -2114,14 +2114,14 @@ discard block |
||
| 2114 | 2114 | |
| 2115 | 2115 | if ($old !== null) { |
| 2116 | 2116 | // Remplacer l'ancien attribut du meme nom |
| 2117 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2117 | + $balise = $r[1].$insert.$r[5]; |
|
| 2118 | 2118 | } else { |
| 2119 | 2119 | // preferer une balise " />" (comme <img />) |
| 2120 | 2120 | if (preg_match(',/>,', $balise)) { |
| 2121 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2121 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2122 | 2122 | } // sinon une balise <a ...> ... </a> |
| 2123 | 2123 | else { |
| 2124 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2124 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2125 | 2125 | } |
| 2126 | 2126 | } |
| 2127 | 2127 | |
@@ -2176,7 +2176,7 @@ discard block |
||
| 2176 | 2176 | if ( |
| 2177 | 2177 | $class_courante |
| 2178 | 2178 | and strpos($class_courante, (string) $c) !== false |
| 2179 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2179 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2180 | 2180 | ) { |
| 2181 | 2181 | $is_class_presente = true; |
| 2182 | 2182 | } |
@@ -2184,12 +2184,12 @@ discard block |
||
| 2184 | 2184 | in_array($operation, ['ajouter', 'commuter']) |
| 2185 | 2185 | and !$is_class_presente |
| 2186 | 2186 | ) { |
| 2187 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2187 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2188 | 2188 | } elseif ( |
| 2189 | 2189 | in_array($operation, ['supprimer', 'commuter']) |
| 2190 | 2190 | and $is_class_presente |
| 2191 | 2191 | ) { |
| 2192 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2192 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2193 | 2193 | } |
| 2194 | 2194 | } |
| 2195 | 2195 | |
@@ -2252,7 +2252,7 @@ discard block |
||
| 2252 | 2252 | // Quelques fonctions de calcul arithmetique |
| 2253 | 2253 | // |
| 2254 | 2254 | function floatstr($a) { |
| 2255 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2255 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2256 | 2256 | } |
| 2257 | 2257 | function strize($f, $a, $b) { |
| 2258 | 2258 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2388,13 +2388,13 @@ discard block |
||
| 2388 | 2388 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2389 | 2389 | define('_TAGS_NOM_AUTEUR', ''); |
| 2390 | 2390 | } |
| 2391 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2391 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2392 | 2392 | foreach ($tags_acceptes as $tag) { |
| 2393 | 2393 | if (strlen($tag)) { |
| 2394 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2395 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2396 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2397 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2394 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2395 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2396 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2397 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2398 | 2398 | } |
| 2399 | 2399 | } |
| 2400 | 2400 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2448,7 +2448,7 @@ discard block |
||
| 2448 | 2448 | . http_img_pack( |
| 2449 | 2449 | 'attachment-16.png', |
| 2450 | 2450 | $t, |
| 2451 | - 'title="' . attribut_html($t) . '"' |
|
| 2451 | + 'title="'.attribut_html($t).'"' |
|
| 2452 | 2452 | ) |
| 2453 | 2453 | . '</a>', |
| 2454 | 2454 | $tag |
@@ -2512,10 +2512,10 @@ discard block |
||
| 2512 | 2512 | $fichier = basename($url); |
| 2513 | 2513 | |
| 2514 | 2514 | return '<a rel="enclosure"' |
| 2515 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2516 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2517 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2518 | - . '>' . $fichier . '</a>'; |
|
| 2515 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2516 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2517 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2518 | + . '>'.$fichier.'</a>'; |
|
| 2519 | 2519 | } |
| 2520 | 2520 | |
| 2521 | 2521 | /** |
@@ -2543,9 +2543,9 @@ discard block |
||
| 2543 | 2543 | } # vieux data |
| 2544 | 2544 | $fichier = basename($url); |
| 2545 | 2545 | $enclosures[] = '<enclosure' |
| 2546 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2547 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2548 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2546 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2547 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2548 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2549 | 2549 | . ' />'; |
| 2550 | 2550 | } |
| 2551 | 2551 | } |
@@ -2571,7 +2571,7 @@ discard block |
||
| 2571 | 2571 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2572 | 2572 | $subjects .= '<dc:subject>' |
| 2573 | 2573 | . texte_backend(textebrut($e)) |
| 2574 | - . '</dc:subject>' . "\n"; |
|
| 2574 | + . '</dc:subject>'."\n"; |
|
| 2575 | 2575 | } |
| 2576 | 2576 | } |
| 2577 | 2577 | |
@@ -2607,7 +2607,7 @@ discard block |
||
| 2607 | 2607 | if (is_array($texte)) { |
| 2608 | 2608 | array_walk( |
| 2609 | 2609 | $texte, |
| 2610 | - function (&$a, $key, $t) { |
|
| 2610 | + function(&$a, $key, $t) { |
|
| 2611 | 2611 | $a = extraire_balise($a, $t); |
| 2612 | 2612 | }, |
| 2613 | 2613 | $tag |
@@ -2655,7 +2655,7 @@ discard block |
||
| 2655 | 2655 | if (is_array($texte)) { |
| 2656 | 2656 | array_walk( |
| 2657 | 2657 | $texte, |
| 2658 | - function (&$a, $key, $t) { |
|
| 2658 | + function(&$a, $key, $t) { |
|
| 2659 | 2659 | $a = extraire_balises($a, $t); |
| 2660 | 2660 | }, |
| 2661 | 2661 | $tag |
@@ -2788,7 +2788,7 @@ discard block |
||
| 2788 | 2788 | if ($fond != '404') { |
| 2789 | 2789 | $contexte = array_shift($p); |
| 2790 | 2790 | $contexte['page'] = $fond; |
| 2791 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2791 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2792 | 2792 | } |
| 2793 | 2793 | } |
| 2794 | 2794 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2843,9 +2843,9 @@ discard block |
||
| 2843 | 2843 | . '"' |
| 2844 | 2844 | . (is_null($val) |
| 2845 | 2845 | ? '' |
| 2846 | - : ' value="' . entites_html($val) . '"' |
|
| 2846 | + : ' value="'.entites_html($val).'"' |
|
| 2847 | 2847 | ) |
| 2848 | - . ' type="hidden"' . "\n/>"; |
|
| 2848 | + . ' type="hidden"'."\n/>"; |
|
| 2849 | 2849 | } |
| 2850 | 2850 | |
| 2851 | 2851 | return join('', $hidden); |
@@ -2955,7 +2955,7 @@ discard block |
||
| 2955 | 2955 | |
| 2956 | 2956 | return preg_replace_callback( |
| 2957 | 2957 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2958 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2958 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2959 | 2959 | $contenu |
| 2960 | 2960 | ); |
| 2961 | 2961 | } |
@@ -3016,14 +3016,14 @@ discard block |
||
| 3016 | 3016 | ) { |
| 3017 | 3017 | $distant = true; |
| 3018 | 3018 | $cssf = parse_url($css); |
| 3019 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 3019 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 3020 | 3020 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 3021 | 3021 | } else { |
| 3022 | 3022 | $distant = false; |
| 3023 | 3023 | $cssf = $css; |
| 3024 | 3024 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 3025 | 3025 | //propose (rien a faire dans ce cas) |
| 3026 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 3026 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 3027 | 3027 | if (@file_exists($f)) { |
| 3028 | 3028 | return $f; |
| 3029 | 3029 | } |
@@ -3033,7 +3033,7 @@ discard block |
||
| 3033 | 3033 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 3034 | 3034 | $f = $dir_var |
| 3035 | 3035 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 3036 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 3036 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3037 | 3037 | |
| 3038 | 3038 | // la css peut etre distante (url absolue !) |
| 3039 | 3039 | if ($distant) { |
@@ -3079,8 +3079,8 @@ discard block |
||
| 3079 | 3079 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3080 | 3080 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3081 | 3081 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3082 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3083 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3082 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3083 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3084 | 3084 | } |
| 3085 | 3085 | $src[] = $regs[0][$k]; |
| 3086 | 3086 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3129,7 +3129,7 @@ discard block |
||
| 3129 | 3129 | |
| 3130 | 3130 | $f = basename($css, '.css'); |
| 3131 | 3131 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3132 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3132 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3133 | 3133 | . '.css'; |
| 3134 | 3134 | |
| 3135 | 3135 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3139,7 +3139,7 @@ discard block |
||
| 3139 | 3139 | if ($url_absolue_css == $css) { |
| 3140 | 3140 | if ( |
| 3141 | 3141 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3142 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3142 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3143 | 3143 | ) { |
| 3144 | 3144 | include_spip('inc/distant'); |
| 3145 | 3145 | $contenu = recuperer_url($css); |
@@ -3251,7 +3251,7 @@ discard block |
||
| 3251 | 3251 | $expression = str_replace('\/', '/', $expression); |
| 3252 | 3252 | $expression = str_replace('/', '\/', $expression); |
| 3253 | 3253 | |
| 3254 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3254 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3255 | 3255 | if (isset($r[$capte])) { |
| 3256 | 3256 | return $r[$capte]; |
| 3257 | 3257 | } else { |
@@ -3289,7 +3289,7 @@ discard block |
||
| 3289 | 3289 | $expression = str_replace('\/', '/', $expression); |
| 3290 | 3290 | $expression = str_replace('/', '\/', $expression); |
| 3291 | 3291 | |
| 3292 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3292 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3293 | 3293 | } |
| 3294 | 3294 | |
| 3295 | 3295 | |
@@ -3308,7 +3308,7 @@ discard block |
||
| 3308 | 3308 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3309 | 3309 | |
| 3310 | 3310 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3311 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3311 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3312 | 3312 | |
| 3313 | 3313 | if ( |
| 3314 | 3314 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3322,7 +3322,7 @@ discard block |
||
| 3322 | 3322 | if (!isset($doublons['documents'])) { |
| 3323 | 3323 | $doublons['documents'] = ''; |
| 3324 | 3324 | } |
| 3325 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3325 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3326 | 3326 | } |
| 3327 | 3327 | |
| 3328 | 3328 | return $letexte; |
@@ -3379,7 +3379,7 @@ discard block |
||
| 3379 | 3379 | if ($env) { |
| 3380 | 3380 | foreach ($env as $i => $j) { |
| 3381 | 3381 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3382 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3382 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3383 | 3383 | } |
| 3384 | 3384 | } |
| 3385 | 3385 | } |
@@ -3418,7 +3418,7 @@ discard block |
||
| 3418 | 3418 | if ($env) { |
| 3419 | 3419 | foreach ($env as $i => $j) { |
| 3420 | 3420 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3421 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3421 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3422 | 3422 | } |
| 3423 | 3423 | } |
| 3424 | 3424 | } |
@@ -3492,10 +3492,10 @@ discard block |
||
| 3492 | 3492 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3493 | 3493 | if ( |
| 3494 | 3494 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3495 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3495 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3496 | 3496 | and file_exists($variante_svg_generique) |
| 3497 | 3497 | ) { |
| 3498 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3498 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3499 | 3499 | $img_file = $variante_svg_size; |
| 3500 | 3500 | } |
| 3501 | 3501 | else { |
@@ -3553,7 +3553,7 @@ discard block |
||
| 3553 | 3553 | return ''; |
| 3554 | 3554 | } |
| 3555 | 3555 | } |
| 3556 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3556 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3557 | 3557 | } |
| 3558 | 3558 | |
| 3559 | 3559 | if (file_exists($img_file)) { |
@@ -3563,14 +3563,14 @@ discard block |
||
| 3563 | 3563 | $alt = ''; |
| 3564 | 3564 | } |
| 3565 | 3565 | elseif ($alt or $alt === '') { |
| 3566 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3566 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3567 | 3567 | } |
| 3568 | 3568 | else { |
| 3569 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3569 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3570 | 3570 | } |
| 3571 | 3571 | return "<img src='$img_file'$alt" |
| 3572 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3573 | - . ' ' . ltrim($atts) |
|
| 3572 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3573 | + . ' '.ltrim($atts) |
|
| 3574 | 3574 | . ' />'; |
| 3575 | 3575 | } |
| 3576 | 3576 | |
@@ -3584,10 +3584,10 @@ discard block |
||
| 3584 | 3584 | */ |
| 3585 | 3585 | function http_style_background($img, $att = '', $size = null) { |
| 3586 | 3586 | if ($size and is_numeric($size)) { |
| 3587 | - $size = trim($size) . 'px'; |
|
| 3587 | + $size = trim($size).'px'; |
|
| 3588 | 3588 | } |
| 3589 | - return " style='background" . |
|
| 3590 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3589 | + return " style='background". |
|
| 3590 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3591 | 3591 | . ($size ? "background-size:{$size};" : '') |
| 3592 | 3592 | . "'"; |
| 3593 | 3593 | } |
@@ -3702,7 +3702,7 @@ discard block |
||
| 3702 | 3702 | $img = http_img_pack( |
| 3703 | 3703 | $img, |
| 3704 | 3704 | $alt, |
| 3705 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3705 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3706 | 3706 | '', |
| 3707 | 3707 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3708 | 3708 | ); |
@@ -3787,7 +3787,7 @@ discard block |
||
| 3787 | 3787 | $balise_svg_source = $balise_svg; |
| 3788 | 3788 | |
| 3789 | 3789 | // entete XML à supprimer |
| 3790 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3790 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3791 | 3791 | |
| 3792 | 3792 | // IE est toujours mon ami |
| 3793 | 3793 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3805,9 +3805,9 @@ discard block |
||
| 3805 | 3805 | // regler le alt |
| 3806 | 3806 | if ($alt) { |
| 3807 | 3807 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3808 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3808 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3809 | 3809 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3810 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3810 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3811 | 3811 | $balise_svg .= $title; |
| 3812 | 3812 | } |
| 3813 | 3813 | else { |
@@ -3855,7 +3855,7 @@ discard block |
||
| 3855 | 3855 | if (is_array($tableau)) { |
| 3856 | 3856 | foreach ($tableau as $k => $v) { |
| 3857 | 3857 | $res = recuperer_fond( |
| 3858 | - 'modeles/' . $modele, |
|
| 3858 | + 'modeles/'.$modele, |
|
| 3859 | 3859 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3860 | 3860 | ); |
| 3861 | 3861 | $texte .= $res; |
@@ -4040,7 +4040,7 @@ discard block |
||
| 4040 | 4040 | } |
| 4041 | 4041 | |
| 4042 | 4042 | $c = serialize($c); |
| 4043 | - $cle = calculer_cle_action($form . $c); |
|
| 4043 | + $cle = calculer_cle_action($form.$c); |
|
| 4044 | 4044 | $c = "$cle:$c"; |
| 4045 | 4045 | |
| 4046 | 4046 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4098,15 +4098,15 @@ discard block |
||
| 4098 | 4098 | } |
| 4099 | 4099 | // toujours encoder l'url source dans le bloc ajax |
| 4100 | 4100 | $r = self(); |
| 4101 | - $r = ' data-origin="' . $r . '"'; |
|
| 4101 | + $r = ' data-origin="'.$r.'"'; |
|
| 4102 | 4102 | $class = 'ajaxbloc'; |
| 4103 | 4103 | if ($ajaxid and is_string($ajaxid)) { |
| 4104 | 4104 | // ajaxid est normalement conforme a un nom de classe css |
| 4105 | 4105 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4106 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4106 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4107 | 4107 | } |
| 4108 | 4108 | |
| 4109 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4109 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4110 | 4110 | } |
| 4111 | 4111 | |
| 4112 | 4112 | /** |
@@ -4150,7 +4150,7 @@ discard block |
||
| 4150 | 4150 | $cle = substr($c, 0, $p); |
| 4151 | 4151 | $c = substr($c, $p + 1); |
| 4152 | 4152 | |
| 4153 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4153 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4154 | 4154 | $env = @unserialize($c); |
| 4155 | 4155 | return $env; |
| 4156 | 4156 | } |
@@ -4271,13 +4271,13 @@ discard block |
||
| 4271 | 4271 | } |
| 4272 | 4272 | } |
| 4273 | 4273 | } |
| 4274 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4274 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4275 | 4275 | } else { |
| 4276 | 4276 | $bal = 'a'; |
| 4277 | 4277 | $att = "href='$url'" |
| 4278 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4279 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4280 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4278 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4279 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4280 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4281 | 4281 | . $evt; |
| 4282 | 4282 | } |
| 4283 | 4283 | if ($libelle === null) { |
@@ -4416,7 +4416,7 @@ discard block |
||
| 4416 | 4416 | |
| 4417 | 4417 | // Icône |
| 4418 | 4418 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4419 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4419 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4420 | 4420 | |
| 4421 | 4421 | // Markup final |
| 4422 | 4422 | if ($type == 'lien') { |
@@ -4693,20 +4693,20 @@ discard block |
||
| 4693 | 4693 | $class_form = 'ajax'; |
| 4694 | 4694 | $class = str_replace('ajax', '', $class); |
| 4695 | 4695 | } |
| 4696 | - $class_btn = 'submit ' . trim($class); |
|
| 4696 | + $class_btn = 'submit '.trim($class); |
|
| 4697 | 4697 | |
| 4698 | 4698 | if ($confirm) { |
| 4699 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4699 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4700 | 4700 | if ($callback) { |
| 4701 | 4701 | $callback = "$confirm?($callback):false"; |
| 4702 | 4702 | } else { |
| 4703 | 4703 | $callback = $confirm; |
| 4704 | 4704 | } |
| 4705 | 4705 | } |
| 4706 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4706 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4707 | 4707 | $title = $title ? " title='$title'" : ''; |
| 4708 | 4708 | |
| 4709 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4709 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4710 | 4710 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4711 | 4711 | } |
| 4712 | 4712 | |
@@ -4771,14 +4771,14 @@ discard block |
||
| 4771 | 4771 | $champ_titre = ''; |
| 4772 | 4772 | if ($demande_titre) { |
| 4773 | 4773 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4774 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4774 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4775 | 4775 | } |
| 4776 | 4776 | include_spip('base/abstract_sql'); |
| 4777 | 4777 | include_spip('base/connect_sql'); |
| 4778 | 4778 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4779 | - '*' . $champ_titre, |
|
| 4779 | + '*'.$champ_titre, |
|
| 4780 | 4780 | $desc['table_sql'], |
| 4781 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4781 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4782 | 4782 | ); |
| 4783 | 4783 | |
| 4784 | 4784 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4871,8 +4871,7 @@ discard block |
||
| 4871 | 4871 | if (isset($ligne_sql['chapo'])) { |
| 4872 | 4872 | $chapo = $ligne_sql['chapo']; |
| 4873 | 4873 | $texte = strlen($descriptif) ? |
| 4874 | - '' : |
|
| 4875 | - "$chapo \n\n $texte"; |
|
| 4874 | + '' : "$chapo \n\n $texte"; |
|
| 4876 | 4875 | } |
| 4877 | 4876 | |
| 4878 | 4877 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4947,7 +4946,7 @@ discard block |
||
| 4947 | 4946 | return $texte; |
| 4948 | 4947 | } |
| 4949 | 4948 | |
| 4950 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4949 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4951 | 4950 | |
| 4952 | 4951 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4953 | 4952 | $Pile = [0 => $env]; |
@@ -4981,7 +4980,7 @@ discard block |
||
| 4981 | 4980 | } |
| 4982 | 4981 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4983 | 4982 | |
| 4984 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4983 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4985 | 4984 | } |
| 4986 | 4985 | |
| 4987 | 4986 | /** |
@@ -5007,10 +5006,10 @@ discard block |
||
| 5007 | 5006 | function wrap($texte, $wrap) { |
| 5008 | 5007 | $balises = extraire_balises($wrap); |
| 5009 | 5008 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 5010 | - $texte = $wrap . $texte; |
|
| 5009 | + $texte = $wrap.$texte; |
|
| 5011 | 5010 | $regs = array_reverse($regs[1]); |
| 5012 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 5013 | - $texte = $texte . $wrap; |
|
| 5011 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 5012 | + $texte = $texte.$wrap; |
|
| 5014 | 5013 | } |
| 5015 | 5014 | |
| 5016 | 5015 | return $texte; |
@@ -5041,7 +5040,7 @@ discard block |
||
| 5041 | 5040 | |
| 5042 | 5041 | // caster $u en array si besoin |
| 5043 | 5042 | if (is_object($u)) { |
| 5044 | - $u = (array)$u; |
|
| 5043 | + $u = (array) $u; |
|
| 5045 | 5044 | } |
| 5046 | 5045 | |
| 5047 | 5046 | if (is_array($u)) { |
@@ -5063,7 +5062,7 @@ discard block |
||
| 5063 | 5062 | // sinon on passe a la ligne et on indente |
| 5064 | 5063 | $i_str = str_pad('', $indent, ' '); |
| 5065 | 5064 | foreach ($u as $k => $v) { |
| 5066 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5065 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5067 | 5066 | } |
| 5068 | 5067 | |
| 5069 | 5068 | return $out; |
@@ -5117,7 +5116,7 @@ discard block |
||
| 5117 | 5116 | * @return string |
| 5118 | 5117 | */ |
| 5119 | 5118 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5120 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5119 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5121 | 5120 | $icone = chemin_image($icone); |
| 5122 | 5121 | $balise_img = charger_filtre('balise_img'); |
| 5123 | 5122 | |
@@ -5143,7 +5142,7 @@ discard block |
||
| 5143 | 5142 | */ |
| 5144 | 5143 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5145 | 5144 | $chaine = explode(':', $chaine); |
| 5146 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5145 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5147 | 5146 | return $t; |
| 5148 | 5147 | } |
| 5149 | 5148 | $chaine = implode(':', $chaine); |
@@ -5209,7 +5208,7 @@ discard block |
||
| 5209 | 5208 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5210 | 5209 | |
| 5211 | 5210 | // calculer le nom de la css |
| 5212 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5211 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5213 | 5212 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5214 | 5213 | $contexte_implicite = calculer_contexte_implicite(); |
| 5215 | 5214 | |
@@ -5217,14 +5216,14 @@ discard block |
||
| 5217 | 5216 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5218 | 5217 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5219 | 5218 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5220 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5219 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5221 | 5220 | } |
| 5222 | 5221 | else { |
| 5223 | 5222 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5224 | 5223 | ksort($contexte); |
| 5225 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5224 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5226 | 5225 | } |
| 5227 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5226 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5228 | 5227 | |
| 5229 | 5228 | // mettre a jour le fichier si il n'existe pas |
| 5230 | 5229 | // ou trop ancien |
@@ -5232,8 +5231,8 @@ discard block |
||
| 5232 | 5231 | // et recopie sur le fichier cible uniquement si il change |
| 5233 | 5232 | if ( |
| 5234 | 5233 | !file_exists($filename) |
| 5235 | - or !file_exists($filename . '.last') |
|
| 5236 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5234 | + or !file_exists($filename.'.last') |
|
| 5235 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5237 | 5236 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5238 | 5237 | ) { |
| 5239 | 5238 | $contenu = $cache['texte']; |
@@ -5254,10 +5253,10 @@ discard block |
||
| 5254 | 5253 | } |
| 5255 | 5254 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5256 | 5255 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5257 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5256 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5258 | 5257 | } |
| 5259 | 5258 | // et ecrire le fichier si il change |
| 5260 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5259 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5261 | 5260 | } |
| 5262 | 5261 | |
| 5263 | 5262 | return timestamp($filename); |
@@ -5483,7 +5482,7 @@ discard block |
||
| 5483 | 5482 | if ($e > 0 and strlen($mid) > 8) { |
| 5484 | 5483 | $mid = '***...***'; |
| 5485 | 5484 | } |
| 5486 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5485 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5487 | 5486 | } |
| 5488 | 5487 | |
| 5489 | 5488 | |
@@ -5545,7 +5544,7 @@ discard block |
||
| 5545 | 5544 | case 'id': |
| 5546 | 5545 | case 'anchor': |
| 5547 | 5546 | if (preg_match(',^\d,', $texte)) { |
| 5548 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5547 | + $texte = substr($type, 0, 1).$texte; |
|
| 5549 | 5548 | } |
| 5550 | 5549 | } |
| 5551 | 5550 | |
@@ -5555,9 +5554,9 @@ discard block |
||
| 5555 | 5554 | |
| 5556 | 5555 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5557 | 5556 | if (preg_match(',^\d,', $texte)) { |
| 5558 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5557 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5559 | 5558 | } |
| 5560 | - $texte .= $separateur . md5($original); |
|
| 5559 | + $texte .= $separateur.md5($original); |
|
| 5561 | 5560 | $texte = substr($texte, 0, $longueur_mini); |
| 5562 | 5561 | } |
| 5563 | 5562 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $GLOBALS['debug_objets']['courant'] = $nom; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - $phpfile = sous_repertoire(_DIR_SKELS, '', false, true) . $nom . '.php'; |
|
| 58 | + $phpfile = sous_repertoire(_DIR_SKELS, '', false, true).$nom.'.php'; |
|
| 59 | 59 | |
| 60 | 60 | // si squelette est deja compile et perenne, le charger |
| 61 | 61 | if (!squelette_obsolete($phpfile, $source)) { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | #} |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if (file_exists($lib = $squelette . '_fonctions' . '.php')) { |
|
| 71 | + if (file_exists($lib = $squelette.'_fonctions'.'.php')) { |
|
| 72 | 72 | include_once $lib; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | eval("return true; $f ;"); |
| 97 | 97 | } catch (\ParseError $e) { |
| 98 | 98 | // Code syntaxiquement faux (critere etc mal programme') |
| 99 | - $msg = _T('zbug_erreur_compilation') . ' | Line ' . $e->getLine() . ' : ' . $e->getMessage(); |
|
| 99 | + $msg = _T('zbug_erreur_compilation').' | Line '.$e->getLine().' : '.$e->getMessage(); |
|
| 100 | 100 | erreur_squelette($msg, $boucle); |
| 101 | 101 | // continuer pour trouver d'autres fautes eventuelles |
| 102 | 102 | // mais prevenir que c'est mort |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | if (defined('_VAR_MODE') and _VAR_MODE == 'debug') { |
| 126 | 126 | // Tracer ce qui vient d'etre compile |
| 127 | - $GLOBALS['debug_objets']['code'][$nom . 'tout'] = $code; |
|
| 127 | + $GLOBALS['debug_objets']['code'][$nom.'tout'] = $code; |
|
| 128 | 128 | |
| 129 | 129 | // si c'est ce que demande le debusqueur, lui passer la main |
| 130 | 130 | if ( |
@@ -148,13 +148,13 @@ discard block |
||
| 148 | 148 | $code = " |
| 149 | 149 | /* |
| 150 | 150 | * Squelette : $sourcefile |
| 151 | - * Date : " . gmdate('D, d M Y H:i:s', @filemtime($sourcefile)) . ' GMT |
|
| 152 | - * Compile : ' . gmdate('D, d M Y H:i:s', time()) . ' GMT |
|
| 153 | - * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : ' . $noms)) . ' |
|
| 151 | + * Date : ".gmdate('D, d M Y H:i:s', @filemtime($sourcefile)).' GMT |
|
| 152 | + * Compile : ' . gmdate('D, d M Y H:i:s', time()).' GMT |
|
| 153 | + * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : '.$noms)).' |
|
| 154 | 154 | */ '; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - $code = '<' . "?php\n" . $code . join('', $boucles) . "\n?" . '>'; |
|
| 157 | + $code = '<'."?php\n".$code.join('', $boucles)."\n?".'>'; |
|
| 158 | 158 | if (!defined('_VAR_NOCACHE') or !_VAR_NOCACHE) { |
| 159 | 159 | ecrire_fichier($phpfile, $code); |
| 160 | 160 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $j = join('-', array_map('ucwords', explode('-', strtolower($r[2])))); |
| 216 | 216 | |
| 217 | 217 | if ($j == 'X-Spip-Filtre' and isset($headers[$j])) { |
| 218 | - $headers[$j] .= '|' . $r[3]; |
|
| 218 | + $headers[$j] .= '|'.$r[3]; |
|
| 219 | 219 | } else { |
| 220 | 220 | $headers[$j] = $r[3]; |
| 221 | 221 | } |
@@ -223,10 +223,10 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | // S'agit-il d'un resultat constant ou contenant du code php |
| 225 | 225 | $process_ins = ( |
| 226 | - strpos($corps, '<' . '?') === false |
|
| 226 | + strpos($corps, '<'.'?') === false |
|
| 227 | 227 | or |
| 228 | - (strpos($corps, '<' . '?xml') !== false and |
|
| 229 | - strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false) |
|
| 228 | + (strpos($corps, '<'.'?xml') !== false and |
|
| 229 | + strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false) |
|
| 230 | 230 | ) |
| 231 | 231 | ? 'html' |
| 232 | 232 | : 'php'; |
@@ -255,10 +255,10 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | if ($process_ins == 'html') { |
| 257 | 257 | $skel['process_ins'] = ( |
| 258 | - strpos($corps, '<' . '?') === false |
|
| 258 | + strpos($corps, '<'.'?') === false |
|
| 259 | 259 | or |
| 260 | - (strpos($corps, '<' . '?xml') !== false and |
|
| 261 | - strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false) |
|
| 260 | + (strpos($corps, '<'.'?xml') !== false and |
|
| 261 | + strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false) |
|
| 262 | 262 | ) |
| 263 | 263 | ? 'html' |
| 264 | 264 | : 'php'; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | // |
| 277 | 277 | |
| 278 | 278 | /** Code PHP pour inclure une balise dynamique à l'exécution d'une page */ |
| 279 | -define('CODE_INCLURE_BALISE', '<' . '?php |
|
| 279 | +define('CODE_INCLURE_BALISE', '<'.'?php |
|
| 280 | 280 | include_once("%s"); |
| 281 | 281 | if ($lang_select = "%s") $lang_select = lang_select($lang_select); |
| 282 | 282 | inserer_balise_dynamique(balise_%s_dyn(%s), array(%s)); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | // pas de lien symbolique sous Windows |
| 308 | 308 | and !(stristr(PHP_OS, 'WIN') and strpos($file, ':') !== false) |
| 309 | 309 | ) { |
| 310 | - $file = './" . _DIR_RACINE . "' . $file; |
|
| 310 | + $file = './" . _DIR_RACINE . "'.$file; |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | $lang = $context_compil[4]; |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | $args = array_map('argumenter_squelette', $args); |
| 319 | 319 | if (!empty($context_compil['appel_php_depuis_modele'])) { |
| 320 | - $args[0] = 'arguments_balise_dyn_depuis_modele(' . $args[0] . ')'; |
|
| 320 | + $args[0] = 'arguments_balise_dyn_depuis_modele('.$args[0].')'; |
|
| 321 | 321 | } |
| 322 | 322 | $args = join(', ', $args); |
| 323 | 323 | |
@@ -351,14 +351,14 @@ discard block |
||
| 351 | 351 | if (is_object($v)) { |
| 352 | 352 | return var_export($v, true); |
| 353 | 353 | } elseif (!is_array($v)) { |
| 354 | - return "'" . texte_script((string) $v) . "'"; |
|
| 354 | + return "'".texte_script((string) $v)."'"; |
|
| 355 | 355 | } else { |
| 356 | 356 | $out = []; |
| 357 | 357 | foreach ($v as $k => $val) { |
| 358 | - $out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val); |
|
| 358 | + $out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val); |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - return 'array(' . join(', ', $out) . ')'; |
|
| 361 | + return 'array('.join(', ', $out).')'; |
|
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | // Y a-t-il une fonction de traitement des arguments ? |
| 439 | - $f = 'balise_' . $nom_balise . '_stat'; |
|
| 439 | + $f = 'balise_'.$nom_balise.'_stat'; |
|
| 440 | 440 | |
| 441 | 441 | $r = !function_exists($f) ? $args : $f($args, $context_compil); |
| 442 | 442 | |
@@ -446,18 +446,18 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | // verifier que la fonction dyn est la, |
| 448 | 448 | // sinon se replier sur la generique si elle existe |
| 449 | - if (!function_exists('balise_' . $nom_balise . '_dyn')) { |
|
| 449 | + if (!function_exists('balise_'.$nom_balise.'_dyn')) { |
|
| 450 | 450 | if ( |
| 451 | 451 | $balise_generique = chercher_balise_generique($nom) |
| 452 | 452 | and $nom_balise_generique = $balise_generique['nom_generique'] |
| 453 | - and $file = include_spip('balise/' . strtolower($nom_balise_generique)) |
|
| 454 | - and function_exists('balise_' . $nom_balise_generique . '_dyn') |
|
| 453 | + and $file = include_spip('balise/'.strtolower($nom_balise_generique)) |
|
| 454 | + and function_exists('balise_'.$nom_balise_generique.'_dyn') |
|
| 455 | 455 | ) { |
| 456 | 456 | // et lui injecter en premier arg le nom de la balise |
| 457 | 457 | array_unshift($r, $nom); |
| 458 | 458 | $nom_balise = $nom_balise_generique; |
| 459 | 459 | if (!_DIR_RESTREINT) { |
| 460 | - $file = _DIR_RESTREINT_ABS . $file; |
|
| 460 | + $file = _DIR_RESTREINT_ABS.$file; |
|
| 461 | 461 | } |
| 462 | 462 | } else { |
| 463 | 463 | $msg = ['zbug_balise_inexistante', ['from' => 'CVT', 'balise' => $nom]]; |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | $n = ''; |
| 559 | 559 | foreach (explode(',', $liste) as $val) { |
| 560 | 560 | if ($a = intval($val) and $val === strval($a)) { |
| 561 | - $n .= ',' . $val; |
|
| 561 | + $n .= ','.$val; |
|
| 562 | 562 | } |
| 563 | 563 | } |
| 564 | 564 | if (strlen($n)) { |
@@ -737,8 +737,8 @@ discard block |
||
| 737 | 737 | // on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction |
| 738 | 738 | $i = 0; |
| 739 | 739 | do { |
| 740 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 741 | - [$sous[1] . ' AS id'], |
|
| 740 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 741 | + [$sous[1].' AS id'], |
|
| 742 | 742 | $from, |
| 743 | 743 | $from_type, |
| 744 | 744 | $wheresub, |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | $id, |
| 752 | 752 | $serveur, |
| 753 | 753 | false |
| 754 | - ) . ')'); |
|
| 754 | + ).')'); |
|
| 755 | 755 | if (!$i) { |
| 756 | 756 | $i = 1; |
| 757 | 757 | $wherestring = calculer_where_to_string($where[$k]); |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | if ($sous[0] == 'SUBSELECT') { |
| 772 | 772 | // c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having) |
| 773 | 773 | array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ? |
| 774 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 774 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 775 | 775 | $sous[1], # select |
| 776 | 776 | $sous[2], #from |
| 777 | 777 | [], #from_type |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | $id, |
| 787 | 787 | $serveur, |
| 788 | 788 | false |
| 789 | - ) . ')'); |
|
| 789 | + ).')'); |
|
| 790 | 790 | } |
| 791 | 791 | array_pop($where_simples); |
| 792 | 792 | } |
@@ -849,15 +849,15 @@ discard block |
||
| 849 | 849 | // sans recours a preg_match |
| 850 | 850 | // un implode(' ',..) est fait dans reinjecte_joint un peu plus bas |
| 851 | 851 | $afrom[$t][$cle] = [ |
| 852 | - "\n" . |
|
| 853 | - ($from_type[$cle] ?? 'INNER') . ' JOIN', |
|
| 852 | + "\n". |
|
| 853 | + ($from_type[$cle] ?? 'INNER').' JOIN', |
|
| 854 | 854 | $from[$cle], |
| 855 | 855 | "AS $cle", |
| 856 | 856 | 'ON (', |
| 857 | 857 | "$cle.$c", |
| 858 | 858 | '=', |
| 859 | 859 | "$t.$carr", |
| 860 | - ($and ? 'AND ' . $and : '') . |
|
| 860 | + ($and ? 'AND '.$and : ''). |
|
| 861 | 861 | ')' |
| 862 | 862 | ]; |
| 863 | 863 | if (isset($afrom[$cle])) { |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | $t = key($from); |
| 896 | 896 | $c = current($from); |
| 897 | 897 | reset($from); |
| 898 | - $e = '/\b(' . "$t\\." . join('|' . $t . '\.', $equiv) . ')\b/'; |
|
| 898 | + $e = '/\b('."$t\\.".join('|'.$t.'\.', $equiv).')\b/'; |
|
| 899 | 899 | if ( |
| 900 | 900 | !(strpos($t, ' ') or // jointure des le depart cf boucle_doc |
| 901 | 901 | calculer_jointnul($t, $select, $e) or |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | unset($afrom[$t][$nt]); |
| 914 | 914 | $afrom[$nt] = $afrom[$t]; |
| 915 | 915 | unset($afrom[$t]); |
| 916 | - $e = '/\b' . preg_quote($nfrom[6]) . '\b/'; |
|
| 916 | + $e = '/\b'.preg_quote($nfrom[6]).'\b/'; |
|
| 917 | 917 | $t = $nfrom[4]; |
| 918 | 918 | $alias = ''; |
| 919 | 919 | // verifier que les deux cles sont homonymes, sinon installer un alias dans le select |
@@ -924,14 +924,14 @@ discard block |
||
| 924 | 924 | if ($newcle != $oldcle) { |
| 925 | 925 | // si l'ancienne cle etait deja dans le select avec un AS |
| 926 | 926 | // reprendre simplement ce AS |
| 927 | - $as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/'; |
|
| 927 | + $as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/'; |
|
| 928 | 928 | if (preg_match($as, implode(',', $select), $m)) { |
| 929 | 929 | $alias = ''; |
| 930 | 930 | } else { |
| 931 | - $alias = ', ' . $nfrom[4] . " AS $oldcle"; |
|
| 931 | + $alias = ', '.$nfrom[4]." AS $oldcle"; |
|
| 932 | 932 | } |
| 933 | 933 | } |
| 934 | - $select = remplacer_jointnul($t . $alias, $select, $e); |
|
| 934 | + $select = remplacer_jointnul($t.$alias, $select, $e); |
|
| 935 | 935 | $join = remplacer_jointnul($t, $join, $e); |
| 936 | 936 | $where = remplacer_jointnul($t, $where, $e); |
| 937 | 937 | $having = remplacer_jointnul($t, $having, $e); |
@@ -981,9 +981,9 @@ discard block |
||
| 981 | 981 | } else { |
| 982 | 982 | $exp = ''; |
| 983 | 983 | if (strtoupper($join) === 'AND') { |
| 984 | - return $exp . join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 984 | + return $exp.join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 985 | 985 | } else { |
| 986 | - return $exp . join($join, $v); |
|
| 986 | + return $exp.join($join, $v); |
|
| 987 | 987 | } |
| 988 | 988 | } |
| 989 | 989 | } |
@@ -1045,6 +1045,6 @@ discard block |
||
| 1045 | 1045 | } |
| 1046 | 1046 | |
| 1047 | 1047 | return $mime_type |
| 1048 | - . (!$connect ? '' : preg_replace('/\W/', '_', $connect)) . '_' |
|
| 1049 | - . md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : '')); |
|
| 1048 | + . (!$connect ? '' : preg_replace('/\W/', '_', $connect)).'_' |
|
| 1049 | + . md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : '')); |
|
| 1050 | 1050 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | unset($erreurs['new_login']); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - $auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 173 | + $auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 174 | 174 | $auth_methode = ($auth_methode ?: 'spip'); |
| 175 | 175 | include_spip('inc/auth'); |
| 176 | 176 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | !autoriser('modifier', 'auteur', $id_auteur, null, ['email' => '?']) |
| 187 | 187 | and $GLOBALS['visiteur_session']['id_auteur'] == $id_auteur |
| 188 | 188 | and !strlen(trim($email)) |
| 189 | - and $email != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur=' . intval($id_auteur))) |
|
| 189 | + and $email != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.intval($id_auteur))) |
|
| 190 | 190 | ) { |
| 191 | 191 | $erreurs['email'] = (($id_auteur == $GLOBALS['visiteur_session']['id_auteur']) ? _T('form_email_non_valide') : _T('form_prop_indiquer_email')); |
| 192 | 192 | } else { |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | #Nouvel auteur |
| 202 | 202 | if (intval($id_auteur) == 0) { |
| 203 | 203 | #Un auteur existe deja avec cette adresse ? |
| 204 | - if (sql_countsel('spip_auteurs', 'email=' . sql_quote($email)) > 0) { |
|
| 204 | + if (sql_countsel('spip_auteurs', 'email='.sql_quote($email)) > 0) { |
|
| 205 | 205 | $erreurs['email'] = _T('erreur_email_deja_existant'); |
| 206 | 206 | } |
| 207 | 207 | } else { |
@@ -209,11 +209,11 @@ discard block |
||
| 209 | 209 | if ( |
| 210 | 210 | (sql_countsel( |
| 211 | 211 | 'spip_auteurs', |
| 212 | - 'email=' . sql_quote($email) |
|
| 212 | + 'email='.sql_quote($email) |
|
| 213 | 213 | ) > 0) and ($id_auteur != ($id_auteur_ancien = sql_getfetsel( |
| 214 | 214 | 'id_auteur', |
| 215 | 215 | 'spip_auteurs', |
| 216 | - 'email=' . sql_quote($email) |
|
| 216 | + 'email='.sql_quote($email) |
|
| 217 | 217 | ))) |
| 218 | 218 | ) { |
| 219 | 219 | $erreurs['email'] = _T('erreur_email_deja_existant'); |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | // corriger un cas si frequent : www.example.org sans le http:// qui precede |
| 232 | 232 | if ($url = _request('url_site') and !tester_url_absolue($url)) { |
| 233 | 233 | if (strpos($url, ':') === false and strncasecmp($url, 'www.', 4) === 0) { |
| 234 | - $url = 'http://' . $url; |
|
| 234 | + $url = 'http://'.$url; |
|
| 235 | 235 | set_request('url_site', $url); |
| 236 | 236 | } |
| 237 | 237 | } |
@@ -248,11 +248,11 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | elseif ( |
| 250 | 250 | ($login = _request('new_login')) and |
| 251 | - $login !== sql_getfetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)) |
|
| 251 | + $login !== sql_getfetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur)) |
|
| 252 | 252 | ) { |
| 253 | 253 | // on verifie la meme chose que dans auteurs_edit_config() |
| 254 | 254 | if ( |
| 255 | - ! auth_autoriser_modifier_login($auth_methode) |
|
| 255 | + !auth_autoriser_modifier_login($auth_methode) |
|
| 256 | 256 | or !autoriser('modifier', 'auteur', intval($id_auteur), null, ['login' => true]) |
| 257 | 257 | // legacy : ne pas risquer d'autoriser la modif login si fonction d'autorisation pas mise a jour et ne teste que l'option email |
| 258 | 258 | or !autoriser('modifier', 'auteur', intval($id_auteur), null, ['email' => true]) |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | if ( |
| 360 | 360 | $GLOBALS['visiteur_session']['id_auteur'] == $id_auteur |
| 361 | 361 | and $email_nouveau != |
| 362 | - ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur=' . intval($id_auteur))) |
|
| 362 | + ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.intval($id_auteur))) |
|
| 363 | 363 | ) { |
| 364 | 364 | $envoyer_mail = charger_fonction('envoyer_mail', 'inc'); |
| 365 | 365 | $texte = _T( |
@@ -393,12 +393,12 @@ discard block |
||
| 393 | 393 | if (isset($erreurs['message_ok'])) { |
| 394 | 394 | if (!isset($res['message_ok'])) { $res['message_ok'] = ''; |
| 395 | 395 | } |
| 396 | - $res['message_ok'] = trim($res['message_ok'] . ' ' . $erreurs['message_ok']); |
|
| 396 | + $res['message_ok'] = trim($res['message_ok'].' '.$erreurs['message_ok']); |
|
| 397 | 397 | } |
| 398 | 398 | if (isset($erreurs['message_erreur']) and $erreurs['message_erreur']) { |
| 399 | 399 | if (!isset($res['message_erreur'])) { $res['message_erreur'] = ''; |
| 400 | 400 | } |
| 401 | - $res['message_erreur'] = trim($res['message_erreur'] . ' ' . $erreurs['message_erreur']); |
|
| 401 | + $res['message_erreur'] = trim($res['message_erreur'].' '.$erreurs['message_erreur']); |
|
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | |
| 426 | 426 | |
| 427 | 427 | function auteur_reset_password($id_auteur, $erreurs = []) { |
| 428 | - $auteur = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 428 | + $auteur = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 429 | 429 | $config = auteurs_edit_config($auteur); |
| 430 | 430 | |
| 431 | 431 | if ($config['edit_pass']) { |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | include_spip('action/editer_auteur'); |
| 461 | 461 | auteur_modifier($id_auteur, $set); |
| 462 | 462 | |
| 463 | - $row = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 463 | + $row = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 464 | 464 | include_spip('inc/filtres'); |
| 465 | 465 | if ( |
| 466 | 466 | $notifier |