@@ -79,7 +79,7 @@ |
||
| 79 | 79 | if (!is_array($id_ou_options)) { |
| 80 | 80 | $options = ['id' => (int) $id_ou_options]; |
| 81 | 81 | $id = $options['id']; |
| 82 | - }else { |
|
| 82 | + } else { |
|
| 83 | 83 | $options = $id_ou_options; |
| 84 | 84 | $id = (int) ($id_ou_options['id'] ?? 0); |
| 85 | 85 | } |
@@ -32,18 +32,18 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | function ranger_cache_gd2() { |
| 34 | 34 | spip_log('ranger_cache_gd2'); |
| 35 | - $base = _DIR_VAR . 'cache-gd2/'; |
|
| 35 | + $base = _DIR_VAR.'cache-gd2/'; |
|
| 36 | 36 | if (is_dir($base) && is_readable($base) && ($dir = opendir($base))) { |
| 37 | 37 | while (($f = readdir($dir)) !== false) { |
| 38 | 38 | if ( |
| 39 | - !is_dir($base . $f) |
|
| 39 | + !is_dir($base.$f) |
|
| 40 | 40 | && !str_starts_with($f, '.') |
| 41 | 41 | && preg_match(',[0-9a-f]{32}\.\w+,', $f) |
| 42 | 42 | ) { |
| 43 | 43 | $sub = substr($f, 0, 2); |
| 44 | 44 | $sub = sous_repertoire($base, $sub); |
| 45 | - @rename($base . $f, $sub . substr($f, 2)); |
|
| 46 | - @unlink($base . $f); // au cas ou le rename a foire (collision) |
|
| 45 | + @rename($base.$f, $sub.substr($f, 2)); |
|
| 46 | + @unlink($base.$f); // au cas ou le rename a foire (collision) |
|
| 47 | 47 | } |
| 48 | 48 | if (time() >= _TIME_OUT) { |
| 49 | 49 | return; |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | $t = $phraseur->ouvrant[$depth] ?? ' '; |
| 41 | 41 | // espace initial signifie: deja integree au resultat |
| 42 | 42 | if ($t[0] != ' ') { |
| 43 | - $phraseur->res .= '<' . $t . '>'; |
|
| 44 | - $phraseur->ouvrant[$depth] = ' ' . $t; |
|
| 43 | + $phraseur->res .= '<'.$t.'>'; |
|
| 44 | + $phraseur->ouvrant[$depth] = ' '.$t; |
|
| 45 | 45 | } |
| 46 | 46 | $t = $phraseur->contenu[$depth]; |
| 47 | 47 | // n'indenter que s'il y a un separateur avant |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | foreach ($attrs as $k => $v) { |
| 53 | 53 | $delim = str_contains($v, "'") ? '"' : "'"; |
| 54 | 54 | $val = xml_entites_html($v); |
| 55 | - $att .= $sep . $k . '=' . $delim |
|
| 55 | + $att .= $sep.$k.'='.$delim |
|
| 56 | 56 | . ($delim !== '"' ? str_replace('"', '"', $val) : $val) |
| 57 | 57 | . $delim; |
| 58 | 58 | $sep = "\n $depth"; |
| 59 | 59 | } |
| 60 | 60 | $phraseur->depth .= ' '; |
| 61 | 61 | $phraseur->contenu[$phraseur->depth] = ''; |
| 62 | - $phraseur->ouvrant[$phraseur->depth] = $name . $att; |
|
| 62 | + $phraseur->ouvrant[$phraseur->depth] = $name.$att; |
|
| 63 | 63 | $phraseur->reperes[$phraseur->depth] = xml_get_current_line_number($phraseur->sax); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | $ouv = $phraseur->ouvrant[$phraseur->depth]; |
| 68 | 68 | |
| 69 | 69 | if ($ouv[0] != ' ') { |
| 70 | - $phraseur->ouvrant[$phraseur->depth] = ' ' . $ouv; |
|
| 70 | + $phraseur->ouvrant[$phraseur->depth] = ' '.$ouv; |
|
| 71 | 71 | } else { |
| 72 | 72 | $ouv = ''; |
| 73 | 73 | } |
| 74 | 74 | $t = $phraseur->contenu[$phraseur->depth]; |
| 75 | 75 | $phraseur->depth = substr($phraseur->depth, 2); |
| 76 | - $t = preg_replace("/[\n\t ]+$/", "\n" . $phraseur->depth, $t); |
|
| 76 | + $t = preg_replace("/[\n\t ]+$/", "\n".$phraseur->depth, $t); |
|
| 77 | 77 | |
| 78 | 78 | // fusion <balise></balise> en <balise />. |
| 79 | 79 | // ATTENTION, certains clients http croient que fusion ==> pas d'atttributs |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | // (param fusion_bal) |
| 83 | 83 | |
| 84 | 84 | if ($t || ($ouv != $name && !$fusion_bal)) { |
| 85 | - $phraseur->res .= ($ouv ? ('<' . $ouv . '>') : '') . $t . '</' . $name . '>'; |
|
| 85 | + $phraseur->res .= ($ouv ? ('<'.$ouv.'>') : '').$t.'</'.$name.'>'; |
|
| 86 | 86 | } else { |
| 87 | - $phraseur->res .= ($ouv ? ('<' . $ouv . ' />') : ('</' . $name . '>')); |
|
| 87 | + $phraseur->res .= ($ouv ? ('<'.$ouv.' />') : ('</'.$name.'>')); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
@@ -126,16 +126,16 @@ discard block |
||
| 126 | 126 | coordonnees_erreur( |
| 127 | 127 | $phraseur, |
| 128 | 128 | xml_error_string(xml_get_error_code($phraseur->sax)) |
| 129 | - . "<br />\n" . |
|
| 129 | + . "<br />\n". |
|
| 130 | 130 | ($phraseur->depth |
| 131 | - ? '(' . |
|
| 132 | - _T('erreur_balise_non_fermee') . |
|
| 133 | - ' <tt>' . |
|
| 134 | - $phraseur->ouvrant[$phraseur->depth] . |
|
| 135 | - '</tt> ' . |
|
| 136 | - _T('ligne') . |
|
| 137 | - ' ' . |
|
| 138 | - $phraseur->reperes[$phraseur->depth] . |
|
| 131 | + ? '('. |
|
| 132 | + _T('erreur_balise_non_fermee'). |
|
| 133 | + ' <tt>'. |
|
| 134 | + $phraseur->ouvrant[$phraseur->depth]. |
|
| 135 | + '</tt> '. |
|
| 136 | + _T('ligne'). |
|
| 137 | + ' '. |
|
| 138 | + $phraseur->reperes[$phraseur->depth]. |
|
| 139 | 139 | ") <br />\n" |
| 140 | 140 | : '') |
| 141 | 141 | ); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | // et escamoter le doctype que sax mange en php5 mais pas en php4 |
| 174 | 174 | if (!$doctype) { |
| 175 | 175 | if (!$r = analyser_doctype($page)) { |
| 176 | - $page = _MESSAGE_DOCTYPE . _DOCTYPE_ECRIRE |
|
| 176 | + $page = _MESSAGE_DOCTYPE._DOCTYPE_ECRIRE |
|
| 177 | 177 | . preg_replace(_REGEXP_DOCTYPE, '', $page); |
| 178 | 178 | $r = analyser_doctype($page); |
| 179 | 179 | } |
@@ -280,18 +280,18 @@ discard block |
||
| 280 | 280 | 'rss-0.91.dtd' |
| 281 | 281 | ]; |
| 282 | 282 | } else { |
| 283 | - $dtd = $topelement . '.dtd'; |
|
| 283 | + $dtd = $topelement.'.dtd'; |
|
| 284 | 284 | $f = find_in_path($dtd); |
| 285 | 285 | if (file_exists($f)) { |
| 286 | 286 | return [$entete, 'SYSTEM', $f, $dtd]; |
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | - spip_log('Dtd pas vu pour ' . substr($data, 0, 100)); |
|
| 290 | + spip_log('Dtd pas vu pour '.substr($data, 0, 100)); |
|
| 291 | 291 | |
| 292 | 292 | return []; |
| 293 | 293 | } |
| 294 | - [$entete, , $topelement, $avail, $suite] = $page; |
|
| 294 | + [$entete,, $topelement, $avail, $suite] = $page; |
|
| 295 | 295 | |
| 296 | 296 | if (!preg_match('/^"([^"]*)"\s*(.*)$/', $suite, $r) && !preg_match("/^'([^']*)'\s*(.*)$/", $suite, $r)) { |
| 297 | 297 | return []; |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | */ |
| 334 | 334 | function _sqlite_func_preg_replace($quoi, $cherche, $remplace) { |
| 335 | 335 | #spip_log("preg_replace : $quoi, $cherche, $remplace, $return",'sqlite.'._LOG_DEBUG); |
| 336 | - return preg_replace('%' . $cherche . '%', $remplace, $quoi); |
|
| 336 | + return preg_replace('%'.$cherche.'%', $remplace, $quoi); |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | /** |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | $u = $GLOBALS['meta']['pcre_u'] ?? 'u'; |
| 396 | 396 | |
| 397 | 397 | #spip_log("regexp_replace : $quoi, $cherche, $remplace, $return",'sqlite.'._LOG_DEBUG); |
| 398 | - return preg_match('%' . $cherche . '%imsS' . $u, $quoi); |
|
| 398 | + return preg_match('%'.$cherche.'%imsS'.$u, $quoi); |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | $count = 0; |
| 445 | 445 | str_replace($mysql_to_strftime_not_ok, '', $conv, $count); |
| 446 | 446 | if ($count > 0) { |
| 447 | - spip_log("DATE_FORMAT : At least one parameter can't be parsed by strftime with format '$conv'", 'sqlite.' . _LOG_ERREUR); |
|
| 447 | + spip_log("DATE_FORMAT : At least one parameter can't be parsed by strftime with format '$conv'", 'sqlite.'._LOG_ERREUR); |
|
| 448 | 448 | } |
| 449 | 449 | $to_strftime[$conv] = str_replace(array_keys($mysql_to_strftime), $mysql_to_strftime, $conv); |
| 450 | 450 | } |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | */ |
| 464 | 464 | function _sqlite_func_to_days($d) { |
| 465 | 465 | static $offset = 719528; // nb de jour entre 0000-00-00 et timestamp 0=1970-01-01 |
| 466 | - $result = $offset + (int)ceil(_sqlite_func_unix_timestamp($d) / (24 * 3600)); |
|
| 466 | + $result = $offset + (int) ceil(_sqlite_func_unix_timestamp($d) / (24 * 3600)); |
|
| 467 | 467 | |
| 468 | 468 | #spip_log("Passage avec TO_DAYS : $d, $result",'sqlite.'._LOG_DEBUG); |
| 469 | 469 | return $result; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $type = reset($objets); |
| 160 | 160 | $type = objet_type($type); |
| 161 | 161 | $id = (int) $ref; |
| 162 | - $ref = $type . $ref; |
|
| 162 | + $ref = $type.$ref; |
|
| 163 | 163 | } |
| 164 | 164 | else { |
| 165 | 165 | // Si la référence ne correspond à rien, c'est fini |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | return json_export(false); |
| 168 | 168 | } |
| 169 | 169 | // Sinon on récupère les infos utiles |
| 170 | - [$type, , $id, , , , ] = array_pad($match, 7, null); |
|
| 170 | + [$type,, $id,,,,] = array_pad($match, 7, null); |
|
| 171 | 171 | |
| 172 | 172 | // On regarde si le type trouvé fait partie des objets sélectionnables |
| 173 | 173 | if (!in_array(table_objet($type), $objets)) { |
@@ -213,8 +213,8 @@ discard block |
||
| 213 | 213 | $types = (is_array($types) ? array_filter($types) : []); |
| 214 | 214 | |
| 215 | 215 | // recuperer tous les freres et soeurs de la rubrique visee |
| 216 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . (int) $id_rubrique); |
|
| 217 | - $fratrie = sql_allfetsel('id_rubrique', 'spip_rubriques', 'id_parent=' . (int) $id_parent); |
|
| 216 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.(int) $id_rubrique); |
|
| 217 | + $fratrie = sql_allfetsel('id_rubrique', 'spip_rubriques', 'id_parent='.(int) $id_parent); |
|
| 218 | 218 | $fratrie = array_column($fratrie, 'id_rubrique'); |
| 219 | 219 | $has = sql_allfetsel('DISTINCT id_parent', 'spip_rubriques', sql_in('id_parent', $fratrie)); |
| 220 | 220 | $has = array_column($has, 'id_parent'); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | // confirmation du deplacement |
| 117 | 117 | if ( |
| 118 | 118 | sql_table_exists('spip_breves') |
| 119 | - && ($contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . (int) $id_objet)) |
|
| 119 | + && ($contient_breves = sql_countsel('spip_breves', 'id_rubrique='.(int) $id_objet)) |
|
| 120 | 120 | && $contient_breves > 0 |
| 121 | 121 | ) { |
| 122 | 122 | // FIXME: utiliser singulier_ou_pluriel, migrer dans plugin Brèves |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | ); |
| 131 | 131 | $confirm .= "\n<div class='confirmer_deplacement verdana2'>" |
| 132 | 132 | . "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>" |
| 133 | - . $scb . |
|
| 133 | + . $scb. |
|
| 134 | 134 | "</label></div></div>\n"; |
| 135 | 135 | } else { |
| 136 | 136 | $confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n"; |
@@ -139,11 +139,11 @@ discard block |
||
| 139 | 139 | $form .= $confirm; |
| 140 | 140 | if ($actionable) { |
| 141 | 141 | if (str_contains($form, '<select')) { |
| 142 | - $form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>" |
|
| 143 | - . '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>' |
|
| 142 | + $form .= "<div style='text-align: ".$GLOBALS['spip_lang_right'].";'>" |
|
| 143 | + . '<input class="fondo submit btn" type="submit" value="'._T('bouton_choisir').'"/>' |
|
| 144 | 144 | . '</div>'; |
| 145 | 145 | } |
| 146 | - $form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form; |
|
| 146 | + $form = "<input type='hidden' name='editer_$objet' value='oui' />\n".$form; |
|
| 147 | 147 | if ($action = charger_fonction("editer_$objet", 'action', true)) { |
| 148 | 148 | $form = generer_action_auteur( |
| 149 | 149 | "editer_$objet", |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | include_spip('inc/presentation'); |
| 171 | 171 | |
| 172 | - return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur(); |
|
| 172 | + return debut_cadre_couleur($logo, true, '', $titre).$form.fin_cadre_couleur(); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | if ($statut == 'nouveau') { |
| 246 | 246 | if ($attente) { |
| 247 | 247 | $statut = $attente; |
| 248 | - $plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')'; |
|
| 248 | + $plus = ' ('._T('info_statut_auteur_a_confirmer').')'; |
|
| 249 | 249 | } else { |
| 250 | 250 | return _T('info_statut_auteur_a_confirmer'); |
| 251 | 251 | } |
@@ -258,16 +258,16 @@ discard block |
||
| 258 | 258 | '5poubelle' => _T('texte_statut_poubelle'), // bouh |
| 259 | 259 | ]; |
| 260 | 260 | if (isset($recom[$statut])) { |
| 261 | - return $recom[$statut] . $plus; |
|
| 261 | + return $recom[$statut].$plus; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | // retrouver directement par le statut sinon |
| 265 | 265 | if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) { |
| 266 | 266 | if (isset($recom[$t])) { |
| 267 | - return $recom[$t] . $plus; |
|
| 267 | + return $recom[$t].$plus; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - return _T($t) . $plus; |
|
| 270 | + return _T($t).$plus; |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | // si on a pas reussi a le traduire, retournons la chaine telle quelle |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | |
| 388 | 388 | if (!$id_rubrique && defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') && _CHOIX_RUBRIQUE_PAR_DEFAUT) { |
| 389 | 389 | $in = (is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0) |
| 390 | - ? ' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique']) |
|
| 390 | + ? ' AND '.sql_in('id_rubrique', $GLOBALS['connect_id_rubrique']) |
|
| 391 | 391 | : ''; |
| 392 | 392 | |
| 393 | 393 | // on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | return ''; |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | - return propre('[->' . $virtuel . ']'); |
|
| 425 | + return propre('[->'.$virtuel.']'); |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | $clic = http_img_pack('rss-16.png', 'RSS', '', $title); |
| 450 | 450 | |
| 451 | 451 | $url = generer_url_api_low_sec('transmettre', 'rss', $op, '', http_build_query($args), false, true); |
| 452 | - return "<a style='float: " . $GLOBALS['spip_lang_right'] . ";' href='$url'>$clic</a>"; |
|
| 452 | + return "<a style='float: ".$GLOBALS['spip_lang_right'].";' href='$url'>$clic</a>"; |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | ); |
| 522 | 522 | |
| 523 | 523 | if ($alertes = array_filter($alertes)) { |
| 524 | - return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" . |
|
| 524 | + return "<div class='wrap-messages-alertes'><div class='messages-alertes'>". |
|
| 525 | 525 | implode(' | ', $alertes) |
| 526 | 526 | . '</div></div>'; |
| 527 | 527 | } |
@@ -557,13 +557,13 @@ discard block |
||
| 557 | 557 | */ |
| 558 | 558 | function afficher_plus_info($lien, $titre = '+', $titre_lien = '') { |
| 559 | 559 | $titre = attribut_html($titre); |
| 560 | - $icone = "\n<a href='$lien' title='$titre' class='plus_info'>" . |
|
| 561 | - http_img_pack('information-16.png', $titre) . '</a>'; |
|
| 560 | + $icone = "\n<a href='$lien' title='$titre' class='plus_info'>". |
|
| 561 | + http_img_pack('information-16.png', $titre).'</a>'; |
|
| 562 | 562 | |
| 563 | 563 | if (!$titre_lien) { |
| 564 | 564 | return $icone; |
| 565 | 565 | } else { |
| 566 | - return $icone . "\n<a href='$lien'>$titre_lien</a>"; |
|
| 566 | + return $icone."\n<a href='$lien'>$titre_lien</a>"; |
|
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | 569 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $role = $roles['roles']['defaut']; |
| 147 | 147 | } |
| 148 | 148 | // where |
| 149 | - $cond = ["$colonne_role=" . sql_quote($role)]; |
|
| 149 | + $cond = ["$colonne_role=".sql_quote($role)]; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | return [$role, $colonne_role, $cond]; |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | unset($cond['role']); // cette condition est particuliere... |
| 180 | 180 | // on ajoute la condition du role aux autres conditions. |
| 181 | 181 | if ($colonne_role && $role != '*') { |
| 182 | - $cond[] = "$colonne_role=" . sql_quote($role); |
|
| 182 | + $cond[] = "$colonne_role=".sql_quote($role); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | return [$cond, $colonne_role, $role]; |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | $all = sql_allfetsel( |
| 363 | 363 | "DISTINCT $colone_role", |
| 364 | 364 | $l, |
| 365 | - 'objet=' . sql_quote(($objet_source == $objet_lien) ? $objet : $objet_source) |
|
| 365 | + 'objet='.sql_quote(($objet_source == $objet_lien) ? $objet : $objet_source) |
|
| 366 | 366 | ); |
| 367 | 367 | $done[$hash] = array_map('reset', $all); |
| 368 | 368 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | static $t1 = ['&', '<', '>']; |
| 120 | 120 | static $t2 = ['&', '<', '>']; |
| 121 | 121 | |
| 122 | - return '<pre>' . str_replace($t1, $t2, (string) $t) . '</pre>'; |
|
| 122 | + return '<pre>'.str_replace($t1, $t2, (string) $t).'</pre>'; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -139,12 +139,12 @@ discard block |
||
| 139 | 139 | foreach ($lignes as &$l) { |
| 140 | 140 | $l = implode('|', $l); |
| 141 | 141 | } |
| 142 | - $corps = implode("\n", $lignes) . "\n"; |
|
| 143 | - $corps = $caption . |
|
| 144 | - "\n|{{" . |
|
| 145 | - implode('}}|{{', $entete) . |
|
| 146 | - '}}|' . |
|
| 147 | - "\n|" . |
|
| 142 | + $corps = implode("\n", $lignes)."\n"; |
|
| 143 | + $corps = $caption. |
|
| 144 | + "\n|{{". |
|
| 145 | + implode('}}|{{', $entete). |
|
| 146 | + '}}|'. |
|
| 147 | + "\n|". |
|
| 148 | 148 | str_replace("\n", "|\n|", $corps); |
| 149 | 149 | include_spip('inc/texte'); |
| 150 | 150 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // Pourquoi SafeHtml transforme-t-il en texte les scripts dans Body ? |
| 189 | 189 | $t = safehtml(preg_replace(',<script.*?</script>,is', '', $t)); |
| 190 | 190 | |
| 191 | - return ($style ? "\n<style>" . $style . '</style>' : '') . $t; |
|
| 191 | + return ($style ? "\n<style>".$style.'</style>' : '').$t; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | // celle du texte) et public (spip_lang est la langue du texte) |
| 44 | 44 | $dir = _DIR_RESTREINT ? lang_dir() : lang_dir($GLOBALS['spip_lang']); |
| 45 | 45 | |
| 46 | - $p = 'puce' . (test_espace_prive() ? '_prive' : ''); |
|
| 46 | + $p = 'puce'.(test_espace_prive() ? '_prive' : ''); |
|
| 47 | 47 | if ($dir == 'rtl') { |
| 48 | 48 | $p .= '_rtl'; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | if (!isset($GLOBALS[$p])) { |
| 52 | - $GLOBALS[$p] = '<span class="spip-puce ' . $dir . '"><b>–</b></span>'; |
|
| 52 | + $GLOBALS[$p] = '<span class="spip-puce '.$dir.'"><b>–</b></span>'; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | return $GLOBALS[$p]; |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | function spip_balisage_code(string $corps, bool $bloc = false, string $attributs = '', string $langage = '') { |
| 68 | 68 | |
| 69 | 69 | $echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code ! |
| 70 | - $class = 'spip_code ' . ($bloc ? 'spip_code_block' : 'spip_code_inline'); |
|
| 70 | + $class = 'spip_code '.($bloc ? 'spip_code_block' : 'spip_code_inline'); |
|
| 71 | 71 | if ($attributs) { |
| 72 | - $attributs = ' ' . trim($attributs); |
|
| 72 | + $attributs = ' '.trim($attributs); |
|
| 73 | 73 | } |
| 74 | 74 | if ($langage) { |
| 75 | 75 | $class .= " language-$langage"; |
| 76 | - $attributs .= ' data-language="' . $langage . '"'; |
|
| 76 | + $attributs .= ' data-language="'.$langage.'"'; |
|
| 77 | 77 | } |
| 78 | 78 | if ($bloc) { |
| 79 | 79 | $html = '<div class="precode">' |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | else { |
| 88 | 88 | $echap = str_replace("\t", ' ', $echap); |
| 89 | 89 | $echap = str_replace(' ', ' ', $echap); |
| 90 | - $html = "<code class=\"$class\" dir=\"ltr\"$attributs>" . $echap . '</code>'; |
|
| 90 | + $html = "<code class=\"$class\" dir=\"ltr\"$attributs>".$echap.'</code>'; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | return $html; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | if (!defined('_BALISES_BLOCS_REGEXP')) { |
| 108 | - define('_BALISES_BLOCS_REGEXP', ',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS'); |
|
| 108 | + define('_BALISES_BLOCS_REGEXP', ',</?('._BALISES_BLOCS.')[>[:space:]],iS'); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | // |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | // Tester si on echappe en span ou en div |
| 124 | 124 | if (is_null($mode) or !in_array($mode, ['div', 'span'])) { |
| 125 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $rempl) ? 'div' : 'span'; |
|
| 125 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $rempl) ? 'div' : 'span'; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | // Decouper en morceaux, base64 a des probleme selon la taille de la pile |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ) { |
| 158 | 158 | foreach ($matches as $m) { |
| 159 | 159 | if ($m[1] === 'code') { |
| 160 | - $code = '<code' . $m[2] . '>' . spip_htmlspecialchars($m[3]) . '</code>'; |
|
| 160 | + $code = '<code'.$m[2].'>'.spip_htmlspecialchars($m[3]).'</code>'; |
|
| 161 | 161 | $pre = str_replace($m[0], $code, $pre); |
| 162 | 162 | } |
| 163 | 163 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | // Echapper les <code>...</ code> |
| 169 | 169 | function traiter_echap_code_dist($regs, $options = []) { |
| 170 | - [, , $att, $corps] = $regs; |
|
| 170 | + [,, $att, $corps] = $regs; |
|
| 171 | 171 | |
| 172 | 172 | // ne pas mettre le <div...> s'il n'y a qu'une ligne |
| 173 | 173 | if (strpos($corps, "\n") !== false) { |
@@ -252,11 +252,11 @@ discard block |
||
| 252 | 252 | // sinon les traiter selon le cas |
| 253 | 253 | $callback_secure_prefix = ($callback_options['secure_prefix'] ?? ''); |
| 254 | 254 | if ( |
| 255 | - function_exists($f = $callback_prefix . $callback_secure_prefix . 'traiter_echap_' . strtolower($regs[1])) |
|
| 256 | - or function_exists($f = $f . '_dist') |
|
| 255 | + function_exists($f = $callback_prefix.$callback_secure_prefix.'traiter_echap_'.strtolower($regs[1])) |
|
| 256 | + or function_exists($f = $f.'_dist') |
|
| 257 | 257 | or ($callback_secure_prefix and ( |
| 258 | - function_exists($f = $callback_prefix . 'traiter_echap_' . strtolower($regs[1])) |
|
| 259 | - or function_exists($f = $f . '_dist') |
|
| 258 | + function_exists($f = $callback_prefix.'traiter_echap_'.strtolower($regs[1])) |
|
| 259 | + or function_exists($f = $f.'_dist') |
|
| 260 | 260 | )) |
| 261 | 261 | ) { |
| 262 | 262 | $echap = $f($regs, $callback_options); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | // dans une callback autonommee |
| 279 | 279 | if (strpos($preg ?: _PROTEGE_BLOCS, 'script') !== false) { |
| 280 | 280 | if ( |
| 281 | - strpos($letexte, '<' . '?') !== false and preg_match_all( |
|
| 281 | + strpos($letexte, '<'.'?') !== false and preg_match_all( |
|
| 282 | 282 | ',<[?].*($|[?]>),UisS', |
| 283 | 283 | $letexte, |
| 284 | 284 | $matches, |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | strpos($letexte, '<') !== false |
| 311 | 311 | and |
| 312 | 312 | preg_match_all( |
| 313 | - ',<(span|div)\sclass=[\'"]base64' . $source . '[\'"]\s(.*)>\s*</\1>,UmsS', |
|
| 313 | + ',<(span|div)\sclass=[\'"]base64'.$source.'[\'"]\s(.*)>\s*</\1>,UmsS', |
|
| 314 | 314 | $letexte, |
| 315 | 315 | $regs, |
| 316 | 316 | PREG_SET_ORDER |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | if ($at) { |
| 330 | - $rempl = '<' . $reg[1] . '>' . $rempl . '</' . $reg[1] . '>'; |
|
| 330 | + $rempl = '<'.$reg[1].'>'.$rempl.'</'.$reg[1].'>'; |
|
| 331 | 331 | foreach ($at as $attr => $a) { |
| 332 | 332 | $rempl = inserer_attribut($rempl, $attr, $a); |
| 333 | 333 | } |
@@ -408,8 +408,8 @@ discard block |
||
| 408 | 408 | $texte = nettoyer_raccourcis_typo($texte); |
| 409 | 409 | |
| 410 | 410 | // balises de sauts de ligne et paragraphe |
| 411 | - $texte = preg_replace('/<p( [^>]*)?' . '>/', "\r\r", $texte); |
|
| 412 | - $texte = preg_replace('/<br( [^>]*)?' . '>/', "\n", $texte); |
|
| 411 | + $texte = preg_replace('/<p( [^>]*)?'.'>/', "\r\r", $texte); |
|
| 412 | + $texte = preg_replace('/<br( [^>]*)?'.'>/', "\n", $texte); |
|
| 413 | 413 | |
| 414 | 414 | // on repasse les doubles \n en \r que nettoyer_raccourcis_typo() a pu modifier |
| 415 | 415 | $texte = str_replace("\n\n", "\r\r", $texte); |
@@ -434,15 +434,15 @@ discard block |
||
| 434 | 434 | // excédentaire est ensuite supprimé par l'appel à preg_replace() |
| 435 | 435 | $long = spip_substr($texte, 0, max($taille + 1 - $taille_suite, 1)); |
| 436 | 436 | $u = $GLOBALS['meta']['pcre_u']; |
| 437 | - $court = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D' . $u, "\\2", $long); |
|
| 437 | + $court = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D'.$u, "\\2", $long); |
|
| 438 | 438 | $points = $suite; |
| 439 | 439 | |
| 440 | 440 | // trop court ? ne pas faire de (...) |
| 441 | 441 | if (spip_strlen($court) < max(0.75 * $taille, 2)) { |
| 442 | 442 | $points = ''; |
| 443 | 443 | $long = spip_substr($texte, 0, $taille + 1); |
| 444 | - preg_match('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D' . $u, $long, $m); |
|
| 445 | - $texte = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D' . $u, "\\2", $long); |
|
| 444 | + preg_match('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D'.$u, $long, $m); |
|
| 445 | + $texte = preg_replace('/(^|([^\s ])[\s ]+)([\s ]|[^\s ]+)?$/D'.$u, "\\2", $long); |
|
| 446 | 446 | // encore trop court ? couper au caractere |
| 447 | 447 | if (spip_strlen($texte) < 0.75 * $taille) { |
| 448 | 448 | $texte = spip_substr($long, 0, $taille); |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | // supprimer l'eventuelle entite finale mal coupee |
| 459 | 459 | $texte = preg_replace('/&#?[a-z0-9]*$/S', '', $texte); |
| 460 | 460 | |
| 461 | - return quote_amp(trim($texte)) . $points; |
|
| 461 | + return quote_amp(trim($texte)).$points; |
|
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | |
@@ -470,16 +470,16 @@ discard block |
||
| 470 | 470 | define('_PROTEGE_JS_MODELES', creer_uniqid()); |
| 471 | 471 | } |
| 472 | 472 | foreach ($r as $regs) { |
| 473 | - $t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t); |
|
| 473 | + $t = str_replace($regs[0], code_echappement($regs[0], 'javascript'._PROTEGE_JS_MODELES), $t); |
|
| 474 | 474 | } |
| 475 | 475 | } |
| 476 | - if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) { |
|
| 476 | + if (preg_match_all(',<\?php.*?($|\?'.'>),isS', $t, $r, PREG_SET_ORDER)) { |
|
| 477 | 477 | if (!defined('_PROTEGE_PHP_MODELES')) { |
| 478 | 478 | include_spip('inc/acces'); |
| 479 | 479 | define('_PROTEGE_PHP_MODELES', creer_uniqid()); |
| 480 | 480 | } |
| 481 | 481 | foreach ($r as $regs) { |
| 482 | - $t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t); |
|
| 482 | + $t = str_replace($regs[0], code_echappement($regs[0], 'php'._PROTEGE_PHP_MODELES), $t); |
|
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | } |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | if (!empty($options['wrap_suspect'])) { |
| 597 | 597 | $texte = wrap($texte, $options['wrap_suspect']); |
| 598 | 598 | } |
| 599 | - $texte = "<mark class='danger-js' title='" . attribut_html(_T('erreur_contenu_suspect')) . "'>⚠️</mark> " . $texte; |
|
| 599 | + $texte = "<mark class='danger-js' title='".attribut_html(_T('erreur_contenu_suspect'))."'>⚠️</mark> ".$texte; |
|
| 600 | 600 | } |
| 601 | 601 | |
| 602 | 602 | $texte = $collecteurModeles->retablir($texte); |
@@ -743,11 +743,11 @@ discard block |
||
| 743 | 743 | **/ |
| 744 | 744 | function supprime_img($letexte, $message = null) { |
| 745 | 745 | if ($message === null) { |
| 746 | - $message = '(' . _T('img_indisponible') . ')'; |
|
| 746 | + $message = '('._T('img_indisponible').')'; |
|
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | return preg_replace( |
| 750 | - ',<(img|doc|emb)([0-9]+)(\|([^>]*))?' . '\s*/?' . '>,i', |
|
| 750 | + ',<(img|doc|emb)([0-9]+)(\|([^>]*))?'.'\s*/?'.'>,i', |
|
| 751 | 751 | $message, |
| 752 | 752 | $letexte |
| 753 | 753 | ); |