@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $credentials_ldap = ['ldap_dn' => $dn, 'ldap_password' => $pass]; |
| 68 | 68 | |
| 69 | 69 | // Si l'utilisateur figure deja dans la base, y recuperer les infos |
| 70 | - $r = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login) . " AND source='ldap'", '', '', '', '', $serveur); |
|
| 70 | + $r = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login)." AND source='ldap'", '', '', '', '', $serveur); |
|
| 71 | 71 | |
| 72 | 72 | if ($r) { |
| 73 | 73 | return array_merge($r, $credentials_ldap); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | if ($r) { |
| 91 | 91 | return array_merge( |
| 92 | 92 | $credentials_ldap, |
| 93 | - sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . (int) $r, '', '', '', '', $serveur) |
|
| 93 | + sql_fetsel('*', 'spip_auteurs', 'id_auteur='.(int) $r, '', '', '', '', $serveur) |
|
| 94 | 94 | ); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $connexion = spip_connect($serveur); |
| 120 | 120 | if (!is_array($connexion['ldap'])) { |
| 121 | 121 | if ($connexion['authentification']['ldap']) { |
| 122 | - $f = _DIR_CONNECT . $connexion['authentification']['ldap']; |
|
| 122 | + $f = _DIR_CONNECT.$connexion['authentification']['ldap']; |
|
| 123 | 123 | unset($GLOBALS['ldap_link']); |
| 124 | 124 | if (is_readable($f)) { |
| 125 | 125 | include_once($f); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | if (!ldap_bind($link, $dn, session_get('ldap_password'))) { |
| 333 | 333 | return false; |
| 334 | 334 | } |
| 335 | - $encoded_pass = '{MD5}' . base64_encode(pack('H*', md5((string) $new_pass))); |
|
| 335 | + $encoded_pass = '{MD5}'.base64_encode(pack('H*', md5((string) $new_pass))); |
|
| 336 | 336 | |
| 337 | 337 | return ldap_mod_replace($link, $dn, ['userPassword' => $encoded_pass]); |
| 338 | 338 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $row = sql_fetsel( |
| 50 | 50 | '*', |
| 51 | 51 | 'spip_auteurs', |
| 52 | - 'login=' . sql_quote($login, $serveur, 'text') . " AND statut<>'5poubelle'", |
|
| 52 | + 'login='.sql_quote($login, $serveur, 'text')." AND statut<>'5poubelle'", |
|
| 53 | 53 | '', |
| 54 | 54 | '', |
| 55 | 55 | '', |
@@ -76,20 +76,20 @@ discard block |
||
| 76 | 76 | // legacy = md5 ou sha256 |
| 77 | 77 | case 32: |
| 78 | 78 | // tres anciens mots de passe encodes en md5(alea.pass) |
| 79 | - $hash = md5($row['alea_actuel'] . $pass); |
|
| 79 | + $hash = md5($row['alea_actuel'].$pass); |
|
| 80 | 80 | $methode = 'md5'; |
| 81 | 81 | case 64: |
| 82 | 82 | if (empty($hash)) { |
| 83 | 83 | // anciens mots de passe encodes en sha256(alea.pass) |
| 84 | 84 | include_spip('auth/sha256.inc'); |
| 85 | - $hash = spip_sha256($row['alea_actuel'] . $pass); |
|
| 85 | + $hash = spip_sha256($row['alea_actuel'].$pass); |
|
| 86 | 86 | $methode = 'sha256'; |
| 87 | 87 | } |
| 88 | 88 | if ($row['pass'] === $hash) { |
| 89 | - spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via $methode", 'auth' . _LOG_DEBUG); |
|
| 89 | + spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via $methode", 'auth'._LOG_DEBUG); |
|
| 90 | 90 | // ce n'est pas cense arriver, mais si jamais c'est un backup inutilisable, il faut le nettoyer pour ne pas bloquer la creation d'une nouvelle cle d'auth |
| 91 | 91 | if (!empty($row['backup_cles'])) { |
| 92 | - sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . (int) $row['id_auteur']); |
|
| 92 | + sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.(int) $row['id_auteur']); |
|
| 93 | 93 | } |
| 94 | 94 | break; |
| 95 | 95 | } |
@@ -107,19 +107,19 @@ discard block |
||
| 107 | 107 | && !empty($row['backup_cles']) |
| 108 | 108 | ) { |
| 109 | 109 | if ($cles->restore($row['backup_cles'], $pass, $row['pass'], $row['id_auteur'])) { |
| 110 | - spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #' . $row['id_auteur'], 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 110 | + spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #'.$row['id_auteur'], 'auth'._LOG_INFO_IMPORTANTE); |
|
| 111 | 111 | if ($cles->save()) { |
| 112 | 112 | $secret = $cles->getSecretAuth(); |
| 113 | 113 | } |
| 114 | 114 | else { |
| 115 | - spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR); |
|
| 115 | + spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR); |
|
| 116 | 116 | // et on echoue car on ne veut pas que la situation reste telle quelle |
| 117 | - raler_fichier(_DIR_ETC . 'cles.php'); |
|
| 117 | + raler_fichier(_DIR_ETC.'cles.php'); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | else { |
| 121 | - spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #' . $row['id_auteur'] . " n'est pas valide", 'auth' . _LOG_ERREUR); |
|
| 122 | - sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . (int) $row['id_auteur']); |
|
| 121 | + spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #'.$row['id_auteur']." n'est pas valide", 'auth'._LOG_ERREUR); |
|
| 122 | + sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.(int) $row['id_auteur']); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | unset($row); |
| 128 | 128 | } |
| 129 | 129 | else { |
| 130 | - spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via Password::verifier", 'auth' . _LOG_DEBUG); |
|
| 130 | + spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via Password::verifier", 'auth'._LOG_DEBUG); |
|
| 131 | 131 | } |
| 132 | 132 | break; |
| 133 | 133 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | @sql_update( |
| 173 | 173 | 'spip_auteurs', |
| 174 | 174 | $set, |
| 175 | - 'id_auteur=' . (int) $row['id_auteur'] . ' AND pass=' . sql_quote( |
|
| 175 | + 'id_auteur='.(int) $row['id_auteur'].' AND pass='.sql_quote( |
|
| 176 | 176 | $row['pass'], |
| 177 | 177 | $serveur, |
| 178 | 178 | 'text' |
@@ -219,24 +219,24 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | // si force, on ne verifie pas la presence d'un backup chez un webmestre |
| 221 | 221 | if ($force) { |
| 222 | - spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 222 | + spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth'._LOG_INFO_IMPORTANTE); |
|
| 223 | 223 | $secret = $cles->getSecretAuth(true); |
| 224 | 224 | return true; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - $has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut=' . sql_quote('0minirezo') . ' AND webmestre=' . sql_quote('oui') . " AND backup_cles!=''"); |
|
| 227 | + $has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut='.sql_quote('0minirezo').' AND webmestre='.sql_quote('oui')." AND backup_cles!=''"); |
|
| 228 | 228 | $has_backup = array_column($has_backup, 'id_auteur'); |
| 229 | 229 | if ($has_backup === []) { |
| 230 | - spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 230 | + spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth'._LOG_INFO_IMPORTANTE); |
|
| 231 | 231 | if ($secret = $cles->getSecretAuth(true)) { |
| 232 | 232 | return true; |
| 233 | 233 | } |
| 234 | - spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR); |
|
| 234 | + spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR); |
|
| 235 | 235 | // et on echoue car on ne veut pas que la situation reste telle quelle |
| 236 | - raler_fichier(_DIR_ETC . 'cles.php'); |
|
| 236 | + raler_fichier(_DIR_ETC.'cles.php'); |
|
| 237 | 237 | } |
| 238 | 238 | else { |
| 239 | - spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #' . implode(', #', $has_backup) . ' doit se connecter pour restaurer son backup des cles', 'auth' . _LOG_ERREUR); |
|
| 239 | + spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #'.implode(', #', $has_backup).' doit se connecter pour restaurer son backup des cles', 'auth'._LOG_ERREUR); |
|
| 240 | 240 | } |
| 241 | 241 | return false; |
| 242 | 242 | } |
@@ -253,8 +253,8 @@ discard block |
||
| 253 | 253 | $flux['data'] .= |
| 254 | 254 | '<script type="text/javascript">/*<![CDATA[*/' |
| 255 | 255 | . "$js\n" |
| 256 | - . "var login_info={'login':'" . $flux['args']['contexte']['var_login'] . "'," |
|
| 257 | - . "'page_auteur': '" . generer_url_public('informer_auteur') . "'," |
|
| 256 | + . "var login_info={'login':'".$flux['args']['contexte']['var_login']."'," |
|
| 257 | + . "'page_auteur': '".generer_url_public('informer_auteur')."'," |
|
| 258 | 258 | . "'informe_auteur_en_cours':false," |
| 259 | 259 | . "'attente_informe':0};" |
| 260 | 260 | . "jQuery(function(){jQuery('#var_login').change(actualise_auteur);});" |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | } else { |
| 295 | 295 | $n = sql_countsel( |
| 296 | 296 | 'spip_auteurs', |
| 297 | - 'login=' . sql_quote($new_login) . ' AND id_auteur!=' . (int) $id_auteur . " AND statut!='5poubelle'", |
|
| 297 | + 'login='.sql_quote($new_login).' AND id_auteur!='.(int) $id_auteur." AND statut!='5poubelle'", |
|
| 298 | 298 | '', |
| 299 | 299 | '', |
| 300 | 300 | $serveur |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | } |
| 323 | 323 | if ( |
| 324 | 324 | !($id_auteur = (int) $id_auteur) |
| 325 | - || !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur, '', '', '', '', $serveur) |
|
| 325 | + || !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.(int) $id_auteur, '', '', '', '', $serveur) |
|
| 326 | 326 | ) { |
| 327 | 327 | return false; |
| 328 | 328 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | $anciens = sql_allfetsel( |
| 338 | 338 | 'id_auteur', |
| 339 | 339 | 'spip_auteurs', |
| 340 | - 'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'", |
|
| 340 | + 'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'", |
|
| 341 | 341 | '', |
| 342 | 342 | '', |
| 343 | 343 | '', |
@@ -371,8 +371,8 @@ discard block |
||
| 371 | 371 | $r = sql_getfetsel( |
| 372 | 372 | 'login', |
| 373 | 373 | 'spip_auteurs', |
| 374 | - "statut<>'5poubelle'" . |
|
| 375 | - ' AND (length(pass)>0)' . |
|
| 374 | + "statut<>'5poubelle'". |
|
| 375 | + ' AND (length(pass)>0)'. |
|
| 376 | 376 | " AND (login=$l)", |
| 377 | 377 | '', |
| 378 | 378 | '', |
@@ -391,8 +391,8 @@ discard block |
||
| 391 | 391 | return sql_getfetsel( |
| 392 | 392 | 'login', |
| 393 | 393 | 'spip_auteurs', |
| 394 | - "statut<>'5poubelle'" . |
|
| 395 | - ' AND (length(pass)>0)' . |
|
| 394 | + "statut<>'5poubelle'". |
|
| 395 | + ' AND (length(pass)>0)'. |
|
| 396 | 396 | " AND (login<>'' AND (nom=$l OR email=$l))", |
| 397 | 397 | '', |
| 398 | 398 | '', |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | |
| 459 | 459 | if ( |
| 460 | 460 | !($id_auteur = (int) $id_auteur) |
| 461 | - || !($auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur, '', '', '', '', $serveur)) |
|
| 461 | + || !($auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur='.(int) $id_auteur, '', '', '', '', $serveur)) |
|
| 462 | 462 | ) { |
| 463 | 463 | return false; |
| 464 | 464 | } |
@@ -515,8 +515,8 @@ discard block |
||
| 515 | 515 | if ( |
| 516 | 516 | isset($champs['login']) || isset($champs['pass']) || isset($champs['statut']) || isset($options['all']) && $options['all'] |
| 517 | 517 | ) { |
| 518 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 519 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 518 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 519 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 520 | 520 | |
| 521 | 521 | // Cette variable de configuration peut etre posee par un plugin |
| 522 | 522 | // par exemple acces_restreint ; |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | (!isset($GLOBALS['meta']['creer_htpasswd']) || $GLOBALS['meta']['creer_htpasswd'] != 'oui') && !@file_exists($htaccess) |
| 526 | 526 | ) { |
| 527 | 527 | spip_unlink($htpasswd); |
| 528 | - spip_unlink($htpasswd . '-admin'); |
|
| 528 | + spip_unlink($htpasswd.'-admin'); |
|
| 529 | 529 | |
| 530 | 530 | return; |
| 531 | 531 | } |
@@ -543,16 +543,16 @@ discard block |
||
| 543 | 543 | ); |
| 544 | 544 | while ($t = sql_fetch($s)) { |
| 545 | 545 | if (strlen((string) $t['login']) && strlen((string) $t['htpass'])) { |
| 546 | - $p1 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 546 | + $p1 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 547 | 547 | if ($t['statut'] == '0minirezo') { |
| 548 | - $p2 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 548 | + $p2 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | } |
| 552 | 552 | sql_free($s); |
| 553 | 553 | if ($p1) { |
| 554 | 554 | ecrire_fichier($htpasswd, $p1); |
| 555 | - ecrire_fichier($htpasswd . '-admin', $p2); |
|
| 555 | + ecrire_fichier($htpasswd.'-admin', $p2); |
|
| 556 | 556 | spip_log("Ecriture de $htpasswd et $htpasswd-admin"); |
| 557 | 557 | } |
| 558 | 558 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | function inc_sql_to_array_dist($data) { |
| 121 | 121 | # sortir le connecteur de $data |
| 122 | 122 | preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v); |
| 123 | - $serveur = (string)$v[1]; |
|
| 123 | + $serveur = (string) $v[1]; |
|
| 124 | 124 | $req = trim($v[2]); |
| 125 | 125 | if ($s = sql_query($req, $serveur)) { |
| 126 | 126 | $r = []; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $json = json_decode($data, true, 512, JSON_THROW_ON_ERROR); |
| 146 | 146 | } catch (JsonException $e) { |
| 147 | 147 | $json = null; |
| 148 | - spip_log('Failed to parse Json data : ' . $e->getMessage(), _LOG_INFO); |
|
| 148 | + spip_log('Failed to parse Json data : '.$e->getMessage(), _LOG_INFO); |
|
| 149 | 149 | } |
| 150 | 150 | return is_array($json) ? (array) $json : []; |
| 151 | 151 | } |
@@ -165,13 +165,13 @@ discard block |
||
| 165 | 165 | $i = 1; |
| 166 | 166 | foreach ($entete as $k => $v) { |
| 167 | 167 | if (trim((string) $v) == '') { |
| 168 | - $v = 'col' . $i; |
|
| 168 | + $v = 'col'.$i; |
|
| 169 | 169 | } // reperer des eventuelles cases vides |
| 170 | 170 | if (is_numeric($v) && $v < 0) { |
| 171 | - $v = '__' . $v; |
|
| 171 | + $v = '__'.$v; |
|
| 172 | 172 | } // ne pas risquer d'ecraser une cle numerique |
| 173 | 173 | if (is_numeric($v)) { |
| 174 | - $v = '_' . $v; |
|
| 174 | + $v = '_'.$v; |
|
| 175 | 175 | } // ne pas risquer d'ecraser une cle numerique |
| 176 | 176 | $v = strtolower(preg_replace(',\W+,', '_', (string) translitteration($v))); |
| 177 | 177 | foreach ($csv as &$item) { |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | * @return array|bool |
| 258 | 258 | */ |
| 259 | 259 | function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) { |
| 260 | - return (array)preg_files($dir, $regexp, $limit); |
|
| 260 | + return (array) preg_files($dir, $regexp, $limit); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /** |
@@ -272,13 +272,13 @@ discard block |
||
| 272 | 272 | $glob_to_array = charger_fonction('glob_to_array', 'inc'); |
| 273 | 273 | $a = $glob_to_array($data); |
| 274 | 274 | foreach ($a as &$v) { |
| 275 | - $b = (array)@stat($v); |
|
| 275 | + $b = (array) @stat($v); |
|
| 276 | 276 | foreach (array_keys($b) as $k) { |
| 277 | 277 | if (is_numeric($k)) { |
| 278 | 278 | unset($b[$k]); |
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | - $b['file'] = preg_replace('`/$`', '', (string) $v) ; |
|
| 281 | + $b['file'] = preg_replace('`/$`', '', (string) $v); |
|
| 282 | 282 | $v = array_merge( |
| 283 | 283 | pathinfo((string) $v), |
| 284 | 284 | $b |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | $xml_array = []; |
| 299 | 299 | for ($object->rewind(); $object->valid(); $object->next()) { |
| 300 | 300 | if (array_key_exists($key = $object->key(), $xml_array)) { |
| 301 | - $key .= '-' . uniqid(); |
|
| 301 | + $key .= '-'.uniqid(); |
|
| 302 | 302 | } |
| 303 | 303 | $vars = get_object_vars($object->current()); |
| 304 | 304 | if (isset($vars['@attributes'])) { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - return $x . $texte; |
|
| 66 | + return $x.$texte; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | if (!str_contains(substr($texte, 0, $pos), '<!-- insert_head -->')) { |
| 179 | - $insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n"; |
|
| 179 | + $insert = "\n".pipeline('insert_head', '<!-- f_insert_head -->')."\n"; |
|
| 180 | 180 | $texte = substr_replace($texte, $insert, $pos, 0); |
| 181 | 181 | } |
| 182 | 182 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } |
| 209 | 209 | $texte = substr_replace($texte, $x, $pos, 0); |
| 210 | 210 | // pas de preview en fenetre enfant |
| 211 | - $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes((string) $GLOBALS['meta']['adresse_site']) . "';}</script>"; |
|
| 211 | + $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes((string) $GLOBALS['meta']['adresse_site'])."';}</script>"; |
|
| 212 | 212 | if (!$pos = stripos($texte, '<head') || !$pos = strpos($texte, '>', $pos)) { |
| 213 | 213 | $pos = -1; |
| 214 | 214 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | // inserer avant le </body> fermant si on peut, a la fin de la page sinon |
| 281 | 281 | if (($p = strpos($texte, '</body>')) !== false) { |
| 282 | - $texte = substr($texte, 0, $p) . $code . substr($texte, $p); |
|
| 282 | + $texte = substr($texte, 0, $p).$code.substr($texte, $p); |
|
| 283 | 283 | } else { |
| 284 | 284 | $texte .= $code; |
| 285 | 285 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $champ = preg_replace(',[\s]+,ms', ' ', $champ); |
| 38 | 38 | $champ = str_replace('"', '""', $champ); |
| 39 | 39 | |
| 40 | - return '"' . $champ . '"'; |
|
| 40 | + return '"'.$champ.'"'; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | if ($callback) { |
| 58 | 58 | $ligne = $callback($nb, $ligne, $delim, $importer_charset); |
| 59 | 59 | } |
| 60 | - $output = implode($delim, array_map('exporter_csv_champ', $ligne)) . "\r\n"; |
|
| 60 | + $output = implode($delim, array_map('exporter_csv_champ', $ligne))."\r\n"; |
|
| 61 | 61 | if ($importer_charset) { |
| 62 | 62 | $output = str_replace('’', '\'', $output); |
| 63 | 63 | $output = unicode2charset(html2unicode(charset2unicode($output)), $importer_charset); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $fichier = 'php://output'; |
| 185 | 185 | } |
| 186 | 186 | else { |
| 187 | - $fichier = sous_repertoire(_DIR_CACHE, 'export') . $basename; |
|
| 187 | + $fichier = sous_repertoire(_DIR_CACHE, 'export').$basename; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | $fp = fopen($fichier, 'w'); |
@@ -78,20 +78,20 @@ discard block |
||
| 78 | 78 | || ( |
| 79 | 79 | !empty($_SERVER['SERVER_SOFTWARE']) |
| 80 | 80 | && _SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE |
| 81 | - && preg_match('/' . _SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE . '/i', (string) $_SERVER['SERVER_SOFTWARE']) |
|
| 81 | + && preg_match('/'._SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE.'/i', (string) $_SERVER['SERVER_SOFTWARE']) |
|
| 82 | 82 | || !empty($_SERVER['SERVER_SIGNATURE']) |
| 83 | 83 | && _SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE |
| 84 | - && preg_match('/' . _SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE . '/i', (string) $_SERVER['SERVER_SIGNATURE']) |
|
| 84 | + && preg_match('/'._SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE.'/i', (string) $_SERVER['SERVER_SIGNATURE']) |
|
| 85 | 85 | || function_exists('apache_getenv') |
| 86 | 86 | || defined('_SERVER_APACHE') |
| 87 | 87 | ) |
| 88 | 88 | ) { |
| 89 | - @header('Location: ' . $url); |
|
| 89 | + @header('Location: '.$url); |
|
| 90 | 90 | $equiv = ''; |
| 91 | 91 | } else { |
| 92 | - @header('Refresh: 0; url=' . $url); |
|
| 92 | + @header('Refresh: 0; url='.$url); |
|
| 93 | 93 | if (isset($GLOBALS['meta']['charset'])) { |
| 94 | - @header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']); |
|
| 94 | + @header('Content-Type: text/html; charset='.$GLOBALS['meta']['charset']); |
|
| 95 | 95 | } |
| 96 | 96 | $equiv = "<meta http-equiv='Refresh' content='0; url=$url'>"; |
| 97 | 97 | } |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | html_lang_attributes(), ' |
| 104 | 104 | <head>', |
| 105 | 105 | $equiv, ' |
| 106 | -<title>HTTP ' . $status . '</title> |
|
| 107 | -' . ((isset($GLOBALS['meta']['charset'])) ? '<meta http-equiv="Content-Type" content="text/html;charset=' . $GLOBALS['meta']['charset'] . '">' : '') . ' |
|
| 106 | +<title>HTTP ' . $status.'</title> |
|
| 107 | +' . ((isset($GLOBALS['meta']['charset'])) ? '<meta http-equiv="Content-Type" content="text/html;charset='.$GLOBALS['meta']['charset'].'">' : '').' |
|
| 108 | 108 | </head> |
| 109 | 109 | <body> |
| 110 | -<h1>HTTP ' . $status . '</h1> |
|
| 110 | +<h1>HTTP ' . $status.'</h1> |
|
| 111 | 111 | <a href="', |
| 112 | 112 | quote_amp($url), |
| 113 | 113 | '">', |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | # en theorie on devrait faire ca tout le temps, mais quand la chaine |
| 143 | 143 | # commence par ? c'est imperatif, sinon l'url finale n'est pas la bonne |
| 144 | 144 | if ($url[0] == '?') { |
| 145 | - $url = url_de_base() . $url; |
|
| 145 | + $url = url_de_base().$url; |
|
| 146 | 146 | } |
| 147 | 147 | $url = str_replace('&', '&', (string) $url); |
| 148 | 148 | spip_log("redirige formulaire ajax: $url"); |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | if ($format == 'ajaxform') { |
| 151 | 151 | return [ |
| 152 | 152 | // on renvoie un lien masque qui sera traite par ajaxCallback.js |
| 153 | - '<a href="' . quote_amp($url) . '" name="ajax_redirect" style="display:none;">' . _T('navigateur_pas_redirige') . '</a>', |
|
| 153 | + '<a href="'.quote_amp($url).'" name="ajax_redirect" style="display:none;">'._T('navigateur_pas_redirige').'</a>', |
|
| 154 | 154 | // et un message au cas ou |
| 155 | - '<br /><a href="' . quote_amp($url) . '">' . _T('navigateur_pas_redirige') . '</a>' |
|
| 155 | + '<br /><a href="'.quote_amp($url).'">'._T('navigateur_pas_redirige').'</a>' |
|
| 156 | 156 | ]; |
| 157 | 157 | } else // format message texte, tout en js inline |
| 158 | 158 | { |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | "<script type='text/javascript'>if (parent.window){parent.window.document.location.replace(\"$url\");} else {document.location.replace(\"$url\");}</script>" |
| 162 | 162 | . http_img_pack('loader.svg', '', " class='loader'") |
| 163 | 163 | . '<br />' |
| 164 | - . '<a href="' . quote_amp($url) . '">' . _T('navigateur_pas_redirige') . '</a>'; |
|
| 164 | + . '<a href="'.quote_amp($url).'">'._T('navigateur_pas_redirige').'</a>'; |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | header("Content-Type: text/html; charset=$charset"); |
| 221 | 221 | header('Expires: 0'); |
| 222 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); |
|
| 222 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
|
| 223 | 223 | header('Cache-Control: no-cache, must-revalidate'); |
| 224 | 224 | header('Pragma: no-cache'); |
| 225 | 225 | } |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | function changer_langue($lang, $liste_langues = null) { |
| 40 | 40 | |
| 41 | 41 | if (is_null($liste_langues)) { |
| 42 | - $liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '') . ',' . ($GLOBALS['meta']['langues_multilingue'] ?? ''); |
|
| 42 | + $liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '').','.($GLOBALS['meta']['langues_multilingue'] ?? ''); |
|
| 43 | 43 | } else { |
| 44 | 44 | if (is_array($liste_langues)) { |
| 45 | 45 | $liste_langues = implode(',', $liste_langues); |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | - $liste_langues = ',' . $liste_langues . ','; |
|
| 48 | + $liste_langues = ','.$liste_langues.','; |
|
| 49 | 49 | |
| 50 | 50 | // Si la langue demandee n'existe pas, on essaie d'autres variantes |
| 51 | 51 | // Exemple : 'pt-br' => 'pt_br' => 'pt' |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | } |
| 191 | 191 | foreach ($langues as $l) { |
| 192 | 192 | $selected = ($l == $default) ? ' selected=\'selected\'' : ''; |
| 193 | - $ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n"; |
|
| 193 | + $ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n"; |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | if (!test_espace_prive()) { |
@@ -208,21 +208,20 @@ discard block |
||
| 208 | 208 | $base, |
| 209 | 209 | $cible, |
| 210 | 210 | (select_langues($nom_select, $change, $ret) |
| 211 | - . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"), |
|
| 211 | + . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"), |
|
| 212 | 212 | " method='post'" |
| 213 | 213 | ); |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | function select_langues($nom_select, $change, $options, $label = '') { |
| 217 | 217 | static $cpt = 0; |
| 218 | - $id = 'menu_langues' . $cpt++; |
|
| 218 | + $id = 'menu_langues'.$cpt++; |
|
| 219 | 219 | |
| 220 | 220 | return |
| 221 | - "<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' . |
|
| 221 | + "<label for='$id'>".($label ?: _T('info_langues')).'</label> '. |
|
| 222 | 222 | "<select name='$nom_select' id='$id' " |
| 223 | 223 | . ((test_espace_prive()) ? |
| 224 | - (($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) : |
|
| 225 | - ("class='forml menu_langues'")) |
|
| 224 | + (($nom_select == 'var_lang_ecrire' ? "class='lang_ecrire'" : "class='fondl'")) : ("class='forml menu_langues'")) |
|
| 226 | 225 | . $change |
| 227 | 226 | . ">\n" |
| 228 | 227 | . $options |
@@ -345,7 +344,7 @@ discard block |
||
| 345 | 344 | isset($GLOBALS['meta']['langue_site']) |
| 346 | 345 | && (!isset($GLOBALS['spip_lang']) || $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site']) |
| 347 | 346 | ) { |
| 348 | - return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install |
|
| 347 | + return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install |
|
| 349 | 348 | } |
| 350 | 349 | // en theorie là, la globale est définie, sinon c'est un problème. |
| 351 | 350 | if (!isset($GLOBALS['spip_lang'])) { |
@@ -457,7 +456,7 @@ discard block |
||
| 457 | 456 | if (!isset($GLOBALS['meta']['langue_site'])) { |
| 458 | 457 | // Initialisation : le francais si dispo, sinon la premiere langue trouvee |
| 459 | 458 | $GLOBALS['meta']['langue_site'] = $tout = |
| 460 | - (!$all_langs || str_contains(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,")) |
|
| 459 | + (!$all_langs || str_contains(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,")) |
|
| 461 | 460 | ? _LANGUE_PAR_DEFAUT |
| 462 | 461 | : substr((string) $all_langs, 0, strpos((string) $all_langs, ',')); |
| 463 | 462 | ecrire_meta('langue_site', $tout); |
@@ -35,15 +35,15 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | // Regarder dans le repertoire local des images TeX et blocs MathML |
| 38 | - if (!@is_dir($dir_tex = _DIR_VAR . 'cache-TeX/')) { |
|
| 38 | + if (!@is_dir($dir_tex = _DIR_VAR.'cache-TeX/')) { |
|
| 39 | 39 | @mkdir($dir_tex, _SPIP_CHMOD); |
| 40 | 40 | } |
| 41 | - $fichier = $dir_tex . md5(trim((string) $tex)) . $ext; |
|
| 41 | + $fichier = $dir_tex.md5(trim((string) $tex)).$ext; |
|
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | // Aller chercher l'image sur le serveur |
| 45 | 45 | if (!@file_exists($fichier) && $server) { |
| 46 | - spip_log($url = $server . '?' . rawurlencode((string) $tex)); |
|
| 46 | + spip_log($url = $server.'?'.rawurlencode((string) $tex)); |
|
| 47 | 47 | include_spip('inc/distant'); |
| 48 | 48 | recuperer_url($url, ['file' => $fichier]); |
| 49 | 49 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | return implode('', file($fichier)); |
| 58 | 58 | } // TeX |
| 59 | 59 | else { |
| 60 | - [, , , $size] = @spip_getimagesize($fichier); |
|
| 60 | + [,,, $size] = @spip_getimagesize($fichier); |
|
| 61 | 61 | $alt = "alt=\"$tex\" title=\"$tex\""; |
| 62 | 62 | |
| 63 | 63 | return "<img src=\"$fichier\" style=\"vertical-align:middle;\" $size $alt />"; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | if ($defaire_amp) { |
| 125 | 125 | $expression = str_replace('&', '&', $expression); |
| 126 | 126 | } |
| 127 | - $echap = "\n<p class=\"spip\" style=\"text-align: center;\">" . produire_image_math($expression) . "</p>\n"; |
|
| 127 | + $echap = "\n<p class=\"spip\" style=\"text-align: center;\">".produire_image_math($expression)."</p>\n"; |
|
| 128 | 128 | $pos = strpos($texte_milieu, (string) $regs[0]); |
| 129 | 129 | $texte_milieu = substr($texte_milieu, 0, $pos) |
| 130 | 130 | . code_echappement($echap, $source) |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | . substr($texte_milieu, $pos + strlen($regs[0])); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $texte_a_voir = $texte_debut . $texte_milieu . $texte_fin; |
|
| 147 | + $texte_a_voir = $texte_debut.$texte_milieu.$texte_fin; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | return $texte_a_voir; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // Appels incomplets (sans $c) |
| 114 | 114 | if (!is_array($c)) { |
| 115 | - spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c'); |
|
| 115 | + spip_log('erreur appel objet_modifier_champs('.$objet.'), manque $c'); |
|
| 116 | 116 | |
| 117 | 117 | return _T('erreur_technique_enregistrement_impossible'); |
| 118 | 118 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $champs = array_map('corriger_caracteres', $champs); |
| 148 | 148 | |
| 149 | 149 | // On récupère l'état avant toute modification |
| 150 | - $row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet); |
|
| 150 | + $row = sql_fetsel('*', $spip_table_objet, $id_table_objet.'='.$id_objet); |
|
| 151 | 151 | |
| 152 | 152 | // Envoyer aux plugins |
| 153 | 153 | $champs = pipeline( |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $id_rubrique = 0; |
| 203 | 203 | if (isset($desc['field']['id_rubrique'])) { |
| 204 | 204 | $parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique'; |
| 205 | - $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . (int) $id_objet); |
|
| 205 | + $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=".(int) $id_objet); |
|
| 206 | 206 | } |
| 207 | 207 | $instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action'); |
| 208 | 208 | $champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur); |
@@ -223,13 +223,13 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | // allez on commit la modif |
| 226 | - sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . (int) $id_objet, [], $serveur); |
|
| 226 | + sql_updateq($spip_table_objet, $champs, "$id_table_objet=".(int) $id_objet, [], $serveur); |
|
| 227 | 227 | |
| 228 | 228 | // on verifie si elle est bien passee |
| 229 | 229 | $moof = sql_fetsel( |
| 230 | 230 | array_keys($champs), |
| 231 | 231 | $spip_table_objet, |
| 232 | - "$id_table_objet=" . (int) $id_objet, |
|
| 232 | + "$id_table_objet=".(int) $id_objet, |
|
| 233 | 233 | [], |
| 234 | 234 | [], |
| 235 | 235 | '', |
@@ -265,13 +265,13 @@ discard block |
||
| 265 | 265 | // c'est un cas exceptionnel |
| 266 | 266 | if ($liste !== []) { |
| 267 | 267 | spip_log( |
| 268 | - "Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true), |
|
| 269 | - 'modifier.' . _LOG_CRITIQUE |
|
| 268 | + "Erreur enregistrement en base $objet/$id_objet champs :".var_export($conflits, true), |
|
| 269 | + 'modifier.'._LOG_CRITIQUE |
|
| 270 | 270 | ); |
| 271 | 271 | |
| 272 | 272 | return _T( |
| 273 | 273 | 'erreur_technique_enregistrement_champs', |
| 274 | - ['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"] |
|
| 274 | + ['champs' => "<i>'".implode("'</i>,<i>'", $liste)."'</i>"] |
|
| 275 | 275 | ); |
| 276 | 276 | } |
| 277 | 277 | } |
@@ -333,18 +333,18 @@ discard block |
||
| 333 | 333 | include_spip('inc/filtres_mini'); |
| 334 | 334 | $qui = ''; |
| 335 | 335 | if (!empty($GLOBALS['visiteur_session']['id_auteur'])) { |
| 336 | - $qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#'; |
|
| 336 | + $qui .= ' #id_auteur:'.$GLOBALS['visiteur_session']['id_auteur'].'#'; |
|
| 337 | 337 | } |
| 338 | 338 | if (!empty($GLOBALS['visiteur_session']['nom'])) { |
| 339 | - $qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#'; |
|
| 339 | + $qui .= ' #nom:'.$GLOBALS['visiteur_session']['nom'].'#'; |
|
| 340 | 340 | } |
| 341 | 341 | if ($qui == '') { |
| 342 | - $qui = '#ip:' . $GLOBALS['ip'] . '#'; |
|
| 342 | + $qui = '#ip:'.$GLOBALS['ip'].'#'; |
|
| 343 | 343 | } |
| 344 | - journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . implode( |
|
| 344 | + journal(_L($qui.' a édité '.$objet.' '.$id_objet.' ('.implode( |
|
| 345 | 345 | '+', |
| 346 | 346 | array_diff(array_keys($champs), ['date_modif']) |
| 347 | - ) . ')'), [ |
|
| 347 | + ).')'), [ |
|
| 348 | 348 | 'faire' => 'modifier', |
| 349 | 349 | 'quoi' => $objet, |
| 350 | 350 | 'id' => $id_objet |