@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | |
| 259 | 259 | // http://code.spip.net/@_sqlite_func_preg_replace |
| 260 | 260 | function _sqlite_func_preg_replace($quoi, $cherche, $remplace) { |
| 261 | - $return = preg_replace('%' . $cherche . '%', $remplace, $quoi); |
|
| 261 | + $return = preg_replace('%'.$cherche.'%', $remplace, $quoi); |
|
| 262 | 262 | |
| 263 | 263 | #spip_log("preg_replace : $quoi, $cherche, $remplace, $return",'sqlite.'._LOG_DEBUG); |
| 264 | 264 | return $return; |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | return false; |
| 315 | 315 | } |
| 316 | 316 | $u = isset($GLOBALS['meta']['pcre_u']) ? $GLOBALS['meta']['pcre_u'] : 'u'; |
| 317 | - $return = preg_match('%' . $cherche . '%imsS' . $u, $quoi); |
|
| 317 | + $return = preg_match('%'.$cherche.'%imsS'.$u, $quoi); |
|
| 318 | 318 | |
| 319 | 319 | #spip_log("regexp_replace : $quoi, $cherche, $remplace, $return",'sqlite.'._LOG_DEBUG); |
| 320 | 320 | return $return; |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | function _sqlite_func_to_days($d) { |
| 337 | 337 | static $offset = 719528; // nb de jour entre 0000-00-00 et timestamp 0=1970-01-01 |
| 338 | - $result = $offset + (int)ceil(_sqlite_func_unix_timestamp($d) / (24 * 3600)); |
|
| 338 | + $result = $offset + (int) ceil(_sqlite_func_unix_timestamp($d) / (24 * 3600)); |
|
| 339 | 339 | |
| 340 | 340 | #spip_log("Passage avec TO_DAYS : $d, $result",'sqlite.'._LOG_DEBUG); |
| 341 | 341 | return $result; |
@@ -42,16 +42,16 @@ |
||
| 42 | 42 | $res = _T('ecrire:taille_cache_image', |
| 43 | 43 | array( |
| 44 | 44 | 'dir' => joli_repertoire(_DIR_VAR), |
| 45 | - 'taille' => "<b>" . (taille_en_octets($taille) > 0 ? taille_en_octets($taille) : "0 octet") . "</b>" |
|
| 45 | + 'taille' => "<b>".(taille_en_octets($taille) > 0 ? taille_en_octets($taille) : "0 octet")."</b>" |
|
| 46 | 46 | ) |
| 47 | 47 | ); |
| 48 | 48 | } else { |
| 49 | 49 | include_spip('inc/invalideur'); |
| 50 | 50 | $taille = |
| 51 | 51 | calculer_taille_dossier(_DIR_CACHE_XML) |
| 52 | - + calculer_taille_dossier(_DIR_CACHE . 'skel/') |
|
| 53 | - + calculer_taille_dossier(_DIR_CACHE . 'wheels/') |
|
| 54 | - + calculer_taille_dossier(_DIR_CACHE . 'contextes/'); |
|
| 52 | + + calculer_taille_dossier(_DIR_CACHE.'skel/') |
|
| 53 | + + calculer_taille_dossier(_DIR_CACHE.'wheels/') |
|
| 54 | + + calculer_taille_dossier(_DIR_CACHE.'contextes/'); |
|
| 55 | 55 | $taille += intval(taille_du_cache()); |
| 56 | 56 | if ($taille <= 150000) { |
| 57 | 57 | $res = _T('taille_cache_vide'); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $t = ($GLOBALS['taille_min'] * $GLOBALS['taille_min']); |
| 77 | 77 | if ($GLOBALS['taille_min'] !== $GLOBALS['taille_max']) { |
| 78 | 78 | $t = $t * 0.9; // marge de securite |
| 79 | - echo round($t / 1000000, 3) . ' Mpx'; |
|
| 79 | + echo round($t / 1000000, 3).' Mpx'; |
|
| 80 | 80 | } else { |
| 81 | 81 | // c'est un cas "on a reussi la borne max initiale, donc on a pas de limite connue" |
| 82 | 82 | $t = 0; |
@@ -111,18 +111,18 @@ discard block |
||
| 111 | 111 | $i = _request('i') + 1; |
| 112 | 112 | $image_source = chemin_image("test.png"); |
| 113 | 113 | $GLOBALS['redirect'] = generer_url_action("tester_taille", |
| 114 | - "i=$i&arg=" . $GLOBALS['taille_min'] . "-" . $GLOBALS['taille_test']); |
|
| 114 | + "i=$i&arg=".$GLOBALS['taille_min']."-".$GLOBALS['taille_test']); |
|
| 115 | 115 | |
| 116 | 116 | ob_start('action_tester_taille_error_handler'); |
| 117 | 117 | filtrer('image_recadre', $image_source, $taille, $taille); |
| 118 | - $GLOBALS['redirect'] = generer_url_action("tester_taille", "i=$i&arg=$taille-" . $GLOBALS['taille_max']); |
|
| 118 | + $GLOBALS['redirect'] = generer_url_action("tester_taille", "i=$i&arg=$taille-".$GLOBALS['taille_max']); |
|
| 119 | 119 | |
| 120 | 120 | // si la valeur intermediaire a reussi, on teste la valeur maxi qui est peut etre sous estimee |
| 121 | 121 | // si $GLOBALS['taille_min']==0 (car on est au premier coup) |
| 122 | 122 | if ($GLOBALS['taille_min'] == 0) { |
| 123 | 123 | $taille = $GLOBALS['taille_max']; |
| 124 | 124 | filtrer('image_recadre', $image_source, $taille, $taille); |
| 125 | - $GLOBALS['redirect'] = generer_url_action("tester_taille", "i=$i&arg=$taille-" . $GLOBALS['taille_max']); |
|
| 125 | + $GLOBALS['redirect'] = generer_url_action("tester_taille", "i=$i&arg=$taille-".$GLOBALS['taille_max']); |
|
| 126 | 126 | } |
| 127 | 127 | ob_end_clean(); |
| 128 | 128 | |
@@ -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'"; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | if ($err = objet_modifier_champs('article', $id_article, |
| 117 | 117 | array( |
| 118 | 118 | 'data' => $set, |
| 119 | - 'nonvide' => array('titre' => _T('info_nouvel_article') . " " . _T('info_numero_abbreviation') . $id_article), |
|
| 119 | + 'nonvide' => array('titre' => _T('info_nouvel_article')." "._T('info_numero_abbreviation').$id_article), |
|
| 120 | 120 | 'invalideur' => $invalideur, |
| 121 | 121 | 'indexation' => $indexation, |
| 122 | 122 | 'date_modif' => 'date_modif' // champ a mettre a date('Y-m-d H:i:s') s'il y a modif |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | if (autoriser('modifier', 'article', $id_article) and $s != 'publie') { |
| 299 | 299 | $statut = $champs['statut'] = $s; |
| 300 | 300 | } else { |
| 301 | - spip_log("editer_article $id_article refus " . join(' ', $c)); |
|
| 301 | + spip_log("editer_article $id_article refus ".join(' ', $c)); |
|
| 302 | 302 | } |
| 303 | 303 | } |
| 304 | 304 | |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | if (isset($c['id_parent']) |
| 323 | 323 | and $id_parent = $c['id_parent'] |
| 324 | 324 | and $id_parent != $id_rubrique |
| 325 | - and (sql_fetsel('1', "spip_rubriques", "id_rubrique=" . intval($id_parent))) |
|
| 325 | + and (sql_fetsel('1', "spip_rubriques", "id_rubrique=".intval($id_parent))) |
|
| 326 | 326 | ) { |
| 327 | 327 | $champs['id_rubrique'] = $id_parent; |
| 328 | 328 | |
@@ -419,12 +419,12 @@ discard block |
||
| 419 | 419 | // changer aussi son secteur et sa langue (si heritee) |
| 420 | 420 | if (isset($champs['id_rubrique'])) { |
| 421 | 421 | |
| 422 | - $row_rub = sql_fetsel("id_secteur, lang", "spip_rubriques", "id_rubrique=" . sql_quote($champs['id_rubrique'])); |
|
| 422 | + $row_rub = sql_fetsel("id_secteur, lang", "spip_rubriques", "id_rubrique=".sql_quote($champs['id_rubrique'])); |
|
| 423 | 423 | |
| 424 | 424 | $langue = $row_rub['lang']; |
| 425 | 425 | $champs['id_secteur'] = $row_rub['id_secteur']; |
| 426 | 426 | if (sql_fetsel('1', 'spip_articles', |
| 427 | - "id_article=" . intval($id_article) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue))) { |
|
| 427 | + "id_article=".intval($id_article)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue))) { |
|
| 428 | 428 | $champs['lang'] = $langue; |
| 429 | 429 | } |
| 430 | 430 | } |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | return; |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | - sql_updateq('spip_articles', $champs, "id_article=" . intval($id_article)); |
|
| 436 | + sql_updateq('spip_articles', $champs, "id_article=".intval($id_article)); |
|
| 437 | 437 | |
| 438 | 438 | // Changer le statut des rubriques concernees |
| 439 | 439 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | foreach ($plus as $n => $t) { |
| 455 | 455 | $plus[$n] = preg_replace(",<!--SPIP-->[\n\r]*,", "", $t); |
| 456 | 456 | } |
| 457 | - set_request('texte', join('', $plus) . _request('texte')); |
|
| 457 | + set_request('texte', join('', $plus)._request('texte')); |
|
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | ) { |
| 38 | 38 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 39 | 39 | include_spip('inc/session'); |
| 40 | - session_set('session_' . $var, $val = _request('val')); |
|
| 40 | + session_set('session_'.$var, $val = _request('val')); |
|
| 41 | 41 | #spip_log("autosave:$var:$val",'autosave'); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @param string $serveur |
| 31 | 31 | * @return string |
| 32 | 32 | */ |
| 33 | -function action_instituer_langue_objet_dist($objet, $id, $id_rubrique, $changer_lang, $serveur='') { |
|
| 33 | +function action_instituer_langue_objet_dist($objet, $id, $id_rubrique, $changer_lang, $serveur = '') { |
|
| 34 | 34 | if ($changer_lang) { |
| 35 | 35 | $table_objet_sql = table_objet_sql($objet); |
| 36 | 36 | $id_table_objet = id_table_objet($objet); |
@@ -38,13 +38,13 @@ discard block |
||
| 38 | 38 | $desc = $trouver_table($table_objet_sql, $serveur); |
| 39 | 39 | |
| 40 | 40 | $set = array(); |
| 41 | - if (isset($desc['field']['langue_choisie'])){ |
|
| 41 | + if (isset($desc['field']['langue_choisie'])) { |
|
| 42 | 42 | $set['langue_choisie'] = 'oui'; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if ($changer_lang != "herit") { |
| 46 | 46 | $set['lang'] = $changer_lang; |
| 47 | - sql_updateq($table_objet_sql, $set, "$id_table_objet=" . intval($id),'',$serveur); |
|
| 47 | + sql_updateq($table_objet_sql, $set, "$id_table_objet=".intval($id), '', $serveur); |
|
| 48 | 48 | include_spip('inc/rubriques'); // pour calculer_langues_rubriques et calculer_langues_utilisees |
| 49 | 49 | if ($table_objet_sql == 'spip_rubriques') { |
| 50 | 50 | calculer_langues_rubriques(); |
@@ -52,16 +52,16 @@ discard block |
||
| 52 | 52 | $langues = calculer_langues_utilisees($serveur); |
| 53 | 53 | ecrire_meta('langues_utilisees', $langues); |
| 54 | 54 | } else { |
| 55 | - $langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=" . intval($id_rubrique)); |
|
| 55 | + $langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=".intval($id_rubrique)); |
|
| 56 | 56 | if (!$langue_parent) { |
| 57 | 57 | $langue_parent = $GLOBALS['meta']['langue_site']; |
| 58 | 58 | } |
| 59 | 59 | $changer_lang = $langue_parent; |
| 60 | 60 | $set['lang'] = $changer_lang; |
| 61 | - if (isset($set['langue_choisie'])){ |
|
| 61 | + if (isset($set['langue_choisie'])) { |
|
| 62 | 62 | $set['langue_choisie'] = 'non'; |
| 63 | 63 | } |
| 64 | - sql_updateq($table_objet_sql, $set, "$id_table_objet=" . intval($id),'',$serveur); |
|
| 64 | + sql_updateq($table_objet_sql, $set, "$id_table_objet=".intval($id), '', $serveur); |
|
| 65 | 65 | if ($table_objet_sql == 'spip_rubriques') { |
| 66 | 66 | include_spip('inc/rubriques'); |
| 67 | 67 | calculer_langues_rubriques(); |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | ask_php_auth(_T('login_deconnexion_ok'), |
| 85 | 85 | _T('login_verifiez_navigateur'), |
| 86 | 86 | _T('login_retour_public'), |
| 87 | - "redirect=" . _DIR_RESTREINT_ABS, |
|
| 87 | + "redirect="._DIR_RESTREINT_ABS, |
|
| 88 | 88 | _T('login_test_navigateur'), |
| 89 | 89 | true); |
| 90 | 90 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | supprime_invalideurs(); |
| 62 | 62 | @spip_unlink(_CACHE_RUBRIQUES); |
| 63 | 63 | @spip_unlink(_CACHE_CHEMIN); |
| 64 | - @spip_unlink(_DIR_TMP . "plugin_xml_cache.gz"); |
|
| 64 | + @spip_unlink(_DIR_TMP."plugin_xml_cache.gz"); |
|
| 65 | 65 | // on ne supprime que _CACHE_PLUGINS_OPT qui declenche la reconstruction des 3 |
| 66 | 66 | // _CACHE_PIPELINES _CACHE_PLUGINS_PATH et _CACHE_PLUGINS_FCT |
| 67 | 67 | // pour eviter des problemes de concurence |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | @spip_unlink(_CACHE_PLUGINS_OPT); |
| 73 | 73 | purger_repertoire(_DIR_CACHE, array('subdir' => true)); |
| 74 | 74 | purger_repertoire(_DIR_AIDE); |
| 75 | - purger_repertoire(_DIR_VAR . 'cache-css'); |
|
| 76 | - purger_repertoire(_DIR_VAR . 'cache-js'); |
|
| 75 | + purger_repertoire(_DIR_VAR.'cache-css'); |
|
| 76 | + purger_repertoire(_DIR_VAR.'cache-js'); |
|
| 77 | 77 | break; |
| 78 | 78 | |
| 79 | 79 | case 'squelettes': |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $champs['source'] = $source ? $source : 'spip'; |
| 96 | 96 | |
| 97 | 97 | $champs['login'] = ''; |
| 98 | - $champs['statut'] = '5poubelle'; // inutilisable tant qu'il n'a pas ete renseigne et institue |
|
| 98 | + $champs['statut'] = '5poubelle'; // inutilisable tant qu'il n'a pas ete renseigne et institue |
|
| 99 | 99 | $champs['webmestre'] = 'non'; |
| 100 | 100 | |
| 101 | 101 | if ($set) { |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | $champs['pass'] = $c['pass']; |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | - $statut = $statut_ancien = sql_getfetsel('statut', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 324 | + $statut = $statut_ancien = sql_getfetsel('statut', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 325 | 325 | |
| 326 | 326 | if (isset($c['statut']) |
| 327 | 327 | and (autoriser('modifier', 'auteur', $id_auteur, null, array('statut' => $c['statut']))) |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | // commencer par traiter les cas particuliers des logins et pass |
| 378 | 378 | // avant les autres ecritures en base |
| 379 | 379 | if (isset($champs['login']) or isset($champs['pass'])) { |
| 380 | - $auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 380 | + $auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 381 | 381 | include_spip('inc/auth'); |
| 382 | 382 | if (isset($champs['login']) and strlen($champs['login'])) { |
| 383 | 383 | if (!auth_modifier_login($auth_methode, $champs['login'], $id_auteur)) { |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | } |
| 386 | 386 | } |
| 387 | 387 | if (isset($champs['pass']) and strlen($champs['pass'])) { |
| 388 | - $champs['login'] = sql_getfetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 388 | + $champs['login'] = sql_getfetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 389 | 389 | if (!auth_modifier_pass($auth_methode, $champs['login'], $champs['pass'], $id_auteur)) { |
| 390 | 390 | $erreurs[] = 'ecrire:impossible_modifier_pass_auteur'; |
| 391 | 391 | } |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | if (!count($champs)) { |
| 399 | 399 | return implode(' ', array_map('_T', $erreurs)); |
| 400 | 400 | } |
| 401 | - sql_updateq('spip_auteurs', $champs, 'id_auteur=' . $id_auteur); |
|
| 401 | + sql_updateq('spip_auteurs', $champs, 'id_auteur='.$id_auteur); |
|
| 402 | 402 | |
| 403 | 403 | // .. mettre a jour les fichiers .htpasswd et .htpasswd-admin |
| 404 | 404 | if ($flag_ecrire_acces |