@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | $out .= afficher_script_statut($id, $type, -$zero - $i++ * $unit, statut_image($type, $s), $s, _T($t)); |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | - return $out . '</span>'; |
|
| 392 | + return $out.'</span>'; |
|
| 393 | 393 | } else { |
| 394 | 394 | $nom = 'puce_statut_'; |
| 395 | 395 | $action = generer_url_ecrire('puce_statut', '', true); |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | $h = generer_action_auteur('instituer_objet', "$type-$id-$statut"); |
| 407 | 407 | $t = supprimer_tags($titre); |
| 408 | 408 | |
| 409 | - return "<a href=\"#\" data-puce-id=\"$id\" data-puce-type=\"$type\" data-puce-decal=\"$n\" data-puce-action=\"$h\" title=\"$t\"$act>" . http_img_pack($img, $t) . '</a>'; |
|
| 409 | + return "<a href=\"#\" data-puce-id=\"$id\" data-puce-type=\"$type\" data-puce-decal=\"$n\" data-puce-action=\"$h\" title=\"$t\"$act>".http_img_pack($img, $t).'</a>'; |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | // compat |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | static $dirs = []; |
| 43 | 43 | $liste = []; |
| 44 | 44 | foreach (creer_chemin() as $dir) { |
| 45 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 45 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 46 | 46 | $dirs[$a] = (is_dir($a) || !$a); |
| 47 | 47 | } |
| 48 | 48 | if ($dirs[$a] && is_readable($a .= $file)) { |
@@ -66,21 +66,21 @@ discard block |
||
| 66 | 66 | **/ |
| 67 | 67 | function chercher_module_lang($module, $lang = '') { |
| 68 | 68 | if ($lang) { |
| 69 | - $lang = '_' . $lang; |
|
| 69 | + $lang = '_'.$lang; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // 1) dans un repertoire nomme lang/ se trouvant sur le chemin |
| 73 | 73 | if ( |
| 74 | 74 | $f = ($module == 'local' |
| 75 | - ? find_in_path($module . $lang . '.php', 'lang/') |
|
| 76 | - : find_langs_in_path($module . $lang . '.php', 'lang/')) |
|
| 75 | + ? find_in_path($module.$lang.'.php', 'lang/') |
|
| 76 | + : find_langs_in_path($module.$lang.'.php', 'lang/')) |
|
| 77 | 77 | ) { |
| 78 | 78 | return is_array($f) ? $f : [$f]; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // 2) directement dans le chemin (old style, uniquement pour local) |
| 82 | 82 | return ($module == 'local' || strpos($module, '/')) |
| 83 | - ? (($f = find_in_path($module . $lang . '.php')) ? [$f] : false) |
|
| 83 | + ? (($f = find_in_path($module.$lang.'.php')) ? [$f] : false) |
|
| 84 | 84 | : false; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | **/ |
| 105 | 105 | function charger_langue($lang, $module = 'spip') { |
| 106 | 106 | static $langs = []; |
| 107 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 107 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 108 | 108 | if (!isset($langs[$lang])) { |
| 109 | 109 | $langs[$lang] = []; |
| 110 | 110 | if ($lang) { |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | foreach ($langs[$lang] as $l) { |
| 121 | 121 | if ($fichiers_lang = chercher_module_lang($module, $l)) { |
| 122 | - $GLOBALS['idx_lang'] = 'i18n_' . $module . '_' . $l; |
|
| 122 | + $GLOBALS['idx_lang'] = 'i18n_'.$module.'_'.$l; |
|
| 123 | 123 | $GLOBALS[$GLOBALS['idx_lang']] = lire_fichier_langue(array_shift($fichiers_lang)); |
| 124 | 124 | surcharger_langue($fichiers_lang); |
| 125 | 125 | if ($l !== $lang) { |
| 126 | - $GLOBALS[$var] = &$GLOBALS['i18n_' . $module . '_' . $l]; |
|
| 126 | + $GLOBALS[$var] = &$GLOBALS['i18n_'.$module.'_'.$l]; |
|
| 127 | 127 | } |
| 128 | - $GLOBALS['lang_' . $var] = $l; |
|
| 128 | + $GLOBALS['lang_'.$var] = $l; |
|
| 129 | 129 | #spip_log("module de langue : {$module}_$l.php", 'traduire'); |
| 130 | 130 | break; |
| 131 | 131 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | function lire_fichier_langue(string $fichier): array { |
| 145 | 145 | $idx_lang_before = $GLOBALS['idx_lang'] ?? null; |
| 146 | - $idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang') . '@temporaire'; |
|
| 146 | + $idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang').'@temporaire'; |
|
| 147 | 147 | $GLOBALS['idx_lang'] = $idx_lang_tmp; |
| 148 | 148 | $idx_lang = include $fichier; |
| 149 | 149 | $GLOBALS['idx_lang'] = $idx_lang_before; |
@@ -254,27 +254,27 @@ discard block |
||
| 254 | 254 | } else { |
| 255 | 255 | $modules = ['spip', 'ecrire']; |
| 256 | 256 | $code = $ori; |
| 257 | - $ori_complet = implode('|', $modules) . ':' . $ori; |
|
| 257 | + $ori_complet = implode('|', $modules).':'.$ori; |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | $desc = new Description(); |
| 261 | 261 | |
| 262 | 262 | // parcourir tous les modules jusqu'a ce qu'on trouve |
| 263 | 263 | foreach ($modules as $module) { |
| 264 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 264 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 265 | 265 | |
| 266 | 266 | if (empty($GLOBALS[$var])) { |
| 267 | 267 | charger_langue($lang, $module); |
| 268 | 268 | // surcharges persos -- on cherche |
| 269 | 269 | // (lang/)local_xx.php et/ou (lang/)local.php ... |
| 270 | - if (!isset($local['local_' . $lang])) { |
|
| 270 | + if (!isset($local['local_'.$lang])) { |
|
| 271 | 271 | // redéfinir la langue en cours pour les surcharges (chercher_langue a pu le changer) |
| 272 | 272 | $GLOBALS['idx_lang'] = $var; |
| 273 | 273 | // ... (lang/)local_xx.php |
| 274 | - $local['local_' . $lang] = chercher_module_lang('local', $lang); |
|
| 274 | + $local['local_'.$lang] = chercher_module_lang('local', $lang); |
|
| 275 | 275 | } |
| 276 | - if ($local['local_' . $lang]) { |
|
| 277 | - surcharger_langue($local['local_' . $lang]); |
|
| 276 | + if ($local['local_'.$lang]) { |
|
| 277 | + surcharger_langue($local['local_'.$lang]); |
|
| 278 | 278 | } |
| 279 | 279 | // ... puis (lang/)local.php |
| 280 | 280 | if (!isset($local['local'])) { |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | if (isset($GLOBALS[$var][$code])) { |
| 289 | 289 | $desc->code = $code; |
| 290 | 290 | $desc->module = $module; |
| 291 | - $desc->langue = $GLOBALS['lang_' . $var] ?? $lang; |
|
| 291 | + $desc->langue = $GLOBALS['lang_'.$var] ?? $lang; |
|
| 292 | 292 | $desc->texte = $GLOBALS[$var][$code]; |
| 293 | 293 | break; |
| 294 | 294 | } |
@@ -346,13 +346,13 @@ discard block |
||
| 346 | 346 | if (!$desc->mode && $desc->texte) { |
| 347 | 347 | // ne pas modifier 2 fois l'affichage |
| 348 | 348 | $desc->mode = 'traduction'; |
| 349 | - $classe = 'debug-traduction' . ($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 349 | + $classe = 'debug-traduction'.($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 350 | 350 | $desc->texte = '<span ' |
| 351 | - . 'lang=' . $desc->langue |
|
| 352 | - . ' class=' . $classe |
|
| 353 | - . ' data-module=' . $desc->module |
|
| 354 | - . ' data-code=' . $desc->code |
|
| 355 | - . ' title=' . $modules . '(' . $desc->langue . ')>' |
|
| 351 | + . 'lang='.$desc->langue |
|
| 352 | + . ' class='.$classe |
|
| 353 | + . ' data-module='.$desc->module |
|
| 354 | + . ' data-code='.$desc->code |
|
| 355 | + . ' title='.$modules.'('.$desc->langue.')>' |
|
| 356 | 356 | . $desc->texte |
| 357 | 357 | . '</span>'; |
| 358 | 358 | $desc->texte = str_replace( |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $_id = $e['id_table_objet']; |
| 52 | 52 | if (isset($contexte[$_id]) && ($id = (int) $contexte[$_id])) { |
| 53 | 53 | $table = $e['table_objet_sql']; |
| 54 | - $row = sql_fetsel('*', $table, "$_id=" . (int) $id); |
|
| 54 | + $row = sql_fetsel('*', $table, "$_id=".(int) $id); |
|
| 55 | 55 | if (isset($row['id_rubrique'])) { |
| 56 | 56 | $contexte['id_rubrique'] = $row['id_rubrique']; |
| 57 | 57 | if (isset($row['id_secteur'])) { |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | $boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position) |
| 116 | 116 | + [ |
| 117 | 117 | $id => new Bouton( |
| 118 | - ($icones && !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 119 | - $infos['titre'], // titre |
|
| 118 | + ($icones && !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 119 | + $infos['titre'], // titre |
|
| 120 | 120 | (isset($infos['action']) && $infos['action']) ? $infos['action'] : null, |
| 121 | 121 | (isset($infos['parametres']) && $infos['parametres']) ? $infos['parametres'] : null |
| 122 | 122 | ) |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | $boutons_admin = array_slice($boutons_admin, 0, $position) |
| 134 | 134 | + [ |
| 135 | 135 | $id => new Bouton( |
| 136 | - ($icones && isset($infos['icone']) && $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 137 | - $infos['titre'], // titre |
|
| 136 | + ($icones && isset($infos['icone']) && $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 137 | + $infos['titre'], // titre |
|
| 138 | 138 | (isset($infos['action']) && $infos['action']) ? $infos['action'] : null, |
| 139 | 139 | (isset($infos['parametres']) && $infos['parametres']) ? $infos['parametres'] : null |
| 140 | 140 | ) |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $url = str_replace('&', '&', $url); |
| 222 | 222 | while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) { |
| 223 | 223 | if ($matches[2] == 'id_secteur' && !isset($contexte['id_secteur']) && isset($contexte['id_rubrique'])) { |
| 224 | - $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . (int) $contexte['id_rubrique']); |
|
| 224 | + $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.(int) $contexte['id_rubrique']); |
|
| 225 | 225 | } |
| 226 | 226 | $val = _request($matches[2], $contexte); |
| 227 | 227 | $url = parametre_url($url, $matches[1], $val ?: '', '&'); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | if ($aff_racine) { |
| 55 | 55 | $info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id="); |
| 56 | - $idom3 = $idom . '_selection'; |
|
| 56 | + $idom3 = $idom.'_selection'; |
|
| 57 | 57 | |
| 58 | 58 | $onClick = "jQuery(this).parent().addClass('on');jQuery('#choix_parent_principal .on').removeClass('on'); aff_selection(0, '$idom3', '$info', event);return false;"; |
| 59 | 59 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | ' ' |
| 72 | 72 | ); |
| 73 | 73 | |
| 74 | - $js_func = $do . '_selection_titre'; |
|
| 74 | + $js_func = $do.'_selection_titre'; |
|
| 75 | 75 | $ondbClick = "$js_func('$ondbClick',0,'selection_rubrique','id_parent');"; |
| 76 | 76 | |
| 77 | 77 | $aff_racine = "<div class='petit-item petite-racine item'>" |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | **/ |
| 113 | 113 | function construire_selectionner_hierarchie($idom, $liste, $racine, $url, $name, $url_init = '') { |
| 114 | 114 | |
| 115 | - $idom1 = $idom . '_champ_recherche'; |
|
| 116 | - $idom2 = $idom . '_principal'; |
|
| 117 | - $idom3 = $idom . '_selection'; |
|
| 118 | - $idom4 = $idom . '_col_1'; |
|
| 119 | - $idom5 = 'img_' . $idom4; |
|
| 120 | - $idom6 = $idom . '_fonc'; |
|
| 115 | + $idom1 = $idom.'_champ_recherche'; |
|
| 116 | + $idom2 = $idom.'_principal'; |
|
| 117 | + $idom3 = $idom.'_selection'; |
|
| 118 | + $idom4 = $idom.'_col_1'; |
|
| 119 | + $idom5 = 'img_'.$idom4; |
|
| 120 | + $idom6 = $idom.'_fonc'; |
|
| 121 | 121 | |
| 122 | 122 | return "<div id='$idom'>" |
| 123 | 123 | . "<a id='$idom6' style='visibility: hidden;'" |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | . http_img_pack( |
| 128 | 128 | 'loader.svg', |
| 129 | 129 | '', |
| 130 | - "class='loader' style='visibility: hidden;float:" . $GLOBALS['spip_lang_right'] . "' id='$idom5'" |
|
| 130 | + "class='loader' style='visibility: hidden;float:".$GLOBALS['spip_lang_right']."' id='$idom5'" |
|
| 131 | 131 | ) |
| 132 | 132 | . '' |
| 133 | - . "<input style='width: 10em;float:" . $GLOBALS['spip_lang_right'] . ";' type='text' class='text search' id='$idom1' placeholder='" . _T('info_rechercher') . "'" |
|
| 133 | + . "<input style='width: 10em;float:".$GLOBALS['spip_lang_right'].";' type='text' class='text search' id='$idom1' placeholder='"._T('info_rechercher')."'" |
|
| 134 | 134 | // eliminer Return car il provoque la soumission (balise unique) |
| 135 | 135 | // et eliminer Tab pour la navigation au clavier |
| 136 | 136 | // ce serait encore mieux de ne le faire que s'il y a encore plusieurs |
@@ -177,8 +177,8 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | $liste = $id_rubrique; |
| 179 | 179 | $id_rubrique = (int) $id_rubrique; |
| 180 | - while ($id_rubrique = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique = ' . $id_rubrique)) { |
|
| 181 | - $liste = $id_rubrique . ",$liste"; |
|
| 180 | + while ($id_rubrique = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique = '.$id_rubrique)) { |
|
| 181 | + $liste = $id_rubrique.",$liste"; |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | return explode(',', "0,$liste"); |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | $champs[] = 'virtuel'; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $data = sql_fetsel('*', $desc['table'], $_id_table . '=' . (int) $id_trad); |
|
| 57 | + $data = sql_fetsel('*', $desc['table'], $_id_table.'='.(int) $id_trad); |
|
| 58 | 58 | |
| 59 | 59 | foreach ($champs as $c) { |
| 60 | 60 | $set[$c] = $data[$c]; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | // si spip_log() est appelé dans mes_options, toutes les constantes n'ont pas été définies |
| 36 | 36 | $logfile = |
| 37 | - ($logdir ?? (defined('_DIR_LOG') ? _DIR_LOG : _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES)) |
|
| 37 | + ($logdir ?? (defined('_DIR_LOG') ? _DIR_LOG : _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES)) |
|
| 38 | 38 | . $logname |
| 39 | 39 | . ($logsuf ?? (defined('_FILE_LOG_SUFFIX') ? _FILE_LOG_SUFFIX : '.log')); |
| 40 | 40 | |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | // Si le repertoire défini n'existe pas, poser dans tmp/ |
| 52 | 52 | if (!$test_repertoire[$d]) { |
| 53 | - $logfile = _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES . $logname . '.log'; |
|
| 53 | + $logfile = _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES.$logname.'.log'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $rotate = 0; |
| 57 | - $pid = '(pid ' . @getmypid() . ')'; |
|
| 57 | + $pid = '(pid '.@getmypid().')'; |
|
| 58 | 58 | |
| 59 | 59 | // accepter spip_log( Array ) |
| 60 | 60 | if (!is_string($message)) { |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | $fi = substr($fi, strlen(_ROOT_RACINE)); |
| 70 | 70 | } |
| 71 | 71 | $fu = $debug[2]['function'] ?? ''; |
| 72 | - $debugverb = "$fi:L$l:$fu" . '():'; |
|
| 72 | + $debugverb = "$fi:L$l:$fu".'():'; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $m = date('Y-m-d H:i:s') . ' ' . ($GLOBALS['ip'] ?? '') . ' ' . $pid . ' ' |
|
| 75 | + $m = date('Y-m-d H:i:s').' '.($GLOBALS['ip'] ?? '').' '.$pid.' ' |
|
| 76 | 76 | //distinguer les logs prives et publics dans les grep |
| 77 | 77 | . $debugverb |
| 78 | 78 | . (test_espace_prive() ? ':Pri:' : ':Pub:') |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | if ( |
| 97 | 97 | $rotate-- > 0 && function_exists('spip_unlink') |
| 98 | 98 | ) { |
| 99 | - spip_unlink($logfile . '.' . $rotate); |
|
| 99 | + spip_unlink($logfile.'.'.$rotate); |
|
| 100 | 100 | while ($rotate--) { |
| 101 | - @rename($logfile . ($rotate ? '.' . $rotate : ''), $logfile . '.' . ($rotate + 1)); |
|
| 101 | + @rename($logfile.($rotate ? '.'.$rotate : ''), $logfile.'.'.($rotate + 1)); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | $arg = parametre_url($url_action, 'arg'); |
| 95 | - $confirm = md5("$action:$arg:" . realpath(__FILE__)); |
|
| 95 | + $confirm = md5("$action:$arg:".realpath(__FILE__)); |
|
| 96 | 96 | if (_request('confirm_action') === $confirm) { |
| 97 | 97 | return true; |
| 98 | 98 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } else { |
| 146 | 146 | return generer_url_action( |
| 147 | 147 | $action, |
| 148 | - 'arg=' . rawurlencode($arg) . "&hash=$hash" . ($r ? "&redirect=$r" : ''), |
|
| 148 | + 'arg='.rawurlencode($arg)."&hash=$hash".($r ? "&redirect=$r" : ''), |
|
| 149 | 149 | $mode, |
| 150 | 150 | $public |
| 151 | 151 | ); |
@@ -156,9 +156,9 @@ discard block |
||
| 156 | 156 | $hash = calculer_action_auteur("$action-$arg"); |
| 157 | 157 | $att .= " style='margin: 0px; border: 0px'"; |
| 158 | 158 | if ($redirect) { |
| 159 | - $redirect = "\n\t\t<input name='redirect' type='hidden' value='" . str_replace("'", ''', $redirect) . "' />"; |
|
| 159 | + $redirect = "\n\t\t<input name='redirect' type='hidden' value='".str_replace("'", ''', $redirect)."' />"; |
|
| 160 | 160 | } |
| 161 | - $mode .= $redirect . " |
|
| 161 | + $mode .= $redirect." |
|
| 162 | 162 | <input name='hash' type='hidden' value='$hash' /> |
| 163 | 163 | <input name='arg' type='hidden' value='$arg' />"; |
| 164 | 164 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | $pass ??= ''; |
| 227 | 227 | $entry = "$action:$id_auteur:$pass:$alea"; |
| 228 | 228 | if (!isset($sha[$entry])) { |
| 229 | - $sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::" . _action_get_alea($alea)); |
|
| 229 | + $sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::"._action_get_alea($alea)); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | return $sha[$entry]; |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | // On nettoie l’URL de tous les var_. |
| 337 | 337 | $url = nettoyer_uri_var($url); |
| 338 | 338 | |
| 339 | - $token = _action_auteur('previsualiser-' . $url, $id_auteur, secret_du_site(), $alea); |
|
| 339 | + $token = _action_auteur('previsualiser-'.$url, $id_auteur, secret_du_site(), $alea); |
|
| 340 | 340 | return "$id_auteur-$token"; |
| 341 | 341 | } |
| 342 | 342 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | ]; |
| 43 | 43 | $options = array_merge($defaut, $options); |
| 44 | 44 | if (is_numeric($options['expires']) && $options['expires'] > 0) { |
| 45 | - $options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT'; |
|
| 45 | + $options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']).' GMT'; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | if (is_null($options) && isset($_SERVER['HTTP_RANGE'])) { |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | function spip_livrer_fichier_entetes($fichier, $content_type = 'application/octet-stream', $attachment = false, $expires = 0) { |
| 72 | 72 | // toujours envoyer un content type, meme vide ! |
| 73 | 73 | header('Accept-Ranges: bytes'); |
| 74 | - header('Content-Type: ' . $content_type); |
|
| 74 | + header('Content-Type: '.$content_type); |
|
| 75 | 75 | |
| 76 | 76 | if (($fs = stat($fichier)) && !empty($fs['size']) && !empty($fs['mtime'])) { |
| 77 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $fs['mtime']) . ' GMT'); |
|
| 77 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', $fs['mtime']).' GMT'); |
|
| 78 | 78 | header(sprintf('Etag: "%x-%x"', $fs['size'], str_pad($fs['mtime'], 16, '0'))); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | else { |
| 95 | 95 | $f = (is_string($attachment) ? $attachment : basename($fichier)); |
| 96 | 96 | header("Content-Disposition: inline; filename=\"$f\";"); |
| 97 | - header('Expires: ' . $expires); // set expiration time |
|
| 97 | + header('Expires: '.$expires); // set expiration time |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
@@ -146,12 +146,12 @@ discard block |
||
| 146 | 146 | // Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451" |
| 147 | 147 | if ($range && preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) { |
| 148 | 148 | ### Offset signifies where we should begin to read the file |
| 149 | - $byteOffset = (int)$match[1]; |
|
| 149 | + $byteOffset = (int) $match[1]; |
|
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | ### Length is for how long we should read the file according to the browser, and can never go beyond the file size |
| 153 | 153 | if (isset($match[2])) { |
| 154 | - $finishBytes = (int)$match[2]; |
|
| 154 | + $finishBytes = (int) $match[2]; |
|
| 155 | 155 | $byteLength = $finishBytes + 1; |
| 156 | 156 | } else { |
| 157 | 157 | $finishBytes = $fileSize - 1; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | // partial content |
| 174 | 174 | header('HTTP/1.1 206 Partial content'); |
| 175 | - header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent |
|
| 175 | + header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent |
|
| 176 | 176 | |
| 177 | 177 | |
| 178 | 178 | $byteRange = $byteLength - $byteOffset; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $this->serveur = strtolower($serveur); |
| 40 | 40 | |
| 41 | 41 | if (!($this->link = _sqlite_link($this->serveur)) && (!defined('_ECRIRE_INSTALL') || !_ECRIRE_INSTALL)) { |
| 42 | - spip_log('Aucune connexion sqlite (link)', 'sqlite.' . _LOG_ERREUR); |
|
| 42 | + spip_log('Aucune connexion sqlite (link)', 'sqlite.'._LOG_ERREUR); |
|
| 43 | 43 | |
| 44 | 44 | return; |
| 45 | 45 | } |
@@ -85,17 +85,17 @@ discard block |
||
| 85 | 85 | try { |
| 86 | 86 | $r = $this->link->query($query); |
| 87 | 87 | } catch (\PDOException $e) { |
| 88 | - spip_log('PDOException: ' . $e->getMessage(), 'sqlite.' . _LOG_DEBUG); |
|
| 88 | + spip_log('PDOException: '.$e->getMessage(), 'sqlite.'._LOG_DEBUG); |
|
| 89 | 89 | $r = false; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // loger les warnings/erreurs eventuels de sqlite remontant dans PHP |
| 93 | 93 | if ($e && $e instanceof \PDOException) { |
| 94 | - $err = strip_tags($e->getMessage()) . ' in ' . $e->getFile() . ' line ' . $e->getLine(); |
|
| 95 | - spip_log("$err - " . $query, 'sqlite.' . _LOG_ERREUR); |
|
| 94 | + $err = strip_tags($e->getMessage()).' in '.$e->getFile().' line '.$e->getLine(); |
|
| 95 | + spip_log("$err - ".$query, 'sqlite.'._LOG_ERREUR); |
|
| 96 | 96 | } elseif (($err = (function_exists('error_get_last') ? error_get_last() : '')) && $err != $last_error) { |
| 97 | - $err = strip_tags($err['message']) . ' in ' . $err['file'] . ' line ' . $err['line']; |
|
| 98 | - spip_log("$err - " . $query, 'sqlite.' . _LOG_ERREUR); |
|
| 97 | + $err = strip_tags($err['message']).' in '.$err['file'].' line '.$err['line']; |
|
| 98 | + spip_log("$err - ".$query, 'sqlite.'._LOG_ERREUR); |
|
| 99 | 99 | } else { |
| 100 | 100 | $err = ''; |
| 101 | 101 | } |