@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | // si une seule colonne, en faire le titre |
| 78 | 78 | if (preg_match("/^([^$sep]+)$sep+\$/", $entete, $l)) { |
| 79 | - $caption = "\n||" . $l[1] . "|"; |
|
| 79 | + $caption = "\n||".$l[1]."|"; |
|
| 80 | 80 | list($entete, $corps) = explode("\n", $corps, 2); |
| 81 | 81 | } |
| 82 | 82 | // si premiere colonne vide, le raccourci doit quand meme produire <th... |
| 83 | 83 | if ($entete[0] == $sep) { |
| 84 | - $entete = ' ' . $entete; |
|
| 84 | + $entete = ' '.$entete; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $lignes = explode("\n", $corps); |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | foreach ($lignes as &$l) { |
| 131 | - $l = str_replace('"#','"',$l); |
|
| 132 | - $l = str_replace('``**``',"\n",$l); |
|
| 131 | + $l = str_replace('"#', '"', $l); |
|
| 132 | + $l = str_replace('``**``', "\n", $l); |
|
| 133 | 133 | $l = explode($sep, $l); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $test_dir .= '/'; |
| 82 | 82 | } |
| 83 | 83 | if (!in_array($test_dir, $GLOBALS['test_dirs'])) { |
| 84 | - $GLOBALS['test_dirs'][] = _DIR_RACINE . $test_dir; |
|
| 84 | + $GLOBALS['test_dirs'][] = _DIR_RACINE.$test_dir; |
|
| 85 | 85 | } |
| 86 | 86 | } else { |
| 87 | 87 | if (!_FILE_CONNECT) { |
@@ -96,11 +96,11 @@ discard block |
||
| 96 | 96 | foreach ($GLOBALS['test_dirs'] as $i => $my_dir) { |
| 97 | 97 | $test = test_ecrire($my_dir); |
| 98 | 98 | if (!$test) { |
| 99 | - $m = preg_replace(',^' . _DIR_RACINE . ',', '', $my_dir); |
|
| 99 | + $m = preg_replace(',^'._DIR_RACINE.',', '', $my_dir); |
|
| 100 | 100 | if (@file_exists($my_dir)) { |
| 101 | - $bad_dirs['<li>' . $m . '</li>'] = 1; |
|
| 101 | + $bad_dirs['<li>'.$m.'</li>'] = 1; |
|
| 102 | 102 | } else { |
| 103 | - $absent_dirs['<li>' . $m . '</li>'] = 1; |
|
| 103 | + $absent_dirs['<li>'.$m.'</li>'] = 1; |
|
| 104 | 104 | } |
| 105 | 105 | } else { |
| 106 | 106 | $chmod = max($chmod, $test); |
@@ -110,21 +110,21 @@ discard block |
||
| 110 | 110 | if ($bad_dirs or $absent_dirs) { |
| 111 | 111 | if (!_FILE_CONNECT) { |
| 112 | 112 | $titre = _T('dirs_preliminaire'); |
| 113 | - $continuer = ' ' . _T('dirs_commencer') . '.'; |
|
| 113 | + $continuer = ' '._T('dirs_commencer').'.'; |
|
| 114 | 114 | } else { |
| 115 | 115 | $titre = _T('dirs_probleme_droits'); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
| 119 | - $res = "<div align='right'>" . menu_langues('var_lang_ecrire') . "</div>\n"; |
|
| 119 | + $res = "<div align='right'>".menu_langues('var_lang_ecrire')."</div>\n"; |
|
| 120 | 120 | |
| 121 | 121 | if ($bad_dirs) { |
| 122 | 122 | $res .= |
| 123 | 123 | _T( |
| 124 | 124 | 'dirs_repertoires_suivants', |
| 125 | 125 | array('bad_dirs' => join("\n", array_keys($bad_dirs))) |
| 126 | - ) . |
|
| 127 | - '<b>' . _T('login_recharger') . '</b>.'; |
|
| 126 | + ). |
|
| 127 | + '<b>'._T('login_recharger').'</b>.'; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | if ($absent_dirs) { |
@@ -132,22 +132,21 @@ discard block |
||
| 132 | 132 | _T( |
| 133 | 133 | 'dirs_repertoires_absents', |
| 134 | 134 | array('bad_dirs' => join("\n", array_keys($absent_dirs))) |
| 135 | - ) . |
|
| 136 | - '<b>' . _T('login_recharger') . '</b>.'; |
|
| 135 | + ). |
|
| 136 | + '<b>'._T('login_recharger').'</b>.'; |
|
| 137 | 137 | } |
| 138 | - $res = '<p>' . $continuer . $res . aider('install0', true) . '</p>'; |
|
| 138 | + $res = '<p>'.$continuer.$res.aider('install0', true).'</p>'; |
|
| 139 | 139 | |
| 140 | 140 | $t = _T('login_recharger'); |
| 141 | - $t = (!$test_dir ? '' : |
|
| 142 | - "<input type='hidden' name='test_dir' value='" . spip_htmlspecialchars($test_dir, ENT_QUOTES) . "' />") |
|
| 141 | + $t = (!$test_dir ? '' : "<input type='hidden' name='test_dir' value='".spip_htmlspecialchars($test_dir, ENT_QUOTES)."' />") |
|
| 143 | 142 | . "<input type='hidden' name='etape' value='chmod' />" |
| 144 | - . "<div style='text-align: right'><input type='submit' value='" . attribut_html($t) . "' /></div>"; |
|
| 143 | + . "<div style='text-align: right'><input type='submit' value='".attribut_html($t)."' /></div>"; |
|
| 145 | 144 | |
| 146 | - echo minipres($titre, $res . generer_form_ecrire('install', $t)); |
|
| 145 | + echo minipres($titre, $res.generer_form_ecrire('install', $t)); |
|
| 147 | 146 | } else { |
| 148 | 147 | $deja = (_FILE_CONNECT and analyse_fichier_connection(_FILE_CONNECT)); |
| 149 | 148 | if (!$deja) { |
| 150 | - redirige_url_ecrire('install', 'etape=1&chmod=' . $chmod); |
|
| 149 | + redirige_url_ecrire('install', 'etape=1&chmod='.$chmod); |
|
| 151 | 150 | } else { |
| 152 | 151 | redirige_url_ecrire(); |
| 153 | 152 | } |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | function echappe_js($t, $class = ' class = "echappe-js"') { |
| 105 | 105 | foreach (array('script', 'iframe') as $tag) { |
| 106 | 106 | if (stripos($t, "<$tag") !== false |
| 107 | - and preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER) |
|
| 107 | + and preg_match_all(',<'.$tag.'.*?($|</'.$tag.'.),isS', $t, $r, PREG_SET_ORDER) |
|
| 108 | 108 | ) { |
| 109 | 109 | foreach ($r as $regs) { |
| 110 | 110 | $t = str_replace($regs[0], |
| 111 | - "<code$class>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>', |
|
| 111 | + "<code$class>".nl2br(spip_htmlspecialchars($regs[0])).'</code>', |
|
| 112 | 112 | $t); |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | * @return string |
| 143 | 143 | * Code protégé |
| 144 | 144 | **/ |
| 145 | -function interdire_scripts($arg, $mode_filtre=null) { |
|
| 145 | +function interdire_scripts($arg, $mode_filtre = null) { |
|
| 146 | 146 | // on memorise le resultat sur les arguments non triviaux |
| 147 | 147 | static $dejavu = array(); |
| 148 | 148 | |
@@ -160,10 +160,10 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | // echapper les tags asp/php |
| 163 | - $t = str_replace('<' . '%', '<%', $arg); |
|
| 163 | + $t = str_replace('<'.'%', '<%', $arg); |
|
| 164 | 164 | |
| 165 | 165 | // echapper le php |
| 166 | - $t = str_replace('<' . '?', '<?', $t); |
|
| 166 | + $t = str_replace('<'.'?', '<?', $t); |
|
| 167 | 167 | |
| 168 | 168 | // echapper le < script language=php > |
| 169 | 169 | $t = preg_replace(',<(script\b[^>]+\blanguage\b[^\w>]+php\b),UimsS', '<\1', $t); |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | // Reinserer les echappements des modeles |
| 187 | 187 | if (defined('_PROTEGE_JS_MODELES')) { |
| 188 | - $t = echappe_retour($t, "javascript" . _PROTEGE_JS_MODELES); |
|
| 188 | + $t = echappe_retour($t, "javascript"._PROTEGE_JS_MODELES); |
|
| 189 | 189 | } |
| 190 | 190 | if (defined('_PROTEGE_PHP_MODELES')) { |
| 191 | - $t = echappe_retour($t, "php" . _PROTEGE_PHP_MODELES); |
|
| 191 | + $t = echappe_retour($t, "php"._PROTEGE_PHP_MODELES); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | return $dejavu[$mode_filtre][$arg] = $t; |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | // et aussi dans l'espace public si la globale filtrer_javascript = -1 |
| 274 | 274 | // https://core.spip.net/issues/4166 |
| 275 | 275 | if ($GLOBALS['filtrer_javascript'] == -1 |
| 276 | - or (isset($env['espace_prive']) and $env['espace_prive'] and $GLOBALS['filtrer_javascript']<=0)) { |
|
| 276 | + or (isset($env['espace_prive']) and $env['espace_prive'] and $GLOBALS['filtrer_javascript'] <= 0)) { |
|
| 277 | 277 | $letexte = echapper_html_suspect($letexte); |
| 278 | 278 | } |
| 279 | 279 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | define('_TYPO_PROTEGER', "!':;?~%-"); |
| 285 | 285 | define('_TYPO_PROTECTEUR', "\x1\x2\x3\x4\x5\x6\x7\x8"); |
| 286 | 286 | |
| 287 | -define('_TYPO_BALISE', ",</?[a-z!][^<>]*[" . preg_quote(_TYPO_PROTEGER) . "][^<>]*>,imsS"); |
|
| 287 | +define('_TYPO_BALISE', ",</?[a-z!][^<>]*[".preg_quote(_TYPO_PROTEGER)."][^<>]*>,imsS"); |
|
| 288 | 288 | |
| 289 | 289 | /** |
| 290 | 290 | * Corrige la typographie |
@@ -433,8 +433,8 @@ discard block |
||
| 433 | 433 | // https://core.spip.net/issues/4166 |
| 434 | 434 | if ($interdire_script |
| 435 | 435 | or $GLOBALS['filtrer_javascript'] == -1 |
| 436 | - or (isset($env['espace_prive']) and $env['espace_prive'] and $GLOBALS['filtrer_javascript']<=0) |
|
| 437 | - or (isset($env['wysiwyg']) and $env['wysiwyg'] and $GLOBALS['filtrer_javascript']<=0)) { |
|
| 436 | + or (isset($env['espace_prive']) and $env['espace_prive'] and $GLOBALS['filtrer_javascript'] <= 0) |
|
| 437 | + or (isset($env['wysiwyg']) and $env['wysiwyg'] and $GLOBALS['filtrer_javascript'] <= 0)) { |
|
| 438 | 438 | $t = echapper_html_suspect($t, false); |
| 439 | 439 | } |
| 440 | 440 | $t = echappe_html($t); |
@@ -44,10 +44,10 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | if ($query) { |
| 47 | - $url .= '?' . $query; |
|
| 47 | + $url .= '?'.$query; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - return '/' . preg_replace(',^/,S', '', $url); |
|
| 50 | + return '/'.preg_replace(',^/,S', '', $url); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | if (preg_match(';^((?:[a-z]{3,33}:)?//.*?)(/.*)?$;iS', $lien, $r)) { |
| 75 | 75 | $r = array_pad($r, 3, null); |
| 76 | 76 | |
| 77 | - return $r[1] . resolve_path($r[2]); |
|
| 77 | + return $r[1].resolve_path($r[2]); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | # L'url site spip est un lien absolu aussi |
@@ -93,13 +93,13 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | switch (substr($lien, 0, 1)) { |
| 95 | 95 | case '/': |
| 96 | - return $debut . resolve_path($lien); |
|
| 96 | + return $debut.resolve_path($lien); |
|
| 97 | 97 | case '#': |
| 98 | - return $debut . resolve_path($dir . $mot . $get . $lien); |
|
| 98 | + return $debut.resolve_path($dir.$mot.$get.$lien); |
|
| 99 | 99 | case '': |
| 100 | - return $debut . resolve_path($dir . $mot . $get . $hash); |
|
| 100 | + return $debut.resolve_path($dir.$mot.$get.$hash); |
|
| 101 | 101 | default: |
| 102 | - return $debut . resolve_path($dir . $lien); |
|
| 102 | + return $debut.resolve_path($dir.$lien); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | return ''; |
| 128 | 128 | } |
| 129 | 129 | if (!$base) { |
| 130 | - $base = url_de_base() . (_DIR_RACINE ? _DIR_RESTREINT_ABS : ''); |
|
| 130 | + $base = url_de_base().(_DIR_RACINE ? _DIR_RESTREINT_ABS : ''); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | return suivre_lien($base, $url); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * @param array $protocoles_autorises |
| 151 | 151 | * @return bool |
| 152 | 152 | */ |
| 153 | -function protocole_verifier($url_absolue, $protocoles_autorises = array('http','https')) { |
|
| 153 | +function protocole_verifier($url_absolue, $protocoles_autorises = array('http', 'https')) { |
|
| 154 | 154 | |
| 155 | 155 | if (preg_match(';^([a-z]{3,7})://;i', $url_absolue, $m)) { |
| 156 | 156 | $protocole = $m[1]; |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | function spip_htmlspecialchars($string, $flags = null, $encoding = 'UTF-8', $double_encode = true) { |
| 232 | 232 | if (is_null($flags)) { |
| 233 | - $flags = ENT_COMPAT|ENT_HTML401; |
|
| 233 | + $flags = ENT_COMPAT | ENT_HTML401; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | return htmlspecialchars($string, $flags, $encoding, $double_encode); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | function spip_htmlentities($string, $flags = null, $encoding = 'UTF-8', $double_encode = true) { |
| 249 | 249 | if (is_null($flags)) { |
| 250 | - $flags = ENT_COMPAT|ENT_HTML401; |
|
| 250 | + $flags = ENT_COMPAT | ENT_HTML401; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | return htmlentities($string, $flags, $encoding, $double_encode); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | if (substr($recherche, 0, 1) == '/' and substr($recherche, -1, 1) == '/' and strlen($recherche) > 2) { |
| 101 | 101 | // c'est une preg |
| 102 | 102 | $recherche_trans = translitteration($recherche); |
| 103 | - $preg = $recherche_trans . $options['preg_flags']; |
|
| 103 | + $preg = $recherche_trans.$options['preg_flags']; |
|
| 104 | 104 | $is_preg = true; |
| 105 | 105 | } else { |
| 106 | 106 | // s'il y a plusieurs mots il faut les chercher tous : oblige REGEXP, |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if (preg_match(",\s+," . $u, $recherche_mod)) { |
|
| 123 | + if (preg_match(",\s+,".$u, $recherche_mod)) { |
|
| 124 | 124 | $is_preg = true; |
| 125 | 125 | |
| 126 | 126 | $recherche_inter = '|'; |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | foreach ($recherche_mots as $mot) { |
| 131 | 131 | if (strlen($mot) >= $min_long) { |
| 132 | 132 | // echapper les caracteres de regexp qui sont eventuellement dans la recherche |
| 133 | - $recherche_inter .= preg_quote($mot) . ' '; |
|
| 133 | + $recherche_inter .= preg_quote($mot).' '; |
|
| 134 | 134 | $petits_mots = false; |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -138,14 +138,14 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | // mais on cherche quand même l'expression complète, même si elle |
| 140 | 140 | // comporte des mots de moins de quatre lettres |
| 141 | - $recherche = trim(preg_replace(',\s+,' . $u, '|', $recherche_inter), '|'); |
|
| 142 | - if (!$recherche or $petits_mots){ |
|
| 141 | + $recherche = trim(preg_replace(',\s+,'.$u, '|', $recherche_inter), '|'); |
|
| 142 | + if (!$recherche or $petits_mots) { |
|
| 143 | 143 | $recherche = preg_quote($recherche_org); |
| 144 | 144 | } |
| 145 | 145 | $recherche_trans = translitteration($recherche); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - $preg = '/' . str_replace('/', '\\/', $recherche_trans) . '/' . $options['preg_flags']; |
|
| 148 | + $preg = '/'.str_replace('/', '\\/', $recherche_trans).'/'.$options['preg_flags']; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // Si la chaine est inactive, on va utiliser LIKE pour aller plus vite |
@@ -184,11 +184,11 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | $q = sql_quote( |
| 186 | 186 | "%" |
| 187 | - . preg_replace(",\s+," . $u, "%", $q) |
|
| 187 | + . preg_replace(",\s+,".$u, "%", $q) |
|
| 188 | 188 | . "%" |
| 189 | 189 | ); |
| 190 | 190 | |
| 191 | - $preg = '/' . preg_replace(",\s+," . $u, ".+", trim($recherche_mod)) . '/' . $options['preg_flags']; |
|
| 191 | + $preg = '/'.preg_replace(",\s+,".$u, ".+", trim($recherche_mod)).'/'.$options['preg_flags']; |
|
| 192 | 192 | |
| 193 | 193 | } else { |
| 194 | 194 | $methode = 'REGEXP'; |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | foreach ($tables as $table => $champs) { |
| 306 | 306 | # lock via memoization, si dispo |
| 307 | 307 | if (function_exists('cache_lock')) { |
| 308 | - cache_lock($lock = _RECHERCHE_LOCK_KEY . ' ' . $table . ' ' . $recherche); |
|
| 308 | + cache_lock($lock = _RECHERCHE_LOCK_KEY.' '.$table.' '.$recherche); |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | spip_timer('rech'); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | ##var_dump($results[$table]); |
| 319 | 319 | |
| 320 | 320 | |
| 321 | - spip_log("recherche $table ($recherche) : " . count($results[$table]) . " resultats " . spip_timer('rech'), |
|
| 321 | + spip_log("recherche $table ($recherche) : ".count($results[$table])." resultats ".spip_timer('rech'), |
|
| 322 | 322 | 'recherche'); |
| 323 | 323 | |
| 324 | 324 | if (isset($lock)) { |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | |
| 352 | 352 | $results = recherche_en_base($recherche, $tables, $options); |
| 353 | 353 | |
| 354 | - $preg = '/' . str_replace('/', '\\/', $recherche) . '/' . $options['preg_flags']; |
|
| 354 | + $preg = '/'.str_replace('/', '\\/', $recherche).'/'.$options['preg_flags']; |
|
| 355 | 355 | |
| 356 | 356 | foreach ($results as $table => $r) { |
| 357 | 357 | $_id_table = id_table_objet($table); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | if (!isset($options['titre'])) { |
| 66 | 66 | $balise_img = chercher_filtre('balise_img'); |
| 67 | - $img = $balise_img(chemin_image('image-24.png'),'', 'cadre-icone'); |
|
| 67 | + $img = $balise_img(chemin_image('image-24.png'), '', 'cadre-icone'); |
|
| 68 | 68 | $libelles = pipeline('libeller_logo', $GLOBALS['logo_libelles']); |
| 69 | 69 | $libelle = (($id_objet or $objet != 'rubrique') ? $objet : 'racine'); |
| 70 | 70 | if (isset($libelles[$libelle])) { |
@@ -76,19 +76,19 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | switch ($objet) { |
| 78 | 78 | case 'article': |
| 79 | - $libelle .= ' ' . aider('logoart'); |
|
| 79 | + $libelle .= ' '.aider('logoart'); |
|
| 80 | 80 | break; |
| 81 | 81 | case 'breve': |
| 82 | - $libelle .= ' ' . aider('breveslogo'); |
|
| 82 | + $libelle .= ' '.aider('breveslogo'); |
|
| 83 | 83 | break; |
| 84 | 84 | case 'rubrique': |
| 85 | - $libelle .= ' ' . aider('rublogo'); |
|
| 85 | + $libelle .= ' '.aider('rublogo'); |
|
| 86 | 86 | break; |
| 87 | 87 | default: |
| 88 | 88 | break; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $options['titre'] = $img . $libelle; |
|
| 91 | + $options['titre'] = $img.$libelle; |
|
| 92 | 92 | } |
| 93 | 93 | if (!isset($options['editable'])) { |
| 94 | 94 | include_spip('inc/autoriser'); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | foreach ($etats as $etat) { |
| 114 | 114 | $logo = $chercher_logo($id_objet, $_id_objet, $etat); |
| 115 | 115 | if ($logo) { |
| 116 | - $res['logo_' . $etat] = $logo[0]; |
|
| 116 | + $res['logo_'.$etat] = $logo[0]; |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | // pas de logo_on -> pas de formulaire pour le survol |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | strtolower(pathinfo($file['name'], PATHINFO_EXTENSION)), |
| 177 | 177 | $extensions_possibles |
| 178 | 178 | )) { |
| 179 | - $erreurs['logo_' . $etat] = _L('Extension non reconnue'); |
|
| 179 | + $erreurs['logo_'.$etat] = _L('Extension non reconnue'); |
|
| 180 | 180 | } |
| 181 | 181 | } elseif ($file and $file['error'] != 0 and isset($file['msg'])) { |
| 182 | 182 | $erreurs['message_erreur'] = $file['msg']; |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | include_spip('inc/documents'); |
| 262 | 262 | $sources = array(); |
| 263 | 263 | foreach (array('on', 'off') as $etat) { |
| 264 | - $logo = 'logo_' . $etat; |
|
| 264 | + $logo = 'logo_'.$etat; |
|
| 265 | 265 | if (isset($_FILES[$logo])) { |
| 266 | 266 | if ($_FILES[$logo]['error'] == 0) { |
| 267 | 267 | $sources[$etat] = $_FILES[$logo]; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $mode = preg_replace(",\W,", '', $mode); |
| 41 | 41 | if ($mode) { |
| 42 | 42 | // chercher dans la base |
| 43 | - $mode_document = 'logo' . $mode; |
|
| 43 | + $mode_document = 'logo'.$mode; |
|
| 44 | 44 | $objet = objet_type($_id_objet); |
| 45 | 45 | $doc = sql_fetsel('D.*', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', "D.mode=".sql_quote($mode_document)." AND L.objet=".sql_quote($objet)." AND id_objet=".intval($id)); |
| 46 | 46 | if ($doc) { |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | if ($compat_old_logos) { |
| 53 | 53 | # attention au cas $id = '0' pour LOGO_SITE_SPIP : utiliser intval() |
| 54 | 54 | $type = type_du_logo($_id_objet); |
| 55 | - $nom = $type . $mode . intval($id); |
|
| 55 | + $nom = $type.$mode.intval($id); |
|
| 56 | 56 | |
| 57 | 57 | foreach ($GLOBALS['formats_logos'] as $format) { |
| 58 | - if (@file_exists($d = (_DIR_LOGOS . $nom . '.' . $format))) { |
|
| 58 | + if (@file_exists($d = (_DIR_LOGOS.$nom.'.'.$format))) { |
|
| 59 | 59 | return array($d, _DIR_LOGOS, $nom, $format, @filemtime($d)); |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | if ($fichier) { |
| 109 | 109 | $code = "quete_logo_file($doc, $qconnect)"; |
| 110 | 110 | } else { |
| 111 | - $code = "quete_logo_document($doc, " . ($lien ? $lien : "''") . ", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)"; |
|
| 111 | + $code = "quete_logo_document($doc, ".($lien ? $lien : "''").", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)"; |
|
| 112 | 112 | } |
| 113 | 113 | // (x=non-faux ? y : '') pour affecter x en retournant y |
| 114 | 114 | if ($p->descr['documents']) { |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | // demande de reduction sur logo avec ecriture spip 2.1 : #LOGO_xxx{200, 0} |
| 127 | 127 | if ($coord_x or $coord_y) { |
| 128 | - $code = "filtrer('image_graver',filtrer('image_reduire'," . $code . ", '$coord_x', '$coord_y'))"; |
|
| 128 | + $code = "filtrer('image_graver',filtrer('image_reduire',".$code.", '$coord_x', '$coord_y'))"; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | $p->code = $code; |
@@ -158,14 +158,12 @@ discard block |
||
| 158 | 158 | * Code compilé retournant le chemin du logo ou le code HTML du logo. |
| 159 | 159 | **/ |
| 160 | 160 | function logo_survol($id_objet, $_id_objet, $type, $align, $fichier, $_lien, $p, $suite) { |
| 161 | - $code = "quete_logo('$id_objet', '" . |
|
| 162 | - (($suite == '_SURVOL') ? 'off' : |
|
| 163 | - (($suite == '_NORMAL') ? 'on' : 'ON')) . |
|
| 164 | - "', $_id_objet," . |
|
| 161 | + $code = "quete_logo('$id_objet', '". |
|
| 162 | + (($suite == '_SURVOL') ? 'off' : (($suite == '_NORMAL') ? 'on' : 'ON')). |
|
| 163 | + "', $_id_objet,". |
|
| 165 | 164 | (($suite == '_RUBRIQUE') ? |
| 166 | - champ_sql('id_rubrique', $p) : |
|
| 167 | - (($type == 'rubrique') ? "quete_parent($_id_objet)" : "''")) . |
|
| 168 | - ', ' . intval($fichier) . ')'; |
|
| 165 | + champ_sql('id_rubrique', $p) : (($type == 'rubrique') ? "quete_parent($_id_objet)" : "''")). |
|
| 166 | + ', '.intval($fichier).')'; |
|
| 169 | 167 | |
| 170 | 168 | if ($fichier) { |
| 171 | 169 | return $code; |
@@ -173,5 +171,5 @@ discard block |
||
| 173 | 171 | |
| 174 | 172 | $align = preg_replace(",\W,", "", $align); |
| 175 | 173 | |
| 176 | - return "quete_html_logo($code, '$align', " .($_lien ? $_lien : "''") .")"; |
|
| 174 | + return "quete_html_logo($code, '$align', ".($_lien ? $_lien : "''").")"; |
|
| 177 | 175 | } |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | //$md5next = $regs[4]; |
| 54 | 54 | } // si envoi non crypte, crypter maintenant |
| 55 | 55 | elseif ($pass) { |
| 56 | - $row = sql_fetsel("alea_actuel, alea_futur", "spip_auteurs", "login=" . sql_quote($login, $serveur, 'text'), '', '', |
|
| 56 | + $row = sql_fetsel("alea_actuel, alea_futur", "spip_auteurs", "login=".sql_quote($login, $serveur, 'text'), '', '', |
|
| 57 | 57 | '', '', $serveur); |
| 58 | 58 | |
| 59 | 59 | if ($row) { |
| 60 | 60 | include_spip('auth/sha256.inc'); |
| 61 | - $shapass = spip_sha256($row['alea_actuel'] . $pass); |
|
| 62 | - $shanext = spip_sha256($row['alea_futur'] . $pass); |
|
| 63 | - $md5pass = md5($row['alea_actuel'] . $pass); |
|
| 61 | + $shapass = spip_sha256($row['alea_actuel'].$pass); |
|
| 62 | + $shanext = spip_sha256($row['alea_futur'].$pass); |
|
| 63 | + $md5pass = md5($row['alea_actuel'].$pass); |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
@@ -70,14 +70,14 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | $row = sql_fetsel("*", "spip_auteurs", |
| 73 | - "login=" . sql_quote($login, $serveur, 'text') . " AND pass=" . sql_quote($shapass, $serveur, |
|
| 74 | - 'text') . " AND statut<>'5poubelle'", '', '', '', '', $serveur); |
|
| 73 | + "login=".sql_quote($login, $serveur, 'text')." AND pass=".sql_quote($shapass, $serveur, |
|
| 74 | + 'text')." AND statut<>'5poubelle'", '', '', '', '', $serveur); |
|
| 75 | 75 | |
| 76 | 76 | // compat avec les anciennes bases en md5 |
| 77 | 77 | if (!$row and $md5pass) { |
| 78 | 78 | $row = sql_fetsel("*", "spip_auteurs", |
| 79 | - "login=" . sql_quote($login, $serveur, 'text') . " AND pass=" . sql_quote($md5pass, $serveur, |
|
| 80 | - 'text') . " AND statut<>'5poubelle'", '', '', '', '', $serveur); |
|
| 79 | + "login=".sql_quote($login, $serveur, 'text')." AND pass=".sql_quote($md5pass, $serveur, |
|
| 80 | + 'text')." AND statut<>'5poubelle'", '', '', '', '', $serveur); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // login/mot de passe incorrect |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | 'alea_actuel' => 'alea_futur', |
| 95 | 95 | 'pass' => sql_quote($shanext, $serveur, 'text'), |
| 96 | 96 | 'alea_futur' => sql_quote(creer_uniqid(), $serveur, 'text') |
| 97 | - ), "id_auteur=" . $row['id_auteur'] . ' AND pass IN (' . sql_quote($shapass, $serveur, |
|
| 98 | - 'text') . ', ' . sql_quote($md5pass, $serveur, 'text') . ')', '', $serveur); |
|
| 97 | + ), "id_auteur=".$row['id_auteur'].' AND pass IN ('.sql_quote($shapass, $serveur, |
|
| 98 | + 'text').', '.sql_quote($md5pass, $serveur, 'text').')', '', $serveur); |
|
| 99 | 99 | // En profiter pour verifier la securite de tmp/ |
| 100 | 100 | // Si elle ne fonctionne pas a l'installation, prevenir |
| 101 | 101 | if (!verifier_htaccess(_DIR_TMP) and defined('_ECRIRE_INSTALL')) { |
@@ -131,16 +131,16 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | // javascript qui gere la securite du login en evitant de faire circuler le pass en clair |
| 133 | 133 | $flux['data'] .= |
| 134 | - ($compat_md5 ? '<script type="text/javascript" src="' . _DIR_JAVASCRIPT . 'md5.js"></script>' : '') |
|
| 135 | - . '<script type="text/javascript" src="' . _DIR_JAVASCRIPT . 'login-sha-min.js"></script>' |
|
| 134 | + ($compat_md5 ? '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'md5.js"></script>' : '') |
|
| 135 | + . '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'login-sha-min.js"></script>' |
|
| 136 | 136 | . '<script type="text/javascript">/*<![CDATA[*/' |
| 137 | - . "var login_info={'alea_actuel':'" . $flux['args']['contexte']['_alea_actuel'] . "'," |
|
| 138 | - . "'alea_futur':'" . $flux['args']['contexte']['_alea_futur'] . "'," |
|
| 139 | - . "'login':'" . $flux['args']['contexte']['var_login'] . "'," |
|
| 140 | - . "'page_auteur': '" . generer_url_public('informer_auteur') . "'," |
|
| 137 | + . "var login_info={'alea_actuel':'".$flux['args']['contexte']['_alea_actuel']."'," |
|
| 138 | + . "'alea_futur':'".$flux['args']['contexte']['_alea_futur']."'," |
|
| 139 | + . "'login':'".$flux['args']['contexte']['var_login']."'," |
|
| 140 | + . "'page_auteur': '".generer_url_public('informer_auteur')."'," |
|
| 141 | 141 | . "'informe_auteur_en_cours':false," |
| 142 | 142 | . "'attente_informe':0," |
| 143 | - . "'compat_md5':" . ($compat_md5 ? "true" : "false") . "};" |
|
| 143 | + . "'compat_md5':".($compat_md5 ? "true" : "false")."};" |
|
| 144 | 144 | . "jQuery(function(){ |
| 145 | 145 | jQuery('#var_login').change(actualise_auteur); |
| 146 | 146 | jQuery('form#formulaire_login').submit(login_submit); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | return _T('info_login_trop_court_car_pluriel', array('nb' => _LOGIN_TROP_COURT)); |
| 183 | 183 | } else { |
| 184 | 184 | $n = sql_countsel('spip_auteurs', |
| 185 | - "login=" . sql_quote($new_login) . " AND id_auteur!=" . intval($id_auteur) . " AND statut!='5poubelle'", '', '', |
|
| 185 | + "login=".sql_quote($new_login)." AND id_auteur!=".intval($id_auteur)." AND statut!='5poubelle'", '', '', |
|
| 186 | 186 | $serveur); |
| 187 | 187 | if ($n) { |
| 188 | 188 | return _T('info_login_existant'); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | return false; |
| 207 | 207 | } |
| 208 | 208 | if (!$id_auteur = intval($id_auteur) |
| 209 | - or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 209 | + or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 210 | 210 | ) { |
| 211 | 211 | return false; |
| 212 | 212 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | // vider le login des auteurs a la poubelle qui avaient ce meme login |
| 220 | 220 | if (strlen($new_login)) { |
| 221 | 221 | $anciens = sql_allfetsel('id_auteur', 'spip_auteurs', |
| 222 | - 'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'", '', '', '', '', $serveur); |
|
| 222 | + 'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'", '', '', '', '', $serveur); |
|
| 223 | 223 | while ($row = array_pop($anciens)) { |
| 224 | 224 | auteur_modifier($row['id_auteur'], array('login' => ''), true); // manque la gestion de $serveur |
| 225 | 225 | } |
@@ -244,8 +244,8 @@ discard block |
||
| 244 | 244 | } // pas la peine de requeter |
| 245 | 245 | $l = sql_quote($login, $serveur, 'text'); |
| 246 | 246 | if ($r = sql_getfetsel('login', 'spip_auteurs', |
| 247 | - "statut<>'5poubelle'" . |
|
| 248 | - " AND (length(pass)>0)" . |
|
| 247 | + "statut<>'5poubelle'". |
|
| 248 | + " AND (length(pass)>0)". |
|
| 249 | 249 | " AND (login=$l)", '', '', '', '', $serveur) |
| 250 | 250 | ) { |
| 251 | 251 | return $r; |
@@ -256,8 +256,8 @@ discard block |
||
| 256 | 256 | // car un nom peut etre homonyme d'un autre login |
| 257 | 257 | else { |
| 258 | 258 | return sql_getfetsel('login', 'spip_auteurs', |
| 259 | - "statut<>'5poubelle'" . |
|
| 260 | - " AND (length(pass)>0)" . |
|
| 259 | + "statut<>'5poubelle'". |
|
| 260 | + " AND (length(pass)>0)". |
|
| 261 | 261 | " AND (login<>'' AND (nom=$l OR email=$l))", '', '', '', '', $serveur); |
| 262 | 262 | } |
| 263 | 263 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | if (!$id_auteur = intval($id_auteur) |
| 343 | - or !sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 343 | + or !sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 344 | 344 | ) { |
| 345 | 345 | return false; |
| 346 | 346 | } |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $htpass = generer_htpass($new_pass); |
| 352 | 352 | $alea_actuel = creer_uniqid(); |
| 353 | 353 | $alea_futur = creer_uniqid(); |
| 354 | - $pass = spip_sha256($alea_actuel . $new_pass); |
|
| 354 | + $pass = spip_sha256($alea_actuel.$new_pass); |
|
| 355 | 355 | $c['pass'] = $pass; |
| 356 | 356 | $c['htpass'] = $htpass; |
| 357 | 357 | $c['alea_actuel'] = $alea_actuel; |
@@ -387,8 +387,8 @@ discard block |
||
| 387 | 387 | or (isset($options['all']) and $options['all']) |
| 388 | 388 | ) { |
| 389 | 389 | |
| 390 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 391 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 390 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 391 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 392 | 392 | |
| 393 | 393 | // Cette variable de configuration peut etre posee par un plugin |
| 394 | 394 | // par exemple acces_restreint ; |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | and !@file_exists($htaccess) |
| 398 | 398 | ) { |
| 399 | 399 | spip_unlink($htpasswd); |
| 400 | - spip_unlink($htpasswd . "-admin"); |
|
| 400 | + spip_unlink($htpasswd."-admin"); |
|
| 401 | 401 | |
| 402 | 402 | return; |
| 403 | 403 | } |
@@ -412,16 +412,16 @@ discard block |
||
| 412 | 412 | sql_in("statut", array('1comite', '0minirezo', 'nouveau'))); |
| 413 | 413 | while ($t = sql_fetch($s)) { |
| 414 | 414 | if (strlen($t['login']) and strlen($t['htpass'])) { |
| 415 | - $p1 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 415 | + $p1 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 416 | 416 | if ($t['statut'] == '0minirezo') { |
| 417 | - $p2 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 417 | + $p2 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | } |
| 421 | 421 | sql_free($s); |
| 422 | 422 | if ($p1) { |
| 423 | 423 | ecrire_fichier($htpasswd, $p1); |
| 424 | - ecrire_fichier($htpasswd . '-admin', $p2); |
|
| 424 | + ecrire_fichier($htpasswd.'-admin', $p2); |
|
| 425 | 425 | spip_log("Ecriture de $htpasswd et $htpasswd-admin"); |
| 426 | 426 | } |
| 427 | 427 | } |