@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | function generer_nom_fichier_cache($contexte, $page) { |
| 30 | 30 | $u = md5(var_export([$contexte, $page], true)); |
| 31 | 31 | |
| 32 | - return $u . '.cache'; |
|
| 32 | + return $u.'.cache'; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | else { |
| 63 | 63 | // en lecture on essaye pas de creer les repertoires, on va au plus vite |
| 64 | - $rep = _DIR_CACHE . "calcul/$d/"; |
|
| 64 | + $rep = _DIR_CACHE."calcul/$d/"; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - return $rep . $u . '.cache'; |
|
| 67 | + return $rep.$u.'.cache'; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | ); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - return crc32($GLOBALS['meta']['cache_signature'] . $page['texte']); |
|
| 118 | + return crc32($GLOBALS['meta']['cache_signature'].$page['texte']); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | // "cache sessionne" ; sa date indique la date de validite |
| 272 | 272 | // des caches sessionnes |
| 273 | 273 | if (!$tmp = lire_cache($chemin_cache)) { |
| 274 | - spip_log('Creation cache sessionne ' . $chemin_cache); |
|
| 274 | + spip_log('Creation cache sessionne '.$chemin_cache); |
|
| 275 | 275 | $tmp = [ |
| 276 | 276 | 'invalideurs' => ['session' => ''], |
| 277 | 277 | 'lastmodified' => $_SERVER['REQUEST_TIME'] |
@@ -297,8 +297,8 @@ discard block |
||
| 297 | 297 | // l'enregistrer, compresse ou non... |
| 298 | 298 | $ok = ecrire_cache($chemin_cache, $pagez); |
| 299 | 299 | |
| 300 | - spip_log((_IS_BOT ? 'Bot:' : '') . "Creation du cache $chemin_cache pour " |
|
| 301 | - . $page['entetes']['X-Spip-Cache'] . ' secondes' . ($ok ? '' : ' (erreur!)'), _LOG_INFO); |
|
| 300 | + spip_log((_IS_BOT ? 'Bot:' : '')."Creation du cache $chemin_cache pour " |
|
| 301 | + . $page['entetes']['X-Spip-Cache'].' secondes'.($ok ? '' : ' (erreur!)'), _LOG_INFO); |
|
| 302 | 302 | |
| 303 | 303 | // Inserer ses invalideurs |
| 304 | 304 | include_spip('inc/invalideur'); |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | function nettoyer_petit_cache($prefix, $duree = 300) { |
| 320 | 320 | // determiner le repertoire a purger : 'tmp/CACHE/rech/' |
| 321 | 321 | $dircache = sous_repertoire(_DIR_CACHE, $prefix); |
| 322 | - if (spip_touch($dircache . 'purger_' . $prefix, $duree, true)) { |
|
| 322 | + if (spip_touch($dircache.'purger_'.$prefix, $duree, true)) { |
|
| 323 | 323 | foreach (preg_files($dircache, '[.]txt$') as $f) { |
| 324 | 324 | if ($_SERVER['REQUEST_TIME'] - (@file_exists($f) ? @filemtime($f) : 0) > $duree) { |
| 325 | 325 | spip_unlink($f); |
@@ -414,9 +414,9 @@ discard block |
||
| 414 | 414 | if (spip_connect()) { |
| 415 | 415 | include_spip('inc/invalideur'); |
| 416 | 416 | retire_caches($chemin_cache); # API invalideur inutile |
| 417 | - supprimer_fichier(_DIR_CACHE . $chemin_cache); |
|
| 417 | + supprimer_fichier(_DIR_CACHE.$chemin_cache); |
|
| 418 | 418 | if (isset($chemin_cache_session) and $chemin_cache_session) { |
| 419 | - supprimer_fichier(_DIR_CACHE . $chemin_cache_session); |
|
| 419 | + supprimer_fichier(_DIR_CACHE.$chemin_cache_session); |
|
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | 422 | } |
@@ -433,9 +433,9 @@ discard block |
||
| 433 | 433 | $page = ['contexte_implicite' => $contexte_implicite]; // ignorer le cache deja lu |
| 434 | 434 | include_spip('inc/invalideur'); |
| 435 | 435 | retire_caches($chemin_cache); # API invalideur inutile |
| 436 | - supprimer_fichier(_DIR_CACHE . $chemin_cache); |
|
| 436 | + supprimer_fichier(_DIR_CACHE.$chemin_cache); |
|
| 437 | 437 | if (isset($chemin_cache_session) and $chemin_cache_session) { |
| 438 | - supprimer_fichier(_DIR_CACHE . $chemin_cache_session); |
|
| 438 | + supprimer_fichier(_DIR_CACHE.$chemin_cache_session); |
|
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | |
@@ -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 |
@@ -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 | } |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | // de connexion, et tout risque d'ambiguite |
| 91 | 91 | if (!isset($nom_cache_desc_sql[$serveur][$objets_sql])) { |
| 92 | 92 | $nom_cache_desc_sql[$serveur][$objets_sql] = |
| 93 | - _DIR_CACHE . 'sql_desc_' |
|
| 93 | + _DIR_CACHE.'sql_desc_' |
|
| 94 | 94 | . ($serveur ? "{$serveur}_" : '') |
| 95 | - . substr(md5($connexion['db'] . ':' . $connexion['prefixe'] . ":$objets_sql"), 0, 8) |
|
| 95 | + . substr(md5($connexion['db'].':'.$connexion['prefixe'].":$objets_sql"), 0, 8) |
|
| 96 | 96 | . '.txt'; |
| 97 | 97 | // nouveau nom de cache = nouvelle version en memoire |
| 98 | 98 | unset($connexion['tables']); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | if ($connexion['spip_connect_version']) { |
| 121 | 121 | if ($table_spip and isset($GLOBALS['table_des_tables'][$nom])) { |
| 122 | 122 | $nom = $GLOBALS['table_des_tables'][$nom]; |
| 123 | - $nom_sql = 'spip_' . $nom; |
|
| 123 | + $nom_sql = 'spip_'.$nom; |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | // meme si pas d'abreviation declaree, trouver la table spip_$nom |
| 148 | 148 | // si c'est une table principale, |
| 149 | 149 | // puisqu'on le fait aussi pour les tables auxiliaires |
| 150 | - elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_' . $nom])) { |
|
| 151 | - $nom_sql = 'spip_' . $nom; |
|
| 150 | + elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_'.$nom])) { |
|
| 151 | + $nom_sql = 'spip_'.$nom; |
|
| 152 | 152 | $fdesc = &$GLOBALS['tables_principales'][$nom_sql]; |
| 153 | 153 | } elseif ( |
| 154 | 154 | isset($GLOBALS['tables_auxiliaires'][$n = $nom]) |
| 155 | - or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_' . $nom]) |
|
| 155 | + or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_'.$nom]) |
|
| 156 | 156 | ) { |
| 157 | 157 | $nom_sql = $n; |
| 158 | 158 | $fdesc = &$GLOBALS['tables_auxiliaires'][$n]; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | ) { |
| 169 | 169 | if (!$fdesc) { |
| 170 | 170 | $log_level = $options['log_missing'] ? _LOG_INFO_IMPORTANTE : _LOG_DEBUG; |
| 171 | - spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base' . $log_level); |
|
| 171 | + spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base'.$log_level); |
|
| 172 | 172 | |
| 173 | 173 | return null; |
| 174 | 174 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $desc['exist'] = true; |
| 181 | 181 | // gerer le cas des cles vides (echec de l'analyse sur une vue par exemple) |
| 182 | 182 | // pour recuperer la declaration de lister_tables_objets_sql() si il y en a une |
| 183 | - if (! $desc['key']) { |
|
| 183 | + if (!$desc['key']) { |
|
| 184 | 184 | spip_log("trouver_table: table sans cle '$serveur' '$nom'", 'base'); |
| 185 | 185 | unset($desc['key']); |
| 186 | 186 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | if (!isset($desc['key']) && !empty($fdesc['key'])) { |
| 198 | 198 | $desc['key'] = $fdesc['key']; |
| 199 | 199 | } |
| 200 | - if (! isset($desc['key'])) { |
|
| 200 | + if (!isset($desc['key'])) { |
|
| 201 | 201 | $desc['key'] = []; |
| 202 | 202 | } |
| 203 | 203 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | // donc si on est dans le public avec un cache on va perdre le dynamisme |
| 148 | 148 | // et on risque de mettre en cache les valeurs pre-remplies du formulaire |
| 149 | 149 | // on injecte donc le PHP qui va appeler la fonction pour generer le formulaire au lieu de directement la fonction |
| 150 | - $p->code = "'<'.'?php echo (" . texte_script($p->code) . "); ?'.'>'"; |
|
| 150 | + $p->code = "'<'.'?php echo (".texte_script($p->code)."); ?'.'>'"; |
|
| 151 | 151 | // dans l'espace prive on a pas de cache, donc pas de soucis (et un leak serait moins grave) |
| 152 | 152 | } |
| 153 | 153 | return $p; |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | foreach ($erreurs as $k => $v) { |
| 328 | 328 | if (is_string($v) and strlen(trim($v)) and strpos($k, '_') !== 0) { |
| 329 | 329 | // on encapsule dans un span car ces messages sont en general simple, juste du texte, et deja dans un span dans le form |
| 330 | - $valeurs['erreurs'][$k] = "<span role='alert'>" . $erreurs[$k] . '</span>'; |
|
| 330 | + $valeurs['erreurs'][$k] = "<span role='alert'>".$erreurs[$k].'</span>'; |
|
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | } |
@@ -975,9 +975,9 @@ |
||
| 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 | - $GLOBALS['table_des_traitements']['NOM']['spip_auteurs'] = 'safehtml(' . _TRAITEMENT_TYPO_SANS_NUMERO . ')'; |
|
| 980 | + $GLOBALS['table_des_traitements']['NOM']['spip_auteurs'] = 'safehtml('._TRAITEMENT_TYPO_SANS_NUMERO.')'; |
|
| 981 | 981 | $GLOBALS['table_des_traitements']['CHAPO'][] = _TRAITEMENT_RACCOURCIS; |
| 982 | 982 | $GLOBALS['table_des_traitements']['DATE'][] = 'normaliser_date(%s)'; |
| 983 | 983 | $GLOBALS['table_des_traitements']['DATE_REDAC'][] = 'normaliser_date(%s)'; |
@@ -64,27 +64,27 @@ discard block |
||
| 64 | 64 | // determiner le dossier de la base : $addr ou _DIR_DB |
| 65 | 65 | $f = _DIR_DB; |
| 66 | 66 | if ($addr and strpos($addr, '/') !== false) { |
| 67 | - $f = rtrim($addr, '/') . '/'; |
|
| 67 | + $f = rtrim($addr, '/').'/'; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // un nom de base demande et impossible d'obtenir la base, on s'en va : |
| 71 | 71 | // il faut que la base existe ou que le repertoire parent soit writable |
| 72 | - if ($db and !is_file($f .= $db . '.sqlite') and !is_writable(dirname($f))) { |
|
| 73 | - spip_log("base $f non trouvee ou droits en ecriture manquants", 'sqlite.' . _LOG_HS); |
|
| 72 | + if ($db and !is_file($f .= $db.'.sqlite') and !is_writable(dirname($f))) { |
|
| 73 | + spip_log("base $f non trouvee ou droits en ecriture manquants", 'sqlite.'._LOG_HS); |
|
| 74 | 74 | |
| 75 | 75 | return false; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // charger les modules sqlite au besoin |
| 79 | 79 | if (!_sqlite_charger_version($sqlite_version)) { |
| 80 | - spip_log("Impossible de trouver/charger le module SQLite ($sqlite_version)!", 'sqlite.' . _LOG_HS); |
|
| 80 | + spip_log("Impossible de trouver/charger le module SQLite ($sqlite_version)!", 'sqlite.'._LOG_HS); |
|
| 81 | 81 | |
| 82 | 82 | return false; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // chargement des constantes |
| 86 | 86 | // il ne faut pas definir les constantes avant d'avoir charge les modules sqlite |
| 87 | - $define = 'spip_sqlite' . $sqlite_version . '_constantes'; |
|
| 87 | + $define = 'spip_sqlite'.$sqlite_version.'_constantes'; |
|
| 88 | 88 | $define(); |
| 89 | 89 | |
| 90 | 90 | $ok = false; |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | // si pas de db -> |
| 93 | 93 | // base temporaire tant qu'on ne connait pas son vrai nom |
| 94 | 94 | // pour tester la connexion |
| 95 | - $db = '_sqlite' . $sqlite_version . '_install'; |
|
| 96 | - $tmp = _DIR_DB . $db . '.sqlite'; |
|
| 95 | + $db = '_sqlite'.$sqlite_version.'_install'; |
|
| 96 | + $tmp = _DIR_DB.$db.'.sqlite'; |
|
| 97 | 97 | $ok = $link = new \PDO("sqlite:$tmp"); |
| 98 | 98 | } else { |
| 99 | 99 | // Ouvrir (eventuellement creer la base) |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | if (!$ok) { |
| 104 | 104 | $e = _sqlite_last_error_from_link($link); |
| 105 | - spip_log("Impossible d'ouvrir la base SQLite($sqlite_version) $f : $e", 'sqlite.' . _LOG_HS); |
|
| 105 | + spip_log("Impossible d'ouvrir la base SQLite($sqlite_version) $f : $e", 'sqlite.'._LOG_HS); |
|
| 106 | 106 | |
| 107 | 107 | return false; |
| 108 | 108 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $table = $regs[3]; |
| 189 | 189 | $suite = $regs[4]; |
| 190 | 190 | } else { |
| 191 | - spip_log("SQLite : Probleme de ALTER TABLE mal forme dans $query", 'sqlite.' . _LOG_ERREUR); |
|
| 191 | + spip_log("SQLite : Probleme de ALTER TABLE mal forme dans $query", 'sqlite.'._LOG_ERREUR); |
|
| 192 | 192 | |
| 193 | 193 | return false; |
| 194 | 194 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $i = 0; |
| 206 | 206 | $ouverte = false; |
| 207 | 207 | while ($do = array_shift($todo)) { |
| 208 | - $todo2[$i] = isset($todo2[$i]) ? $todo2[$i] . ',' . $do : $do; |
|
| 208 | + $todo2[$i] = isset($todo2[$i]) ? $todo2[$i].','.$do : $do; |
|
| 209 | 209 | $o = (false !== strpos($do, '(')); |
| 210 | 210 | $f = (false !== strpos($do, ')')); |
| 211 | 211 | if ($o and !$f) { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | ) { |
| 232 | 232 | spip_log( |
| 233 | 233 | "SQLite : Probleme de ALTER TABLE, utilisation non reconnue dans : $do \n(requete d'origine : $query)", |
| 234 | - 'sqlite.' . _LOG_ERREUR |
|
| 234 | + 'sqlite.'._LOG_ERREUR |
|
| 235 | 235 | ); |
| 236 | 236 | |
| 237 | 237 | return false; |
@@ -327,10 +327,10 @@ discard block |
||
| 327 | 327 | |
| 328 | 328 | // pas geres en sqlite2 |
| 329 | 329 | case 'RENAME': |
| 330 | - $do = 'RENAME TO' . substr($do, 6); |
|
| 330 | + $do = 'RENAME TO'.substr($do, 6); |
|
| 331 | 331 | case 'RENAME TO': |
| 332 | 332 | if (!spip_sqlite::executer_requete("$debut $do", $serveur)) { |
| 333 | - spip_log("SQLite : Erreur ALTER TABLE / RENAME : $query", 'sqlite.' . _LOG_ERREUR); |
|
| 333 | + spip_log("SQLite : Erreur ALTER TABLE / RENAME : $query", 'sqlite.'._LOG_ERREUR); |
|
| 334 | 334 | |
| 335 | 335 | return false; |
| 336 | 336 | } |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | $colonnes = substr($colonne_origine, 1, -1); |
| 374 | 374 | if (false !== strpos(',', $colonnes)) { |
| 375 | 375 | spip_log('SQLite : Erreur, impossible de creer un index sur plusieurs colonnes' |
| 376 | - . " sans qu'il ait de nom ($table, ($colonnes))", 'sqlite.' . _LOG_ERREUR); |
|
| 376 | + . " sans qu'il ait de nom ($table, ($colonnes))", 'sqlite.'._LOG_ERREUR); |
|
| 377 | 377 | break; |
| 378 | 378 | } else { |
| 379 | 379 | $nom_index = $colonnes; |
@@ -388,12 +388,12 @@ discard block |
||
| 388 | 388 | |
| 389 | 389 | // pas geres en sqlite2 |
| 390 | 390 | case 'ADD COLUMN': |
| 391 | - $do = 'ADD' . substr($do, 10); |
|
| 391 | + $do = 'ADD'.substr($do, 10); |
|
| 392 | 392 | case 'ADD': |
| 393 | 393 | default: |
| 394 | 394 | if (!preg_match(',primary\s+key,i', $do)) { |
| 395 | 395 | if (!spip_sqlite::executer_requete("$debut $do", $serveur)) { |
| 396 | - spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.' . _LOG_ERREUR); |
|
| 396 | + spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.'._LOG_ERREUR); |
|
| 397 | 397 | |
| 398 | 398 | return false; |
| 399 | 399 | } |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | $opts['field'] = [$colonne_ajoutee => $def]; |
| 415 | 415 | if (!_sqlite_modifier_table($table, [$colonne_ajoutee], $opts, $serveur)) { |
| 416 | - spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.' . _LOG_ERREUR); |
|
| 416 | + spip_log("SQLite : Erreur ALTER TABLE / ADD : $query", 'sqlite.'._LOG_ERREUR); |
|
| 417 | 417 | |
| 418 | 418 | return false; |
| 419 | 419 | } |
@@ -421,10 +421,10 @@ discard block |
||
| 421 | 421 | break; |
| 422 | 422 | } |
| 423 | 423 | // tout est bon, ouf ! |
| 424 | - spip_log("SQLite ($serveur) : Changements OK : $debut $do", 'sqlite.' . _LOG_INFO); |
|
| 424 | + spip_log("SQLite ($serveur) : Changements OK : $debut $do", 'sqlite.'._LOG_INFO); |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | - spip_log("SQLite ($serveur) : fin ALTER TABLE OK !", 'sqlite.' . _LOG_INFO); |
|
| 427 | + spip_log("SQLite ($serveur) : fin ALTER TABLE OK !", 'sqlite.'._LOG_INFO); |
|
| 428 | 428 | |
| 429 | 429 | return true; |
| 430 | 430 | } |
@@ -493,9 +493,9 @@ discard block |
||
| 493 | 493 | * @return bool true si la base est créee. |
| 494 | 494 | **/ |
| 495 | 495 | function spip_sqlite_create_base($nom, $serveur = '', $option = true) { |
| 496 | - $f = $nom . '.sqlite'; |
|
| 496 | + $f = $nom.'.sqlite'; |
|
| 497 | 497 | if (strpos($nom, '/') === false) { |
| 498 | - $f = _DIR_DB . $f; |
|
| 498 | + $f = _DIR_DB.$f; |
|
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | $ok = new \PDO("sqlite:$f"); |
@@ -535,13 +535,13 @@ discard block |
||
| 535 | 535 | if (sql_showtable($nom, false, $serveur)) { |
| 536 | 536 | spip_log( |
| 537 | 537 | "Echec creation d'une vue sql ($nom) car celle-ci existe deja (serveur:$serveur)", |
| 538 | - 'sqlite.' . _LOG_ERREUR |
|
| 538 | + 'sqlite.'._LOG_ERREUR |
|
| 539 | 539 | ); |
| 540 | 540 | |
| 541 | 541 | return false; |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | - $query = "CREATE VIEW $nom AS " . $query_select; |
|
| 544 | + $query = "CREATE VIEW $nom AS ".$query_select; |
|
| 545 | 545 | |
| 546 | 546 | return spip_sqlite_query($query, $serveur, $requeter); |
| 547 | 547 | } |
@@ -567,8 +567,8 @@ discard block |
||
| 567 | 567 | function spip_sqlite_create_index($nom, $table, $champs, $unique = '', $serveur = '', $requeter = true) { |
| 568 | 568 | if (!($nom or $table or $champs)) { |
| 569 | 569 | spip_log( |
| 570 | - "Champ manquant pour creer un index sqlite ($nom, $table, (" . join(',', $champs) . '))', |
|
| 571 | - 'sqlite.' . _LOG_ERREUR |
|
| 570 | + "Champ manquant pour creer un index sqlite ($nom, $table, (".join(',', $champs).'))', |
|
| 571 | + 'sqlite.'._LOG_ERREUR |
|
| 572 | 572 | ); |
| 573 | 573 | |
| 574 | 574 | return false; |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | |
| 577 | 577 | // SQLite ne differentie pas noms des index en fonction des tables |
| 578 | 578 | // il faut donc creer des noms uniques d'index pour une base sqlite |
| 579 | - $nom = $table . '_' . $nom; |
|
| 579 | + $nom = $table.'_'.$nom; |
|
| 580 | 580 | // enlever d'eventuelles parentheses deja presentes sur champs |
| 581 | 581 | if (!is_array($champs)) { |
| 582 | 582 | if ($champs[0] == '(') { |
@@ -598,12 +598,12 @@ discard block |
||
| 598 | 598 | } else { |
| 599 | 599 | /* simuler le IF EXISTS - version 2 et sqlite < 3.3a */ |
| 600 | 600 | $a = spip_sqlite_showtable($table, $serveur); |
| 601 | - if (isset($a['key']['KEY ' . $nom])) { |
|
| 601 | + if (isset($a['key']['KEY '.$nom])) { |
|
| 602 | 602 | return true; |
| 603 | 603 | } |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | - $query = 'CREATE ' . ($unique ? 'UNIQUE ' : '') . "INDEX$ifnotexists $nom ON $table (" . join(',', $champs) . ')'; |
|
| 606 | + $query = 'CREATE '.($unique ? 'UNIQUE ' : '')."INDEX$ifnotexists $nom ON $table (".join(',', $champs).')'; |
|
| 607 | 607 | $res = spip_sqlite_query($query, $serveur, $requeter); |
| 608 | 608 | if (!$requeter) { |
| 609 | 609 | return $res; |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | $serveur = '', |
| 680 | 680 | $requeter = true |
| 681 | 681 | ) { |
| 682 | - $c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 682 | + $c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 683 | 683 | $r = spip_sqlite_select( |
| 684 | 684 | "COUNT($c)", |
| 685 | 685 | $from, |
@@ -788,14 +788,14 @@ discard block |
||
| 788 | 788 | */ |
| 789 | 789 | function spip_sqlite_drop_index($nom, $table, $serveur = '', $requeter = true) { |
| 790 | 790 | if (!($nom or $table)) { |
| 791 | - spip_log("Champ manquant pour supprimer un index sqlite ($nom, $table)", 'sqlite.' . _LOG_ERREUR); |
|
| 791 | + spip_log("Champ manquant pour supprimer un index sqlite ($nom, $table)", 'sqlite.'._LOG_ERREUR); |
|
| 792 | 792 | |
| 793 | 793 | return false; |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | // SQLite ne differentie pas noms des index en fonction des tables |
| 797 | 797 | // il faut donc creer des noms uniques d'index pour une base sqlite |
| 798 | - $index = $table . '_' . $nom; |
|
| 798 | + $index = $table.'_'.$nom; |
|
| 799 | 799 | $exist = ' IF EXISTS'; |
| 800 | 800 | |
| 801 | 801 | $query = "DROP INDEX$exist $index"; |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | if ($s) { |
| 828 | 828 | $trace = debug_backtrace(); |
| 829 | 829 | if ($trace[0]['function'] != 'spip_sqlite_error') { |
| 830 | - spip_log("$s - $query - " . sql_error_backtrace(), 'sqlite.' . _LOG_ERREUR); |
|
| 830 | + spip_log("$s - $query - ".sql_error_backtrace(), 'sqlite.'._LOG_ERREUR); |
|
| 831 | 831 | } |
| 832 | 832 | } |
| 833 | 833 | |
@@ -874,14 +874,14 @@ discard block |
||
| 874 | 874 | $t = $link->errorInfo(); |
| 875 | 875 | $s = ltrim($t[0], '0'); // 00000 si pas d'erreur |
| 876 | 876 | if ($s) { |
| 877 | - $s .= ' / ' . $t[1]; |
|
| 877 | + $s .= ' / '.$t[1]; |
|
| 878 | 878 | } // ajoute l'erreur du moteur SQLite |
| 879 | 879 | } else { |
| 880 | 880 | $s = ': aucune ressource sqlite (link)'; |
| 881 | 881 | } |
| 882 | 882 | |
| 883 | 883 | if ($s) { |
| 884 | - spip_log("Erreur sqlite $s", 'sqlite.' . _LOG_ERREUR); |
|
| 884 | + spip_log("Erreur sqlite $s", 'sqlite.'._LOG_ERREUR); |
|
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | return $s ? $s : 0; |
@@ -905,7 +905,7 @@ discard block |
||
| 905 | 905 | } |
| 906 | 906 | |
| 907 | 907 | $query = spip_sqlite::traduire_requete($query, $serveur); |
| 908 | - $query = 'EXPLAIN ' . $query; |
|
| 908 | + $query = 'EXPLAIN '.$query; |
|
| 909 | 909 | if (!$requeter) { |
| 910 | 910 | return $query; |
| 911 | 911 | } |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | **/ |
| 1067 | 1067 | function spip_sqlite_insert($table, $champs, $valeurs, $desc = [], $serveur = '', $requeter = true) { |
| 1068 | 1068 | |
| 1069 | - $query = "INSERT INTO $table " . ($champs ? "$champs VALUES $valeurs" : 'DEFAULT VALUES'); |
|
| 1069 | + $query = "INSERT INTO $table ".($champs ? "$champs VALUES $valeurs" : 'DEFAULT VALUES'); |
|
| 1070 | 1070 | if ($r = spip_sqlite_query($query, $serveur, $requeter)) { |
| 1071 | 1071 | if (!$requeter) { |
| 1072 | 1072 | return $r; |
@@ -1121,8 +1121,8 @@ discard block |
||
| 1121 | 1121 | |
| 1122 | 1122 | $cles = $valeurs = ''; |
| 1123 | 1123 | if (count($couples)) { |
| 1124 | - $cles = '(' . join(',', array_keys($couples)) . ')'; |
|
| 1125 | - $valeurs = '(' . join(',', $couples) . ')'; |
|
| 1124 | + $cles = '('.join(',', array_keys($couples)).')'; |
|
| 1125 | + $valeurs = '('.join(',', $couples).')'; |
|
| 1126 | 1126 | } |
| 1127 | 1127 | |
| 1128 | 1128 | return spip_sqlite_insert($table, $cles, $valeurs, $desc, $serveur, $requeter); |
@@ -1182,11 +1182,11 @@ discard block |
||
| 1182 | 1182 | |
| 1183 | 1183 | $champs = $valeurs = ''; |
| 1184 | 1184 | if (count($couples)) { |
| 1185 | - $champs = '(' . join(',', array_keys($couples)) . ')'; |
|
| 1186 | - $valeurs = '(' . join(',', $couples) . ')'; |
|
| 1187 | - $query = $query_start . "$champs VALUES $valeurs"; |
|
| 1185 | + $champs = '('.join(',', array_keys($couples)).')'; |
|
| 1186 | + $valeurs = '('.join(',', $couples).')'; |
|
| 1187 | + $query = $query_start."$champs VALUES $valeurs"; |
|
| 1188 | 1188 | } else { |
| 1189 | - $query = $query_start . 'DEFAULT VALUES'; |
|
| 1189 | + $query = $query_start.'DEFAULT VALUES'; |
|
| 1190 | 1190 | } |
| 1191 | 1191 | |
| 1192 | 1192 | if ($requeter) { |
@@ -1318,7 +1318,7 @@ discard block |
||
| 1318 | 1318 | * @return string Texte de sélection pour la requête |
| 1319 | 1319 | */ |
| 1320 | 1320 | function spip_sqlite_multi($objet, $lang) { |
| 1321 | - $r = 'EXTRAIRE_MULTI(' . $objet . ", '" . $lang . "') AS multi"; |
|
| 1321 | + $r = 'EXTRAIRE_MULTI('.$objet.", '".$lang."') AS multi"; |
|
| 1322 | 1322 | |
| 1323 | 1323 | return $r; |
| 1324 | 1324 | } |
@@ -1389,7 +1389,7 @@ discard block |
||
| 1389 | 1389 | function spip_sqlite_date_proche($champ, $interval, $unite) { |
| 1390 | 1390 | $op = (($interval <= 0) ? '>' : '<'); |
| 1391 | 1391 | |
| 1392 | - return "($champ $op datetime('" . date('Y-m-d H:i:s') . "', '$interval $unite'))"; |
|
| 1392 | + return "($champ $op datetime('".date('Y-m-d H:i:s')."', '$interval $unite'))"; |
|
| 1393 | 1393 | } |
| 1394 | 1394 | |
| 1395 | 1395 | |
@@ -1421,7 +1421,7 @@ discard block |
||
| 1421 | 1421 | and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c) |
| 1422 | 1422 | ) { |
| 1423 | 1423 | spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT ''", $serveur); |
| 1424 | - spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE); |
|
| 1424 | + spip_log("ALTER $q", 'repair'._LOG_INFO_IMPORTANTE); |
|
| 1425 | 1425 | } |
| 1426 | 1426 | if ( |
| 1427 | 1427 | preg_match(',^(INTEGER),i', $d) |
@@ -1431,7 +1431,7 @@ discard block |
||
| 1431 | 1431 | and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c) |
| 1432 | 1432 | ) { |
| 1433 | 1433 | spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT '0'", $serveur); |
| 1434 | - spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE); |
|
| 1434 | + spip_log("ALTER $q", 'repair'._LOG_INFO_IMPORTANTE); |
|
| 1435 | 1435 | } |
| 1436 | 1436 | if ( |
| 1437 | 1437 | preg_match(',^(datetime),i', $d) |
@@ -1441,7 +1441,7 @@ discard block |
||
| 1441 | 1441 | and (!isset($desc['key']['PRIMARY KEY']) or $desc['key']['PRIMARY KEY'] !== $c) |
| 1442 | 1442 | ) { |
| 1443 | 1443 | spip_sqlite_alter($q = "TABLE $table CHANGE $c $c $d DEFAULT '0000-00-00 00:00:00'", $serveur); |
| 1444 | - spip_log("ALTER $q", 'repair' . _LOG_INFO_IMPORTANTE); |
|
| 1444 | + spip_log("ALTER $q", 'repair'._LOG_INFO_IMPORTANTE); |
|
| 1445 | 1445 | } |
| 1446 | 1446 | } |
| 1447 | 1447 | |
@@ -1492,10 +1492,10 @@ discard block |
||
| 1492 | 1492 | // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci |
| 1493 | 1493 | $couples = _sqlite_ajouter_champs_timestamp($table, $couples, $desc, $serveur); |
| 1494 | 1494 | |
| 1495 | - return spip_sqlite_query("REPLACE INTO $table (" . join(',', array_keys($couples)) . ') VALUES (' . join( |
|
| 1495 | + return spip_sqlite_query("REPLACE INTO $table (".join(',', array_keys($couples)).') VALUES ('.join( |
|
| 1496 | 1496 | ',', |
| 1497 | 1497 | $couples |
| 1498 | - ) . ')', $serveur); |
|
| 1498 | + ).')', $serveur); |
|
| 1499 | 1499 | } |
| 1500 | 1500 | |
| 1501 | 1501 | |
@@ -1581,7 +1581,7 @@ discard block |
||
| 1581 | 1581 | . _sqlite_calculer_expression('WHERE', $where) |
| 1582 | 1582 | . _sqlite_calculer_expression('GROUP BY', $groupby, ',') |
| 1583 | 1583 | . _sqlite_calculer_expression('HAVING', $having) |
| 1584 | - . ($orderby ? ("\nORDER BY " . _sqlite_calculer_order($orderby)) : '') |
|
| 1584 | + . ($orderby ? ("\nORDER BY "._sqlite_calculer_order($orderby)) : '') |
|
| 1585 | 1585 | . ($limit ? "\nLIMIT $limit" : ''); |
| 1586 | 1586 | |
| 1587 | 1587 | // dans un select, on doit renvoyer la requête en cas d'erreur |
@@ -1619,10 +1619,10 @@ discard block |
||
| 1619 | 1619 | // interdire la creation d'une nouvelle base, |
| 1620 | 1620 | // sauf si on est dans l'installation |
| 1621 | 1621 | if ( |
| 1622 | - !is_file($f = _DIR_DB . $db . '.sqlite') |
|
| 1622 | + !is_file($f = _DIR_DB.$db.'.sqlite') |
|
| 1623 | 1623 | && (!defined('_ECRIRE_INSTALL') || !_ECRIRE_INSTALL) |
| 1624 | 1624 | ) { |
| 1625 | - spip_log("Il est interdit de creer la base $db", 'sqlite.' . _LOG_HS); |
|
| 1625 | + spip_log("Il est interdit de creer la base $db", 'sqlite.'._LOG_HS); |
|
| 1626 | 1626 | |
| 1627 | 1627 | return false; |
| 1628 | 1628 | } |
@@ -1631,12 +1631,12 @@ discard block |
||
| 1631 | 1631 | // avec les identifiants connus |
| 1632 | 1632 | $index = $serveur ? $serveur : 0; |
| 1633 | 1633 | |
| 1634 | - if ($link = spip_connect_db('', '', '', '', '@selectdb@' . $db, $serveur, '', '')) { |
|
| 1634 | + if ($link = spip_connect_db('', '', '', '', '@selectdb@'.$db, $serveur, '', '')) { |
|
| 1635 | 1635 | if (($db == $link['db']) && $GLOBALS['connexions'][$index] = $link) { |
| 1636 | 1636 | return $db; |
| 1637 | 1637 | } |
| 1638 | 1638 | } else { |
| 1639 | - spip_log("Impossible de selectionner la base $db", 'sqlite.' . _LOG_HS); |
|
| 1639 | + spip_log("Impossible de selectionner la base $db", 'sqlite.'._LOG_HS); |
|
| 1640 | 1640 | |
| 1641 | 1641 | return false; |
| 1642 | 1642 | } |
@@ -1687,7 +1687,7 @@ discard block |
||
| 1687 | 1687 | $match = "^$match$"; |
| 1688 | 1688 | |
| 1689 | 1689 | return spip_sqlite_query( |
| 1690 | - "SELECT name FROM sqlite_master WHERE type='table' AND tbl_name REGEXP " . _q($match), |
|
| 1690 | + "SELECT name FROM sqlite_master WHERE type='table' AND tbl_name REGEXP "._q($match), |
|
| 1691 | 1691 | $serveur, |
| 1692 | 1692 | $requeter |
| 1693 | 1693 | ); |
@@ -1710,7 +1710,7 @@ discard block |
||
| 1710 | 1710 | $r = spip_sqlite_query( |
| 1711 | 1711 | 'SELECT name FROM sqlite_master WHERE' |
| 1712 | 1712 | . ' type=\'table\'' |
| 1713 | - . ' AND name=' . spip_sqlite_quote($table, 'string') |
|
| 1713 | + . ' AND name='.spip_sqlite_quote($table, 'string') |
|
| 1714 | 1714 | . ' AND name NOT LIKE \'sqlite_%\'', |
| 1715 | 1715 | $serveur, |
| 1716 | 1716 | $requeter |
@@ -1807,7 +1807,7 @@ discard block |
||
| 1807 | 1807 | // s'il y a une parenthèse fermante dans la clé |
| 1808 | 1808 | // ou dans la définition sans qu'il n'y ait une ouverture avant |
| 1809 | 1809 | if (false !== strpos($k, ')') or preg_match('/^[^\(]*\)/', $def)) { |
| 1810 | - $fields[$k_precedent] .= ',' . $k . ' ' . $def; |
|
| 1810 | + $fields[$k_precedent] .= ','.$k.' '.$def; |
|
| 1811 | 1811 | continue; |
| 1812 | 1812 | } |
| 1813 | 1813 | |
@@ -1842,13 +1842,13 @@ discard block |
||
| 1842 | 1842 | . 'ORDER BY substr(type,2,1), name'; |
| 1843 | 1843 | $a = spip_sqlite_query($query, $serveur, $requeter); |
| 1844 | 1844 | while ($r = spip_sqlite_fetch($a, null, $serveur)) { |
| 1845 | - $key = str_replace($nom_table . '_', '', $r['name']); // enlever le nom de la table ajoute a l'index |
|
| 1845 | + $key = str_replace($nom_table.'_', '', $r['name']); // enlever le nom de la table ajoute a l'index |
|
| 1846 | 1846 | $keytype = 'KEY'; |
| 1847 | 1847 | if (strpos($r['sql'], 'UNIQUE INDEX') !== false) { |
| 1848 | 1848 | $keytype = 'UNIQUE KEY'; |
| 1849 | 1849 | } |
| 1850 | 1850 | $colonnes = preg_replace(',.*\((.*)\).*,', '$1', $r['sql']); |
| 1851 | - $keys[$keytype . ' ' . $key] = $colonnes; |
|
| 1851 | + $keys[$keytype.' '.$key] = $colonnes; |
|
| 1852 | 1852 | } |
| 1853 | 1853 | } |
| 1854 | 1854 | } // c'est une vue, on liste les champs disponibles simplement |
@@ -1895,7 +1895,7 @@ discard block |
||
| 1895 | 1895 | |
| 1896 | 1896 | $set = []; |
| 1897 | 1897 | foreach ($champs as $champ => $val) { |
| 1898 | - $set[] = $champ . "=$val"; |
|
| 1898 | + $set[] = $champ."=$val"; |
|
| 1899 | 1899 | } |
| 1900 | 1900 | if (!empty($set)) { |
| 1901 | 1901 | return spip_sqlite_query( |
@@ -1948,7 +1948,7 @@ discard block |
||
| 1948 | 1948 | |
| 1949 | 1949 | $set = []; |
| 1950 | 1950 | foreach ($champs as $champ => $val) { |
| 1951 | - $set[$champ] = $champ . '=' . _sqlite_calculer_cite($val, isset($fields[$champ]) ? $fields[$champ] : ''); |
|
| 1951 | + $set[$champ] = $champ.'='._sqlite_calculer_cite($val, isset($fields[$champ]) ? $fields[$champ] : ''); |
|
| 1952 | 1952 | } |
| 1953 | 1953 | |
| 1954 | 1954 | // recherche de champs 'timestamp' pour mise a jour auto de ceux-ci |
@@ -1956,7 +1956,7 @@ discard block |
||
| 1956 | 1956 | $maj = _sqlite_ajouter_champs_timestamp($table, [], $desc, $serveur); |
| 1957 | 1957 | foreach ($maj as $champ => $val) { |
| 1958 | 1958 | if (!isset($set[$champ])) { |
| 1959 | - $set[$champ] = $champ . '=' . $val; |
|
| 1959 | + $set[$champ] = $champ.'='.$val; |
|
| 1960 | 1960 | } |
| 1961 | 1961 | } |
| 1962 | 1962 | |
@@ -1985,7 +1985,7 @@ discard block |
||
| 1985 | 1985 | */ |
| 1986 | 1986 | function _sqlite_init() { |
| 1987 | 1987 | if (!defined('_DIR_DB')) { |
| 1988 | - define('_DIR_DB', _DIR_ETC . 'bases/'); |
|
| 1988 | + define('_DIR_DB', _DIR_ETC.'bases/'); |
|
| 1989 | 1989 | } |
| 1990 | 1990 | if (!defined('_SQLITE_CHMOD')) { |
| 1991 | 1991 | define('_SQLITE_CHMOD', _SPIP_CHMOD); |
@@ -2092,9 +2092,9 @@ discard block |
||
| 2092 | 2092 | } |
| 2093 | 2093 | |
| 2094 | 2094 | // echapper les ' en '' |
| 2095 | - spip_log('Pas de methode ->quote pour echapper', 'sqlite.' . _LOG_INFO_IMPORTANTE); |
|
| 2095 | + spip_log('Pas de methode ->quote pour echapper', 'sqlite.'._LOG_INFO_IMPORTANTE); |
|
| 2096 | 2096 | |
| 2097 | - return ("'" . str_replace("'", "''", $v) . "'"); |
|
| 2097 | + return ("'".str_replace("'", "''", $v)."'"); |
|
| 2098 | 2098 | } |
| 2099 | 2099 | |
| 2100 | 2100 | |
@@ -2117,12 +2117,12 @@ discard block |
||
| 2117 | 2117 | $exp = "\n$expression "; |
| 2118 | 2118 | |
| 2119 | 2119 | if (!is_array($v)) { |
| 2120 | - return $exp . $v; |
|
| 2120 | + return $exp.$v; |
|
| 2121 | 2121 | } else { |
| 2122 | 2122 | if (strtoupper($join) === 'AND') { |
| 2123 | - return $exp . join("\n\t$join ", array_map('_sqlite_calculer_where', $v)); |
|
| 2123 | + return $exp.join("\n\t$join ", array_map('_sqlite_calculer_where', $v)); |
|
| 2124 | 2124 | } else { |
| 2125 | - return $exp . join($join, $v); |
|
| 2125 | + return $exp.join($join, $v); |
|
| 2126 | 2126 | } |
| 2127 | 2127 | } |
| 2128 | 2128 | } |
@@ -2156,17 +2156,17 @@ discard block |
||
| 2156 | 2156 | if (substr($k, -1) == '@') { |
| 2157 | 2157 | // c'est une jointure qui se refere au from precedent |
| 2158 | 2158 | // pas de virgule |
| 2159 | - $res .= ' ' . $v; |
|
| 2159 | + $res .= ' '.$v; |
|
| 2160 | 2160 | } else { |
| 2161 | 2161 | if (!is_numeric($k)) { |
| 2162 | 2162 | $p = strpos($v, ' '); |
| 2163 | 2163 | if ($p) { |
| 2164 | - $v = substr($v, 0, $p) . " AS '$k'" . substr($v, $p); |
|
| 2164 | + $v = substr($v, 0, $p)." AS '$k'".substr($v, $p); |
|
| 2165 | 2165 | } else { |
| 2166 | 2166 | $v .= " AS '$k'"; |
| 2167 | 2167 | } |
| 2168 | 2168 | } |
| 2169 | - $res .= ', ' . $v; |
|
| 2169 | + $res .= ', '.$v; |
|
| 2170 | 2170 | } |
| 2171 | 2171 | } |
| 2172 | 2172 | |
@@ -2304,13 +2304,13 @@ discard block |
||
| 2304 | 2304 | |
| 2305 | 2305 | $def_origine = sql_showtable($table_origine, false, $serveur); |
| 2306 | 2306 | if (!$def_origine or !isset($def_origine['field'])) { |
| 2307 | - spip_log("Alter table impossible sur $table_origine : table non trouvee", 'sqlite' . _LOG_ERREUR); |
|
| 2307 | + spip_log("Alter table impossible sur $table_origine : table non trouvee", 'sqlite'._LOG_ERREUR); |
|
| 2308 | 2308 | |
| 2309 | 2309 | return false; |
| 2310 | 2310 | } |
| 2311 | 2311 | |
| 2312 | 2312 | |
| 2313 | - $table_tmp = $table_origine . '_tmp'; |
|
| 2313 | + $table_tmp = $table_origine.'_tmp'; |
|
| 2314 | 2314 | |
| 2315 | 2315 | // 1) creer une table temporaire avec les modifications |
| 2316 | 2316 | // - DROP : suppression de la colonne |
@@ -2397,7 +2397,7 @@ discard block |
||
| 2397 | 2397 | } else { |
| 2398 | 2398 | // enlever KEY |
| 2399 | 2399 | $k = substr($k, 4); |
| 2400 | - $queries[] = "CREATE INDEX $table_destination" . "_$k ON $table_destination ($v)"; |
|
| 2400 | + $queries[] = "CREATE INDEX $table_destination"."_$k ON $table_destination ($v)"; |
|
| 2401 | 2401 | } |
| 2402 | 2402 | } |
| 2403 | 2403 | |
@@ -2408,7 +2408,7 @@ discard block |
||
| 2408 | 2408 | foreach ($queries as $q) { |
| 2409 | 2409 | if (!spip_sqlite::executer_requete($q, $serveur)) { |
| 2410 | 2410 | spip_log('SQLite : ALTER TABLE table :' |
| 2411 | - . " Erreur a l'execution de la requete : $q", 'sqlite.' . _LOG_ERREUR); |
|
| 2411 | + . " Erreur a l'execution de la requete : $q", 'sqlite.'._LOG_ERREUR); |
|
| 2412 | 2412 | spip_sqlite::annuler_transaction($serveur); |
| 2413 | 2413 | |
| 2414 | 2414 | return false; |
@@ -2498,27 +2498,27 @@ discard block |
||
| 2498 | 2498 | $enum = '(\s*\([^\)]*\))?'; |
| 2499 | 2499 | |
| 2500 | 2500 | $remplace = [ |
| 2501 | - '/enum' . $enum . '/is' => 'VARCHAR(255)', |
|
| 2501 | + '/enum'.$enum.'/is' => 'VARCHAR(255)', |
|
| 2502 | 2502 | '/COLLATE \w+_bin/is' => 'COLLATE BINARY', |
| 2503 | 2503 | '/COLLATE \w+_ci/is' => 'COLLATE NOCASE', |
| 2504 | 2504 | '/auto_increment/is' => '', |
| 2505 | 2505 | '/current_timestamp\(\)/is' => 'CURRENT_TIMESTAMP', // Fix export depuis mariaDB #4374 |
| 2506 | 2506 | '/(timestamp .* )ON .*$/is' => '\\1', |
| 2507 | 2507 | '/character set \w+/is' => '', |
| 2508 | - '/((big|small|medium|tiny)?int(eger)?)' . $num . '\s*unsigned/is' => '\\1 UNSIGNED', |
|
| 2508 | + '/((big|small|medium|tiny)?int(eger)?)'.$num.'\s*unsigned/is' => '\\1 UNSIGNED', |
|
| 2509 | 2509 | '/(text\s+not\s+null(\s+collate\s+\w+)?)\s*$/is' => "\\1 DEFAULT ''", |
| 2510 | - '/((char|varchar)' . $num . '\s+not\s+null(\s+collate\s+\w+)?)\s*$/is' => "\\1 DEFAULT ''", |
|
| 2510 | + '/((char|varchar)'.$num.'\s+not\s+null(\s+collate\s+\w+)?)\s*$/is' => "\\1 DEFAULT ''", |
|
| 2511 | 2511 | '/(datetime\s+not\s+null)\s*$/is' => "\\1 DEFAULT '0000-00-00 00:00:00'", |
| 2512 | 2512 | '/(date\s+not\s+null)\s*$/is' => "\\1 DEFAULT '0000-00-00'", |
| 2513 | 2513 | ]; |
| 2514 | 2514 | |
| 2515 | 2515 | // pour l'autoincrement, il faut des INTEGER NOT NULL PRIMARY KEY |
| 2516 | 2516 | $remplace_autocinc = [ |
| 2517 | - '/(big|small|medium|tiny)?int(eger)?' . $num . '/is' => 'INTEGER' |
|
| 2517 | + '/(big|small|medium|tiny)?int(eger)?'.$num.'/is' => 'INTEGER' |
|
| 2518 | 2518 | ]; |
| 2519 | 2519 | // pour les int non autoincrement, il faut un DEFAULT |
| 2520 | 2520 | $remplace_nonautocinc = [ |
| 2521 | - '/((big|small|medium|tiny)?int(eger)?' . $num . '\s+not\s+null)\s*$/is' => "\\1 DEFAULT 0", |
|
| 2521 | + '/((big|small|medium|tiny)?int(eger)?'.$num.'\s+not\s+null)\s*$/is' => "\\1 DEFAULT 0", |
|
| 2522 | 2522 | ]; |
| 2523 | 2523 | |
| 2524 | 2524 | if (is_string($query)) { |
@@ -2560,7 +2560,7 @@ discard block |
||
| 2560 | 2560 | return str_ireplace('BINARY', 'COLLATE BINARY', $champ); |
| 2561 | 2561 | } |
| 2562 | 2562 | if (preg_match(',^(char|varchar|(long|small|medium|tiny)?text),i', $champ)) { |
| 2563 | - return $champ . ' COLLATE NOCASE'; |
|
| 2563 | + return $champ.' COLLATE NOCASE'; |
|
| 2564 | 2564 | } |
| 2565 | 2565 | |
| 2566 | 2566 | return $champ; |
@@ -2650,14 +2650,14 @@ discard block |
||
| 2650 | 2650 | } else { |
| 2651 | 2651 | /* simuler le IF EXISTS - version 2 et sqlite < 3.3a */ |
| 2652 | 2652 | $a = spip_sqlite_showtable($nom, $serveur); |
| 2653 | - if (isset($a['key']['KEY ' . $nom])) { |
|
| 2653 | + if (isset($a['key']['KEY '.$nom])) { |
|
| 2654 | 2654 | return true; |
| 2655 | 2655 | } |
| 2656 | 2656 | } |
| 2657 | 2657 | } |
| 2658 | 2658 | |
| 2659 | 2659 | $temporary = $temporary ? ' TEMPORARY' : ''; |
| 2660 | - $q = "CREATE$temporary TABLE$ifnotexists $nom ($query" . ($keys ? ",$keys" : '') . ")\n"; |
|
| 2660 | + $q = "CREATE$temporary TABLE$ifnotexists $nom ($query".($keys ? ",$keys" : '').")\n"; |
|
| 2661 | 2661 | |
| 2662 | 2662 | return $q; |
| 2663 | 2663 | } |
@@ -2878,7 +2878,7 @@ discard block |
||
| 2878 | 2878 | $this->serveur = strtolower($serveur); |
| 2879 | 2879 | |
| 2880 | 2880 | if (!($this->link = _sqlite_link($this->serveur)) && (!defined('_ECRIRE_INSTALL') || !_ECRIRE_INSTALL)) { |
| 2881 | - spip_log('Aucune connexion sqlite (link)', 'sqlite.' . _LOG_ERREUR); |
|
| 2881 | + spip_log('Aucune connexion sqlite (link)', 'sqlite.'._LOG_ERREUR); |
|
| 2882 | 2882 | |
| 2883 | 2883 | return false; |
| 2884 | 2884 | } |
@@ -2924,7 +2924,7 @@ discard block |
||
| 2924 | 2924 | try { |
| 2925 | 2925 | $r = $this->link->query($query); |
| 2926 | 2926 | } catch (\PDOException $e) { |
| 2927 | - spip_log('PDOException: ' . $e->getMessage(), 'sqlite.' . _LOG_DEBUG); |
|
| 2927 | + spip_log('PDOException: '.$e->getMessage(), 'sqlite.'._LOG_DEBUG); |
|
| 2928 | 2928 | $r = false; |
| 2929 | 2929 | } |
| 2930 | 2930 | // sauvegarde de la requete (elle y est deja dans $r->queryString) |
@@ -2945,11 +2945,11 @@ discard block |
||
| 2945 | 2945 | |
| 2946 | 2946 | // loger les warnings/erreurs eventuels de sqlite remontant dans PHP |
| 2947 | 2947 | if ($e and $e instanceof \PDOException) { |
| 2948 | - $err = strip_tags($e->getMessage()) . ' in ' . $e->getFile() . ' line ' . $e->getLine(); |
|
| 2949 | - spip_log("$err - " . $query, 'sqlite.' . _LOG_ERREUR); |
|
| 2948 | + $err = strip_tags($e->getMessage()).' in '.$e->getFile().' line '.$e->getLine(); |
|
| 2949 | + spip_log("$err - ".$query, 'sqlite.'._LOG_ERREUR); |
|
| 2950 | 2950 | } elseif ($err = (function_exists('error_get_last') ? error_get_last() : '') and $err != $last_error) { |
| 2951 | - $err = strip_tags($err['message']) . ' in ' . $err['file'] . ' line ' . $err['line']; |
|
| 2952 | - spip_log("$err - " . $query, 'sqlite.' . _LOG_ERREUR); |
|
| 2951 | + $err = strip_tags($err['message']).' in '.$err['file'].' line '.$err['line']; |
|
| 2952 | + spip_log("$err - ".$query, 'sqlite.'._LOG_ERREUR); |
|
| 2953 | 2953 | } else { |
| 2954 | 2954 | $err = ''; |
| 2955 | 2955 | } |
@@ -3027,15 +3027,15 @@ discard block |
||
| 3027 | 3027 | // Correction Create Database |
| 3028 | 3028 | // Create Database -> requete ignoree |
| 3029 | 3029 | if (strpos($this->query, 'CREATE DATABASE') === 0) { |
| 3030 | - spip_log("Sqlite : requete non executee -> $this->query", 'sqlite.' . _LOG_AVERTISSEMENT); |
|
| 3030 | + spip_log("Sqlite : requete non executee -> $this->query", 'sqlite.'._LOG_AVERTISSEMENT); |
|
| 3031 | 3031 | $this->query = 'SELECT 1'; |
| 3032 | 3032 | } |
| 3033 | 3033 | |
| 3034 | 3034 | // Correction Insert Ignore |
| 3035 | 3035 | // INSERT IGNORE -> insert (tout court et pas 'insert or replace') |
| 3036 | 3036 | if (strpos($this->query, 'INSERT IGNORE') === 0) { |
| 3037 | - spip_log("Sqlite : requete transformee -> $this->query", 'sqlite.' . _LOG_DEBUG); |
|
| 3038 | - $this->query = 'INSERT ' . substr($this->query, '13'); |
|
| 3037 | + spip_log("Sqlite : requete transformee -> $this->query", 'sqlite.'._LOG_DEBUG); |
|
| 3038 | + $this->query = 'INSERT '.substr($this->query, '13'); |
|
| 3039 | 3039 | } |
| 3040 | 3040 | |
| 3041 | 3041 | // Correction des dates avec INTERVAL |
@@ -3063,7 +3063,7 @@ discard block |
||
| 3063 | 3063 | if (($this->sqlite_version == 2) && (strpos($this->query, 'USING') !== false)) { |
| 3064 | 3064 | spip_log( |
| 3065 | 3065 | "'USING (champ)' n'est pas reconnu en SQLite 2. Utilisez 'ON table1.champ = table2.champ'", |
| 3066 | - 'sqlite.' . _LOG_ERREUR |
|
| 3066 | + 'sqlite.'._LOG_ERREUR |
|
| 3067 | 3067 | ); |
| 3068 | 3068 | $this->query = preg_replace('/USING\s*\([^\)]*\)/', '', $this->query); |
| 3069 | 3069 | } |
@@ -3086,8 +3086,8 @@ discard block |
||
| 3086 | 3086 | } else { |
| 3087 | 3087 | $suite = ''; |
| 3088 | 3088 | } |
| 3089 | - $pref = ($this->prefixe) ? $this->prefixe . '_' : ''; |
|
| 3090 | - $this->query = preg_replace('/([,\s])spip_/S', '\1' . $pref, $this->query) . $suite; |
|
| 3089 | + $pref = ($this->prefixe) ? $this->prefixe.'_' : ''; |
|
| 3090 | + $this->query = preg_replace('/([,\s])spip_/S', '\1'.$pref, $this->query).$suite; |
|
| 3091 | 3091 | |
| 3092 | 3092 | // Correction zero AS x |
| 3093 | 3093 | // pg n'aime pas 0+x AS alias, sqlite, dans le meme style, |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | ); |
| 107 | 107 | |
| 108 | 108 | // Si l'article est publie, invalider les caches et demander sa reindexation |
| 109 | - $t = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id_article)); |
|
| 109 | + $t = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id_article)); |
|
| 110 | 110 | $invalideur = $indexation = false; |
| 111 | 111 | if ($t == 'publie') { |
| 112 | 112 | $invalideur = "id='article/$id_article'"; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $id_article, |
| 120 | 120 | [ |
| 121 | 121 | 'data' => $set, |
| 122 | - 'nonvide' => ['titre' => _T('info_nouvel_article') . ' ' . _T('info_numero_abbreviation') . $id_article], |
|
| 122 | + 'nonvide' => ['titre' => _T('info_nouvel_article').' '._T('info_numero_abbreviation').$id_article], |
|
| 123 | 123 | 'invalideur' => $invalideur, |
| 124 | 124 | 'indexation' => $indexation, |
| 125 | 125 | 'date_modif' => 'date_modif' // champ a mettre a date('Y-m-d H:i:s') s'il y a modif |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | } elseif (autoriser('modifier', 'article', $id_article) and $s != 'publie') { |
| 310 | 310 | $statut = $champs['statut'] = $s; |
| 311 | 311 | } else { |
| 312 | - spip_log("editer_article $id_article refus " . join(' ', $c)); |
|
| 312 | + spip_log("editer_article $id_article refus ".join(' ', $c)); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | // En cas de publication, fixer la date a "maintenant" |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | isset($c['id_parent']) |
| 335 | 335 | and $id_parent = $c['id_parent'] |
| 336 | 336 | and $id_parent != $id_rubrique |
| 337 | - and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent))) |
|
| 337 | + and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent))) |
|
| 338 | 338 | ) { |
| 339 | 339 | $champs['id_rubrique'] = $id_parent; |
| 340 | 340 | |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | // Si on deplace l'article |
| 436 | 436 | // changer aussi son secteur et sa langue (si heritee) |
| 437 | 437 | if (isset($champs['id_rubrique'])) { |
| 438 | - $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique'])); |
|
| 438 | + $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique'])); |
|
| 439 | 439 | |
| 440 | 440 | $langue = $row_rub['lang']; |
| 441 | 441 | $champs['id_secteur'] = $row_rub['id_secteur']; |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | sql_fetsel( |
| 444 | 444 | '1', |
| 445 | 445 | 'spip_articles', |
| 446 | - 'id_article=' . intval($id_article) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue) |
|
| 446 | + 'id_article='.intval($id_article)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue) |
|
| 447 | 447 | ) |
| 448 | 448 | ) { |
| 449 | 449 | $champs['lang'] = $langue; |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | return; |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | - sql_updateq('spip_articles', $champs, 'id_article=' . intval($id_article)); |
|
| 457 | + sql_updateq('spip_articles', $champs, 'id_article='.intval($id_article)); |
|
| 458 | 458 | |
| 459 | 459 | // Changer le statut des rubriques concernees |
| 460 | 460 | |
@@ -475,6 +475,6 @@ discard block |
||
| 475 | 475 | foreach ($plus as $n => $t) { |
| 476 | 476 | $plus[$n] = preg_replace(",<!--SPIP-->[\n\r]*,", '', $t); |
| 477 | 477 | } |
| 478 | - set_request('texte', join('', $plus) . _request('texte')); |
|
| 478 | + set_request('texte', join('', $plus)._request('texte')); |
|
| 479 | 479 | } |
| 480 | 480 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $credentials_ldap = ['ldap_dn' => $dn, 'ldap_password' => $pass]; |
| 69 | 69 | |
| 70 | 70 | // Si l'utilisateur figure deja dans la base, y recuperer les infos |
| 71 | - $r = sql_fetsel('*', 'spip_auteurs', 'login=' . sql_quote($login) . " AND source='ldap'", '', '', '', '', $serveur); |
|
| 71 | + $r = sql_fetsel('*', 'spip_auteurs', 'login='.sql_quote($login)." AND source='ldap'", '', '', '', '', $serveur); |
|
| 72 | 72 | |
| 73 | 73 | if ($r) { |
| 74 | 74 | return array_merge($r, $credentials_ldap); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | if ($r) { |
| 93 | 93 | return array_merge( |
| 94 | 94 | $credentials_ldap, |
| 95 | - sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . intval($r), '', '', '', '', $serveur) |
|
| 95 | + sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($r), '', '', '', '', $serveur) |
|
| 96 | 96 | ); |
| 97 | 97 | } |
| 98 | 98 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $connexion = spip_connect($serveur); |
| 122 | 122 | if (!is_array($connexion['ldap'])) { |
| 123 | 123 | if ($connexion['authentification']['ldap']) { |
| 124 | - $f = _DIR_CONNECT . $connexion['authentification']['ldap']; |
|
| 124 | + $f = _DIR_CONNECT.$connexion['authentification']['ldap']; |
|
| 125 | 125 | unset($GLOBALS['ldap_link']); |
| 126 | 126 | if (is_readable($f)) { |
| 127 | 127 | include_once($f); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | if (!ldap_bind($link, $dn, session_get('ldap_password'))) { |
| 335 | 335 | return false; |
| 336 | 336 | } |
| 337 | - $encoded_pass = '{MD5}' . base64_encode(pack('H*', md5($new_pass))); |
|
| 337 | + $encoded_pass = '{MD5}'.base64_encode(pack('H*', md5($new_pass))); |
|
| 338 | 338 | $success = ldap_mod_replace($link, $dn, ['userPassword' => $encoded_pass]); |
| 339 | 339 | |
| 340 | 340 | return $success; |