@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $result = sql_select( |
| 43 | 43 | 'id_rubrique, id_parent, titre, descriptif, lang', |
| 44 | 44 | 'spip_rubriques', |
| 45 | - 'id_parent=' . (int) $collection, |
|
| 45 | + 'id_parent='.(int) $collection, |
|
| 46 | 46 | '', |
| 47 | 47 | '0+titre,titre', |
| 48 | 48 | $debut == -1 ? '' : "$debut,$limite" |
@@ -73,13 +73,13 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $lib_bouton = (acces_restreint_rubrique($id_rubrique) |
| 75 | 75 | ? http_img_pack('auteur-0minirezo-16.png', '', " width='16' height='16'", _T('image_administrer_rubrique')) |
| 76 | - : '') . |
|
| 77 | - " <a class='titremlien' dir='$lang_dir'" . |
|
| 78 | - ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='" . $row['lang'] . "'" : '') . |
|
| 79 | - " href='" . |
|
| 80 | - generer_objet_url($id_rubrique, 'rubrique') . |
|
| 81 | - "'><span class='titre'>" . |
|
| 82 | - $rang . $titre |
|
| 76 | + : ''). |
|
| 77 | + " <a class='titremlien' dir='$lang_dir'". |
|
| 78 | + ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='".$row['lang']."'" : ''). |
|
| 79 | + " href='". |
|
| 80 | + generer_objet_url($id_rubrique, 'rubrique'). |
|
| 81 | + "'><span class='titre'>". |
|
| 82 | + $rang.$titre |
|
| 83 | 83 | . '</span>' |
| 84 | 84 | . (is_string($logo) ? $logo : '') |
| 85 | 85 | . '</a>'; |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | ; |
| 90 | 90 | |
| 91 | 91 | $res[] = |
| 92 | - debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre) . |
|
| 93 | - $les_sous_enfants . |
|
| 92 | + debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre). |
|
| 93 | + $les_sous_enfants. |
|
| 94 | 94 | fin_cadre_sous_rub(); |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * Le contenu du bloc dépliable |
| 110 | 110 | */ |
| 111 | 111 | function sous_enfant_rub($collection2) { |
| 112 | - $nb = sql_countsel('spip_rubriques', 'id_parent=' . (int) $collection2); |
|
| 112 | + $nb = sql_countsel('spip_rubriques', 'id_parent='.(int) $collection2); |
|
| 113 | 113 | |
| 114 | 114 | $retour = ''; |
| 115 | 115 | $pagination = ''; |
@@ -121,23 +121,23 @@ discard block |
||
| 121 | 121 | * Si > 500 on affiche une pagination |
| 122 | 122 | */ |
| 123 | 123 | if ($nb > $limite) { |
| 124 | - $debut = _request('debut_rubrique' . $collection2) ?: $debut; |
|
| 124 | + $debut = _request('debut_rubrique'.$collection2) ?: $debut; |
|
| 125 | 125 | $pagination = chercher_filtre('pagination'); |
| 126 | - $pagination = '<nav class="pagination">' . $pagination( |
|
| 126 | + $pagination = '<nav class="pagination">'.$pagination( |
|
| 127 | 127 | $nb, |
| 128 | - '_rubrique' . $collection2, |
|
| 128 | + '_rubrique'.$collection2, |
|
| 129 | 129 | $debut, |
| 130 | 130 | $limite, |
| 131 | 131 | true, |
| 132 | 132 | 'prive' |
| 133 | - ) . '</nav>'; |
|
| 133 | + ).'</nav>'; |
|
| 134 | 134 | $limite = $debut + $limite; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | $result = sql_select( |
| 138 | 138 | 'id_rubrique, id_parent, titre, lang', |
| 139 | 139 | 'spip_rubriques', |
| 140 | - 'id_parent=' . (int) $collection2, |
|
| 140 | + 'id_parent='.(int) $collection2, |
|
| 141 | 141 | '', |
| 142 | 142 | '0+titre,titre', |
| 143 | 143 | $debut == -1 ? '' : "$debut,$limite" |
@@ -157,14 +157,14 @@ discard block |
||
| 157 | 157 | changer_typo($row['lang']); |
| 158 | 158 | $lang_dir = lang_dir($row['lang']); |
| 159 | 159 | if (autoriser('voir', 'rubrique', $id_rubrique2)) { |
| 160 | - $retour .= "\n<li class='item' dir='$lang_dir'><a href='" . generer_objet_url( |
|
| 160 | + $retour .= "\n<li class='item' dir='$lang_dir'><a href='".generer_objet_url( |
|
| 161 | 161 | $id_rubrique2, |
| 162 | 162 | 'rubrique' |
| 163 | - ) . "'>" . $rang2 . $titre2 . "</a></li>\n"; |
|
| 163 | + )."'>".$rang2.$titre2."</a></li>\n"; |
|
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - $retour = $pagination . $retour . $pagination; |
|
| 167 | + $retour = $pagination.$retour.$pagination; |
|
| 168 | 168 | |
| 169 | 169 | if (!$retour) { |
| 170 | 170 | return ''; |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | return debut_block_depliable($debut > 0, "enfants$collection2") |
| 174 | 174 | . "\n<ul class='liste-items sous-sous-rub'>\n" |
| 175 | 175 | . $retour |
| 176 | - . "</ul>\n" . fin_block() . "\n\n"; |
|
| 176 | + . "</ul>\n".fin_block()."\n\n"; |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -192,13 +192,13 @@ discard block |
||
| 192 | 192 | $debut = 0; |
| 193 | 193 | $limite = 500; |
| 194 | 194 | |
| 195 | - $nb = sql_countsel('spip_rubriques', 'id_parent=' . (int) $id_rubrique); |
|
| 195 | + $nb = sql_countsel('spip_rubriques', 'id_parent='.(int) $id_rubrique); |
|
| 196 | 196 | |
| 197 | 197 | if ($nb > $limite) { |
| 198 | - $debut = _request('debut_rubrique' . $id_rubrique) ?: $debut; |
|
| 198 | + $debut = _request('debut_rubrique'.$id_rubrique) ?: $debut; |
|
| 199 | 199 | $pagination = chercher_filtre('pagination'); |
| 200 | - $pagination = '<br class="nettoyeur"><nav class="pagination">' . |
|
| 201 | - $pagination($nb, '_rubrique' . $id_rubrique, $debut, $limite, true, 'prive') . |
|
| 200 | + $pagination = '<br class="nettoyeur"><nav class="pagination">'. |
|
| 201 | + $pagination($nb, '_rubrique'.$id_rubrique, $debut, $limite, true, 'prive'). |
|
| 202 | 202 | '</nav>'; |
| 203 | 203 | } |
| 204 | 204 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $id_rubrique = $GLOBALS['connect_id_rubrique'][0]; |
| 42 | 42 | } elseif ( |
| 43 | 43 | is_int(_AUTO_SELECTION_RUBRIQUE) |
| 44 | - && sql_fetsel('id_rubrique', 'spip_rubriques', 'id_rubrique=' . (int) _AUTO_SELECTION_RUBRIQUE) |
|
| 44 | + && sql_fetsel('id_rubrique', 'spip_rubriques', 'id_rubrique='.(int) _AUTO_SELECTION_RUBRIQUE) |
|
| 45 | 45 | ) { |
| 46 | 46 | $id_rubrique = _AUTO_SELECTION_RUBRIQUE; |
| 47 | 47 | } else { |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | $id_rubrique = $row_rub['id_rubrique']; |
| 51 | 51 | } |
| 52 | 52 | // si le choix ne convient pas, on cherche dans un secteur |
| 53 | - if (!autoriser('creer' . $objet . 'dans', 'rubrique', $id_rubrique)) { |
|
| 53 | + if (!autoriser('creer'.$objet.'dans', 'rubrique', $id_rubrique)) { |
|
| 54 | 54 | $id_rubrique = ''; |
| 55 | 55 | // manque de chance, la rubrique n'est pas autorisee, on cherche un des secteurs autorises |
| 56 | 56 | $res = sql_select('id_rubrique', 'spip_rubriques', 'id_parent=0'); |
| 57 | 57 | while (!$id_rubrique && ($row_rub = sql_fetch($res))) { |
| 58 | - if (autoriser('creer' . $objet . 'dans', 'rubrique', $row_rub['id_rubrique'])) { |
|
| 58 | + if (autoriser('creer'.$objet.'dans', 'rubrique', $row_rub['id_rubrique'])) { |
|
| 59 | 59 | $id_rubrique = $row_rub['id_rubrique']; |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | if (!$max_age) { |
| 107 | 107 | $max_age = _DEFAULT_LOCKTIME; |
| 108 | 108 | } |
| 109 | - $lock_file = _DIR_TMP . _NAME_LOCK . '-' . substr(md5($fichier), 0, 8); |
|
| 109 | + $lock_file = _DIR_TMP._NAME_LOCK.'-'.substr(md5($fichier), 0, 8); |
|
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | /* |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | |
| 117 | 117 | $id = creer_uniqid(); |
| 118 | - $tpath = _DIR_TMP . "slock.$id"; |
|
| 118 | + $tpath = _DIR_TMP."slock.$id"; |
|
| 119 | 119 | $tmpfd = @fopen($tpath, 'w'); // hum, le 'x' necessite php4,3,2 ... |
| 120 | 120 | if (!$tmpfd) { /* open failed */ |
| 121 | 121 | @fclose($tmpfd); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * thinks the current time is (our_tmp.st_ctime).. |
| 242 | 242 | */ |
| 243 | 243 | |
| 244 | - $tpath = _DIR_TMP . "stime.$id"; |
|
| 244 | + $tpath = _DIR_TMP."stime.$id"; |
|
| 245 | 245 | $tmpfd = @fopen($tpath, 'w'); |
| 246 | 246 | if (!$tmpfd || @fwrite($tmpfd, 'zz', 2) != 2 || !($our_tmp = fstat($tmpfd))) { |
| 247 | 247 | /* The open failed, or we can't write the file, or we can't stat it */ |
@@ -251,14 +251,14 @@ discard block |
||
| 251 | 251 | return false; //(NFSL_SYSF); |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - @fclose($tmpfd); /* We don't need this once we have our_tmp.st_ctime. */ |
|
| 254 | + @fclose($tmpfd); /* We don't need this once we have our_tmp.st_ctime. */ |
|
| 255 | 255 | spip_unlink($tpath); |
| 256 | 256 | |
| 257 | 257 | /* |
| 258 | 258 | * 2. make fullpath, a buffer for the full pathname of the lock file |
| 259 | 259 | */ |
| 260 | 260 | |
| 261 | - $lock_file = _DIR_TMP . _NAME_LOCK . '-' . substr(md5($fichier), 0, 8); |
|
| 261 | + $lock_file = _DIR_TMP._NAME_LOCK.'-'.substr(md5($fichier), 0, 8); |
|
| 262 | 262 | |
| 263 | 263 | /* |
| 264 | 264 | * 3. If the ctime hasn't been modified, unlink the file and return. If the |
@@ -278,10 +278,10 @@ discard block |
||
| 278 | 278 | if (!$test) { |
| 279 | 279 | return false; |
| 280 | 280 | } //(NFSL_LOST); |
| 281 | - sleep(1 + (random_int(0, 4))); /* so sleep a bit */ |
|
| 281 | + sleep(1 + (random_int(0, 4))); /* so sleep a bit */ |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - return true;//(NFSL_OK); /* success */ |
|
| 284 | + return true; //(NFSL_OK); /* success */ |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | /* |
@@ -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 |
@@ -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]; |
@@ -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; |