@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | static $t1 = ['&', '<', '>']; |
| 121 | 121 | static $t2 = ['&', '<', '>']; |
| 122 | 122 | |
| 123 | - return '<pre>' . str_replace($t1, $t2, (string) $t) . '</pre>'; |
|
| 123 | + return '<pre>'.str_replace($t1, $t2, (string) $t).'</pre>'; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -140,12 +140,12 @@ discard block |
||
| 140 | 140 | foreach ($lignes as &$l) { |
| 141 | 141 | $l = join('|', $l); |
| 142 | 142 | } |
| 143 | - $corps = join("\n", $lignes) . "\n"; |
|
| 144 | - $corps = $caption . |
|
| 145 | - "\n|{{" . |
|
| 146 | - join('}}|{{', $entete) . |
|
| 147 | - '}}|' . |
|
| 148 | - "\n|" . |
|
| 143 | + $corps = join("\n", $lignes)."\n"; |
|
| 144 | + $corps = $caption. |
|
| 145 | + "\n|{{". |
|
| 146 | + join('}}|{{', $entete). |
|
| 147 | + '}}|'. |
|
| 148 | + "\n|". |
|
| 149 | 149 | str_replace("\n", "|\n|", $corps); |
| 150 | 150 | include_spip('inc/texte'); |
| 151 | 151 | |
@@ -187,9 +187,9 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | // Pourquoi SafeHtml transforme-t-il en texte les scripts dans Body ? |
| 190 | - $t = safehtml(preg_replace(',<script' . '.*?</script>,is', '', $t)); |
|
| 190 | + $t = safehtml(preg_replace(',<script'.'.*?</script>,is', '', $t)); |
|
| 191 | 191 | |
| 192 | - return (!$style ? '' : "\n<style>" . $style . '</style>') . $t; |
|
| 192 | + return (!$style ? '' : "\n<style>".$style.'</style>').$t; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $champ = preg_replace(',[\s]+,ms', ' ', $champ); |
| 39 | 39 | $champ = str_replace('"', '""', $champ); |
| 40 | 40 | |
| 41 | - return '"' . $champ . '"'; |
|
| 41 | + return '"'.$champ.'"'; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | if ($callback) { |
| 59 | 59 | $ligne = $callback($nb, $ligne, $delim, $importer_charset); |
| 60 | 60 | } |
| 61 | - $output = join($delim, array_map('exporter_csv_champ', $ligne)) . "\r\n"; |
|
| 61 | + $output = join($delim, array_map('exporter_csv_champ', $ligne))."\r\n"; |
|
| 62 | 62 | if ($importer_charset) { |
| 63 | 63 | $output = str_replace('’', '\'', $output); |
| 64 | 64 | $output = unicode2charset(html2unicode(charset2unicode($output)), $importer_charset); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $fichier = 'php://output'; |
| 176 | 176 | } |
| 177 | 177 | else { |
| 178 | - $fichier = sous_repertoire(_DIR_CACHE, 'export') . $filename; |
|
| 178 | + $fichier = sous_repertoire(_DIR_CACHE, 'export').$filename; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $fp = fopen($fichier, 'w'); |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | |
| 94 | 94 | $res = ltrim($res['texte']); |
| 95 | 95 | if (empty($res)) { |
| 96 | - spip_log("$arg $qs resultat vide", 'transmettre' . _LOG_INFO_IMPORTANTE); |
|
| 96 | + spip_log("$arg $qs resultat vide", 'transmettre'._LOG_INFO_IMPORTANTE); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | echo $res; |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | ob_start(); |
| 48 | 48 | if (strpos($page['texte'], '?xml') !== false) { |
| 49 | - $page['texte'] = str_replace('<' . '?xml', "<\1?xml", $page['texte']); |
|
| 49 | + $page['texte'] = str_replace('<'.'?xml', "<\1?xml", $page['texte']); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | try { |
| 53 | - $res = eval('?' . '>' . $page['texte']); |
|
| 53 | + $res = eval('?'.'>'.$page['texte']); |
|
| 54 | 54 | $page['texte'] = ob_get_contents(); |
| 55 | 55 | } catch (\Throwable $e) { |
| 56 | 56 | $code = $page['texte']; |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | if (!function_exists('numerote_ligne_php')) { |
| 59 | 59 | function numerote_ligne_php($match) { |
| 60 | 60 | $GLOBALS['numero_ligne_php']++; |
| 61 | - return "\n/*" . str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT) . '*/'; |
|
| 61 | + return "\n/*".str_pad($GLOBALS['numero_ligne_php'], 3, '0', STR_PAD_LEFT).'*/'; |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | - $code = '/*001*/' . preg_replace_callback(",\n,", 'numerote_ligne_php', $code); |
|
| 64 | + $code = '/*001*/'.preg_replace_callback(",\n,", 'numerote_ligne_php', $code); |
|
| 65 | 65 | $code = trim(highlight_string($code, true)); |
| 66 | - erreur_squelette('L' . $e->getLine() . ': ' . $e->getMessage() . '<br />' . $code, [$page['source'],'',$e->getFile(),'',$GLOBALS['spip_lang']]); |
|
| 66 | + erreur_squelette('L'.$e->getLine().': '.$e->getMessage().'<br />'.$code, [$page['source'], '', $e->getFile(), '', $GLOBALS['spip_lang']]); |
|
| 67 | 67 | $page['texte'] = '<!-- Erreur -->'; |
| 68 | 68 | } |
| 69 | 69 | ob_end_clean(); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $page['process_ins'] = 'html'; |
| 72 | 72 | |
| 73 | 73 | if (strpos($page['texte'], '?xml') !== false) { |
| 74 | - $page['texte'] = str_replace("<\1?xml", '<' . '?xml', $page['texte']); |
|
| 74 | + $page['texte'] = str_replace("<\1?xml", '<'.'?xml', $page['texte']); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | sql_updateq( |
| 136 | 136 | 'spip_rubriques', |
| 137 | 137 | ['statut' => 'publie', 'date' => date('Y-m-d H:i:s')], |
| 138 | - 'id_rubrique=' . intval($id_rubrique) |
|
| 138 | + 'id_rubrique='.intval($id_rubrique) |
|
| 139 | 139 | ); |
| 140 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique)); |
|
| 140 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique='.intval($id_rubrique)); |
|
| 141 | 141 | if (!$id_parent) { |
| 142 | 142 | break; |
| 143 | 143 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | return $id_pred != $id_rubrique; |
| 173 | 173 | } |
| 174 | 174 | // passer au parent si on a depublie |
| 175 | - $r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred)); |
|
| 175 | + $r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_pred)); |
|
| 176 | 176 | $id_pred = $r['id_parent']; |
| 177 | 177 | } |
| 178 | 178 | |
@@ -197,14 +197,14 @@ discard block |
||
| 197 | 197 | $date = date('Y-m-d H:i:s'); |
| 198 | 198 | } |
| 199 | 199 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 200 | - ' AND date <= ' . sql_quote($date) : ''; |
|
| 200 | + ' AND date <= '.sql_quote($date) : ''; |
|
| 201 | 201 | |
| 202 | 202 | if (!$id_rubrique = intval($id_rubrique)) { |
| 203 | 203 | return false; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // verifier qu'elle existe et est bien publiee |
| 207 | - $r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 207 | + $r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 208 | 208 | if (!$r or $r['statut'] !== 'publie') { |
| 209 | 209 | return false; |
| 210 | 210 | } |
@@ -214,12 +214,12 @@ discard block |
||
| 214 | 214 | $compte = [ |
| 215 | 215 | 'articles' => sql_countsel( |
| 216 | 216 | 'spip_articles', |
| 217 | - 'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates" |
|
| 217 | + 'id_rubrique='.intval($id_rubrique)." AND statut='publie'$postdates" |
|
| 218 | 218 | ), |
| 219 | - 'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"), |
|
| 219 | + 'rubriques' => sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)." AND statut='publie'"), |
|
| 220 | 220 | 'documents' => sql_countsel( |
| 221 | 221 | 'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document', |
| 222 | - 'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') " |
|
| 222 | + 'L.id_objet='.intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') " |
|
| 223 | 223 | ) |
| 224 | 224 | ]; |
| 225 | 225 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique)); |
|
| 247 | + sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique='.intval($id_rubrique)); |
|
| 248 | 248 | |
| 249 | 249 | # spip_log("depublier_rubrique $id_pred"); |
| 250 | 250 | return true; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | // Afficher les articles post-dates ? |
| 309 | 309 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 310 | - 'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 310 | + 'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 311 | 311 | |
| 312 | 312 | $r = sql_select( |
| 313 | 313 | 'R.id_rubrique AS id, max(A.date) AS date_h', |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | sql_updateq( |
| 320 | 320 | 'spip_rubriques', |
| 321 | 321 | ['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']], |
| 322 | - 'id_rubrique=' . intval($row['id']) |
|
| 322 | + 'id_rubrique='.intval($row['id']) |
|
| 323 | 323 | ); |
| 324 | 324 | } |
| 325 | 325 | |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | sql_updateq( |
| 346 | 346 | 'spip_rubriques', |
| 347 | 347 | ['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']], |
| 348 | - 'id_rubrique=' . intval($row['id']) |
|
| 348 | + 'id_rubrique='.intval($row['id']) |
|
| 349 | 349 | ); |
| 350 | 350 | $continuer = true; |
| 351 | 351 | } |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | and $rows = sql_allfetsel( |
| 399 | 399 | 'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur', |
| 400 | 400 | 'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique', |
| 401 | - 'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)', |
|
| 401 | + 'R.profondeur='.intval($prof).' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)', |
|
| 402 | 402 | '', |
| 403 | 403 | 'R.id_secteur', |
| 404 | 404 | '0,100' |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | and $rows = sql_allfetsel( |
| 438 | 438 | 'id_rubrique as id', |
| 439 | 439 | 'spip_rubriques', |
| 440 | - 'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select( |
|
| 440 | + 'profondeur='.intval($prof + 1).' AND id_parent NOT IN ('.sql_get_select( |
|
| 441 | 441 | 'zzz.id_rubrique', |
| 442 | 442 | 'spip_rubriques AS zzz', |
| 443 | - 'zzz.profondeur=' . intval($prof) |
|
| 444 | - ) . ')', |
|
| 443 | + 'zzz.profondeur='.intval($prof) |
|
| 444 | + ).')', |
|
| 445 | 445 | '', |
| 446 | 446 | '', |
| 447 | 447 | '0,100' |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | // si pas de rubrique a profondeur $prof+1 pas la peine de continuer |
| 456 | 456 | // si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse) |
| 457 | 457 | // on arrete les frais |
| 458 | - if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) { |
|
| 458 | + if (sql_countsel('spip_rubriques', 'profondeur='.intval($prof + 1))) { |
|
| 459 | 459 | $prof++; |
| 460 | 460 | $continuer = true; |
| 461 | 461 | } |
@@ -463,12 +463,12 @@ discard block |
||
| 463 | 463 | |
| 464 | 464 | // loger si la table des rubriques semble foireuse |
| 465 | 465 | // et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles |
| 466 | - if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) { |
|
| 466 | + if (sql_countsel('spip_rubriques', 'profondeur>'.intval($prof + 1))) { |
|
| 467 | 467 | spip_log( |
| 468 | - 'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)', |
|
| 468 | + 'Les rubriques de profondeur>'.($prof + 1).' semblent suspectes (branches morte ou reference circulaire dans les parents)', |
|
| 469 | 469 | _LOG_CRITIQUE |
| 470 | 470 | ); |
| 471 | - sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1)); |
|
| 471 | + sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>'.intval($prof + 1)); |
|
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | // reparer les articles |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | ); |
| 480 | 480 | |
| 481 | 481 | while ($row = sql_fetch($r)) { |
| 482 | - sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id'])); |
|
| 482 | + sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article='.intval($row['id'])); |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | // avertir les plugins qui peuvent faire leur mises a jour egalement |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | $t = sql_updateq( |
| 511 | 511 | 'spip_rubriques', |
| 512 | 512 | ['lang' => $row['lang'], 'langue_choisie' => 'non'], |
| 513 | - 'id_rubrique=' . intval($id_rubrique) |
|
| 513 | + 'id_rubrique='.intval($id_rubrique) |
|
| 514 | 514 | ); |
| 515 | 515 | } |
| 516 | 516 | |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | sql_updateq( |
| 556 | 556 | 'spip_articles', |
| 557 | 557 | ['lang' => $row['lang'], 'langue_choisie' => 'non'], |
| 558 | - 'id_article=' . intval($id_article) |
|
| 558 | + 'id_article='.intval($id_article) |
|
| 559 | 559 | ); |
| 560 | 560 | } |
| 561 | 561 | |
@@ -630,11 +630,11 @@ discard block |
||
| 630 | 630 | ]; |
| 631 | 631 | // generer un nom de fonction "anonyme" unique |
| 632 | 632 | do { |
| 633 | - $functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . random_int(0, mt_getrandmax()); |
|
| 633 | + $functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.random_int(0, mt_getrandmax()); |
|
| 634 | 634 | } while (function_exists($functionname)); |
| 635 | 635 | $code = calculer_boucle('calculer_langues_utilisees', $boucles); |
| 636 | - $code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code; |
|
| 637 | - $code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();'; |
|
| 636 | + $code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code; |
|
| 637 | + $code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();'; |
|
| 638 | 638 | $res = ''; |
| 639 | 639 | eval($code); |
| 640 | 640 | $res = explode(',', $res); |
@@ -736,11 +736,11 @@ discard block |
||
| 736 | 736 | $maxiter-- and $filles = sql_allfetsel( |
| 737 | 737 | 'id_rubrique', |
| 738 | 738 | 'spip_rubriques', |
| 739 | - sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT') |
|
| 739 | + sql_in('id_parent', $r).' AND '.sql_in('id_rubrique', $r, 'NOT') |
|
| 740 | 740 | ) |
| 741 | 741 | ) { |
| 742 | 742 | $r = join(',', array_column($filles, 'id_rubrique')); |
| 743 | - $branche .= ',' . $r; |
|
| 743 | + $branche .= ','.$r; |
|
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | # securite pour ne pas plomber la conso memoire sur les sites prolifiques |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | |
| 781 | 781 | if (isset($b[$id])) { |
| 782 | 782 | // Notre branche commence par la rubrique de depart si $tout=true |
| 783 | - return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id]; |
|
| 783 | + return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id]; |
|
| 784 | 784 | } |
| 785 | 785 | |
| 786 | 786 | $hier = ''; |
@@ -793,11 +793,11 @@ discard block |
||
| 793 | 793 | $maxiter-- and $parents = sql_allfetsel( |
| 794 | 794 | 'id_parent', |
| 795 | 795 | 'spip_rubriques', |
| 796 | - sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT') |
|
| 796 | + sql_in('id_rubrique', $ids_nouveaux_parents).' AND '.sql_in('id_parent', $hier, 'NOT') |
|
| 797 | 797 | ) |
| 798 | 798 | ) { |
| 799 | 799 | $ids_nouveaux_parents = join(',', array_column($parents, 'id_parent')); |
| 800 | - $hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : ''); |
|
| 800 | + $hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : ''); |
|
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | # securite pour ne pas plomber la conso memoire sur les sites prolifiques |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | include_spip('base/abstract_sql'); |
| 830 | 830 | if ($check) { |
| 831 | 831 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 832 | - 'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 832 | + 'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 833 | 833 | |
| 834 | 834 | $r = sql_select( |
| 835 | 835 | 'DISTINCT A.id_rubrique AS id', |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | $t = sql_fetsel( |
| 847 | 847 | 'date', |
| 848 | 848 | 'spip_articles', |
| 849 | - "statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')), |
|
| 849 | + "statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')), |
|
| 850 | 850 | '', |
| 851 | 851 | 'date', |
| 852 | 852 | '1' |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | $r = sql_getfetsel( |
| 903 | 903 | 'id_rubrique', |
| 904 | 904 | 'spip_rubriques', |
| 905 | - 'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent), |
|
| 905 | + 'titre = '.sql_quote($titre).' AND id_parent='.intval($id_parent), |
|
| 906 | 906 | $groupby = [], |
| 907 | 907 | $orderby = [], |
| 908 | 908 | $limit = '', |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | sql_updateq( |
| 939 | 939 | 'spip_rubriques', |
| 940 | 940 | ['id_secteur' => $id_secteur, 'lang' => $lang], |
| 941 | - 'id_rubrique=' . intval($id_rubrique), |
|
| 941 | + 'id_rubrique='.intval($id_rubrique), |
|
| 942 | 942 | [], |
| 943 | 943 | $serveur |
| 944 | 944 | ); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $arg = parametre_url($url_action, 'arg'); |
| 96 | - $confirm = md5("$action:$arg:" . realpath(__FILE__)); |
|
| 96 | + $confirm = md5("$action:$arg:".realpath(__FILE__)); |
|
| 97 | 97 | if (_request('confirm_action') === $confirm) { |
| 98 | 98 | return true; |
| 99 | 99 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } else { |
| 147 | 147 | return generer_url_action( |
| 148 | 148 | $action, |
| 149 | - 'arg=' . rawurlencode($arg) . "&hash=$hash" . (!$r ? '' : "&redirect=$r"), |
|
| 149 | + 'arg='.rawurlencode($arg)."&hash=$hash".(!$r ? '' : "&redirect=$r"), |
|
| 150 | 150 | $mode, |
| 151 | 151 | $public |
| 152 | 152 | ); |
@@ -157,9 +157,9 @@ discard block |
||
| 157 | 157 | $hash = calculer_action_auteur("$action-$arg"); |
| 158 | 158 | $att .= " style='margin: 0px; border: 0px'"; |
| 159 | 159 | if ($redirect) { |
| 160 | - $redirect = "\n\t\t<input name='redirect' type='hidden' value='" . str_replace("'", ''', $redirect) . "' />"; |
|
| 160 | + $redirect = "\n\t\t<input name='redirect' type='hidden' value='".str_replace("'", ''', $redirect)."' />"; |
|
| 161 | 161 | } |
| 162 | - $mode .= $redirect . " |
|
| 162 | + $mode .= $redirect." |
|
| 163 | 163 | <input name='hash' type='hidden' value='$hash' /> |
| 164 | 164 | <input name='arg' type='hidden' value='$arg' />"; |
| 165 | 165 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $pass = $pass ?? ''; |
| 234 | 234 | $entry = "$action:$id_auteur:$pass:$alea"; |
| 235 | 235 | if (!isset($sha[$entry])) { |
| 236 | - $sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::" . _action_get_alea($alea)); |
|
| 236 | + $sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::"._action_get_alea($alea)); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | return $sha[$entry]; |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | // On nettoie l’URL de tous les var_. |
| 352 | 352 | $url = nettoyer_uri_var($url); |
| 353 | 353 | |
| 354 | - $token = _action_auteur('previsualiser-' . $url, $id_auteur, secret_du_site(), $alea); |
|
| 354 | + $token = _action_auteur('previsualiser-'.$url, $id_auteur, secret_du_site(), $alea); |
|
| 355 | 355 | return "$id_auteur-$token"; |
| 356 | 356 | } |
| 357 | 357 | |
@@ -91,17 +91,17 @@ discard block |
||
| 91 | 91 | $cles = \Spip\Chiffrer\SpipCles::instance(); |
| 92 | 92 | $secret = $cles->getSecretAuth(); |
| 93 | 93 | |
| 94 | - $id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login=' . sql_quote($login)); |
|
| 94 | + $id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login='.sql_quote($login)); |
|
| 95 | 95 | if ($id_auteur !== null) { |
| 96 | 96 | // c'est un auteur connu : si on a pas de secret il faut absolument qu'il se reconnecte avec le meme mot de passe |
| 97 | 97 | // pour restaurer la copie des cles |
| 98 | 98 | if (!$secret and !auth_spip_initialiser_secret()) { |
| 99 | - $row = sql_fetsel('backup_cles, pass', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 99 | + $row = sql_fetsel('backup_cles, pass', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 100 | 100 | if (empty($row['backup_cles']) or !$cles->restore($row['backup_cles'], $pass, $row['pass'], $id_auteur)) { |
| 101 | 101 | $echec = _T('avis_connexion_erreur_fichier_cle_manquant_1'); |
| 102 | 102 | echouer_etape_3b($echec); |
| 103 | 103 | } |
| 104 | - spip_log("Les cles secretes ont ete restaurées avec le backup du webmestre #$id_auteur", 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 104 | + spip_log("Les cles secretes ont ete restaurées avec le backup du webmestre #$id_auteur", 'auth'._LOG_INFO_IMPORTANTE); |
|
| 105 | 105 | $cles->save(); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | 'email' => $email, |
| 111 | 111 | 'login' => $login, |
| 112 | 112 | 'statut' => '0minirezo' |
| 113 | - ], 'id_auteur=' . intval($id_auteur)); |
|
| 113 | + ], 'id_auteur='.intval($id_auteur)); |
|
| 114 | 114 | // le passer webmestre separement du reste, au cas ou l'alter n'aurait pas fonctionne |
| 115 | 115 | @sql_updateq('spip_auteurs', ['webmestre' => 'oui'], "id_auteur=$id_auteur"); |
| 116 | 116 | if (!auth_spip_modifier_pass($login, $pass, $id_auteur)) { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | !$auteur = auth_identifier_login($login, $pass) |
| 153 | 153 | or !auth_loger($auteur) |
| 154 | 154 | ) { |
| 155 | - spip_log("login automatique impossible $auth_spip $session" . (is_countable($row) ? count($row) : 0)); |
|
| 155 | + spip_log("login automatique impossible $auth_spip $session".(is_countable($row) ? count($row) : 0)); |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
@@ -174,9 +174,9 @@ discard block |
||
| 174 | 174 | function echouer_etape_3b($echec) { |
| 175 | 175 | echo minipres( |
| 176 | 176 | 'AUTO', |
| 177 | - info_progression_etape(3, 'etape_', 'install/', true) . |
|
| 178 | - "<div class='error'><h3>$echec</h3>\n" . |
|
| 179 | - '<p>' . _T('avis_connexion_echec_2') . '</p>' . |
|
| 177 | + info_progression_etape(3, 'etape_', 'install/', true). |
|
| 178 | + "<div class='error'><h3>$echec</h3>\n". |
|
| 179 | + '<p>'._T('avis_connexion_echec_2').'</p>'. |
|
| 180 | 180 | '</div>' |
| 181 | 181 | ); |
| 182 | 182 | exit; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $pass_poivre = hash_hmac('sha256', $password_clair, $key); |
| 38 | 38 | return password_verify($pass_poivre, $password_hash); |
| 39 | 39 | } |
| 40 | - spip_log('Aucune clé pour vérifier le mot de passe', 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 40 | + spip_log('Aucune clé pour vérifier le mot de passe', 'chiffrer'._LOG_INFO_IMPORTANTE); |
|
| 41 | 41 | return false; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $pass_poivre = hash_hmac('sha256', $password_clair, $key); |
| 60 | 60 | return password_hash($pass_poivre, PASSWORD_DEFAULT); |
| 61 | 61 | } |
| 62 | - spip_log('Aucune clé pour chiffrer le mot de passe', 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 62 | + spip_log('Aucune clé pour chiffrer le mot de passe', 'chiffrer'._LOG_INFO_IMPORTANTE); |
|
| 63 | 63 | return null; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | public function generate(string $name): string { |
| 31 | 31 | $key = Chiffrement::keygen(); |
| 32 | 32 | $this->keys[$name] = $key; |
| 33 | - spip_log("Création de la cle $name", 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 33 | + spip_log("Création de la cle $name", 'chiffrer'._LOG_INFO_IMPORTANTE); |
|
| 34 | 34 | return $key; |
| 35 | 35 | } |
| 36 | 36 | |