@@ -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); |
@@ -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 |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | if ($objet == 'rubrique') { |
| 115 | 115 | // si c'est une rubrique-secteur contenant des breves, demander la |
| 116 | 116 | // confirmation du deplacement |
| 117 | - $contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . intval($id_objet)); |
|
| 117 | + $contient_breves = sql_countsel('spip_breves', 'id_rubrique='.intval($id_objet)); |
|
| 118 | 118 | |
| 119 | 119 | if ($contient_breves > 0) { |
| 120 | 120 | $scb = ($contient_breves > 1 ? 's' : ''); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | ); |
| 128 | 128 | $confirm .= "\n<div class='confirmer_deplacement verdana2'>" |
| 129 | 129 | . "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>" |
| 130 | - . $scb . |
|
| 130 | + . $scb. |
|
| 131 | 131 | "</label></div></div>\n"; |
| 132 | 132 | } else { |
| 133 | 133 | $confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n"; |
@@ -136,11 +136,11 @@ discard block |
||
| 136 | 136 | $form .= $confirm; |
| 137 | 137 | if ($actionable) { |
| 138 | 138 | if (strpos($form, '<select') !== false) { |
| 139 | - $form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>" |
|
| 140 | - . '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>' |
|
| 139 | + $form .= "<div style='text-align: ".$GLOBALS['spip_lang_right'].";'>" |
|
| 140 | + . '<input class="fondo submit btn" type="submit" value="'._T('bouton_choisir').'"/>' |
|
| 141 | 141 | . '</div>'; |
| 142 | 142 | } |
| 143 | - $form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form; |
|
| 143 | + $form = "<input type='hidden' name='editer_$objet' value='oui' />\n".$form; |
|
| 144 | 144 | if ($action = charger_fonction("editer_$objet", 'action', true)) { |
| 145 | 145 | $form = generer_action_auteur( |
| 146 | 146 | "editer_$objet", |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | include_spip('inc/presentation'); |
| 168 | 168 | |
| 169 | - return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur(); |
|
| 169 | + return debut_cadre_couleur($logo, true, '', $titre).$form.fin_cadre_couleur(); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | if ($statut == 'nouveau') { |
| 243 | 243 | if ($attente) { |
| 244 | 244 | $statut = $attente; |
| 245 | - $plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')'; |
|
| 245 | + $plus = ' ('._T('info_statut_auteur_a_confirmer').')'; |
|
| 246 | 246 | } else { |
| 247 | 247 | return _T('info_statut_auteur_a_confirmer'); |
| 248 | 248 | } |
@@ -255,16 +255,16 @@ discard block |
||
| 255 | 255 | '5poubelle' => _T('texte_statut_poubelle'), // bouh |
| 256 | 256 | ]; |
| 257 | 257 | if (isset($recom[$statut])) { |
| 258 | - return $recom[$statut] . $plus; |
|
| 258 | + return $recom[$statut].$plus; |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | // retrouver directement par le statut sinon |
| 262 | 262 | if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) { |
| 263 | 263 | if (isset($recom[$t])) { |
| 264 | - return $recom[$t] . $plus; |
|
| 264 | + return $recom[$t].$plus; |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - return _T($t) . $plus; |
|
| 267 | + return _T($t).$plus; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | // si on a pas reussi a le traduire, retournons la chaine telle quelle |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | if (!$id_rubrique and defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') and _CHOIX_RUBRIQUE_PAR_DEFAUT) { |
| 389 | 389 | $in = !(is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0) |
| 390 | 390 | ? '' |
| 391 | - : (' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])); |
|
| 391 | + : (' AND '.sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])); |
|
| 392 | 392 | |
| 393 | 393 | // on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement |
| 394 | 394 | if ($objet == 'rubrique') { |
@@ -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 | |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | ); |
| 526 | 526 | |
| 527 | 527 | if ($alertes = array_filter($alertes)) { |
| 528 | - return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" . |
|
| 528 | + return "<div class='wrap-messages-alertes'><div class='messages-alertes'>". |
|
| 529 | 529 | join(' | ', $alertes) |
| 530 | 530 | . '</div></div>'; |
| 531 | 531 | } |
@@ -559,13 +559,13 @@ discard block |
||
| 559 | 559 | */ |
| 560 | 560 | function afficher_plus_info($lien, $titre = '+', $titre_lien = '') { |
| 561 | 561 | $titre = attribut_html($titre); |
| 562 | - $icone = "\n<a href='$lien' title='$titre' class='plus_info'>" . |
|
| 563 | - http_img_pack('information-16.png', $titre) . '</a>'; |
|
| 562 | + $icone = "\n<a href='$lien' title='$titre' class='plus_info'>". |
|
| 563 | + http_img_pack('information-16.png', $titre).'</a>'; |
|
| 564 | 564 | |
| 565 | 565 | if (!$titre_lien) { |
| 566 | 566 | return $icone; |
| 567 | 567 | } else { |
| 568 | - return $icone . "\n<a href='$lien'>$titre_lien</a>"; |
|
| 568 | + return $icone."\n<a href='$lien'>$titre_lien</a>"; |
|
| 569 | 569 | } |
| 570 | 570 | } |
| 571 | 571 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * Mot de passe |
| 32 | 32 | **/ |
| 33 | 33 | function creer_pass_aleatoire($longueur = 16, $sel = '') { |
| 34 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 34 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 35 | 35 | |
| 36 | 36 | mt_srand($seed); |
| 37 | 37 | $s = ''; |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | if (!$s) { |
| 43 | 43 | $s = random_int(0, mt_getrandmax()); |
| 44 | 44 | } |
| 45 | - $s = substr(md5(uniqid($s) . $sel), 0, 16); |
|
| 45 | + $s = substr(md5(uniqid($s).$sel), 0, 16); |
|
| 46 | 46 | } |
| 47 | - $r = unpack('Cr', pack('H2', $s . $s)); |
|
| 47 | + $r = unpack('Cr', pack('H2', $s.$s)); |
|
| 48 | 48 | $x = $r['r'] & 63; |
| 49 | 49 | if ($x < 10) { |
| 50 | 50 | $x = chr($x + 48); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | static $seeded; |
| 83 | 83 | |
| 84 | 84 | if (!$seeded) { |
| 85 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 85 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 86 | 86 | mt_srand($seed); |
| 87 | 87 | $seeded = true; |
| 88 | 88 | } |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire()); |
| 169 | 169 | } |
| 170 | 170 | } else { |
| 171 | - $low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = ' . intval($id_auteur)); |
|
| 171 | + $low_sec = sql_getfetsel('low_sec', 'spip_auteurs', 'id_auteur = '.intval($id_auteur)); |
|
| 172 | 172 | if (!$low_sec) { |
| 173 | 173 | $low_sec = creer_pass_aleatoire(); |
| 174 | - sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = ' . intval($id_auteur)); |
|
| 174 | + sql_updateq('spip_auteurs', ['low_sec' => $low_sec], 'id_auteur = '.intval($id_auteur)); |
|
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
@@ -229,9 +229,9 @@ discard block |
||
| 229 | 229 | function generer_url_api_low_sec(string $script, string $format, string $fond, string $path, string $args, bool $no_entities = false, ?bool $public = null) { |
| 230 | 230 | $id_auteur = $GLOBALS['visiteur_session']['id_auteur'] ?? 0; |
| 231 | 231 | $cle = afficher_low_sec($id_auteur, "$script/$format $fond $args"); |
| 232 | - $path = "$id_auteur/$cle/$format/$fond" . ($path ? "/$path" : ''); |
|
| 232 | + $path = "$id_auteur/$cle/$format/$fond".($path ? "/$path" : ''); |
|
| 233 | 233 | |
| 234 | - return generer_url_api( $script, $path, $args, $no_entities = false, $public); |
|
| 234 | + return generer_url_api($script, $path, $args, $no_entities = false, $public); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | foreach ($args as $val => $var) { |
| 254 | 254 | if ($var) { |
| 255 | 255 | if ($val <> 'statut') { |
| 256 | - $a .= ':' . $val . '-' . $var; |
|
| 256 | + $a .= ':'.$val.'-'.$var; |
|
| 257 | 257 | } |
| 258 | - $b .= $val . '=' . $var . '&'; |
|
| 258 | + $b .= $val.'='.$var.'&'; |
|
| 259 | 259 | } |
| 260 | 260 | } |
| 261 | 261 | $a = substr($a, 1); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * Clé |
| 286 | 286 | **/ |
| 287 | 287 | function afficher_low_sec($id_auteur, $action = '') { |
| 288 | - return substr(md5($action . low_sec($id_auteur)), 0, 8); |
|
| 288 | + return substr(md5($action.low_sec($id_auteur)), 0, 8); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | if (!$id_auteur = intval($id_auteur)) { |
| 317 | 317 | return; |
| 318 | 318 | } // jamais trop prudent ;) |
| 319 | - sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = ' . intval($id_auteur)); |
|
| 319 | + sql_updateq('spip_auteurs', ['low_sec' => ''], 'id_auteur = '.intval($id_auteur)); |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | function initialiser_sel() { |
| 328 | 328 | if (!isset($GLOBALS['htsalt'])) { |
| 329 | 329 | if (CRYPT_MD5) { |
| 330 | - $GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire(); |
|
| 330 | + $GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire(); |
|
| 331 | 331 | } else { |
| 332 | 332 | $GLOBALS['htsalt'] = ''; |
| 333 | 333 | } |
@@ -349,8 +349,8 @@ discard block |
||
| 349 | 349 | * - void sinon. |
| 350 | 350 | **/ |
| 351 | 351 | function ecrire_acces() { |
| 352 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 353 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 352 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 353 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 354 | 354 | |
| 355 | 355 | // Cette variable de configuration peut etre posee par un plugin |
| 356 | 356 | // par exemple acces_restreint ; |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | and !@file_exists($htaccess) |
| 362 | 362 | ) { |
| 363 | 363 | spip_unlink($htpasswd); |
| 364 | - spip_unlink($htpasswd . '-admin'); |
|
| 364 | + spip_unlink($htpasswd.'-admin'); |
|
| 365 | 365 | return; |
| 366 | 366 | } |
| 367 | 367 | |
@@ -390,10 +390,10 @@ discard block |
||
| 390 | 390 | $pwd_all = ''; // login:htpass pour tous |
| 391 | 391 | $pwd_admin = ''; // login:htpass pour les admins |
| 392 | 392 | |
| 393 | - $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND " . sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 393 | + $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
|
| 394 | 394 | while ($row = sql_fetch($res)) { |
| 395 | 395 | if (strlen($row['login']) and strlen($row['htpass'])) { |
| 396 | - $ligne = $row['login'] . ':' . $row['htpass'] . "\n"; |
|
| 396 | + $ligne = $row['login'].':'.$row['htpass']."\n"; |
|
| 397 | 397 | $pwd_all .= $ligne; |
| 398 | 398 | if ($row['statut'] == '0minirezo') { |
| 399 | 399 | $pwd_admin .= $ligne; |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | * @return boolean |
| 439 | 439 | */ |
| 440 | 440 | function verifier_htaccess($rep, $force = false) { |
| 441 | - $htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME; |
|
| 441 | + $htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME; |
|
| 442 | 442 | if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) { |
| 443 | 443 | return true; |
| 444 | 444 | } |
@@ -467,17 +467,17 @@ discard block |
||
| 467 | 467 | fputs($ht, $deny); |
| 468 | 468 | fclose($ht); |
| 469 | 469 | @chmod($htaccess, _SPIP_CHMOD & 0666); |
| 470 | - $t = rtrim($rep, '/') . '/.ok'; |
|
| 470 | + $t = rtrim($rep, '/').'/.ok'; |
|
| 471 | 471 | if ($ht = @fopen($t, 'w')) { |
| 472 | 472 | @fclose($ht); |
| 473 | 473 | include_spip('inc/distant'); |
| 474 | 474 | $t = substr($t, strlen(_DIR_RACINE)); |
| 475 | - $t = url_de_base() . $t; |
|
| 475 | + $t = url_de_base().$t; |
|
| 476 | 476 | $ht = recuperer_url($t, ['methode' => 'HEAD', 'taille_max' => 0, 'follow_location' => false]); |
| 477 | 477 | $ht = ($ht['status'] ?? null) === 403; |
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | - spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee')); |
|
| 480 | + spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee')); |
|
| 481 | 481 | |
| 482 | 482 | return $ht; |
| 483 | 483 | } |
@@ -503,11 +503,11 @@ discard block |
||
| 503 | 503 | $dirs = sql_allfetsel('extension', 'spip_types_documents'); |
| 504 | 504 | $dirs[] = ['extension' => 'distant']; |
| 505 | 505 | foreach ($dirs as $e) { |
| 506 | - if (is_dir($dir = _DIR_IMG . $e['extension'])) { |
|
| 506 | + if (is_dir($dir = _DIR_IMG.$e['extension'])) { |
|
| 507 | 507 | if ($f) { |
| 508 | 508 | verifier_htaccess($dir); |
| 509 | 509 | } else { |
| 510 | - spip_unlink($dir . '/' . _ACCESS_FILE_NAME); |
|
| 510 | + spip_unlink($dir.'/'._ACCESS_FILE_NAME); |
|
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | 513 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | } |
| 16 | 16 | } |
| 17 | 17 | krsort($items); |
| 18 | - $texte = str_replace($placeholder, implode("\n\t", $items) . "\n", $texte); |
|
| 18 | + $texte = str_replace($placeholder, implode("\n\t", $items)."\n", $texte); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | return $texte; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | if ($changer_lang != 'herit') { |
| 46 | 46 | $set['lang'] = $changer_lang; |
| 47 | - sql_updateq($table_objet_sql, $set, "$id_table_objet=" . intval($id), [], $serveur); |
|
| 47 | + sql_updateq($table_objet_sql, $set, "$id_table_objet=".intval($id), [], $serveur); |
|
| 48 | 48 | include_spip('inc/rubriques'); // pour calculer_langues_rubriques et calculer_langues_utilisees |
| 49 | 49 | if ($table_objet_sql == 'spip_rubriques') { |
| 50 | 50 | calculer_langues_rubriques(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $langues = calculer_langues_utilisees($serveur); |
| 53 | 53 | ecrire_meta('langues_utilisees', $langues); |
| 54 | 54 | } else { |
| 55 | - $langue_parent = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 55 | + $langue_parent = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 56 | 56 | if (!$langue_parent) { |
| 57 | 57 | $langue_parent = $GLOBALS['meta']['langue_site']; |
| 58 | 58 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if (isset($set['langue_choisie'])) { |
| 62 | 62 | $set['langue_choisie'] = 'non'; |
| 63 | 63 | } |
| 64 | - sql_updateq($table_objet_sql, $set, "$id_table_objet=" . intval($id), [], $serveur); |
|
| 64 | + sql_updateq($table_objet_sql, $set, "$id_table_objet=".intval($id), [], $serveur); |
|
| 65 | 65 | if ($table_objet_sql == 'spip_rubriques') { |
| 66 | 66 | include_spip('inc/rubriques'); |
| 67 | 67 | calculer_langues_rubriques(); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $row = sql_fetsel( |
| 57 | 57 | 'alea_actuel, alea_futur', |
| 58 | 58 | 'spip_auteurs', |
| 59 | - 'login=' . sql_quote($login, $serveur, 'text'), |
|
| 59 | + 'login='.sql_quote($login, $serveur, 'text'), |
|
| 60 | 60 | '', |
| 61 | 61 | '', |
| 62 | 62 | '', |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | if ($row) { |
| 68 | 68 | include_spip('auth/sha256.inc'); |
| 69 | - $shapass = spip_sha256($row['alea_actuel'] . $pass); |
|
| 70 | - $shanext = spip_sha256($row['alea_futur'] . $pass); |
|
| 71 | - $md5pass = md5($row['alea_actuel'] . $pass); |
|
| 69 | + $shapass = spip_sha256($row['alea_actuel'].$pass); |
|
| 70 | + $shanext = spip_sha256($row['alea_futur'].$pass); |
|
| 71 | + $md5pass = md5($row['alea_actuel'].$pass); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | $row = sql_fetsel( |
| 81 | 81 | '*', |
| 82 | 82 | 'spip_auteurs', |
| 83 | - 'login=' . sql_quote($login, $serveur, 'text') . ' AND pass=' . sql_quote( |
|
| 83 | + 'login='.sql_quote($login, $serveur, 'text').' AND pass='.sql_quote( |
|
| 84 | 84 | $shapass, |
| 85 | 85 | $serveur, |
| 86 | 86 | 'text' |
| 87 | - ) . " AND statut<>'5poubelle'", |
|
| 87 | + )." AND statut<>'5poubelle'", |
|
| 88 | 88 | '', |
| 89 | 89 | '', |
| 90 | 90 | '', |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | $row = sql_fetsel( |
| 98 | 98 | '*', |
| 99 | 99 | 'spip_auteurs', |
| 100 | - 'login=' . sql_quote($login, $serveur, 'text') . ' AND pass=' . sql_quote( |
|
| 100 | + 'login='.sql_quote($login, $serveur, 'text').' AND pass='.sql_quote( |
|
| 101 | 101 | $md5pass, |
| 102 | 102 | $serveur, |
| 103 | 103 | 'text' |
| 104 | - ) . " AND statut<>'5poubelle'", |
|
| 104 | + )." AND statut<>'5poubelle'", |
|
| 105 | 105 | '', |
| 106 | 106 | '', |
| 107 | 107 | '', |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | 'pass' => sql_quote($shanext, $serveur, 'text'), |
| 127 | 127 | 'alea_futur' => sql_quote(creer_uniqid(), $serveur, 'text') |
| 128 | 128 | ], |
| 129 | - 'id_auteur=' . $row['id_auteur'] . ' AND pass IN (' . sql_quote( |
|
| 129 | + 'id_auteur='.$row['id_auteur'].' AND pass IN ('.sql_quote( |
|
| 130 | 130 | $shapass, |
| 131 | 131 | $serveur, |
| 132 | 132 | 'text' |
| 133 | - ) . ', ' . sql_quote($md5pass, $serveur, 'text') . ')', |
|
| 133 | + ).', '.sql_quote($md5pass, $serveur, 'text').')', |
|
| 134 | 134 | [], |
| 135 | 135 | $serveur |
| 136 | 136 | ); |
@@ -169,16 +169,16 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | // javascript qui gere la securite du login en evitant de faire circuler le pass en clair |
| 171 | 171 | $flux['data'] .= |
| 172 | - ($compat_md5 ? '<script type="text/javascript" src="' . _DIR_JAVASCRIPT . 'md5.js"></script>' : '') |
|
| 173 | - . '<script type="text/javascript" src="' . _DIR_JAVASCRIPT . 'login-sha-min.js"></script>' |
|
| 172 | + ($compat_md5 ? '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'md5.js"></script>' : '') |
|
| 173 | + . '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'login-sha-min.js"></script>' |
|
| 174 | 174 | . '<script type="text/javascript">/*<![CDATA[*/' |
| 175 | - . "var login_info={'alea_actuel':'" . $flux['args']['contexte']['_alea_actuel'] . "'," |
|
| 176 | - . "'alea_futur':'" . $flux['args']['contexte']['_alea_futur'] . "'," |
|
| 177 | - . "'login':'" . $flux['args']['contexte']['var_login'] . "'," |
|
| 178 | - . "'page_auteur': '" . generer_url_public('informer_auteur') . "'," |
|
| 175 | + . "var login_info={'alea_actuel':'".$flux['args']['contexte']['_alea_actuel']."'," |
|
| 176 | + . "'alea_futur':'".$flux['args']['contexte']['_alea_futur']."'," |
|
| 177 | + . "'login':'".$flux['args']['contexte']['var_login']."'," |
|
| 178 | + . "'page_auteur': '".generer_url_public('informer_auteur')."'," |
|
| 179 | 179 | . "'informe_auteur_en_cours':false," |
| 180 | 180 | . "'attente_informe':0," |
| 181 | - . "'compat_md5':" . ($compat_md5 ? 'true' : 'false') . '};' |
|
| 181 | + . "'compat_md5':".($compat_md5 ? 'true' : 'false').'};' |
|
| 182 | 182 | . "jQuery(function(){ |
| 183 | 183 | jQuery('#var_login').change(actualise_auteur); |
| 184 | 184 | jQuery('form#formulaire_login').submit(login_submit); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } else { |
| 223 | 223 | $n = sql_countsel( |
| 224 | 224 | 'spip_auteurs', |
| 225 | - 'login=' . sql_quote($new_login) . ' AND id_auteur!=' . intval($id_auteur) . " AND statut!='5poubelle'", |
|
| 225 | + 'login='.sql_quote($new_login).' AND id_auteur!='.intval($id_auteur)." AND statut!='5poubelle'", |
|
| 226 | 226 | '', |
| 227 | 227 | '', |
| 228 | 228 | $serveur |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | if ( |
| 252 | 252 | !$id_auteur = intval($id_auteur) |
| 253 | - or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 253 | + or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 254 | 254 | ) { |
| 255 | 255 | return false; |
| 256 | 256 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $anciens = sql_allfetsel( |
| 266 | 266 | 'id_auteur', |
| 267 | 267 | 'spip_auteurs', |
| 268 | - 'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'", |
|
| 268 | + 'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'", |
|
| 269 | 269 | '', |
| 270 | 270 | '', |
| 271 | 271 | '', |
@@ -299,8 +299,8 @@ discard block |
||
| 299 | 299 | $r = sql_getfetsel( |
| 300 | 300 | 'login', |
| 301 | 301 | 'spip_auteurs', |
| 302 | - "statut<>'5poubelle'" . |
|
| 303 | - ' AND (length(pass)>0)' . |
|
| 302 | + "statut<>'5poubelle'". |
|
| 303 | + ' AND (length(pass)>0)'. |
|
| 304 | 304 | " AND (login=$l)", |
| 305 | 305 | '', |
| 306 | 306 | '', |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | return sql_getfetsel( |
| 320 | 320 | 'login', |
| 321 | 321 | 'spip_auteurs', |
| 322 | - "statut<>'5poubelle'" . |
|
| 323 | - ' AND (length(pass)>0)' . |
|
| 322 | + "statut<>'5poubelle'". |
|
| 323 | + ' AND (length(pass)>0)'. |
|
| 324 | 324 | " AND (login<>'' AND (nom=$l OR email=$l))", |
| 325 | 325 | '', |
| 326 | 326 | '', |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | |
| 412 | 412 | if ( |
| 413 | 413 | !$id_auteur = intval($id_auteur) |
| 414 | - or !sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 414 | + or !sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 415 | 415 | ) { |
| 416 | 416 | return false; |
| 417 | 417 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | $htpass = generer_htpass($new_pass); |
| 423 | 423 | $alea_actuel = creer_uniqid(); |
| 424 | 424 | $alea_futur = creer_uniqid(); |
| 425 | - $pass = spip_sha256($alea_actuel . $new_pass); |
|
| 425 | + $pass = spip_sha256($alea_actuel.$new_pass); |
|
| 426 | 426 | $c['pass'] = $pass; |
| 427 | 427 | $c['htpass'] = $htpass; |
| 428 | 428 | $c['alea_actuel'] = $alea_actuel; |
@@ -458,8 +458,8 @@ discard block |
||
| 458 | 458 | or isset($champs['statut']) |
| 459 | 459 | or (isset($options['all']) and $options['all']) |
| 460 | 460 | ) { |
| 461 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 462 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 461 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 462 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 463 | 463 | |
| 464 | 464 | // Cette variable de configuration peut etre posee par un plugin |
| 465 | 465 | // par exemple acces_restreint ; |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | and !@file_exists($htaccess) |
| 470 | 470 | ) { |
| 471 | 471 | spip_unlink($htpasswd); |
| 472 | - spip_unlink($htpasswd . '-admin'); |
|
| 472 | + spip_unlink($htpasswd.'-admin'); |
|
| 473 | 473 | |
| 474 | 474 | return; |
| 475 | 475 | } |
@@ -487,16 +487,16 @@ discard block |
||
| 487 | 487 | ); |
| 488 | 488 | while ($t = sql_fetch($s)) { |
| 489 | 489 | if (strlen($t['login']) and strlen($t['htpass'])) { |
| 490 | - $p1 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 490 | + $p1 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 491 | 491 | if ($t['statut'] == '0minirezo') { |
| 492 | - $p2 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 492 | + $p2 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 493 | 493 | } |
| 494 | 494 | } |
| 495 | 495 | } |
| 496 | 496 | sql_free($s); |
| 497 | 497 | if ($p1) { |
| 498 | 498 | ecrire_fichier($htpasswd, $p1); |
| 499 | - ecrire_fichier($htpasswd . '-admin', $p2); |
|
| 499 | + ecrire_fichier($htpasswd.'-admin', $p2); |
|
| 500 | 500 | spip_log("Ecriture de $htpasswd et $htpasswd-admin"); |
| 501 | 501 | } |
| 502 | 502 | } |