@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | ) { |
| 29 | 29 | // si l'url est une url du site, on la laisse passer sans rien faire |
| 30 | 30 | // c'est encore le plus simple |
| 31 | - $base = $GLOBALS['meta']['adresse_site'] . '/'; |
|
| 31 | + $base = $GLOBALS['meta']['adresse_site'].'/'; |
|
| 32 | 32 | if (strlen($base) and strncmp($redirect, $base, strlen($base)) == 0) { |
| 33 | 33 | return $redirect; |
| 34 | 34 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | if ($ancre = _request('var_ajax_ancre')) { |
| 157 | 157 | // pas n'importe quoi quand meme dans la variable ! |
| 158 | 158 | $ancre = str_replace(['<', '"', "'"], ['<', '"', ''], $ancre); |
| 159 | - $texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>" . $texte; |
|
| 159 | + $texte = "<a href='#$ancre' name='ajax_ancre' style='display:none;'>anchor</a>".$texte; |
|
| 160 | 160 | } |
| 161 | 161 | } else { |
| 162 | 162 | include_spip('inc/headers'); |
@@ -199,26 +199,26 @@ discard block |
||
| 199 | 199 | $sign = _request('formulaire_action_sign'); |
| 200 | 200 | if (!empty($GLOBALS['visiteur_session']['id_auteur'])) { |
| 201 | 201 | if (empty($sign)) { |
| 202 | - spip_log("signature ajax form incorrecte : $form (formulaire non signe mais on a une session)", 'formulaires' . _LOG_ERREUR); |
|
| 202 | + spip_log("signature ajax form incorrecte : $form (formulaire non signe mais on a une session)", 'formulaires'._LOG_ERREUR); |
|
| 203 | 203 | return false; |
| 204 | 204 | } |
| 205 | 205 | $securiser_action = charger_fonction('securiser_action', 'inc'); |
| 206 | 206 | $secu = $securiser_action($form, $args, '', -1); |
| 207 | 207 | if ($sign !== $secu['hash']) { |
| 208 | - spip_log("signature ajax form incorrecte : $form (formulaire signe mais ne correspond pas a la session)", 'formulaires' . _LOG_ERREUR); |
|
| 208 | + spip_log("signature ajax form incorrecte : $form (formulaire signe mais ne correspond pas a la session)", 'formulaires'._LOG_ERREUR); |
|
| 209 | 209 | return false; |
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | else { |
| 213 | 213 | if (!empty($sign)) { |
| 214 | - spip_log("signature ajax form incorrecte : $form (formulaire signe mais pas de session)", 'formulaires' . _LOG_ERREUR); |
|
| 214 | + spip_log("signature ajax form incorrecte : $form (formulaire signe mais pas de session)", 'formulaires'._LOG_ERREUR); |
|
| 215 | 215 | return false; |
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | include_spip('inc/filtres'); |
| 220 | 220 | if (($args = decoder_contexte_ajax($args, $form)) === false) { |
| 221 | - spip_log("signature ajax form incorrecte : $form (encodage corrompu)", 'formulaires' . _LOG_ERREUR); |
|
| 221 | + spip_log("signature ajax form incorrecte : $form (encodage corrompu)", 'formulaires'._LOG_ERREUR); |
|
| 222 | 222 | |
| 223 | 223 | return false; // continuons le hit comme si de rien etait |
| 224 | 224 | } else { |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | // on ajoute un br en display none en tete du retour ajax pour regler un bug dans IE6/7 |
| 336 | 336 | // sans cela le formulaire n'est pas actif apres le hit ajax |
| 337 | 337 | // la classe ajax-form-is-ok sert a s'assurer que le retour ajax s'est bien passe |
| 338 | - $retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>" . $retour; |
|
| 338 | + $retour = "<br class='bugajaxie ajax-form-is-ok' style='display:none;'/>".$retour; |
|
| 339 | 339 | ajax_retour($retour, false); |
| 340 | 340 | |
| 341 | 341 | return true; // on a fini le hit |
@@ -975,7 +975,7 @@ |
||
| 975 | 975 | if (!defined('_TRAITEMENT_TYPO_SANS_NUMERO')) { |
| 976 | 976 | define('_TRAITEMENT_TYPO_SANS_NUMERO', 'supprimer_numero(typo(%s, "TYPO", $connect, $Pile[0]))'); |
| 977 | 977 | } |
| 978 | - $GLOBALS['table_des_traitements']['BIO'][] = 'safehtml(' . _TRAITEMENT_RACCOURCIS . ')'; |
|
| 978 | + $GLOBALS['table_des_traitements']['BIO'][] = 'safehtml('._TRAITEMENT_RACCOURCIS.')'; |
|
| 979 | 979 | $GLOBALS['table_des_traitements']['NOM_SITE']['spip_auteurs'] = 'entites_html(%s)'; |
| 980 | 980 | $GLOBALS['table_des_traitements']['NOM']['spip_auteurs'] = 'safehtml(%s)'; |
| 981 | 981 | $GLOBALS['table_des_traitements']['CHAPO'][] = _TRAITEMENT_RACCOURCIS; |
@@ -155,23 +155,23 @@ discard block |
||
| 155 | 155 | or !$r = verifier_upload_autorise($dest) |
| 156 | 156 | or $r['autozip'] |
| 157 | 157 | ) { |
| 158 | - $dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1]; |
|
| 158 | + $dest = substr($dest, 0, -strlen($m[0])).'_'.$m[1]; |
|
| 159 | 159 | break; |
| 160 | 160 | } |
| 161 | 161 | else { |
| 162 | 162 | $dest = substr($dest, 0, -strlen($m[0])); |
| 163 | - $ext = $m[1] . '.' . $ext; |
|
| 163 | + $ext = $m[1].'.'.$ext; |
|
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // Si le document "source" est deja au bon endroit, ne rien faire |
| 168 | - if ($source == ($dir . $dest . '.' . $ext)) { |
|
| 168 | + if ($source == ($dir.$dest.'.'.$ext)) { |
|
| 169 | 169 | return $source; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | // sinon tourner jusqu'a trouver un numero correct |
| 173 | 173 | $n = 0; |
| 174 | - while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) { |
|
| 174 | + while (@file_exists($newFile = $dir.$dest.($n++ ? ('-'.$n) : '').'.'.$ext)) { |
|
| 175 | 175 | ; |
| 176 | 176 | } |
| 177 | 177 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | function deplacer_fichier_upload($source, $dest, $move = false) { |
| 233 | 233 | // Securite |
| 234 | 234 | if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) { |
| 235 | - $dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE))); |
|
| 235 | + $dest = _DIR_RACINE.preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE))); |
|
| 236 | 236 | } else { |
| 237 | 237 | $dest = preg_replace(',\.\.+,', '.', $dest); |
| 238 | 238 | } |
@@ -314,8 +314,8 @@ discard block |
||
| 314 | 314 | |
| 315 | 315 | default: /* autre */ |
| 316 | 316 | if (!$msg) { |
| 317 | - $msg = _T('pass_erreur') . ' ' . $error |
|
| 318 | - . '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]'); |
|
| 317 | + $msg = _T('pass_erreur').' '.$error |
|
| 318 | + . '<br />'.propre('[->http://php.net/manual/fr/features.file-upload.errors.php]'); |
|
| 319 | 319 | } |
| 320 | 320 | break; |
| 321 | 321 | } |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | include_spip('inc/minipres'); |
| 334 | 334 | echo minipres( |
| 335 | 335 | $msg, |
| 336 | - "<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>' |
|
| 336 | + "<div style='text-align: ".$GLOBALS['spip_lang_right']."'><a href='".rawurldecode($GLOBALS['redirect'])."'><button type='button'>"._T('ecrire:bouton_suivant').'</button></a></div>' |
|
| 337 | 337 | ); |
| 338 | 338 | exit; |
| 339 | 339 | } |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | // chercher la classe d'iterateur |
| 79 | 79 | // IterateurXXX |
| 80 | 80 | // definie dans le fichier iterateurs/xxx.php |
| 81 | - $class = 'Iterateur' . $iterateur; |
|
| 81 | + $class = 'Iterateur'.$iterateur; |
|
| 82 | 82 | if (!class_exists($class)) { |
| 83 | 83 | if ( |
| 84 | - !include_spip('iterateur/' . strtolower($iterateur)) |
|
| 84 | + !include_spip('iterateur/'.strtolower($iterateur)) |
|
| 85 | 85 | or !class_exists($class) |
| 86 | 86 | ) { |
| 87 | 87 | die("Iterateur $iterateur non trouvé"); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | return $this->iter->$nom(); |
| 210 | 210 | } catch (Exception $e) { |
| 211 | 211 | // #GETCHILDREN sur un fichier de DirectoryIterator ... |
| 212 | - spip_log("Methode $nom en echec sur " . get_class($this->iter)); |
|
| 212 | + spip_log("Methode $nom en echec sur ".get_class($this->iter)); |
|
| 213 | 213 | spip_log("Cela peut être normal : retour d'une ligne de resultat ne pouvant pas calculer cette methode"); |
| 214 | 214 | |
| 215 | 215 | return ''; |
@@ -258,8 +258,8 @@ discard block |
||
| 258 | 258 | // Creer la fonction de filtrage sur $this |
| 259 | 259 | if ($this->filtre) { |
| 260 | 260 | if ($filtres = $this->assembler_filtres($this->filtre)) { |
| 261 | - $filtres = 'return ' . $filtres.';'; |
|
| 262 | - $this->func_filtre = function () use ($filtres) { |
|
| 261 | + $filtres = 'return '.$filtres.';'; |
|
| 262 | + $this->func_filtre = function() use ($filtres) { |
|
| 263 | 263 | return eval($filtres); |
| 264 | 264 | }; |
| 265 | 265 | } |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | return null; |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | - return "(" . implode( ") $operateur (", $filtres_string) . ")"; |
|
| 298 | + return "(".implode(") $operateur (", $filtres_string).")"; |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | /** |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | return $this->composer_filtre($v[1], $v[0], $v[2]); |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | - return null; // sera ignore |
|
| 379 | + return null; // sera ignore |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /** |
@@ -402,28 +402,28 @@ discard block |
||
| 402 | 402 | # if (!in_array($cle, array('cle', 'valeur'))) |
| 403 | 403 | # return; |
| 404 | 404 | |
| 405 | - $a = '$this->get_select(\'' . $cle . '\')'; |
|
| 405 | + $a = '$this->get_select(\''.$cle.'\')'; |
|
| 406 | 406 | |
| 407 | 407 | $filtre = ''; |
| 408 | 408 | |
| 409 | 409 | if ($op == 'REGEXP') { |
| 410 | - $filtre = 'filtrer("match", ' . $a . ', ' . str_replace('\"', '"', $valeur) . ')'; |
|
| 410 | + $filtre = 'filtrer("match", '.$a.', '.str_replace('\"', '"', $valeur).')'; |
|
| 411 | 411 | $op = ''; |
| 412 | 412 | } else { |
| 413 | 413 | if ($op == 'LIKE') { |
| 414 | 414 | $valeur = str_replace(['\"', '_', '%'], ['"', '.', '.*'], preg_quote($valeur)); |
| 415 | - $filtre = 'filtrer("match", ' . $a . ', ' . $valeur . ')'; |
|
| 415 | + $filtre = 'filtrer("match", '.$a.', '.$valeur.')'; |
|
| 416 | 416 | $op = ''; |
| 417 | 417 | } else { |
| 418 | 418 | if ($op == '=') { |
| 419 | 419 | $op = '=='; |
| 420 | 420 | } else { |
| 421 | 421 | if ($op == 'IN') { |
| 422 | - $filtre = 'in_array(' . $a . ', array' . $valeur . ')'; |
|
| 422 | + $filtre = 'in_array('.$a.', array'.$valeur.')'; |
|
| 423 | 423 | $op = ''; |
| 424 | 424 | } else { |
| 425 | 425 | if (!in_array($op, ['<', '<=', '>', '>='])) { |
| 426 | - spip_log('operateur non reconnu ' . $op); // [todo] mettre une erreur de squelette |
|
| 426 | + spip_log('operateur non reconnu '.$op); // [todo] mettre une erreur de squelette |
|
| 427 | 427 | $op = ''; |
| 428 | 428 | } |
| 429 | 429 | } |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | if ($op) { |
| 435 | - $filtre = $a . $op . str_replace('\"', '"', $valeur); |
|
| 435 | + $filtre = $a.$op.str_replace('\"', '"', $valeur); |
|
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | if ($not) { |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | if ($echec) { |
| 49 | 49 | echo minipres( |
| 50 | 50 | 'AUTO', |
| 51 | - info_progression_etape(3, 'etape_', 'install/', true) . |
|
| 52 | - "<div class='error'><h3>$echec</h3>\n" . |
|
| 53 | - '<p>' . _T('avis_connexion_echec_2') . '</p>' . |
|
| 51 | + info_progression_etape(3, 'etape_', 'install/', true). |
|
| 52 | + "<div class='error'><h3>$echec</h3>\n". |
|
| 53 | + '<p>'._T('avis_connexion_echec_2').'</p>'. |
|
| 54 | 54 | '</div>' |
| 55 | 55 | ); |
| 56 | 56 | exit; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | $alea_actuel = creer_uniqid(); |
| 90 | 90 | $alea_futur = creer_uniqid(); |
| 91 | - $shapass = spip_sha256($alea_actuel . $pass); |
|
| 91 | + $shapass = spip_sha256($alea_actuel.$pass); |
|
| 92 | 92 | // prelablement, creer le champ webmestre si il n'existe pas (install neuve |
| 93 | 93 | // sur une vieille base |
| 94 | 94 | $t = sql_showtable('spip_auteurs', true); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | @sql_alter("TABLE spip_auteurs ADD webmestre varchar(3) DEFAULT 'non' NOT NULL"); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - $id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login=' . sql_quote($login)); |
|
| 99 | + $id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login='.sql_quote($login)); |
|
| 100 | 100 | if ($id_auteur !== null) { |
| 101 | 101 | sql_updateq('spip_auteurs', [ |
| 102 | 102 | 'nom' => $nom, |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | !$auteur = auth_identifier_login($login, $pass) |
| 137 | 137 | or !auth_loger($auteur, true) |
| 138 | 138 | ) { |
| 139 | - spip_log("login automatique impossible $auth_spip $session" . count($row)); |
|
| 139 | + spip_log("login automatique impossible $auth_spip $session".count($row)); |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
@@ -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 | '', |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | 'alea_actuel' => 'alea_futur', |
| 124 | 124 | 'pass' => sql_quote($shanext, $serveur, 'text'), |
| 125 | 125 | 'alea_futur' => sql_quote(creer_uniqid(), $serveur, 'text') |
| 126 | - ], 'id_auteur=' . $row['id_auteur'] . ' AND pass IN (' . sql_quote( |
|
| 126 | + ], 'id_auteur='.$row['id_auteur'].' AND pass IN ('.sql_quote( |
|
| 127 | 127 | $shapass, |
| 128 | 128 | $serveur, |
| 129 | 129 | 'text' |
| 130 | - ) . ', ' . sql_quote($md5pass, $serveur, 'text') . ')', '', $serveur); |
|
| 130 | + ).', '.sql_quote($md5pass, $serveur, 'text').')', '', $serveur); |
|
| 131 | 131 | // En profiter pour verifier la securite de tmp/ |
| 132 | 132 | // Si elle ne fonctionne pas a l'installation, prevenir |
| 133 | 133 | if (!verifier_htaccess(_DIR_TMP) and defined('_ECRIRE_INSTALL')) { |
@@ -163,16 +163,16 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | // javascript qui gere la securite du login en evitant de faire circuler le pass en clair |
| 165 | 165 | $flux['data'] .= |
| 166 | - ($compat_md5 ? '<script type="text/javascript" src="' . _DIR_JAVASCRIPT . 'md5.js"></script>' : '') |
|
| 167 | - . '<script type="text/javascript" src="' . _DIR_JAVASCRIPT . 'login-sha-min.js"></script>' |
|
| 166 | + ($compat_md5 ? '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'md5.js"></script>' : '') |
|
| 167 | + . '<script type="text/javascript" src="'._DIR_JAVASCRIPT.'login-sha-min.js"></script>' |
|
| 168 | 168 | . '<script type="text/javascript">/*<![CDATA[*/' |
| 169 | - . "var login_info={'alea_actuel':'" . $flux['args']['contexte']['_alea_actuel'] . "'," |
|
| 170 | - . "'alea_futur':'" . $flux['args']['contexte']['_alea_futur'] . "'," |
|
| 171 | - . "'login':'" . $flux['args']['contexte']['var_login'] . "'," |
|
| 172 | - . "'page_auteur': '" . generer_url_public('informer_auteur') . "'," |
|
| 169 | + . "var login_info={'alea_actuel':'".$flux['args']['contexte']['_alea_actuel']."'," |
|
| 170 | + . "'alea_futur':'".$flux['args']['contexte']['_alea_futur']."'," |
|
| 171 | + . "'login':'".$flux['args']['contexte']['var_login']."'," |
|
| 172 | + . "'page_auteur': '".generer_url_public('informer_auteur')."'," |
|
| 173 | 173 | . "'informe_auteur_en_cours':false," |
| 174 | 174 | . "'attente_informe':0," |
| 175 | - . "'compat_md5':" . ($compat_md5 ? 'true' : 'false') . '};' |
|
| 175 | + . "'compat_md5':".($compat_md5 ? 'true' : 'false').'};' |
|
| 176 | 176 | . "jQuery(function(){ |
| 177 | 177 | jQuery('#var_login').change(actualise_auteur); |
| 178 | 178 | jQuery('form#formulaire_login').submit(login_submit); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | } else { |
| 216 | 216 | $n = sql_countsel( |
| 217 | 217 | 'spip_auteurs', |
| 218 | - 'login=' . sql_quote($new_login) . ' AND id_auteur!=' . intval($id_auteur) . " AND statut!='5poubelle'", |
|
| 218 | + 'login='.sql_quote($new_login).' AND id_auteur!='.intval($id_auteur)." AND statut!='5poubelle'", |
|
| 219 | 219 | '', |
| 220 | 220 | '', |
| 221 | 221 | $serveur |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | if ( |
| 245 | 245 | !$id_auteur = intval($id_auteur) |
| 246 | - or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 246 | + or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 247 | 247 | ) { |
| 248 | 248 | return false; |
| 249 | 249 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $anciens = sql_allfetsel( |
| 259 | 259 | 'id_auteur', |
| 260 | 260 | 'spip_auteurs', |
| 261 | - 'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'", |
|
| 261 | + 'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'", |
|
| 262 | 262 | '', |
| 263 | 263 | '', |
| 264 | 264 | '', |
@@ -292,8 +292,8 @@ discard block |
||
| 292 | 292 | $r = sql_getfetsel( |
| 293 | 293 | 'login', |
| 294 | 294 | 'spip_auteurs', |
| 295 | - "statut<>'5poubelle'" . |
|
| 296 | - ' AND (length(pass)>0)' . |
|
| 295 | + "statut<>'5poubelle'". |
|
| 296 | + ' AND (length(pass)>0)'. |
|
| 297 | 297 | " AND (login=$l)", |
| 298 | 298 | '', |
| 299 | 299 | '', |
@@ -312,8 +312,8 @@ discard block |
||
| 312 | 312 | return sql_getfetsel( |
| 313 | 313 | 'login', |
| 314 | 314 | 'spip_auteurs', |
| 315 | - "statut<>'5poubelle'" . |
|
| 316 | - ' AND (length(pass)>0)' . |
|
| 315 | + "statut<>'5poubelle'". |
|
| 316 | + ' AND (length(pass)>0)'. |
|
| 317 | 317 | " AND (login<>'' AND (nom=$l OR email=$l))", |
| 318 | 318 | '', |
| 319 | 319 | '', |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | if ( |
| 405 | 405 | !$id_auteur = intval($id_auteur) |
| 406 | - or !sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 406 | + or !sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 407 | 407 | ) { |
| 408 | 408 | return false; |
| 409 | 409 | } |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | } |
| 417 | 417 | $alea_actuel = creer_uniqid(); |
| 418 | 418 | $alea_futur = creer_uniqid(); |
| 419 | - $pass = spip_sha256($alea_actuel . $new_pass); |
|
| 419 | + $pass = spip_sha256($alea_actuel.$new_pass); |
|
| 420 | 420 | $c['pass'] = $pass; |
| 421 | 421 | $c['htpass'] = $htpass; |
| 422 | 422 | $c['alea_actuel'] = $alea_actuel; |
@@ -452,8 +452,8 @@ discard block |
||
| 452 | 452 | or isset($champs['statut']) |
| 453 | 453 | or (isset($options['all']) and $options['all']) |
| 454 | 454 | ) { |
| 455 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 456 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 455 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 456 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 457 | 457 | |
| 458 | 458 | // Cette variable de configuration peut etre posee par un plugin |
| 459 | 459 | // par exemple acces_restreint ; |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | and !@file_exists($htaccess) |
| 464 | 464 | ) { |
| 465 | 465 | spip_unlink($htpasswd); |
| 466 | - spip_unlink($htpasswd . '-admin'); |
|
| 466 | + spip_unlink($htpasswd.'-admin'); |
|
| 467 | 467 | |
| 468 | 468 | return; |
| 469 | 469 | } |
@@ -481,16 +481,16 @@ discard block |
||
| 481 | 481 | ); |
| 482 | 482 | while ($t = sql_fetch($s)) { |
| 483 | 483 | if (strlen($t['login']) and strlen($t['htpass'])) { |
| 484 | - $p1 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 484 | + $p1 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 485 | 485 | if ($t['statut'] == '0minirezo') { |
| 486 | - $p2 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 486 | + $p2 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | } |
| 490 | 490 | sql_free($s); |
| 491 | 491 | if ($p1) { |
| 492 | 492 | ecrire_fichier($htpasswd, $p1); |
| 493 | - ecrire_fichier($htpasswd . '-admin', $p2); |
|
| 493 | + ecrire_fichier($htpasswd.'-admin', $p2); |
|
| 494 | 494 | spip_log("Ecriture de $htpasswd et $htpasswd-admin"); |
| 495 | 495 | } |
| 496 | 496 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | function surligner_mots($page, $surcharge_surligne = '') { |
| 38 | 38 | $surlignejs_engines = [ |
| 39 | 39 | [ |
| 40 | - ',' . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . ',i', |
|
| 40 | + ','.str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']).',i', |
|
| 41 | 41 | ',recherche=([^&]+),i' |
| 42 | 42 | ], //SPIP |
| 43 | 43 | [',^http://(www\.)?google\.,i', ',q=([^&]+),i'], // Google |
@@ -72,19 +72,19 @@ discard block |
||
| 72 | 72 | //good referrer found or var_recherche is not null |
| 73 | 73 | include_spip('inc/filtres'); |
| 74 | 74 | $script = " |
| 75 | - <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js')) . "'></script> |
|
| 75 | + <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js'))."'></script> |
|
| 76 | 76 | <script type='text/javascript'> |
| 77 | 77 | var highlighter = function() { |
| 78 | 78 | jQuery(this).SearchHighlight({ |
| 79 | - tag_name:'" . (html5_permis() ? 'mark' : 'span') . "', |
|
| 79 | + tag_name:'" . (html5_permis() ? 'mark' : 'span')."', |
|
| 80 | 80 | style_name:'spip_surligne', |
| 81 | 81 | exact:'whole', |
| 82 | 82 | style_name_suffix:false, |
| 83 | - engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . "/i,/recherche=([^&]+)/i], |
|
| 83 | + engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site'])."/i,/recherche=([^&]+)/i], |
|
| 84 | 84 | highlight:'.surlignable', |
| 85 | 85 | nohighlight:'.pas_surlignable'" . |
| 86 | 86 | ($surcharge_surligne ? ", |
| 87 | - keys:'$surcharge_surligne'" : '') . ', |
|
| 87 | + keys:'$surcharge_surligne'" : '').', |
|
| 88 | 88 | min_length: 3 |
| 89 | 89 | }); |
| 90 | 90 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | define('_INC_DISTANT_CONTENT_ENCODING', 'gzip'); |
| 27 | 27 | } |
| 28 | 28 | if (!defined('_INC_DISTANT_USER_AGENT')) { |
| 29 | - define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')'); |
|
| 29 | + define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')'); |
|
| 30 | 30 | } |
| 31 | 31 | if (!defined('_INC_DISTANT_MAX_SIZE')) { |
| 32 | 32 | define('_INC_DISTANT_MAX_SIZE', 2097152); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | define('_INC_DISTANT_CONNECT_TIMEOUT', 10); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -define('_REGEXP_COPIE_LOCALE', ',' . |
|
| 38 | +define('_REGEXP_COPIE_LOCALE', ','. |
|
| 39 | 39 | preg_replace( |
| 40 | 40 | '@^https?:@', |
| 41 | 41 | 'https?:', |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // si c'est la protection de soi-meme, retourner le path |
| 72 | 72 | if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) { |
| 73 | - $source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]); |
|
| 73 | + $source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]); |
|
| 74 | 74 | |
| 75 | 75 | return @file_exists($source) ? $source : false; |
| 76 | 76 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return false; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $localrac = _DIR_RACINE . $local; |
|
| 93 | + $localrac = _DIR_RACINE.$local; |
|
| 94 | 94 | $t = ($mode == 'force') ? false : @file_exists($localrac); |
| 95 | 95 | |
| 96 | 96 | // test d'existence du fichier |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | ['file' => $localrac, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : ''] |
| 116 | 116 | ); |
| 117 | 117 | if (!$res or (!$res['length'] and $res['status'] != 304)) { |
| 118 | - spip_log("copie_locale : Echec recuperation $source sur $localrac status : " . $res['status'], 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 118 | + spip_log("copie_locale : Echec recuperation $source sur $localrac status : ".$res['status'], 'distant'._LOG_INFO_IMPORTANTE); |
|
| 119 | 119 | } |
| 120 | 120 | if (!$res['length']) { |
| 121 | 121 | // si $t c'est sans doute juste un not-modified-since |
| 122 | 122 | return $t ? $local : false; |
| 123 | 123 | } |
| 124 | - spip_log("copie_locale : recuperation $source sur $localrac taille " . $res['length'] . ' OK', 'distant'); |
|
| 124 | + spip_log("copie_locale : recuperation $source sur $localrac taille ".$res['length'].' OK', 'distant'); |
|
| 125 | 125 | |
| 126 | 126 | // si on retrouve l'extension |
| 127 | 127 | if ( |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | if (!$is_known_host) { |
| 207 | 207 | $host = trim($parsed_url['host'], '.'); |
| 208 | - if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 208 | + if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 209 | 209 | $ip = gethostbyname($host); |
| 210 | 210 | if ($ip === $host) { |
| 211 | 211 | // Error condition for gethostbyname() |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | foreach ($records as $record) { |
| 216 | 216 | // il faut que le TTL soit suffisant afin d'etre certain que le copie_locale eventuel qui suit |
| 217 | 217 | // se fasse sur la meme IP |
| 218 | - if ($record['ttl']<10) { |
|
| 218 | + if ($record['ttl'] < 10) { |
|
| 219 | 219 | $ip = false; |
| 220 | 220 | break; |
| 221 | 221 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | if ($ip) { |
| 229 | - if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 229 | + if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 230 | 230 | return false; |
| 231 | 231 | } |
| 232 | 232 | } |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | $port = $parsed_url['port']; |
| 240 | - if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 240 | + if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 241 | 241 | return $url; |
| 242 | 242 | } |
| 243 | 243 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | if ($taille > 500) { |
| 310 | - $boundary = substr(md5(rand() . 'spip'), 0, 8); |
|
| 310 | + $boundary = substr(md5(rand().'spip'), 0, 8); |
|
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
@@ -335,16 +335,16 @@ discard block |
||
| 335 | 335 | } |
| 336 | 336 | } else { |
| 337 | 337 | // fabrique une chaine HTTP simple pour un POST |
| 338 | - $entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; |
|
| 338 | + $entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n"; |
|
| 339 | 339 | $chaine = []; |
| 340 | 340 | if (is_array($donnees)) { |
| 341 | 341 | foreach ($donnees as $cle => $valeur) { |
| 342 | 342 | if (is_array($valeur)) { |
| 343 | 343 | foreach ($valeur as $val2) { |
| 344 | - $chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2); |
|
| 344 | + $chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2); |
|
| 345 | 345 | } |
| 346 | 346 | } else { |
| 347 | - $chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur); |
|
| 347 | + $chaine[] = rawurlencode($cle).'='.rawurlencode($valeur); |
|
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | $chaine = implode('&', $chaine); |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $url_idn = implode($host_ascii, $url_idn); |
| 379 | 379 | } |
| 380 | 380 | // et on urlencode les char utf si besoin dans le path |
| 381 | - $url_idn = preg_replace_callback('/[^\x20-\x7f]/', function ($match) { |
|
| 381 | + $url_idn = preg_replace_callback('/[^\x20-\x7f]/', function($match) { |
|
| 382 | 382 | return urlencode($match[0]); |
| 383 | 383 | }, $url_idn); |
| 384 | 384 | } |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | $head_add = ''; |
| 457 | 457 | if (!empty($options['headers'])) { |
| 458 | 458 | foreach ($options['headers'] as $champ => $valeur) { |
| 459 | - $head_add .= $champ . ': ' . $valeur . "\r\n"; |
|
| 459 | + $head_add .= $champ.': '.$valeur."\r\n"; |
|
| 460 | 460 | } |
| 461 | 461 | // ne pas le repasser a recuperer_url si on follow un location, car ils seront dans datas |
| 462 | 462 | unset($options['headers']); |
@@ -466,9 +466,9 @@ discard block |
||
| 466 | 466 | list($head, $postdata) = prepare_donnees_post($options['datas'], $options['boundary']); |
| 467 | 467 | $head .= $head_add; |
| 468 | 468 | if (stripos($head, 'Content-Length:') === false) { |
| 469 | - $head .= 'Content-Length: ' . strlen($postdata) . "\r\n"; |
|
| 469 | + $head .= 'Content-Length: '.strlen($postdata)."\r\n"; |
|
| 470 | 470 | } |
| 471 | - $options['datas'] = $head . "\r\n" . $postdata; |
|
| 471 | + $options['datas'] = $head."\r\n".$postdata; |
|
| 472 | 472 | if ( |
| 473 | 473 | strlen($postdata) |
| 474 | 474 | and !$methode_demandee |
@@ -476,15 +476,15 @@ discard block |
||
| 476 | 476 | $options['methode'] = 'POST'; |
| 477 | 477 | } |
| 478 | 478 | } elseif ($head_add) { |
| 479 | - $options['datas'] = $head_add . "\r\n"; |
|
| 479 | + $options['datas'] = $head_add."\r\n"; |
|
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | // Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole |
| 483 | 483 | $url = preg_replace(',^feed://,i', 'http://', $url); |
| 484 | 484 | if (!tester_url_absolue($url)) { |
| 485 | - $url = 'http://' . $url; |
|
| 485 | + $url = 'http://'.$url; |
|
| 486 | 486 | } elseif (strncmp($url, '//', 2) == 0) { |
| 487 | - $url = 'http:' . $url; |
|
| 487 | + $url = 'http:'.$url; |
|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | $url = url_to_ascii($url); |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | $options['if_modified_since'] |
| 514 | 514 | ); |
| 515 | 515 | if (!$handle) { |
| 516 | - spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR); |
|
| 516 | + spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR); |
|
| 517 | 517 | |
| 518 | 518 | return false; |
| 519 | 519 | } |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | 'status' => 200, |
| 544 | 544 | ]; |
| 545 | 545 | } else { |
| 546 | - spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR); |
|
| 546 | + spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR); |
|
| 547 | 547 | return false; |
| 548 | 548 | } |
| 549 | 549 | } elseif ($res['location'] and $options['follow_location']) { |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | |
| 556 | 556 | return recuperer_url($url, $options); |
| 557 | 557 | } elseif ($res['status'] !== 200) { |
| 558 | - spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant'); |
|
| 558 | + spip_log('HTTP status '.$res['status']." pour $url", 'distant'); |
|
| 559 | 559 | } |
| 560 | 560 | $result['status'] = $res['status']; |
| 561 | 561 | if (isset($res['headers'])) { |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | |
| 581 | 581 | $gz = false; |
| 582 | 582 | if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) { |
| 583 | - $gz = (_DIR_TMP . md5(uniqid(mt_rand())) . '.tmp.gz'); |
|
| 583 | + $gz = (_DIR_TMP.md5(uniqid(mt_rand())).'.tmp.gz'); |
|
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | // si on a pas deja recuperer le contenu par une methode detournee |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | $sig['url'] = $url; |
| 667 | 667 | |
| 668 | 668 | $dir = sous_repertoire(_DIR_CACHE, 'curl'); |
| 669 | - $cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 669 | + $cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 670 | 670 | $sub = sous_repertoire($dir, substr($cache, 0, 2)); |
| 671 | 671 | $cache = "$sub$cache"; |
| 672 | 672 | |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | $fp = false; |
| 720 | 720 | if ($fichier) { |
| 721 | 721 | include_spip('inc/acces'); |
| 722 | - $tmpfile = "$fichier." . creer_uniqid() . '.tmp'; |
|
| 722 | + $tmpfile = "$fichier.".creer_uniqid().'.tmp'; |
|
| 723 | 723 | $fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX); |
| 724 | 724 | if (!$fp and file_exists($fichier)) { |
| 725 | 725 | return filesize($fichier); |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | } |
| 779 | 779 | $result['status'] = intval($r[1]); |
| 780 | 780 | while ($s = trim(fgets($handle, 16384))) { |
| 781 | - $result['headers'][] = $s . "\n"; |
|
| 781 | + $result['headers'][] = $s."\n"; |
|
| 782 | 782 | preg_match(',^([^:]*): *(.*)$,i', $s, $r); |
| 783 | 783 | list(, $d, $v) = $r; |
| 784 | 784 | if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) { |
@@ -827,13 +827,13 @@ discard block |
||
| 827 | 827 | |
| 828 | 828 | // on se place tout le temps comme si on etait a la racine |
| 829 | 829 | if (_DIR_RACINE) { |
| 830 | - $d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d); |
|
| 830 | + $d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d); |
|
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 833 | $m = md5($source); |
| 834 | 834 | |
| 835 | 835 | return $d |
| 836 | - . substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12) |
|
| 836 | + . substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12) |
|
| 837 | 837 | . substr($m, 0, 4) |
| 838 | 838 | . ".$extension"; |
| 839 | 839 | } |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | // Si c'est deja local pas de souci |
| 857 | 857 | if (!tester_url_absolue($source)) { |
| 858 | 858 | if (_DIR_RACINE) { |
| 859 | - $source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source); |
|
| 859 | + $source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source); |
|
| 860 | 860 | } |
| 861 | 861 | |
| 862 | 862 | return $source; |
@@ -874,7 +874,7 @@ discard block |
||
| 874 | 874 | $ext |
| 875 | 875 | and preg_match(',^\w+$,', $ext) // pas de php?truc=1&... |
| 876 | 876 | and $f = nom_fichier_copie_locale($source, $ext) |
| 877 | - and file_exists(_DIR_RACINE . $f) |
|
| 877 | + and file_exists(_DIR_RACINE.$f) |
|
| 878 | 878 | ) { |
| 879 | 879 | return $f; |
| 880 | 880 | } |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | |
| 883 | 883 | // Si c'est deja dans la table des documents, |
| 884 | 884 | // ramener le nom de sa copie potentielle |
| 885 | - $ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''"); |
|
| 885 | + $ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''"); |
|
| 886 | 886 | |
| 887 | 887 | if ($ext) { |
| 888 | 888 | return nom_fichier_copie_locale($source, $ext); |
@@ -893,9 +893,9 @@ discard block |
||
| 893 | 893 | |
| 894 | 894 | $ext = $path_parts ? $path_parts['extension'] : ''; |
| 895 | 895 | |
| 896 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 896 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 897 | 897 | $f = nom_fichier_copie_locale($source, $ext); |
| 898 | - if (file_exists(_DIR_RACINE . $f)) { |
|
| 898 | + if (file_exists(_DIR_RACINE.$f)) { |
|
| 899 | 899 | return $f; |
| 900 | 900 | } |
| 901 | 901 | } |
@@ -903,7 +903,7 @@ discard block |
||
| 903 | 903 | // Ping pour voir si son extension est connue et autorisee |
| 904 | 904 | // avec mise en cache du resultat du ping |
| 905 | 905 | |
| 906 | - $cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source); |
|
| 906 | + $cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source); |
|
| 907 | 907 | if ( |
| 908 | 908 | !@file_exists($cache) |
| 909 | 909 | or !$path_parts = @unserialize(spip_file_get_contents($cache)) |
@@ -913,10 +913,10 @@ discard block |
||
| 913 | 913 | ecrire_fichier($cache, serialize($path_parts)); |
| 914 | 914 | } |
| 915 | 915 | $ext = !empty($path_parts['extension']) ? $path_parts['extension'] : ''; |
| 916 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 916 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 917 | 917 | return nom_fichier_copie_locale($source, $ext); |
| 918 | 918 | } |
| 919 | - spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR); |
|
| 919 | + spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR); |
|
| 920 | 920 | } |
| 921 | 921 | |
| 922 | 922 | |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | } else { |
| 1001 | 1001 | if ($a['body']) { |
| 1002 | 1002 | $a['extension'] = $extension; |
| 1003 | - $a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension); |
|
| 1003 | + $a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension); |
|
| 1004 | 1004 | ecrire_fichier($a['fichier'], $a['body']); |
| 1005 | 1005 | $size_image = @spip_getimagesize($a['fichier']); |
| 1006 | 1006 | $a['largeur'] = intval($size_image[0]); |
@@ -1065,20 +1065,20 @@ discard block |
||
| 1065 | 1065 | !$t |
| 1066 | 1066 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1067 | 1067 | ) { |
| 1068 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
|
| 1068 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote($rext[1], '', 'text')); |
|
| 1069 | 1069 | } |
| 1070 | 1070 | if ( |
| 1071 | 1071 | !$t |
| 1072 | 1072 | and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 1073 | 1073 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 1074 | 1074 | ) { |
| 1075 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
|
| 1075 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote($rext[1], '', 'text')); |
|
| 1076 | 1076 | } |
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | 1079 | // Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
| 1080 | 1080 | if (!$t) { |
| 1081 | - $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type)); |
|
| 1081 | + $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type)); |
|
| 1082 | 1082 | } |
| 1083 | 1083 | |
| 1084 | 1084 | // Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
@@ -1089,11 +1089,11 @@ discard block |
||
| 1089 | 1089 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1090 | 1090 | ) { |
| 1091 | 1091 | # eviter xxx.3 => 3gp (> SPIP 3) |
| 1092 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
|
| 1092 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote($rext[1], '', 'text')); |
|
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | if ($t) { |
| 1096 | - spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant'); |
|
| 1096 | + spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant'); |
|
| 1097 | 1097 | return $t['extension']; |
| 1098 | 1098 | } else { |
| 1099 | 1099 | # par defaut on retombe sur '.bin' si c'est autorise |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | } |
| 1197 | 1197 | } else { |
| 1198 | 1198 | $scheme = $t['scheme']; |
| 1199 | - $noproxy = $scheme . '://'; |
|
| 1199 | + $noproxy = $scheme.'://'; |
|
| 1200 | 1200 | } |
| 1201 | 1201 | if (isset($t['user'])) { |
| 1202 | 1202 | $user = [$t['user'], $t['pass']]; |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | } |
| 1211 | 1211 | |
| 1212 | 1212 | if (!empty($t['query'])) { |
| 1213 | - $path .= '?' . $t['query']; |
|
| 1213 | + $path .= '?'.$t['query']; |
|
| 1214 | 1214 | } |
| 1215 | 1215 | |
| 1216 | 1216 | $f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date); |
@@ -1284,20 +1284,20 @@ discard block |
||
| 1284 | 1284 | $proxy_user = ''; |
| 1285 | 1285 | $http_proxy = need_proxy($host); |
| 1286 | 1286 | if ($user) { |
| 1287 | - $user = urlencode($user[0]) . ':' . urlencode($user[1]); |
|
| 1287 | + $user = urlencode($user[0]).':'.urlencode($user[1]); |
|
| 1288 | 1288 | } |
| 1289 | 1289 | |
| 1290 | 1290 | $connect = ''; |
| 1291 | 1291 | if ($http_proxy) { |
| 1292 | - if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) { |
|
| 1293 | - $path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : ''); |
|
| 1294 | - $connect = 'CONNECT ' . $path_host . " $vers\r\n" |
|
| 1292 | + if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) { |
|
| 1293 | + $path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : ''); |
|
| 1294 | + $connect = 'CONNECT '.$path_host." $vers\r\n" |
|
| 1295 | 1295 | . "Host: $path_host\r\n" |
| 1296 | 1296 | . "Proxy-Connection: Keep-Alive\r\n"; |
| 1297 | 1297 | } else { |
| 1298 | - $path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://") |
|
| 1298 | + $path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://") |
|
| 1299 | 1299 | . (!$user ? '' : "$user@") |
| 1300 | - . "$host" . (($port != 80) ? ":$port" : '') . $path; |
|
| 1300 | + . "$host".(($port != 80) ? ":$port" : '').$path; |
|
| 1301 | 1301 | } |
| 1302 | 1302 | $t2 = @parse_url($http_proxy); |
| 1303 | 1303 | $first_host = $t2['host']; |
@@ -1305,10 +1305,10 @@ discard block |
||
| 1305 | 1305 | $port = 80; |
| 1306 | 1306 | } |
| 1307 | 1307 | if ($t2['user']) { |
| 1308 | - $proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']); |
|
| 1308 | + $proxy_user = base64_encode($t2['user'].':'.$t2['pass']); |
|
| 1309 | 1309 | } |
| 1310 | 1310 | } else { |
| 1311 | - $first_host = $noproxy . $host; |
|
| 1311 | + $first_host = $noproxy.$host; |
|
| 1312 | 1312 | } |
| 1313 | 1313 | |
| 1314 | 1314 | if ($connect) { |
@@ -1330,7 +1330,7 @@ discard block |
||
| 1330 | 1330 | ); |
| 1331 | 1331 | spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect'); |
| 1332 | 1332 | if (!$f) { |
| 1333 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1333 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1334 | 1334 | return $errno; |
| 1335 | 1335 | } |
| 1336 | 1336 | stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT); |
@@ -1343,7 +1343,7 @@ discard block |
||
| 1343 | 1343 | or !count($res = explode(' ', $res)) |
| 1344 | 1344 | or $res[1] !== '200' |
| 1345 | 1345 | ) { |
| 1346 | - spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE); |
|
| 1346 | + spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE); |
|
| 1347 | 1347 | fclose($f); |
| 1348 | 1348 | |
| 1349 | 1349 | return false; |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | } while (!$f and $ntry-- and $errno !== 110 and sleep(1)); |
| 1361 | 1361 | spip_log("Recuperer $path sur $first_host:$port par $f"); |
| 1362 | 1362 | if (!$f) { |
| 1363 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1363 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1364 | 1364 | |
| 1365 | 1365 | return $errno; |
| 1366 | 1366 | } |
@@ -1370,16 +1370,16 @@ discard block |
||
| 1370 | 1370 | $site = isset($GLOBALS['meta']['adresse_site']) ? $GLOBALS['meta']['adresse_site'] : ''; |
| 1371 | 1371 | |
| 1372 | 1372 | $host_port = $host; |
| 1373 | - if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) { |
|
| 1373 | + if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) { |
|
| 1374 | 1374 | $host_port .= ":$port"; |
| 1375 | 1375 | } |
| 1376 | 1376 | $req = "$method $path $vers\r\n" |
| 1377 | 1377 | . "Host: $host_port\r\n" |
| 1378 | - . 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n" |
|
| 1379 | - . ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n")) |
|
| 1378 | + . 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n" |
|
| 1379 | + . ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n")) |
|
| 1380 | 1380 | . (!$site ? '' : "Referer: $site/$referer\r\n") |
| 1381 | - . (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n")) |
|
| 1382 | - . (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n")) |
|
| 1381 | + . (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n")) |
|
| 1382 | + . (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n")) |
|
| 1383 | 1383 | . (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n") |
| 1384 | 1384 | . (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n"); |
| 1385 | 1385 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | // Appels incomplets (sans $c) |
| 115 | 115 | if (!is_array($c)) { |
| 116 | - spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c'); |
|
| 116 | + spip_log('erreur appel objet_modifier_champs('.$objet.'), manque $c'); |
|
| 117 | 117 | |
| 118 | 118 | return _T('erreur_technique_enregistrement_impossible'); |
| 119 | 119 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $champs = array_map('corriger_caracteres', $champs); |
| 147 | 147 | |
| 148 | 148 | // On récupère l'état avant toute modification |
| 149 | - $row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet); |
|
| 149 | + $row = sql_fetsel('*', $spip_table_objet, $id_table_objet.'='.$id_objet); |
|
| 150 | 150 | |
| 151 | 151 | // Envoyer aux plugins |
| 152 | 152 | $champs = pipeline( |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $id_rubrique = 0; |
| 201 | 201 | if (isset($desc['field']['id_rubrique'])) { |
| 202 | 202 | $parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique'; |
| 203 | - $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . intval($id_objet)); |
|
| 203 | + $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=".intval($id_objet)); |
|
| 204 | 204 | } |
| 205 | 205 | $instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action'); |
| 206 | 206 | $champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur); |
@@ -222,13 +222,13 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | // allez on commit la modif |
| 225 | - sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . intval($id_objet), $serveur); |
|
| 225 | + sql_updateq($spip_table_objet, $champs, "$id_table_objet=".intval($id_objet), $serveur); |
|
| 226 | 226 | |
| 227 | 227 | // on verifie si elle est bien passee |
| 228 | 228 | $moof = sql_fetsel( |
| 229 | 229 | array_keys($champs), |
| 230 | 230 | $spip_table_objet, |
| 231 | - "$id_table_objet=" . intval($id_objet), |
|
| 231 | + "$id_table_objet=".intval($id_objet), |
|
| 232 | 232 | [], |
| 233 | 233 | [], |
| 234 | 234 | '', |
@@ -264,13 +264,13 @@ discard block |
||
| 264 | 264 | // c'est un cas exceptionnel |
| 265 | 265 | if (count($liste)) { |
| 266 | 266 | spip_log( |
| 267 | - "Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true), |
|
| 268 | - 'modifier.' . _LOG_CRITIQUE |
|
| 267 | + "Erreur enregistrement en base $objet/$id_objet champs :".var_export($conflits, true), |
|
| 268 | + 'modifier.'._LOG_CRITIQUE |
|
| 269 | 269 | ); |
| 270 | 270 | |
| 271 | 271 | return _T( |
| 272 | 272 | 'erreur_technique_enregistrement_champs', |
| 273 | - ['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"] |
|
| 273 | + ['champs' => "<i>'".implode("'</i>,<i>'", $liste)."'</i>"] |
|
| 274 | 274 | ); |
| 275 | 275 | } |
| 276 | 276 | } |
@@ -311,10 +311,10 @@ discard block |
||
| 311 | 311 | // message a affiner :-) |
| 312 | 312 | include_spip('inc/filtres_mini'); |
| 313 | 313 | $qui = !empty($GLOBALS['visiteur_session']['nom']) ? $GLOBALS['visiteur_session']['nom'] : $GLOBALS['ip']; |
| 314 | - journal(_L($qui . ' a édité l’' . $objet . ' ' . $id_objet . ' (' . join( |
|
| 314 | + journal(_L($qui.' a édité l’'.$objet.' '.$id_objet.' ('.join( |
|
| 315 | 315 | '+', |
| 316 | 316 | array_diff(array_keys($champs), ['date_modif']) |
| 317 | - ) . ')'), [ |
|
| 317 | + ).')'), [ |
|
| 318 | 318 | 'faire' => 'modifier', |
| 319 | 319 | 'quoi' => $objet, |
| 320 | 320 | 'id' => $id_objet |