@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $_id_table = reset($_id_table); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - $requete['SELECT'][] = 't.' . $_id_table; |
|
| 69 | + $requete['SELECT'][] = 't.'.$_id_table; |
|
| 70 | 70 | $a = []; |
| 71 | 71 | // Recherche fulltext |
| 72 | 72 | foreach ($champs as $champ => $poids) { |
@@ -77,13 +77,13 @@ discard block |
||
| 77 | 77 | $champ = "t.$champ"; |
| 78 | 78 | } |
| 79 | 79 | $requete['SELECT'][] = $champ; |
| 80 | - $a[] = $champ . ' ' . $methode . ' ' . $q; |
|
| 80 | + $a[] = $champ.' '.$methode.' '.$q; |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | if ($a) { |
| 84 | 84 | $requete['WHERE'][] = implode(' OR ', $a); |
| 85 | 85 | } |
| 86 | - $requete['FROM'][] = table_objet_sql($table) . ' AS t'; |
|
| 86 | + $requete['FROM'][] = table_objet_sql($table).' AS t'; |
|
| 87 | 87 | |
| 88 | 88 | $results = []; |
| 89 | 89 | |
@@ -244,8 +244,8 @@ discard block |
||
| 244 | 244 | ); |
| 245 | 245 | } // cas table de liaison generique spip_xxx_yyy |
| 246 | 246 | elseif ( |
| 247 | - ($t = $trouver_table($table_arrivee . '_' . $table_depart, $serveur)) |
|
| 248 | - || ($t = $trouver_table($table_depart . '_' . $table_arrivee, $serveur)) |
|
| 247 | + ($t = $trouver_table($table_arrivee.'_'.$table_depart, $serveur)) |
|
| 248 | + || ($t = $trouver_table($table_depart.'_'.$table_arrivee, $serveur)) |
|
| 249 | 249 | ) { |
| 250 | 250 | $s = sql_select( |
| 251 | 251 | "$cle_depart,$cle_arrivee", |
@@ -284,12 +284,12 @@ discard block |
||
| 284 | 284 | } |
| 285 | 285 | if (isset($joint['champs']) && $joint['champs']) { |
| 286 | 286 | foreach ($joint['champs'] as $c => $val) { |
| 287 | - $results[$id]['champs'][$table_liee . '.' . $c] = $val; |
|
| 287 | + $results[$id]['champs'][$table_liee.'.'.$c] = $val; |
|
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | if (isset($joint['matches']) && $joint['matches']) { |
| 291 | 291 | foreach ($joint['matches'] as $c => $val) { |
| 292 | - $results[$id]['matches'][$table_liee . '.' . $c] = $val; |
|
| 292 | + $results[$id]['matches'][$table_liee.'.'.$c] = $val; |
|
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | } |
@@ -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 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | if (str_starts_with($recherche, '/') && str_ends_with($recherche, '/') && strlen($recherche) > 2) { |
| 99 | 99 | // c'est une preg |
| 100 | 100 | $recherche_trans = translitteration($recherche); |
| 101 | - $preg = $recherche_trans . $options['preg_flags']; |
|
| 101 | + $preg = $recherche_trans.$options['preg_flags']; |
|
| 102 | 102 | $is_preg = true; |
| 103 | 103 | } else { |
| 104 | 104 | // s'il y a plusieurs mots il faut les chercher tous : oblige REGEXP, |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - if (preg_match(',\s+,' . $u, $recherche_mod)) { |
|
| 121 | + if (preg_match(',\s+,'.$u, $recherche_mod)) { |
|
| 122 | 122 | $is_preg = true; |
| 123 | 123 | |
| 124 | 124 | $recherche_inter = '|'; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | foreach ($recherche_mots as $mot) { |
| 129 | 129 | if (strlen($mot) >= $min_long) { |
| 130 | 130 | // echapper les caracteres de regexp qui sont eventuellement dans la recherche |
| 131 | - $recherche_inter .= preg_quote($mot) . ' '; |
|
| 131 | + $recherche_inter .= preg_quote($mot).' '; |
|
| 132 | 132 | $petits_mots = false; |
| 133 | 133 | } |
| 134 | 134 | } |
@@ -136,14 +136,14 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | // mais on cherche quand même l'expression complète, même si elle |
| 138 | 138 | // comporte des mots de moins de quatre lettres |
| 139 | - $recherche = trim(preg_replace(',\s+,' . $u, '|', $recherche_inter), '|'); |
|
| 139 | + $recherche = trim(preg_replace(',\s+,'.$u, '|', $recherche_inter), '|'); |
|
| 140 | 140 | if (!$recherche || $petits_mots) { |
| 141 | 141 | $recherche = preg_quote($recherche_org); |
| 142 | 142 | } |
| 143 | 143 | $recherche_trans = translitteration($recherche); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - $preg = '/' . str_replace('/', '\\/', $recherche_trans) . '/' . $options['preg_flags']; |
|
| 146 | + $preg = '/'.str_replace('/', '\\/', $recherche_trans).'/'.$options['preg_flags']; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | // Si la chaine est inactive, on va utiliser LIKE pour aller plus vite |
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | $q = sql_quote( |
| 182 | 182 | '%' |
| 183 | - . preg_replace(',\s+,' . $u, '%', $q) |
|
| 183 | + . preg_replace(',\s+,'.$u, '%', $q) |
|
| 184 | 184 | . '%' |
| 185 | 185 | ); |
| 186 | 186 | |
| 187 | - $preg = '/' . preg_replace(',\s+,' . $u, '.+', trim($recherche_mod)) . '/' . $options['preg_flags']; |
|
| 187 | + $preg = '/'.preg_replace(',\s+,'.$u, '.+', trim($recherche_mod)).'/'.$options['preg_flags']; |
|
| 188 | 188 | } else { |
| 189 | 189 | $methode = 'REGEXP'; |
| 190 | 190 | $q = sql_quote(trim($recherche, '/')); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | foreach ($tables as $table => $champs) { |
| 304 | 304 | # lock via memoization, si dispo |
| 305 | 305 | if (function_exists('cache_lock')) { |
| 306 | - cache_lock($lock = _RECHERCHE_LOCK_KEY . ' ' . $table . ' ' . $recherche); |
|
| 306 | + cache_lock($lock = _RECHERCHE_LOCK_KEY.' '.$table.' '.$recherche); |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | spip_timer('rech'); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | |
| 320 | 320 | spip_log( |
| 321 | - "recherche $table ($recherche) : " . (is_countable($results[$table]) ? count($results[$table]) : 0) . ' resultats ' . spip_timer('rech'), |
|
| 321 | + "recherche $table ($recherche) : ".(is_countable($results[$table]) ? count($results[$table]) : 0).' resultats '.spip_timer('rech'), |
|
| 322 | 322 | 'recherche' |
| 323 | 323 | ); |
| 324 | 324 | |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | |
| 353 | 353 | $results = recherche_en_base($recherche, $tables, $options); |
| 354 | 354 | |
| 355 | - $preg = '/' . str_replace('/', '\\/', $recherche) . '/' . $options['preg_flags']; |
|
| 355 | + $preg = '/'.str_replace('/', '\\/', $recherche).'/'.$options['preg_flags']; |
|
| 356 | 356 | |
| 357 | 357 | foreach ($results as $table => $r) { |
| 358 | 358 | $_id_table = id_table_objet($table); |
@@ -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 |
@@ -42,13 +42,13 @@ discard block |
||
| 42 | 42 | $blue = dechex($blue); |
| 43 | 43 | |
| 44 | 44 | if (strlen($red) == 1) { |
| 45 | - $red = '0' . $red; |
|
| 45 | + $red = '0'.$red; |
|
| 46 | 46 | } |
| 47 | 47 | if (strlen($green) == 1) { |
| 48 | - $green = '0' . $green; |
|
| 48 | + $green = '0'.$green; |
|
| 49 | 49 | } |
| 50 | 50 | if (strlen($blue) == 1) { |
| 51 | - $blue = '0' . $blue; |
|
| 51 | + $blue = '0'.$blue; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return "$red$green$blue"; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $couleur = couleur_html_to_hex($couleur); |
| 68 | 68 | $couleur = ltrim($couleur, '#'); |
| 69 | 69 | if (strlen($couleur) === 3) { |
| 70 | - $couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2]; |
|
| 70 | + $couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2]; |
|
| 71 | 71 | } |
| 72 | 72 | $retour = []; |
| 73 | 73 | $retour['red'] = hexdec(substr($couleur, 0, 2)); |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | $var_G = ($G / 255); |
| 126 | 126 | $var_B = ($B / 255); |
| 127 | 127 | |
| 128 | - $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 129 | - $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 130 | - $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 128 | + $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 129 | + $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 130 | + $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 131 | 131 | |
| 132 | 132 | $L = ($var_Max + $var_Min) / 2; |
| 133 | 133 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | function _couleur_hsl_to_rgb($H, $S, $L) { |
| 187 | 187 | // helper |
| 188 | - $hue_2_rgb = function ($v1, $v2, $vH) { |
|
| 188 | + $hue_2_rgb = function($v1, $v2, $vH) { |
|
| 189 | 189 | if ($vH < 0) { |
| 190 | 190 | $vH += 1; |
| 191 | 191 | } |
@@ -319,11 +319,11 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | } elseif ( |
| 321 | 321 | preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs) |
| 322 | - && ($extension = _image_trouver_extension_depuis_mime('image/' . $regs[1])) |
|
| 322 | + && ($extension = _image_trouver_extension_depuis_mime('image/'.$regs[1])) |
|
| 323 | 323 | && in_array($extension, _image_extensions_acceptees_en_entree()) |
| 324 | 324 | ) { |
| 325 | 325 | # gerer img src="data:....base64" |
| 326 | - $local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension); |
|
| 326 | + $local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension); |
|
| 327 | 327 | if (!file_exists($local)) { |
| 328 | 328 | ecrire_fichier($local, base64_decode($regs[2])); |
| 329 | 329 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | // les protocoles web prennent au moins 3 lettres |
| 341 | 341 | if (tester_url_absolue($source)) { |
| 342 | 342 | include_spip('inc/distant'); |
| 343 | - $fichier = _DIR_RACINE . copie_locale($source); |
|
| 343 | + $fichier = _DIR_RACINE.copie_locale($source); |
|
| 344 | 344 | if (!$fichier) { |
| 345 | 345 | return ''; |
| 346 | 346 | } |
@@ -442,9 +442,9 @@ discard block |
||
| 442 | 442 | // on garde la terminaison initiale car image simplement copiee |
| 443 | 443 | // et on postfixe son nom avec un md5 du path |
| 444 | 444 | $terminaison_dest = $terminaison; |
| 445 | - $fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5); |
|
| 445 | + $fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5); |
|
| 446 | 446 | } else { |
| 447 | - $fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5); |
|
| 447 | + $fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5); |
|
| 448 | 448 | } |
| 449 | 449 | $cache = sous_repertoire(_DIR_VAR, $cache); |
| 450 | 450 | $cache = sous_repertoire($cache, $effet); |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | $fichier_dest = substr($fichier_dest, 2); |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | - $fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest; |
|
| 458 | + $fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest; |
|
| 459 | 459 | |
| 460 | 460 | $GLOBALS['images_calculees'][] = $fichier_dest; |
| 461 | 461 | |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | } |
| 482 | 482 | if ($creer && !@file_exists($fichier)) { |
| 483 | 483 | if (!@file_exists("$fichier.src")) { |
| 484 | - spip_log("Image absente : $fichier", 'images' . _LOG_ERREUR); |
|
| 484 | + spip_log("Image absente : $fichier", 'images'._LOG_ERREUR); |
|
| 485 | 485 | |
| 486 | 486 | return false; |
| 487 | 487 | } |
@@ -491,15 +491,15 @@ discard block |
||
| 491 | 491 | |
| 492 | 492 | if ($creer) { |
| 493 | 493 | spip_log( |
| 494 | - 'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier", |
|
| 495 | - 'images' . _LOG_DEBUG |
|
| 494 | + 'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier", |
|
| 495 | + 'images'._LOG_DEBUG |
|
| 496 | 496 | ); |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | $term_fonction = _image_trouver_extension_pertinente($fichier); |
| 500 | - $ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction; |
|
| 500 | + $ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction; |
|
| 501 | 501 | $ret['fichier'] = $fichier; |
| 502 | - $ret['fonction_image'] = '_image_image' . $terminaison_dest; |
|
| 502 | + $ret['fonction_image'] = '_image_image'.$terminaison_dest; |
|
| 503 | 503 | $ret['fichier_dest'] = $fichier_dest; |
| 504 | 504 | $ret['format_source'] = _image_extension_normalisee($terminaison); |
| 505 | 505 | $ret['format_dest'] = $terminaison_dest; |
@@ -643,7 +643,7 @@ discard block |
||
| 643 | 643 | |
| 644 | 644 | $_terminaison = _image_trouver_extension_depuis_mime($mime); |
| 645 | 645 | if ($_terminaison && $_terminaison !== $terminaison) { |
| 646 | - spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE); |
|
| 646 | + spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE); |
|
| 647 | 647 | $terminaison = $_terminaison; |
| 648 | 648 | } |
| 649 | 649 | return $terminaison; |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | if (!function_exists('imagepng')) { |
| 779 | 779 | return false; |
| 780 | 780 | } |
| 781 | - $tmp = $fichier . '.tmp'; |
|
| 781 | + $tmp = $fichier.'.tmp'; |
|
| 782 | 782 | $ret = imagepng($img, $tmp); |
| 783 | 783 | if (file_exists($tmp)) { |
| 784 | 784 | $taille_test = @getimagesize($tmp); |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | if (!function_exists('imagegif')) { |
| 814 | 814 | return false; |
| 815 | 815 | } |
| 816 | - $tmp = $fichier . '.tmp'; |
|
| 816 | + $tmp = $fichier.'.tmp'; |
|
| 817 | 817 | $ret = imagegif($img, $tmp); |
| 818 | 818 | if (file_exists($tmp)) { |
| 819 | 819 | $taille_test = @getimagesize($tmp); |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | if (!function_exists('imagejpeg')) { |
| 854 | 854 | return false; |
| 855 | 855 | } |
| 856 | - $tmp = $fichier . '.tmp'; |
|
| 856 | + $tmp = $fichier.'.tmp'; |
|
| 857 | 857 | |
| 858 | 858 | // Enable interlancing |
| 859 | 859 | imageinterlace($img, true); |
@@ -914,7 +914,7 @@ discard block |
||
| 914 | 914 | if (!function_exists('imagewebp')) { |
| 915 | 915 | return false; |
| 916 | 916 | } |
| 917 | - $tmp = $fichier . '.tmp'; |
|
| 917 | + $tmp = $fichier.'.tmp'; |
|
| 918 | 918 | $ret = imagewebp($img, $tmp, $qualite); |
| 919 | 919 | if (file_exists($tmp)) { |
| 920 | 920 | $taille_test = @getimagesize($tmp); |
@@ -948,7 +948,7 @@ discard block |
||
| 948 | 948 | */ |
| 949 | 949 | function _image_imagesvg($img, $fichier) { |
| 950 | 950 | |
| 951 | - $tmp = $fichier . '.tmp'; |
|
| 951 | + $tmp = $fichier.'.tmp'; |
|
| 952 | 952 | if (!str_contains($img, '<')) { |
| 953 | 953 | $img = supprimer_timestamp($img); |
| 954 | 954 | if (!file_exists($img)) { |
@@ -1005,14 +1005,14 @@ discard block |
||
| 1005 | 1005 | */ |
| 1006 | 1006 | function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) { |
| 1007 | 1007 | if (is_null($fonction)) { |
| 1008 | - $fonction = '_image_image' . $valeurs['format_dest']; |
|
| 1008 | + $fonction = '_image_image'.$valeurs['format_dest']; |
|
| 1009 | 1009 | } |
| 1010 | 1010 | $ret = false; |
| 1011 | 1011 | #un flag pour reperer les images gravees |
| 1012 | 1012 | $lock = ( |
| 1013 | 1013 | !statut_effacer_images_temporaires('get') |
| 1014 | 1014 | || @file_exists($valeurs['fichier_dest']) |
| 1015 | - && !@file_exists($valeurs['fichier_dest'] . '.src') |
|
| 1015 | + && !@file_exists($valeurs['fichier_dest'].'.src') |
|
| 1016 | 1016 | ); |
| 1017 | 1017 | if ( |
| 1018 | 1018 | function_exists($fonction) |
@@ -1024,7 +1024,7 @@ discard block |
||
| 1024 | 1024 | [$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']); |
| 1025 | 1025 | $valeurs['date'] = @filemtime($valeurs['fichier_dest']); |
| 1026 | 1026 | // pour la retrouver apres disparition |
| 1027 | - ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true); |
|
| 1027 | + ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true); |
|
| 1028 | 1028 | } |
| 1029 | 1029 | |
| 1030 | 1030 | return $ret; |
@@ -1199,7 +1199,7 @@ discard block |
||
| 1199 | 1199 | |
| 1200 | 1200 | // attributs deprecies. Transformer en CSS |
| 1201 | 1201 | if ($espace = extraire_attribut($tag, 'hspace')) { |
| 1202 | - $style = "margin:{$espace}px;" . $style; |
|
| 1202 | + $style = "margin:{$espace}px;".$style; |
|
| 1203 | 1203 | $tag = inserer_attribut($tag, 'hspace', ''); |
| 1204 | 1204 | } |
| 1205 | 1205 | |
@@ -1322,7 +1322,7 @@ discard block |
||
| 1322 | 1322 | $image = $valeurs['fichier']; |
| 1323 | 1323 | $format = $valeurs['format_source']; |
| 1324 | 1324 | $destdir = dirname($valeurs['fichier_dest']); |
| 1325 | - $destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']); |
|
| 1325 | + $destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']); |
|
| 1326 | 1326 | |
| 1327 | 1327 | $format_sortie = $valeurs['format_dest']; |
| 1328 | 1328 | |
@@ -1354,7 +1354,7 @@ discard block |
||
| 1354 | 1354 | |
| 1355 | 1355 | // Si l'image est de la taille demandee (ou plus petite), simplement la retourner |
| 1356 | 1356 | if ($srcWidth && $srcWidth <= $maxWidth && $srcHeight <= $maxHeight) { |
| 1357 | - $vignette = $destination . '.' . $format; |
|
| 1357 | + $vignette = $destination.'.'.$format; |
|
| 1358 | 1358 | @copy($image, $vignette); |
| 1359 | 1359 | } |
| 1360 | 1360 | |
@@ -1362,7 +1362,7 @@ discard block |
||
| 1362 | 1362 | include_spip('inc/svg'); |
| 1363 | 1363 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1364 | 1364 | $format_sortie = 'svg'; |
| 1365 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1365 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1366 | 1366 | $valeurs['fichier_dest'] = $vignette; |
| 1367 | 1367 | _image_gd_output($svg, $valeurs); |
| 1368 | 1368 | } |
@@ -1374,9 +1374,9 @@ discard block |
||
| 1374 | 1374 | define('_CONVERT_COMMAND', 'convert'); |
| 1375 | 1375 | } // Securite : mes_options.php peut preciser le chemin absolu |
| 1376 | 1376 | if (!defined('_RESIZE_COMMAND')) { |
| 1377 | - define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -orient Undefined -resize %xx%y! %src %dest'); |
|
| 1377 | + define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -orient Undefined -resize %xx%y! %src %dest'); |
|
| 1378 | 1378 | } |
| 1379 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1379 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1380 | 1380 | $commande = str_replace( |
| 1381 | 1381 | ['%x', '%y', '%src', '%dest'], |
| 1382 | 1382 | [ |
@@ -1392,7 +1392,7 @@ discard block |
||
| 1392 | 1392 | if (!@file_exists($vignette)) { |
| 1393 | 1393 | spip_log("echec convert sur $vignette"); |
| 1394 | 1394 | |
| 1395 | - return; // echec commande |
|
| 1395 | + return; // echec commande |
|
| 1396 | 1396 | } |
| 1397 | 1397 | } |
| 1398 | 1398 | |
@@ -1409,7 +1409,7 @@ discard block |
||
| 1409 | 1409 | if (!$output) { |
| 1410 | 1410 | return; |
| 1411 | 1411 | } |
| 1412 | - $vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie; |
|
| 1412 | + $vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie; |
|
| 1413 | 1413 | |
| 1414 | 1414 | $imagick = new Imagick(); |
| 1415 | 1415 | $imagick->readImage(realpath($image)); |
@@ -1418,7 +1418,7 @@ discard block |
||
| 1418 | 1418 | $destHeight, |
| 1419 | 1419 | Imagick::FILTER_LANCZOS, |
| 1420 | 1420 | 1 |
| 1421 | - );//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1421 | + ); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1422 | 1422 | $imagick->writeImage($vignette); |
| 1423 | 1423 | |
| 1424 | 1424 | if (!@file_exists($vignette)) { |
@@ -1427,7 +1427,7 @@ discard block |
||
| 1427 | 1427 | return; |
| 1428 | 1428 | } |
| 1429 | 1429 | // remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester) |
| 1430 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1430 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1431 | 1431 | } |
| 1432 | 1432 | |
| 1433 | 1433 | // netpbm |
@@ -1438,11 +1438,11 @@ discard block |
||
| 1438 | 1438 | if (_PNMSCALE_COMMAND == '') { |
| 1439 | 1439 | return; |
| 1440 | 1440 | } |
| 1441 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1441 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1442 | 1442 | $pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND); |
| 1443 | 1443 | if ($format == 'jpg') { |
| 1444 | 1444 | $jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND); |
| 1445 | - exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1445 | + exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1446 | 1446 | if (!($s = @filesize($vignette))) { |
| 1447 | 1447 | spip_unlink($vignette); |
| 1448 | 1448 | } |
@@ -1454,7 +1454,7 @@ discard block |
||
| 1454 | 1454 | } else { |
| 1455 | 1455 | if ($format == 'gif') { |
| 1456 | 1456 | $giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND); |
| 1457 | - exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1457 | + exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1458 | 1458 | if (!($s = @filesize($vignette))) { |
| 1459 | 1459 | spip_unlink($vignette); |
| 1460 | 1460 | } |
@@ -1466,7 +1466,7 @@ discard block |
||
| 1466 | 1466 | } else { |
| 1467 | 1467 | if ($format == 'png') { |
| 1468 | 1468 | $pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND); |
| 1469 | - exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1469 | + exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1470 | 1470 | if (!($s = @filesize($vignette))) { |
| 1471 | 1471 | spip_unlink($vignette); |
| 1472 | 1472 | } |
@@ -1488,7 +1488,7 @@ discard block |
||
| 1488 | 1488 | return; |
| 1489 | 1489 | } |
| 1490 | 1490 | if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) { |
| 1491 | - spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels'); |
|
| 1491 | + spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels'); |
|
| 1492 | 1492 | |
| 1493 | 1493 | return; |
| 1494 | 1494 | } |
@@ -1790,7 +1790,7 @@ discard block |
||
| 1790 | 1790 | // de l'image, de facon a tromper le cache du navigateur |
| 1791 | 1791 | // quand on fait supprimer/reuploader un logo |
| 1792 | 1792 | // (pas de filemtime si SAFE MODE) |
| 1793 | - $date = test_espace_prive() ? ('?' . $date) : ''; |
|
| 1793 | + $date = test_espace_prive() ? ('?'.$date) : ''; |
|
| 1794 | 1794 | |
| 1795 | 1795 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1796 | 1796 | } |
@@ -1868,9 +1868,9 @@ discard block |
||
| 1868 | 1868 | $b = $argb['blue']; |
| 1869 | 1869 | |
| 1870 | 1870 | if ($bpp[$key] == 32) { |
| 1871 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a); |
|
| 1871 | + $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a); |
|
| 1872 | 1872 | } elseif ($bpp[$key] === 24) { |
| 1873 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r); |
|
| 1873 | + $icXOR[$key] .= chr($b).chr($g).chr($r); |
|
| 1874 | 1874 | } |
| 1875 | 1875 | |
| 1876 | 1876 | if ($a < 128) { |
@@ -1897,48 +1897,48 @@ discard block |
||
| 1897 | 1897 | |
| 1898 | 1898 | // BITMAPINFOHEADER - 40 bytes |
| 1899 | 1899 | $BitmapInfoHeader[$key] = ''; |
| 1900 | - $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1901 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1900 | + $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1901 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1902 | 1902 | // The biHeight member specifies the combined |
| 1903 | 1903 | // height of the XOR and AND masks. |
| 1904 | 1904 | $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG biHeight; |
| 1905 | - $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1906 | - $BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00"; // wBitCount; |
|
| 1907 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1908 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1909 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1910 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1911 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1912 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1905 | + $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1906 | + $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount; |
|
| 1907 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1908 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1909 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1910 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1911 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1912 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1913 | 1913 | } |
| 1914 | 1914 | |
| 1915 | 1915 | |
| 1916 | - $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1917 | - $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1918 | - $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1916 | + $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1917 | + $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1918 | + $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1919 | 1919 | |
| 1920 | 1920 | $dwImageOffset = 6 + (count($gd_image_array) * 16); |
| 1921 | 1921 | foreach (array_keys($gd_image_array) as $key) { |
| 1922 | 1922 | // ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) |
| 1923 | 1923 | |
| 1924 | - $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1925 | - $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1926 | - $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1927 | - $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1924 | + $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1925 | + $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1926 | + $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1927 | + $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1928 | 1928 | |
| 1929 | - $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1930 | - $icondata .= chr($bpp[$key]) . "\x00"; // wBitCount; // Bits per pixel |
|
| 1929 | + $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1930 | + $icondata .= chr($bpp[$key])."\x00"; // wBitCount; // Bits per pixel |
|
| 1931 | 1931 | |
| 1932 | 1932 | $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]); |
| 1933 | 1933 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1934 | 1934 | $dwBytesInRes, |
| 1935 | 1935 | 4 |
| 1936 | - ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1936 | + ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1937 | 1937 | |
| 1938 | 1938 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1939 | 1939 | $dwImageOffset, |
| 1940 | 1940 | 4 |
| 1941 | - ); // dwImageOffset; // Where in the file is this image? |
|
| 1941 | + ); // dwImageOffset; // Where in the file is this image? |
|
| 1942 | 1942 | $dwImageOffset += strlen($BitmapInfoHeader[$key]); |
| 1943 | 1943 | $dwImageOffset += strlen($icXOR[$key]); |
| 1944 | 1944 | $dwImageOffset += strlen($icAND[$key]); |
@@ -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( |
@@ -35,15 +35,15 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | // Regarder dans le repertoire local des images TeX et blocs MathML |
| 38 | - if (!@is_dir($dir_tex = _DIR_VAR . 'cache-TeX/')) { |
|
| 38 | + if (!@is_dir($dir_tex = _DIR_VAR.'cache-TeX/')) { |
|
| 39 | 39 | @mkdir($dir_tex, _SPIP_CHMOD); |
| 40 | 40 | } |
| 41 | - $fichier = $dir_tex . md5(trim($tex)) . $ext; |
|
| 41 | + $fichier = $dir_tex.md5(trim($tex)).$ext; |
|
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | // Aller chercher l'image sur le serveur |
| 45 | 45 | if (!@file_exists($fichier) && $server) { |
| 46 | - spip_log($url = $server . '?' . rawurlencode($tex)); |
|
| 46 | + spip_log($url = $server.'?'.rawurlencode($tex)); |
|
| 47 | 47 | include_spip('inc/distant'); |
| 48 | 48 | recuperer_url($url, ['file' => $fichier]); |
| 49 | 49 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | return implode('', file($fichier)); |
| 58 | 58 | } // TeX |
| 59 | 59 | else { |
| 60 | - [, , , $size] = @spip_getimagesize($fichier); |
|
| 60 | + [,,, $size] = @spip_getimagesize($fichier); |
|
| 61 | 61 | $alt = "alt=\"$tex\" title=\"$tex\""; |
| 62 | 62 | |
| 63 | 63 | return "<img src=\"$fichier\" style=\"vertical-align:middle;\" $size $alt />"; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | if ($defaire_amp) { |
| 125 | 125 | $expression = str_replace('&', '&', $expression); |
| 126 | 126 | } |
| 127 | - $echap = "\n<p class=\"spip\" style=\"text-align: center;\">" . produire_image_math($expression) . "</p>\n"; |
|
| 127 | + $echap = "\n<p class=\"spip\" style=\"text-align: center;\">".produire_image_math($expression)."</p>\n"; |
|
| 128 | 128 | $pos = strpos($texte_milieu, (string) $regs[0]); |
| 129 | 129 | $texte_milieu = substr($texte_milieu, 0, $pos) |
| 130 | 130 | . code_echappement($echap, $source) |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | . substr($texte_milieu, $pos + strlen($regs[0])); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $texte_a_voir = $texte_debut . $texte_milieu . $texte_fin; |
|
| 147 | + $texte_a_voir = $texte_debut.$texte_milieu.$texte_fin; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | return $texte_a_voir; |