@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | function inc_sql_to_array_dist($data) { |
| 121 | 121 | # sortir le connecteur de $data |
| 122 | 122 | preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v); |
| 123 | - $serveur = (string)$v[1]; |
|
| 123 | + $serveur = (string) $v[1]; |
|
| 124 | 124 | $req = trim($v[2]); |
| 125 | 125 | if ($s = sql_query($req, $serveur)) { |
| 126 | 126 | $r = []; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $json = json_decode($data, true, 512, JSON_THROW_ON_ERROR); |
| 146 | 146 | } catch (JsonException $e) { |
| 147 | 147 | $json = null; |
| 148 | - spip_logger()->info('Failed to parse Json data : ' . $e->getMessage()); |
|
| 148 | + spip_logger()->info('Failed to parse Json data : '.$e->getMessage()); |
|
| 149 | 149 | } |
| 150 | 150 | return is_array($json) ? (array) $json : []; |
| 151 | 151 | } |
@@ -165,13 +165,13 @@ discard block |
||
| 165 | 165 | $i = 1; |
| 166 | 166 | foreach ($entete as $k => $v) { |
| 167 | 167 | if (trim((string) $v) == '') { |
| 168 | - $v = 'col' . $i; |
|
| 168 | + $v = 'col'.$i; |
|
| 169 | 169 | } // reperer des eventuelles cases vides |
| 170 | 170 | if (is_numeric($v) && $v < 0) { |
| 171 | - $v = '__' . $v; |
|
| 171 | + $v = '__'.$v; |
|
| 172 | 172 | } // ne pas risquer d'ecraser une cle numerique |
| 173 | 173 | if (is_numeric($v)) { |
| 174 | - $v = '_' . $v; |
|
| 174 | + $v = '_'.$v; |
|
| 175 | 175 | } // ne pas risquer d'ecraser une cle numerique |
| 176 | 176 | $v = strtolower(preg_replace(',\W+,', '_', (string) translitteration($v))); |
| 177 | 177 | foreach ($csv as &$item) { |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | * @return array|bool |
| 258 | 258 | */ |
| 259 | 259 | function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) { |
| 260 | - return (array)preg_files($dir, $regexp, $limit); |
|
| 260 | + return (array) preg_files($dir, $regexp, $limit); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /** |
@@ -272,13 +272,13 @@ discard block |
||
| 272 | 272 | $glob_to_array = charger_fonction('glob_to_array', 'inc'); |
| 273 | 273 | $a = $glob_to_array($data); |
| 274 | 274 | foreach ($a as &$v) { |
| 275 | - $b = (array)@stat($v); |
|
| 275 | + $b = (array) @stat($v); |
|
| 276 | 276 | foreach (array_keys($b) as $k) { |
| 277 | 277 | if (is_numeric($k)) { |
| 278 | 278 | unset($b[$k]); |
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | - $b['file'] = preg_replace('`/$`', '', (string) $v) ; |
|
| 281 | + $b['file'] = preg_replace('`/$`', '', (string) $v); |
|
| 282 | 282 | $v = array_merge( |
| 283 | 283 | pathinfo((string) $v), |
| 284 | 284 | $b |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | $xml_array = []; |
| 299 | 299 | for ($object->rewind(); $object->valid(); $object->next()) { |
| 300 | 300 | if (array_key_exists($key = $object->key(), $xml_array)) { |
| 301 | - $key .= '-' . uniqid(); |
|
| 301 | + $key .= '-'.uniqid(); |
|
| 302 | 302 | } |
| 303 | 303 | $vars = get_object_vars($object->current()); |
| 304 | 304 | if (isset($vars['@attributes'])) { |
@@ -78,20 +78,20 @@ discard block |
||
| 78 | 78 | || ( |
| 79 | 79 | !empty($_SERVER['SERVER_SOFTWARE']) |
| 80 | 80 | && _SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE |
| 81 | - && preg_match('/' . _SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE . '/i', (string) $_SERVER['SERVER_SOFTWARE']) |
|
| 81 | + && preg_match('/'._SERVEUR_SOFTWARE_ACCEPTE_LOCATION_APRES_COOKIE.'/i', (string) $_SERVER['SERVER_SOFTWARE']) |
|
| 82 | 82 | || !empty($_SERVER['SERVER_SIGNATURE']) |
| 83 | 83 | && _SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE |
| 84 | - && preg_match('/' . _SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE . '/i', (string) $_SERVER['SERVER_SIGNATURE']) |
|
| 84 | + && preg_match('/'._SERVEUR_SIGNATURE_ACCEPTE_LOCATION_APRES_COOKIE.'/i', (string) $_SERVER['SERVER_SIGNATURE']) |
|
| 85 | 85 | || function_exists('apache_getenv') |
| 86 | 86 | || defined('_SERVER_APACHE') |
| 87 | 87 | ) |
| 88 | 88 | ) { |
| 89 | - @header('Location: ' . $url); |
|
| 89 | + @header('Location: '.$url); |
|
| 90 | 90 | $equiv = ''; |
| 91 | 91 | } else { |
| 92 | - @header('Refresh: 0; url=' . $url); |
|
| 92 | + @header('Refresh: 0; url='.$url); |
|
| 93 | 93 | if (isset($GLOBALS['meta']['charset'])) { |
| 94 | - @header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']); |
|
| 94 | + @header('Content-Type: text/html; charset='.$GLOBALS['meta']['charset']); |
|
| 95 | 95 | } |
| 96 | 96 | $equiv = "<meta http-equiv='Refresh' content='0; url=$url'>"; |
| 97 | 97 | } |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | html_lang_attributes(), ' |
| 104 | 104 | <head>', |
| 105 | 105 | $equiv, ' |
| 106 | -<title>HTTP ' . $status . '</title> |
|
| 107 | -' . ((isset($GLOBALS['meta']['charset'])) ? '<meta http-equiv="Content-Type" content="text/html;charset=' . $GLOBALS['meta']['charset'] . '">' : '') . ' |
|
| 106 | +<title>HTTP ' . $status.'</title> |
|
| 107 | +' . ((isset($GLOBALS['meta']['charset'])) ? '<meta http-equiv="Content-Type" content="text/html;charset='.$GLOBALS['meta']['charset'].'">' : '').' |
|
| 108 | 108 | </head> |
| 109 | 109 | <body> |
| 110 | -<h1>HTTP ' . $status . '</h1> |
|
| 110 | +<h1>HTTP ' . $status.'</h1> |
|
| 111 | 111 | <a href="', |
| 112 | 112 | quote_amp($url), |
| 113 | 113 | '">', |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | # en theorie on devrait faire ca tout le temps, mais quand la chaine |
| 143 | 143 | # commence par ? c'est imperatif, sinon l'url finale n'est pas la bonne |
| 144 | 144 | if ($url[0] == '?') { |
| 145 | - $url = url_de_base() . $url; |
|
| 145 | + $url = url_de_base().$url; |
|
| 146 | 146 | } |
| 147 | 147 | $url = str_replace('&', '&', (string) $url); |
| 148 | 148 | spip_logger()->info("redirige formulaire ajax: $url"); |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | if ($format == 'ajaxform') { |
| 151 | 151 | return [ |
| 152 | 152 | // on renvoie un lien masque qui sera traite par ajaxCallback.js |
| 153 | - '<a href="' . quote_amp($url) . '" name="ajax_redirect" style="display:none;">' . _T('navigateur_pas_redirige') . '</a>', |
|
| 153 | + '<a href="'.quote_amp($url).'" name="ajax_redirect" style="display:none;">'._T('navigateur_pas_redirige').'</a>', |
|
| 154 | 154 | // et un message au cas ou |
| 155 | - '<br /><a href="' . quote_amp($url) . '">' . _T('navigateur_pas_redirige') . '</a>' |
|
| 155 | + '<br /><a href="'.quote_amp($url).'">'._T('navigateur_pas_redirige').'</a>' |
|
| 156 | 156 | ]; |
| 157 | 157 | } else // format message texte, tout en js inline |
| 158 | 158 | { |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | "<script type='text/javascript'>if (parent.window){parent.window.document.location.replace(\"$url\");} else {document.location.replace(\"$url\");}</script>" |
| 162 | 162 | . http_img_pack('loader.svg', '', " class='loader'") |
| 163 | 163 | . '<br />' |
| 164 | - . '<a href="' . quote_amp($url) . '">' . _T('navigateur_pas_redirige') . '</a>'; |
|
| 164 | + . '<a href="'.quote_amp($url).'">'._T('navigateur_pas_redirige').'</a>'; |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | header("Content-Type: text/html; charset=$charset"); |
| 206 | 206 | header('Expires: 0'); |
| 207 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); |
|
| 207 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
|
| 208 | 208 | header('Cache-Control: no-cache, must-revalidate'); |
| 209 | 209 | header('Pragma: no-cache'); |
| 210 | 210 | } |
@@ -37,15 +37,15 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // Regarder dans le repertoire local des images TeX et blocs MathML |
| 40 | - if (!@is_dir($dir_tex = _DIR_VAR . 'cache-TeX/')) { |
|
| 40 | + if (!@is_dir($dir_tex = _DIR_VAR.'cache-TeX/')) { |
|
| 41 | 41 | @mkdir($dir_tex, _SPIP_CHMOD); |
| 42 | 42 | } |
| 43 | - $fichier = $dir_tex . md5(trim((string) $tex)) . $ext; |
|
| 43 | + $fichier = $dir_tex.md5(trim((string) $tex)).$ext; |
|
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | // Aller chercher l'image sur le serveur |
| 47 | 47 | if (!@file_exists($fichier) && $server) { |
| 48 | - spip_logger()->info($url = $server . '?' . rawurlencode((string) $tex)); |
|
| 48 | + spip_logger()->info($url = $server.'?'.rawurlencode((string) $tex)); |
|
| 49 | 49 | include_spip('inc/distant'); |
| 50 | 50 | recuperer_url($url, ['file' => $fichier]); |
| 51 | 51 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | return implode('', file($fichier)); |
| 60 | 60 | } // TeX |
| 61 | 61 | else { |
| 62 | - [, , , $size] = @spip_getimagesize($fichier); |
|
| 62 | + [,,, $size] = @spip_getimagesize($fichier); |
|
| 63 | 63 | $alt = "alt=\"$tex\" title=\"$tex\""; |
| 64 | 64 | |
| 65 | 65 | return "<img src=\"$fichier\" style=\"vertical-align:middle;\" $size $alt />"; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $expression = str_replace('&', '&', $expression); |
| 126 | 126 | } |
| 127 | 127 | $echap = produire_image_math($expression); |
| 128 | - $echap = ($t['pre'] ?? '') . $echap . ($t['post'] ?? ''); |
|
| 128 | + $echap = ($t['pre'] ?? '').$echap.($t['post'] ?? ''); |
|
| 129 | 129 | $echap = CollecteurHtmlTag::echappementHtmlBase64($echap, $source); |
| 130 | 130 | |
| 131 | 131 | $pos = strpos($texte_milieu, (string) $regs[0]); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // Appels incomplets (sans $c) |
| 114 | 114 | if (!is_array($c)) { |
| 115 | - spip_logger()->info('erreur appel objet_modifier_champs(' . $objet . '), manque $c'); |
|
| 115 | + spip_logger()->info('erreur appel objet_modifier_champs('.$objet.'), manque $c'); |
|
| 116 | 116 | |
| 117 | 117 | return _T('erreur_technique_enregistrement_impossible'); |
| 118 | 118 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $champs = array_map('corriger_caracteres', $champs); |
| 148 | 148 | |
| 149 | 149 | // On récupère l'état avant toute modification |
| 150 | - $row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet); |
|
| 150 | + $row = sql_fetsel('*', $spip_table_objet, $id_table_objet.'='.$id_objet); |
|
| 151 | 151 | |
| 152 | 152 | // Envoyer aux plugins |
| 153 | 153 | $champs = pipeline( |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $id_rubrique = 0; |
| 203 | 203 | if (isset($desc['field']['id_rubrique'])) { |
| 204 | 204 | $parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique'; |
| 205 | - $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . (int) $id_objet); |
|
| 205 | + $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=".(int) $id_objet); |
|
| 206 | 206 | } |
| 207 | 207 | $instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action'); |
| 208 | 208 | $champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur); |
@@ -223,13 +223,13 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | // allez on commit la modif |
| 226 | - sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . (int) $id_objet, [], $serveur); |
|
| 226 | + sql_updateq($spip_table_objet, $champs, "$id_table_objet=".(int) $id_objet, [], $serveur); |
|
| 227 | 227 | |
| 228 | 228 | // on verifie si elle est bien passee |
| 229 | 229 | $moof = sql_fetsel( |
| 230 | 230 | array_keys($champs), |
| 231 | 231 | $spip_table_objet, |
| 232 | - "$id_table_objet=" . (int) $id_objet, |
|
| 232 | + "$id_table_objet=".(int) $id_objet, |
|
| 233 | 233 | [], |
| 234 | 234 | [], |
| 235 | 235 | '', |
@@ -265,12 +265,12 @@ discard block |
||
| 265 | 265 | // c'est un cas exceptionnel |
| 266 | 266 | if ($liste !== []) { |
| 267 | 267 | spip_logger('modifier')->critical( |
| 268 | - "Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true), |
|
| 268 | + "Erreur enregistrement en base $objet/$id_objet champs :".var_export($conflits, true), |
|
| 269 | 269 | ); |
| 270 | 270 | |
| 271 | 271 | return _T( |
| 272 | 272 | 'erreur_technique_enregistrement_champs', |
| 273 | - ['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"] |
|
| 273 | + ['champs' => "<i>'".implode("'</i>,<i>'", $liste)."'</i>"] |
|
| 274 | 274 | ); |
| 275 | 275 | } |
| 276 | 276 | } |
@@ -332,18 +332,18 @@ discard block |
||
| 332 | 332 | include_spip('inc/filtres_mini'); |
| 333 | 333 | $qui = ''; |
| 334 | 334 | if (!empty($GLOBALS['visiteur_session']['id_auteur'])) { |
| 335 | - $qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#'; |
|
| 335 | + $qui .= ' #id_auteur:'.$GLOBALS['visiteur_session']['id_auteur'].'#'; |
|
| 336 | 336 | } |
| 337 | 337 | if (!empty($GLOBALS['visiteur_session']['nom'])) { |
| 338 | - $qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#'; |
|
| 338 | + $qui .= ' #nom:'.$GLOBALS['visiteur_session']['nom'].'#'; |
|
| 339 | 339 | } |
| 340 | 340 | if ($qui == '') { |
| 341 | - $qui = '#ip:' . $GLOBALS['ip'] . '#'; |
|
| 341 | + $qui = '#ip:'.$GLOBALS['ip'].'#'; |
|
| 342 | 342 | } |
| 343 | - journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . implode( |
|
| 343 | + journal(_L($qui.' a édité '.$objet.' '.$id_objet.' ('.implode( |
|
| 344 | 344 | '+', |
| 345 | 345 | array_diff(array_keys($champs), ['date_modif']) |
| 346 | - ) . ')'), [ |
|
| 346 | + ).')'), [ |
|
| 347 | 347 | 'faire' => 'modifier', |
| 348 | 348 | 'quoi' => $objet, |
| 349 | 349 | 'id' => $id_objet |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | renouvelle_alea(); |
| 65 | 65 | $new = false; |
| 66 | 66 | } else { |
| 67 | - spip_logger()->info("impossible d'ecrire dans " . $cache); |
|
| 67 | + spip_logger()->info("impossible d'ecrire dans ".$cache); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | // et refaire le cache si on a du lire en base |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | if (!isset($touch[$table])) { |
| 165 | 165 | touch_meta($antidate, $table); |
| 166 | 166 | } |
| 167 | - sql_delete('spip_' . $table, "nom='$nom'", '', 'continue'); |
|
| 167 | + sql_delete('spip_'.$table, "nom='$nom'", '', 'continue'); |
|
| 168 | 168 | unset($GLOBALS[$table][$nom]); |
| 169 | 169 | if (!isset($touch[$table])) { |
| 170 | 170 | touch_meta($antidate, $table); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | return; |
| 197 | 197 | } |
| 198 | 198 | include_spip('base/abstract_sql'); |
| 199 | - $res = sql_select('*', 'spip_' . $table, 'nom=' . sql_quote($nom), '', '', '', '', '', 'continue'); |
|
| 199 | + $res = sql_select('*', 'spip_'.$table, 'nom='.sql_quote($nom), '', '', '', '', '', 'continue'); |
|
| 200 | 200 | // table pas encore installee, travailler en php seulement |
| 201 | 201 | if (!$res) { |
| 202 | 202 | $GLOBALS[$table][$nom] = $valeur; |
@@ -231,9 +231,9 @@ discard block |
||
| 231 | 231 | $r['impt'] = sql_quote($importable, '', 'text'); |
| 232 | 232 | } |
| 233 | 233 | if ($row) { |
| 234 | - sql_update('spip_' . $table, $r, 'nom=' . sql_quote($nom)); |
|
| 234 | + sql_update('spip_'.$table, $r, 'nom='.sql_quote($nom)); |
|
| 235 | 235 | } else { |
| 236 | - sql_insert('spip_' . $table, '(' . implode(',', array_keys($r)) . ')', '(' . implode(',', array_values($r)) . ')'); |
|
| 236 | + sql_insert('spip_'.$table, '('.implode(',', array_keys($r)).')', '('.implode(',', array_values($r)).')'); |
|
| 237 | 237 | } |
| 238 | 238 | if (!isset($touch[$table])) { |
| 239 | 239 | touch_meta($antidate, $table); |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | * Nom du fichier cache |
| 251 | 251 | **/ |
| 252 | 252 | function cache_meta($table = 'meta') { |
| 253 | - return ($table == 'meta') ? _FILE_META : (_DIR_CACHE . $table . '.php'); |
|
| 253 | + return ($table == 'meta') ? _FILE_META : (_DIR_CACHE.$table.'.php'); |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | /** |
@@ -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 | |
@@ -491,14 +491,14 @@ discard block |
||
| 491 | 491 | |
| 492 | 492 | if ($creer) { |
| 493 | 493 | spip_logger('images')->error( |
| 494 | - 'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier", |
|
| 494 | + 'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier", |
|
| 495 | 495 | ); |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | $term_fonction = _image_trouver_extension_pertinente($fichier); |
| 499 | - $ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction; |
|
| 499 | + $ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction; |
|
| 500 | 500 | $ret['fichier'] = $fichier; |
| 501 | - $ret['fonction_image'] = '_image_image' . $terminaison_dest; |
|
| 501 | + $ret['fonction_image'] = '_image_image'.$terminaison_dest; |
|
| 502 | 502 | $ret['fichier_dest'] = $fichier_dest; |
| 503 | 503 | $ret['format_source'] = _image_extension_normalisee($terminaison); |
| 504 | 504 | $ret['format_dest'] = $terminaison_dest; |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | if (!function_exists('imagepng')) { |
| 776 | 776 | return false; |
| 777 | 777 | } |
| 778 | - $tmp = $fichier . '.tmp'; |
|
| 778 | + $tmp = $fichier.'.tmp'; |
|
| 779 | 779 | $ret = imagepng($img, $tmp); |
| 780 | 780 | if (file_exists($tmp)) { |
| 781 | 781 | $taille_test = @getimagesize($tmp); |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | if (!function_exists('imagegif')) { |
| 811 | 811 | return false; |
| 812 | 812 | } |
| 813 | - $tmp = $fichier . '.tmp'; |
|
| 813 | + $tmp = $fichier.'.tmp'; |
|
| 814 | 814 | $ret = imagegif($img, $tmp); |
| 815 | 815 | if (file_exists($tmp)) { |
| 816 | 816 | $taille_test = @getimagesize($tmp); |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | if (!function_exists('imagejpeg')) { |
| 851 | 851 | return false; |
| 852 | 852 | } |
| 853 | - $tmp = $fichier . '.tmp'; |
|
| 853 | + $tmp = $fichier.'.tmp'; |
|
| 854 | 854 | |
| 855 | 855 | // Enable interlancing |
| 856 | 856 | imageinterlace($img, true); |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | if (!function_exists('imagewebp')) { |
| 912 | 912 | return false; |
| 913 | 913 | } |
| 914 | - $tmp = $fichier . '.tmp'; |
|
| 914 | + $tmp = $fichier.'.tmp'; |
|
| 915 | 915 | $ret = imagewebp($img, $tmp, $qualite); |
| 916 | 916 | if (file_exists($tmp)) { |
| 917 | 917 | $taille_test = @getimagesize($tmp); |
@@ -945,7 +945,7 @@ discard block |
||
| 945 | 945 | */ |
| 946 | 946 | function _image_imagesvg($img, $fichier) { |
| 947 | 947 | |
| 948 | - $tmp = $fichier . '.tmp'; |
|
| 948 | + $tmp = $fichier.'.tmp'; |
|
| 949 | 949 | if (!str_contains($img, '<')) { |
| 950 | 950 | $img = supprimer_timestamp($img); |
| 951 | 951 | if (!file_exists($img)) { |
@@ -1002,14 +1002,14 @@ discard block |
||
| 1002 | 1002 | */ |
| 1003 | 1003 | function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) { |
| 1004 | 1004 | if (is_null($fonction)) { |
| 1005 | - $fonction = '_image_image' . $valeurs['format_dest']; |
|
| 1005 | + $fonction = '_image_image'.$valeurs['format_dest']; |
|
| 1006 | 1006 | } |
| 1007 | 1007 | $ret = false; |
| 1008 | 1008 | #un flag pour reperer les images gravees |
| 1009 | 1009 | $lock = ( |
| 1010 | 1010 | !statut_effacer_images_temporaires('get') |
| 1011 | 1011 | || @file_exists($valeurs['fichier_dest']) |
| 1012 | - && !@file_exists($valeurs['fichier_dest'] . '.src') |
|
| 1012 | + && !@file_exists($valeurs['fichier_dest'].'.src') |
|
| 1013 | 1013 | ); |
| 1014 | 1014 | if ( |
| 1015 | 1015 | function_exists($fonction) |
@@ -1021,7 +1021,7 @@ discard block |
||
| 1021 | 1021 | [$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']); |
| 1022 | 1022 | $valeurs['date'] = @filemtime($valeurs['fichier_dest']); |
| 1023 | 1023 | // pour la retrouver apres disparition |
| 1024 | - ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true); |
|
| 1024 | + ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true); |
|
| 1025 | 1025 | } |
| 1026 | 1026 | |
| 1027 | 1027 | return $ret; |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | |
| 1197 | 1197 | // attributs deprecies. Transformer en CSS |
| 1198 | 1198 | if ($espace = extraire_attribut($tag, 'hspace')) { |
| 1199 | - $style = "margin:{$espace}px;" . $style; |
|
| 1199 | + $style = "margin:{$espace}px;".$style; |
|
| 1200 | 1200 | $tag = inserer_attribut($tag, 'hspace', ''); |
| 1201 | 1201 | } |
| 1202 | 1202 | |
@@ -1319,7 +1319,7 @@ discard block |
||
| 1319 | 1319 | $image = $valeurs['fichier']; |
| 1320 | 1320 | $format = $valeurs['format_source']; |
| 1321 | 1321 | $destdir = dirname((string) $valeurs['fichier_dest']); |
| 1322 | - $destfile = basename((string) $valeurs['fichier_dest'], '.' . $valeurs['format_dest']); |
|
| 1322 | + $destfile = basename((string) $valeurs['fichier_dest'], '.'.$valeurs['format_dest']); |
|
| 1323 | 1323 | |
| 1324 | 1324 | $format_sortie = $valeurs['format_dest']; |
| 1325 | 1325 | |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | |
| 1352 | 1352 | // Si l'image est de la taille demandee (ou plus petite), simplement la retourner |
| 1353 | 1353 | if ($srcWidth && $srcWidth <= $maxWidth && $srcHeight <= $maxHeight) { |
| 1354 | - $vignette = $destination . '.' . $format; |
|
| 1354 | + $vignette = $destination.'.'.$format; |
|
| 1355 | 1355 | @copy($image, $vignette); |
| 1356 | 1356 | } |
| 1357 | 1357 | |
@@ -1359,7 +1359,7 @@ discard block |
||
| 1359 | 1359 | include_spip('inc/svg'); |
| 1360 | 1360 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1361 | 1361 | $format_sortie = 'svg'; |
| 1362 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1362 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1363 | 1363 | $valeurs['fichier_dest'] = $vignette; |
| 1364 | 1364 | _image_gd_output($svg, $valeurs); |
| 1365 | 1365 | } |
@@ -1371,9 +1371,9 @@ discard block |
||
| 1371 | 1371 | define('_CONVERT_COMMAND', 'convert'); |
| 1372 | 1372 | } // Securite : mes_options.php peut preciser le chemin absolu |
| 1373 | 1373 | if (!defined('_RESIZE_COMMAND')) { |
| 1374 | - define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -orient Undefined -resize %xx%y! %src %dest'); |
|
| 1374 | + define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -orient Undefined -resize %xx%y! %src %dest'); |
|
| 1375 | 1375 | } |
| 1376 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1376 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1377 | 1377 | $commande = str_replace( |
| 1378 | 1378 | ['%x', '%y', '%src', '%dest'], |
| 1379 | 1379 | [ |
@@ -1389,7 +1389,7 @@ discard block |
||
| 1389 | 1389 | if (!@file_exists($vignette)) { |
| 1390 | 1390 | spip_logger('images')->info("echec convert sur $vignette"); |
| 1391 | 1391 | |
| 1392 | - return; // echec commande |
|
| 1392 | + return; // echec commande |
|
| 1393 | 1393 | } |
| 1394 | 1394 | } |
| 1395 | 1395 | |
@@ -1406,7 +1406,7 @@ discard block |
||
| 1406 | 1406 | if (!$output) { |
| 1407 | 1407 | return; |
| 1408 | 1408 | } |
| 1409 | - $vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie; |
|
| 1409 | + $vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie; |
|
| 1410 | 1410 | |
| 1411 | 1411 | $imagick = new Imagick(); |
| 1412 | 1412 | $imagick->readImage(realpath($image)); |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | $destHeight, |
| 1416 | 1416 | Imagick::FILTER_LANCZOS, |
| 1417 | 1417 | 1 |
| 1418 | - );//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1418 | + ); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1419 | 1419 | $imagick->writeImage($vignette); |
| 1420 | 1420 | |
| 1421 | 1421 | if (!@file_exists($vignette)) { |
@@ -1424,7 +1424,7 @@ discard block |
||
| 1424 | 1424 | return; |
| 1425 | 1425 | } |
| 1426 | 1426 | // remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester) |
| 1427 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1427 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1428 | 1428 | } |
| 1429 | 1429 | |
| 1430 | 1430 | // netpbm |
@@ -1435,11 +1435,11 @@ discard block |
||
| 1435 | 1435 | if (_PNMSCALE_COMMAND == '') { |
| 1436 | 1436 | return; |
| 1437 | 1437 | } |
| 1438 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1438 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1439 | 1439 | $pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', (string) _PNMSCALE_COMMAND); |
| 1440 | 1440 | if ($format == 'jpg') { |
| 1441 | 1441 | $jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', (string) _PNMSCALE_COMMAND); |
| 1442 | - exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1442 | + exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1443 | 1443 | if (!($s = @filesize($vignette))) { |
| 1444 | 1444 | spip_unlink($vignette); |
| 1445 | 1445 | } |
@@ -1451,7 +1451,7 @@ discard block |
||
| 1451 | 1451 | } else { |
| 1452 | 1452 | if ($format == 'gif') { |
| 1453 | 1453 | $giftopnm_command = str_replace('pnmscale', 'giftopnm', (string) _PNMSCALE_COMMAND); |
| 1454 | - exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1454 | + exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1455 | 1455 | if (!($s = @filesize($vignette))) { |
| 1456 | 1456 | spip_unlink($vignette); |
| 1457 | 1457 | } |
@@ -1463,7 +1463,7 @@ discard block |
||
| 1463 | 1463 | } else { |
| 1464 | 1464 | if ($format == 'png') { |
| 1465 | 1465 | $pngtopnm_command = str_replace('pnmscale', 'pngtopnm', (string) _PNMSCALE_COMMAND); |
| 1466 | - exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1466 | + exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1467 | 1467 | if (!($s = @filesize($vignette))) { |
| 1468 | 1468 | spip_unlink($vignette); |
| 1469 | 1469 | } |
@@ -1485,7 +1485,7 @@ discard block |
||
| 1485 | 1485 | return; |
| 1486 | 1486 | } |
| 1487 | 1487 | if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) { |
| 1488 | - spip_logger('images')->info('vignette gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels'); |
|
| 1488 | + spip_logger('images')->info('vignette gd2 impossible : '.$srcWidth * $srcHeight.'pixels'); |
|
| 1489 | 1489 | |
| 1490 | 1490 | return; |
| 1491 | 1491 | } |
@@ -1788,7 +1788,7 @@ discard block |
||
| 1788 | 1788 | // de l'image, de facon a tromper le cache du navigateur |
| 1789 | 1789 | // quand on fait supprimer/reuploader un logo |
| 1790 | 1790 | // (pas de filemtime si SAFE MODE) |
| 1791 | - $date = test_espace_prive() ? ('?' . $date) : ''; |
|
| 1791 | + $date = test_espace_prive() ? ('?'.$date) : ''; |
|
| 1792 | 1792 | |
| 1793 | 1793 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1794 | 1794 | } |
@@ -1866,9 +1866,9 @@ discard block |
||
| 1866 | 1866 | $b = $argb['blue']; |
| 1867 | 1867 | |
| 1868 | 1868 | if ($bpp[$key] == 32) { |
| 1869 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a); |
|
| 1869 | + $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a); |
|
| 1870 | 1870 | } elseif ($bpp[$key] === 24) { |
| 1871 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r); |
|
| 1871 | + $icXOR[$key] .= chr($b).chr($g).chr($r); |
|
| 1872 | 1872 | } |
| 1873 | 1873 | |
| 1874 | 1874 | if ($a < 128) { |
@@ -1895,48 +1895,48 @@ discard block |
||
| 1895 | 1895 | |
| 1896 | 1896 | // BITMAPINFOHEADER - 40 bytes |
| 1897 | 1897 | $BitmapInfoHeader[$key] = ''; |
| 1898 | - $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1899 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1898 | + $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1899 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1900 | 1900 | // The biHeight member specifies the combined |
| 1901 | 1901 | // height of the XOR and AND masks. |
| 1902 | 1902 | $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG biHeight; |
| 1903 | - $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1904 | - $BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00"; // wBitCount; |
|
| 1905 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1906 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1907 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1908 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1909 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1910 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1903 | + $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1904 | + $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount; |
|
| 1905 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1906 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1907 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1908 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1909 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1910 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1911 | 1911 | } |
| 1912 | 1912 | |
| 1913 | 1913 | |
| 1914 | - $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1915 | - $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1916 | - $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1914 | + $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1915 | + $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1916 | + $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1917 | 1917 | |
| 1918 | 1918 | $dwImageOffset = 6 + (count($gd_image_array) * 16); |
| 1919 | 1919 | foreach (array_keys($gd_image_array) as $key) { |
| 1920 | 1920 | // ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) |
| 1921 | 1921 | |
| 1922 | - $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1923 | - $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1924 | - $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1925 | - $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1922 | + $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1923 | + $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1924 | + $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1925 | + $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1926 | 1926 | |
| 1927 | - $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1928 | - $icondata .= chr($bpp[$key]) . "\x00"; // wBitCount; // Bits per pixel |
|
| 1927 | + $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1928 | + $icondata .= chr($bpp[$key])."\x00"; // wBitCount; // Bits per pixel |
|
| 1929 | 1929 | |
| 1930 | 1930 | $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]); |
| 1931 | 1931 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1932 | 1932 | $dwBytesInRes, |
| 1933 | 1933 | 4 |
| 1934 | - ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1934 | + ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1935 | 1935 | |
| 1936 | 1936 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1937 | 1937 | $dwImageOffset, |
| 1938 | 1938 | 4 |
| 1939 | - ); // dwImageOffset; // Where in the file is this image? |
|
| 1939 | + ); // dwImageOffset; // Where in the file is this image? |
|
| 1940 | 1940 | $dwImageOffset += strlen($BitmapInfoHeader[$key]); |
| 1941 | 1941 | $dwImageOffset += strlen($icXOR[$key]); |
| 1942 | 1942 | $dwImageOffset += strlen($icAND[$key]); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | if ($res) { |
| 55 | 55 | return $res; |
| 56 | 56 | } |
| 57 | - spip_logger()->info("meta: $script " . print_r($_POST, true)); |
|
| 57 | + spip_logger()->info("meta: $script ".print_r($_POST, true)); |
|
| 58 | 58 | ecrire_meta($script, serialize($_POST)); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | // on pourrait statuer automatiquement les webmestres a l'init d'une action auth par ftp ... ? |
| 126 | 126 | |
| 127 | - spip_logger($journal)->info("admin $pref" . ($valeur ? ' (reprise)' : ' (init)')); |
|
| 127 | + spip_logger($journal)->info("admin $pref".($valeur ? ' (reprise)' : ' (init)')); |
|
| 128 | 128 | |
| 129 | 129 | return ''; |
| 130 | 130 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | if (autoriser('configurer')) { |
| 143 | 143 | return _DIR_TMP; |
| 144 | 144 | } else { |
| 145 | - return _DIR_TRANSFERT . $GLOBALS['visiteur_session']['login'] . '/'; |
|
| 145 | + return _DIR_TRANSFERT.$GLOBALS['visiteur_session']['login'].'/'; |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | * Nom du fichier |
| 161 | 161 | **/ |
| 162 | 162 | function fichier_admin($action, $pref = 'admin_') { |
| 163 | - return $pref . |
|
| 164 | - substr(md5($action . (time() & ~2047) . $GLOBALS['visiteur_session']['login']), 0, 10); |
|
| 163 | + return $pref. |
|
| 164 | + substr(md5($action.(time() & ~2047).$GLOBALS['visiteur_session']['login']), 0, 10); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | } else { |
| 198 | 198 | $dir = dir_admin(); |
| 199 | 199 | $signal = fichier_admin($script); |
| 200 | - if (@file_exists($dir . $signal)) { |
|
| 200 | + if (@file_exists($dir.$signal)) { |
|
| 201 | 201 | spip_logger()->info("Action admin: $action"); |
| 202 | 202 | |
| 203 | 203 | return ''; |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | return ''; |
| 217 | 217 | } |
| 218 | - $corps .= '<input type="hidden" name="validation_admin" value="' . $signal . '" />'; |
|
| 218 | + $corps .= '<input type="hidden" name="validation_admin" value="'.$signal.'" />'; |
|
| 219 | 219 | $suivant = _T('bouton_valider'); |
| 220 | 220 | $js = ''; |
| 221 | 221 | } else { |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | . "</legend>\n<label for='fichier'>" |
| 231 | 231 | . _T('info_creer_repertoire') |
| 232 | 232 | . "</label>\n" |
| 233 | - . "<span id='signal' class='formo'>" . $signal . '</span>' |
|
| 233 | + . "<span id='signal' class='formo'>".$signal.'</span>' |
|
| 234 | 234 | . "<input type='hidden' id='fichier' name='fichier' value='" |
| 235 | 235 | . $signal |
| 236 | 236 | . "' />" |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | * Nom de l'action (en base) qui a été exécutée |
| 268 | 268 | **/ |
| 269 | 269 | function fin_admin($action) { |
| 270 | - $signal = dir_admin() . fichier_admin($action); |
|
| 270 | + $signal = dir_admin().fichier_admin($action); |
|
| 271 | 271 | spip_unlink($signal); |
| 272 | 272 | if ($action != 'delete_all') { |
| 273 | 273 | effacer_meta($action); |
@@ -295,8 +295,8 @@ discard block |
||
| 295 | 295 | include_spip('inc/filtres'); |
| 296 | 296 | foreach ([...$_POST, ...$_GET] as $n => $c) { |
| 297 | 297 | if (!in_array($n, ['fichier', 'exec', 'validation_admin']) && !is_array($c)) { |
| 298 | - $suite .= "\n<input type='hidden' name='" . spip_htmlspecialchars($n) . "' value='" . |
|
| 299 | - entites_html($c) . |
|
| 298 | + $suite .= "\n<input type='hidden' name='".spip_htmlspecialchars($n)."' value='". |
|
| 299 | + entites_html($c). |
|
| 300 | 300 | "' />"; |
| 301 | 301 | } |
| 302 | 302 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $md5args = md5($arguments); |
| 70 | 70 | |
| 71 | 71 | // si pas de date programee, des que possible |
| 72 | - $duplicate_where = 'status=' . intval(_JQ_SCHEDULED) . ' AND '; |
|
| 72 | + $duplicate_where = 'status='.intval(_JQ_SCHEDULED).' AND '; |
|
| 73 | 73 | if (!$time) { |
| 74 | 74 | $time = time(); |
| 75 | 75 | $duplicate_where = ''; // ne pas dupliquer si deja le meme job en cours d'execution |
@@ -94,9 +94,8 @@ discard block |
||
| 94 | 94 | 'id_job', |
| 95 | 95 | 'spip_jobs', |
| 96 | 96 | $duplicate_where = |
| 97 | - $duplicate_where . 'fonction=' . sql_quote($function) |
|
| 98 | - . (($no_duplicate === 'function_only') ? '' : |
|
| 99 | - ' AND md5args=' . sql_quote($md5args) . ' AND inclure=' . sql_quote($file)) |
|
| 97 | + $duplicate_where.'fonction='.sql_quote($function) |
|
| 98 | + . (($no_duplicate === 'function_only') ? '' : ' AND md5args='.sql_quote($md5args).' AND inclure='.sql_quote($file)) |
|
| 100 | 99 | )) |
| 101 | 100 | ) { |
| 102 | 101 | return $id_job; |
@@ -108,9 +107,9 @@ discard block |
||
| 108 | 107 | // doit s'effacer |
| 109 | 108 | if ( |
| 110 | 109 | $no_duplicate |
| 111 | - && ($id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<' . intval($id_job) . " AND $duplicate_where")) |
|
| 110 | + && ($id_prev = sql_getfetsel('id_job', 'spip_jobs', 'id_job<'.intval($id_job)." AND $duplicate_where")) |
|
| 112 | 111 | ) { |
| 113 | - sql_delete('spip_jobs', 'id_job=' . intval($id_job)); |
|
| 112 | + sql_delete('spip_jobs', 'id_job='.intval($id_job)); |
|
| 114 | 113 | |
| 115 | 114 | return $id_prev; |
| 116 | 115 | } |
@@ -122,10 +121,10 @@ discard block |
||
| 122 | 121 | // ie cas d'un char non acceptables sur certains type de champs |
| 123 | 122 | // qui coupe la valeur |
| 124 | 123 | if (defined('_JQ_INSERT_CHECK_ARGS') && $id_job) { |
| 125 | - $args = sql_getfetsel('args', 'spip_jobs', 'id_job=' . intval($id_job)); |
|
| 124 | + $args = sql_getfetsel('args', 'spip_jobs', 'id_job='.intval($id_job)); |
|
| 126 | 125 | if ($args !== $arguments) { |
| 127 | 126 | spip_logger('queue')->info( |
| 128 | - 'arguments job errones / longueur ' . strlen($args) . ' vs ' . strlen($arguments) . ' / valeur : ' |
|
| 127 | + 'arguments job errones / longueur '.strlen($args).' vs '.strlen($arguments).' / valeur : ' |
|
| 129 | 128 | . var_export($arguments, true) |
| 130 | 129 | ); |
| 131 | 130 | } |
@@ -154,7 +153,7 @@ discard block |
||
| 154 | 153 | function queue_purger() { |
| 155 | 154 | include_spip('base/abstract_sql'); |
| 156 | 155 | sql_delete('spip_jobs'); |
| 157 | - sql_delete('spip_jobs_liens', 'id_job NOT IN (' . sql_get_select('id_job', 'spip_jobs') . ')'); |
|
| 156 | + sql_delete('spip_jobs_liens', 'id_job NOT IN ('.sql_get_select('id_job', 'spip_jobs').')'); |
|
| 158 | 157 | include_spip('inc/genie'); |
| 159 | 158 | genie_queue_watch_dist(); |
| 160 | 159 | } |
@@ -170,8 +169,8 @@ discard block |
||
| 170 | 169 | include_spip('base/abstract_sql'); |
| 171 | 170 | |
| 172 | 171 | if ( |
| 173 | - ($row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job=' . intval($id_job))) |
|
| 174 | - && ($res = sql_delete('spip_jobs', 'id_job=' . intval($id_job))) |
|
| 172 | + ($row = sql_fetsel('fonction,inclure,date', 'spip_jobs', 'id_job='.intval($id_job))) |
|
| 173 | + && ($res = sql_delete('spip_jobs', 'id_job='.intval($id_job))) |
|
| 175 | 174 | ) { |
| 176 | 175 | queue_unlink_job($id_job); |
| 177 | 176 | // est-ce une tache cron qu'il faut relancer ? |
@@ -221,7 +220,7 @@ discard block |
||
| 221 | 220 | * resultat du sql_delete |
| 222 | 221 | */ |
| 223 | 222 | function queue_unlink_job($id_job) { |
| 224 | - return sql_delete('spip_jobs_liens', 'id_job=' . intval($id_job)); |
|
| 223 | + return sql_delete('spip_jobs_liens', 'id_job='.intval($id_job)); |
|
| 225 | 224 | } |
| 226 | 225 | |
| 227 | 226 | /** |
@@ -239,7 +238,7 @@ discard block |
||
| 239 | 238 | // deserialiser les arguments |
| 240 | 239 | $args = unserialize($row['args']); |
| 241 | 240 | if (!is_array($args)) { |
| 242 | - $logger->info('arguments job errones ' . var_export($row, true)); |
|
| 241 | + $logger->info('arguments job errones '.var_export($row, true)); |
|
| 243 | 242 | return false; |
| 244 | 243 | } |
| 245 | 244 | |
@@ -256,14 +255,14 @@ discard block |
||
| 256 | 255 | } |
| 257 | 256 | |
| 258 | 257 | if (!function_exists($fonction)) { |
| 259 | - $logger->info("fonction $fonction ($inclure) inexistante " . var_export($row, true)); |
|
| 258 | + $logger->info("fonction $fonction ($inclure) inexistante ".var_export($row, true)); |
|
| 260 | 259 | |
| 261 | 260 | return false; |
| 262 | 261 | } |
| 263 | 262 | |
| 264 | - $logger->info('queue [' . $row['id_job'] . "]: $fonction() start"); |
|
| 263 | + $logger->info('queue ['.$row['id_job']."]: $fonction() start"); |
|
| 265 | 264 | $res = $fonction(...$args); |
| 266 | - $logger->info('queue [' . $row['id_job'] . "]: $fonction() end"); |
|
| 265 | + $logger->info('queue ['.$row['id_job']."]: $fonction() end"); |
|
| 267 | 266 | |
| 268 | 267 | return $res; |
| 269 | 268 | } |
@@ -337,19 +336,19 @@ discard block |
||
| 337 | 336 | // lorsqu'un job cron n'a pas fini, sa priorite est descendue |
| 338 | 337 | // pour qu'il ne bloque pas les autres jobs en attente |
| 339 | 338 | if (is_array($force_jobs) && count($force_jobs)) { |
| 340 | - $cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND ' . sql_in('id_job', $force_jobs); |
|
| 339 | + $cond = 'status='.intval(_JQ_SCHEDULED).' AND '.sql_in('id_job', $force_jobs); |
|
| 341 | 340 | } else { |
| 342 | 341 | $now = date('Y-m-d H:i:s', $time); |
| 343 | - $cond = 'status=' . intval(_JQ_SCHEDULED) . ' AND date<=' . sql_quote($now); |
|
| 342 | + $cond = 'status='.intval(_JQ_SCHEDULED).' AND date<='.sql_quote($now); |
|
| 344 | 343 | } |
| 345 | 344 | |
| 346 | 345 | register_shutdown_function('queue_error_handler'); // recuperer les erreurs auant que possible |
| 347 | - $res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,' . (_JQ_MAX_JOBS_EXECUTE + 1)); |
|
| 346 | + $res = sql_allfetsel('*', 'spip_jobs', $cond, '', 'priorite DESC,date', '0,'.(_JQ_MAX_JOBS_EXECUTE + 1)); |
|
| 348 | 347 | do { |
| 349 | 348 | if ($row = array_shift($res)) { |
| 350 | 349 | $nbj++; |
| 351 | 350 | // il faut un verrou, a base de sql_delete |
| 352 | - if (sql_delete('spip_jobs', 'id_job=' . intval($row['id_job']) . ' AND status=' . intval(_JQ_SCHEDULED))) { |
|
| 351 | + if (sql_delete('spip_jobs', 'id_job='.intval($row['id_job']).' AND status='.intval(_JQ_SCHEDULED))) { |
|
| 353 | 352 | #$logger->info("JQ schedule job ".$nbj." OK"); |
| 354 | 353 | // on reinsert dans la base aussitot avec un status=_JQ_PENDING |
| 355 | 354 | $row['status'] = _JQ_PENDING; |
@@ -364,9 +363,9 @@ discard block |
||
| 364 | 363 | queue_close_job($row, $time, $result); |
| 365 | 364 | } |
| 366 | 365 | } |
| 367 | - $logger->debug('JQ schedule job end time ' . $time); |
|
| 366 | + $logger->debug('JQ schedule job end time '.$time); |
|
| 368 | 367 | } while ($nbj < _JQ_MAX_JOBS_EXECUTE && $row && $time < $end_time); |
| 369 | - $logger->debug('JQ schedule end time ' . time()); |
|
| 368 | + $logger->debug('JQ schedule end time '.time()); |
|
| 370 | 369 | |
| 371 | 370 | if ($row = array_shift($res)) { |
| 372 | 371 | queue_update_next_job_time(0); // on sait qu'il y a encore des jobs a lancer ASAP |
@@ -405,9 +404,9 @@ discard block |
||
| 405 | 404 | } |
| 406 | 405 | } |
| 407 | 406 | // purger ses liens eventuels avec des objets |
| 408 | - sql_delete('spip_jobs_liens', 'id_job=' . intval($row['id_job'])); |
|
| 407 | + sql_delete('spip_jobs_liens', 'id_job='.intval($row['id_job'])); |
|
| 409 | 408 | // supprimer le job fini |
| 410 | - sql_delete('spip_jobs', 'id_job=' . intval($row['id_job'])); |
|
| 409 | + sql_delete('spip_jobs', 'id_job='.intval($row['id_job'])); |
|
| 411 | 410 | } |
| 412 | 411 | |
| 413 | 412 | /** |
@@ -480,18 +479,18 @@ discard block |
||
| 480 | 479 | $res = sql_allfetsel( |
| 481 | 480 | '*', |
| 482 | 481 | 'spip_jobs', |
| 483 | - 'status=' . intval(_JQ_PENDING) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time - 180)) |
|
| 482 | + 'status='.intval(_JQ_PENDING).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time - 180)) |
|
| 484 | 483 | ); |
| 485 | 484 | if (is_array($res)) { |
| 486 | 485 | foreach ($res as $row) { |
| 487 | 486 | queue_close_job($row, $time); |
| 488 | - spip_logger('job_mort')->error('queue_close_job car _JQ_PENDING depuis +180s : ' . print_r($row, true)); |
|
| 487 | + spip_logger('job_mort')->error('queue_close_job car _JQ_PENDING depuis +180s : '.print_r($row, true)); |
|
| 489 | 488 | } |
| 490 | 489 | } |
| 491 | 490 | |
| 492 | 491 | // chercher la date du prochain job si pas connu |
| 493 | 492 | if (is_null($next) || is_null(queue_sleep_time_to_next_job())) { |
| 494 | - $date = sql_getfetsel('date', 'spip_jobs', 'status=' . intval(_JQ_SCHEDULED), '', 'date', '0,1'); |
|
| 493 | + $date = sql_getfetsel('date', 'spip_jobs', 'status='.intval(_JQ_SCHEDULED), '', 'date', '0,1'); |
|
| 495 | 494 | $next = strtotime($date); |
| 496 | 495 | } |
| 497 | 496 | if (!is_null($next_time)) { |
@@ -504,7 +503,7 @@ discard block |
||
| 504 | 503 | if (is_null($nb_jobs_scheduled)) { |
| 505 | 504 | $nb_jobs_scheduled = sql_countsel( |
| 506 | 505 | 'spip_jobs', |
| 507 | - 'status=' . intval(_JQ_SCHEDULED) . ' AND date<' . sql_quote(date('Y-m-d H:i:s', $time)) |
|
| 506 | + 'status='.intval(_JQ_SCHEDULED).' AND date<'.sql_quote(date('Y-m-d H:i:s', $time)) |
|
| 508 | 507 | ); |
| 509 | 508 | } elseif ($next <= $time) { |
| 510 | 509 | $nb_jobs_scheduled++; |
@@ -573,7 +572,7 @@ discard block |
||
| 573 | 572 | } |
| 574 | 573 | |
| 575 | 574 | // ne pas relancer si on vient de lancer dans la meme seconde par un hit concurent |
| 576 | - if (file_exists($lock = _DIR_TMP . 'cron.lock') && !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) { |
|
| 575 | + if (file_exists($lock = _DIR_TMP.'cron.lock') && !(@filemtime($lock) < $_SERVER['REQUEST_TIME'])) { |
|
| 577 | 576 | return $texte; |
| 578 | 577 | } |
| 579 | 578 | |
@@ -645,7 +644,7 @@ discard block |
||
| 645 | 644 | $port = 80; |
| 646 | 645 | } |
| 647 | 646 | $fp = @fsockopen( |
| 648 | - $scheme . $parts['host'], |
|
| 647 | + $scheme.$parts['host'], |
|
| 649 | 648 | $parts['port'] ?? $port, |
| 650 | 649 | $errno, |
| 651 | 650 | $errstr, |
@@ -655,13 +654,13 @@ discard block |
||
| 655 | 654 | if ($fp) { |
| 656 | 655 | $host_sent = $parts['host']; |
| 657 | 656 | if (isset($parts['port']) && $parts['port'] !== $port) { |
| 658 | - $host_sent .= ':' . $parts['port']; |
|
| 657 | + $host_sent .= ':'.$parts['port']; |
|
| 659 | 658 | } |
| 660 | 659 | $timeout = 200; // ms |
| 661 | 660 | stream_set_timeout($fp, 0, $timeout * 1000); |
| 662 | - $query = $parts['path'] . ($parts['query'] ? '?' . $parts['query'] : ''); |
|
| 663 | - $out = 'GET ' . $query . " HTTP/1.1\r\n"; |
|
| 664 | - $out .= 'Host: ' . $host_sent . "\r\n"; |
|
| 661 | + $query = $parts['path'].($parts['query'] ? '?'.$parts['query'] : ''); |
|
| 662 | + $out = 'GET '.$query." HTTP/1.1\r\n"; |
|
| 663 | + $out .= 'Host: '.$host_sent."\r\n"; |
|
| 665 | 664 | $out .= "Connection: Close\r\n\r\n"; |
| 666 | 665 | fwrite($fp, $out); |
| 667 | 666 | spip_timer('read'); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | /** l'adresse du repertoire de telechargement et de decompactage des plugins */ |
| 23 | 23 | if (!defined('_DIR_PLUGINS_AUTO')) { |
| 24 | - define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/'); |
|
| 24 | + define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins. |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | if ($dir) { |
| 379 | 379 | $dir .= '/'; |
| 380 | 380 | } |
| 381 | - $dir .= 'procure:' . $procure['nom']; |
|
| 381 | + $dir .= 'procure:'.$procure['nom']; |
|
| 382 | 382 | |
| 383 | 383 | $procure['etat'] = '?'; |
| 384 | 384 | $procure['dir_type'] = $resume['dir_type']; |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | $plug = $resume['dir']; |
| 559 | 559 | $k = $infos[$dir_type][$plug]; |
| 560 | 560 | |
| 561 | - $plug = constant($dir_type) . $plug; |
|
| 561 | + $plug = constant($dir_type).$plug; |
|
| 562 | 562 | if (!isset($msg[$p])) { |
| 563 | 563 | if (isset($resume['erreur']) && $resume['erreur']) { |
| 564 | 564 | $msg[$p] = [$resume['erreur']]; |
@@ -601,10 +601,10 @@ discard block |
||
| 601 | 601 | $list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation']; |
| 602 | 602 | } elseif (!$raw) { |
| 603 | 603 | foreach ($list as $plug => $msg) { |
| 604 | - $list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 605 | - . '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>'; |
|
| 604 | + $list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 605 | + . '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>'; |
|
| 606 | 606 | } |
| 607 | - $list = '<ul>' . join("\n", $list) . '</ul>'; |
|
| 607 | + $list = '<ul>'.join("\n", $list).'</ul>'; |
|
| 608 | 608 | } |
| 609 | 609 | if ($raz) { |
| 610 | 610 | effacer_meta('plugin_erreur_activation'); |
@@ -718,13 +718,13 @@ discard block |
||
| 718 | 718 | if ($minimum_inclus && spip_version_compare($version, $minimum, '<')) { |
| 719 | 719 | return _T("plugin_{$balise}_{$type}", [ |
| 720 | 720 | 'plugin' => $nom, |
| 721 | - 'version' => ' ≥ ' . $minimum |
|
| 721 | + 'version' => ' ≥ '.$minimum |
|
| 722 | 722 | ]); |
| 723 | 723 | } |
| 724 | 724 | if (!$minimum_inclus && spip_version_compare($version, $minimum, '<=')) { |
| 725 | 725 | return _T("plugin_{$balise}_{$type}", [ |
| 726 | 726 | 'plugin' => $nom, |
| 727 | - 'version' => ' > ' . $minimum |
|
| 727 | + 'version' => ' > '.$minimum |
|
| 728 | 728 | ]); |
| 729 | 729 | } |
| 730 | 730 | } |
@@ -733,13 +733,13 @@ discard block |
||
| 733 | 733 | if ($maximum_inclus && spip_version_compare($version, $maximum, '>')) { |
| 734 | 734 | return _T("plugin_{$balise}_{$type}", [ |
| 735 | 735 | 'plugin' => $nom, |
| 736 | - 'version' => ' ≤ ' . $maximum |
|
| 736 | + 'version' => ' ≤ '.$maximum |
|
| 737 | 737 | ]); |
| 738 | 738 | } |
| 739 | 739 | if (!$maximum_inclus && spip_version_compare($version, $maximum, '>=')) { |
| 740 | 740 | return _T("plugin_{$balise}_plugin", [ |
| 741 | 741 | 'plugin' => $nom, |
| 742 | - 'version' => ' < ' . $maximum |
|
| 742 | + 'version' => ' < '.$maximum |
|
| 743 | 743 | ]); |
| 744 | 744 | } |
| 745 | 745 | } |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | include_spip('inc/charger_plugin'); |
| 759 | 759 | $url = '<br />' . bouton_telechargement_plugin($url, 'lib'); |
| 760 | 760 | }*/ |
| 761 | - return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>"; |
|
| 761 | + return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>"; |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | foreach ($plugin_valides as $p => $resume) { |
| 858 | 858 | // Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP |
| 859 | 859 | if (!str_starts_with($p, 'PHP:') && $p !== 'PHP') { |
| 860 | - $header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : ''); |
|
| 860 | + $header[] = $p.($resume['version'] ? '('.$resume['version'].')' : ''); |
|
| 861 | 861 | } |
| 862 | 862 | if ($resume['dir']) { |
| 863 | 863 | foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) { |
@@ -882,11 +882,11 @@ discard block |
||
| 882 | 882 | $header = strtolower(implode(',', $header)); |
| 883 | 883 | if (!isset($GLOBALS['spip_header_silencieux']) || !$GLOBALS['spip_header_silencieux']) { |
| 884 | 884 | ecrire_fichier( |
| 885 | - _DIR_VAR . 'config.txt', |
|
| 886 | - (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header |
|
| 885 | + _DIR_VAR.'config.txt', |
|
| 886 | + (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header |
|
| 887 | 887 | ); |
| 888 | 888 | } else { |
| 889 | - @unlink(_DIR_VAR . 'config.txt'); |
|
| 889 | + @unlink(_DIR_VAR.'config.txt'); |
|
| 890 | 890 | } |
| 891 | 891 | // generer charger_plugins_chemin.php |
| 892 | 892 | plugins_precompile_chemin($plugin_valides, $ordre); |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | // definir le plugin, donc le path avant l'include du fichier options |
| 941 | 941 | // permet de faire des include_spip pour attraper un inc_ du plugin |
| 942 | 942 | |
| 943 | - $dir = $dir_type . ".'" . $plug . "/'"; |
|
| 943 | + $dir = $dir_type.".'".$plug."/'"; |
|
| 944 | 944 | |
| 945 | 945 | $prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix'])); |
| 946 | 946 | if ( |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | if (!$info['chemin']) { |
| 952 | 952 | $chemins['public'][] = "_DIR_PLUGIN_$prefix"; |
| 953 | 953 | $chemins['prive'][] = "_DIR_PLUGIN_$prefix"; |
| 954 | - if (is_dir(constant($dir_type) . $plug . '/squelettes/')) { |
|
| 954 | + if (is_dir(constant($dir_type).$plug.'/squelettes/')) { |
|
| 955 | 955 | $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'"; |
| 956 | 956 | } |
| 957 | 957 | } |
@@ -973,13 +973,13 @@ discard block |
||
| 973 | 973 | $dir = ''; |
| 974 | 974 | } |
| 975 | 975 | if (strlen($dir)) { |
| 976 | - $dir = rtrim($dir, '/') . '/'; |
|
| 976 | + $dir = rtrim($dir, '/').'/'; |
|
| 977 | 977 | } |
| 978 | 978 | if (!isset($chemin['type']) || $chemin['type'] == 'public') { |
| 979 | - $chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 979 | + $chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 980 | 980 | } |
| 981 | 981 | if (!isset($chemin['type']) || $chemin['type'] == 'prive') { |
| 982 | - $chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 982 | + $chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 983 | 983 | } |
| 984 | 984 | } |
| 985 | 985 | } |
@@ -988,11 +988,11 @@ discard block |
||
| 988 | 988 | } |
| 989 | 989 | } |
| 990 | 990 | if (count($chemins['public']) || count($chemins['prive'])) { |
| 991 | - $contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode( |
|
| 991 | + $contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode( |
|
| 992 | 992 | ',', |
| 993 | 993 | array_reverse($chemins['public']) |
| 994 | - ) . "]);\n" |
|
| 995 | - . 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n"; |
|
| 994 | + )."]);\n" |
|
| 995 | + . 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n"; |
|
| 996 | 996 | } |
| 997 | 997 | |
| 998 | 998 | ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu); |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | && !str_contains($dir, ':') |
| 1042 | 1042 | && file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml |
| 1043 | 1043 | ) { |
| 1044 | - if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) { |
|
| 1044 | + if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) { |
|
| 1045 | 1045 | $info[$charge] = [$file]; |
| 1046 | 1046 | } |
| 1047 | 1047 | } |
@@ -1056,7 +1056,7 @@ discard block |
||
| 1056 | 1056 | ) { |
| 1057 | 1057 | unset($info[$charge][$k]); |
| 1058 | 1058 | } else { |
| 1059 | - $_file = $root_dir_type . ".'$plug/$file'"; |
|
| 1059 | + $_file = $root_dir_type.".'$plug/$file'"; |
|
| 1060 | 1060 | $contenu[$charge] .= "include_once_check($_file);\n"; |
| 1061 | 1061 | } |
| 1062 | 1062 | } |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | } |
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | - $contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options']; |
|
| 1069 | + $contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options']; |
|
| 1070 | 1070 | $contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons) |
| 1071 | 1071 | . plugin_ongletbouton('onglets_plugins', $onglets); |
| 1072 | 1072 | |
@@ -1101,12 +1101,12 @@ discard block |
||
| 1101 | 1101 | define("_UPDATED_$nom", $val); |
| 1102 | 1102 | define("_UPDATED_md5_$nom", $md5); |
| 1103 | 1103 | } |
| 1104 | - $val = "unserialize('" . str_replace("'", "\'", $val) . "')"; |
|
| 1104 | + $val = "unserialize('".str_replace("'", "\'", $val)."')"; |
|
| 1105 | 1105 | |
| 1106 | 1106 | return |
| 1107 | 1107 | "if (!function_exists('$nom')) {\n" |
| 1108 | 1108 | . "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n" |
| 1109 | - . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n" |
|
| 1109 | + . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n" |
|
| 1110 | 1110 | . "}\n"; |
| 1111 | 1111 | } |
| 1112 | 1112 | |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | if (@is_readable(_CACHE_PLUGINS_OPT)) { |
| 1130 | 1130 | include_once(_CACHE_PLUGINS_OPT); |
| 1131 | 1131 | } else { |
| 1132 | - spip_logger()->info('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT); |
|
| 1132 | + spip_logger()->info('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT); |
|
| 1133 | 1133 | } |
| 1134 | 1134 | } |
| 1135 | 1135 | |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | $dir_type = $plugin_valides[$p]['dir_type']; |
| 1167 | 1167 | $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type); |
| 1168 | 1168 | $plug = $plugin_valides[$p]['dir']; |
| 1169 | - $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_'); |
|
| 1169 | + $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_'); |
|
| 1170 | 1170 | if (isset($info['pipeline']) && is_array($info['pipeline'])) { |
| 1171 | 1171 | foreach ($info['pipeline'] as $pipe) { |
| 1172 | 1172 | $nom = $pipe['nom']; |
@@ -1200,7 +1200,7 @@ discard block |
||
| 1200 | 1200 | } |
| 1201 | 1201 | if (isset($pipe['inclure'])) { |
| 1202 | 1202 | $GLOBALS['spip_matrice']["$prefix$action"] = |
| 1203 | - "$root_dir_type:$plug/" . $pipe['inclure']; |
|
| 1203 | + "$root_dir_type:$plug/".$pipe['inclure']; |
|
| 1204 | 1204 | } |
| 1205 | 1205 | } |
| 1206 | 1206 | } |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | $prepend_code['taches_generales_cron'] = ''; |
| 1211 | 1211 | } |
| 1212 | 1212 | foreach ($info['genie'] as $genie) { |
| 1213 | - $nom = $prefix . $genie['nom']; |
|
| 1213 | + $nom = $prefix.$genie['nom']; |
|
| 1214 | 1214 | $periode = max(60, intval($genie['periode'])); |
| 1215 | 1215 | if (charger_fonction($nom, 'genie', true)) { |
| 1216 | 1216 | $prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n"; |
@@ -1228,13 +1228,13 @@ discard block |
||
| 1228 | 1228 | } |
| 1229 | 1229 | foreach ($info['style'] as $style) { |
| 1230 | 1230 | if (isset($style['path']) && $style['path']) { |
| 1231 | - $code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) "; |
|
| 1231 | + $code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) "; |
|
| 1232 | 1232 | } else { |
| 1233 | - $code = "if (\$f='" . addslashes($style['url']) . "') "; |
|
| 1233 | + $code = "if (\$f='".addslashes($style['url'])."') "; |
|
| 1234 | 1234 | } |
| 1235 | 1235 | $code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\""; |
| 1236 | 1236 | if (isset($style['media']) && strlen($style['media'])) { |
| 1237 | - $code .= ' media="' . addslashes($style['media']) . '"'; |
|
| 1237 | + $code .= ' media="'.addslashes($style['media']).'"'; |
|
| 1238 | 1238 | } |
| 1239 | 1239 | $code .= "/>';\n"; |
| 1240 | 1240 | if ($style['type'] != 'prive') { |
@@ -1254,9 +1254,9 @@ discard block |
||
| 1254 | 1254 | if (isset($info['script']) && (is_countable($info['script']) ? count($info['script']) : 0)) { |
| 1255 | 1255 | foreach ($info['script'] as $script) { |
| 1256 | 1256 | if (isset($script['path']) && $script['path']) { |
| 1257 | - $code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) "; |
|
| 1257 | + $code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) "; |
|
| 1258 | 1258 | } else { |
| 1259 | - $code = "if (\$f='" . addslashes($script['url']) . "') "; |
|
| 1259 | + $code = "if (\$f='".addslashes($script['url'])."') "; |
|
| 1260 | 1260 | } |
| 1261 | 1261 | $code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n"; |
| 1262 | 1262 | if ($script['type'] != 'prive') { |
@@ -1319,10 +1319,10 @@ discard block |
||
| 1319 | 1319 | unset($GLOBALS['spip_pipeline']['all']); |
| 1320 | 1320 | $all_pipes = trim(array_shift($a)); |
| 1321 | 1321 | if ($all_pipes) { |
| 1322 | - $all_pipes = '|' . ltrim($all_pipes, '|'); |
|
| 1322 | + $all_pipes = '|'.ltrim($all_pipes, '|'); |
|
| 1323 | 1323 | } |
| 1324 | 1324 | if (count($a)) { |
| 1325 | - $all_pipes_end = '||' . array_shift($a); |
|
| 1325 | + $all_pipes_end = '||'.array_shift($a); |
|
| 1326 | 1326 | } |
| 1327 | 1327 | } |
| 1328 | 1328 | $content = ''; |
@@ -1339,7 +1339,7 @@ discard block |
||
| 1339 | 1339 | // Eclater le pipeline en filtres et appliquer chaque filtre |
| 1340 | 1340 | foreach ($pipe as $fonc) { |
| 1341 | 1341 | $fonc = trim($fonc); |
| 1342 | - $s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n"; |
|
| 1342 | + $s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n"; |
|
| 1343 | 1343 | if (isset($GLOBALS['spip_matrice'][$fonc])) { |
| 1344 | 1344 | $file = $GLOBALS['spip_matrice'][$fonc]; |
| 1345 | 1345 | $file = "'$file'"; |
@@ -1350,7 +1350,7 @@ discard block |
||
| 1350 | 1350 | if (defined($root_dir)) { |
| 1351 | 1351 | $dir = $root_dir; |
| 1352 | 1352 | } |
| 1353 | - $file = str_replace($regs[0], "'." . $dir . ".'", $file); |
|
| 1353 | + $file = str_replace($regs[0], "'.".$dir.".'", $file); |
|
| 1354 | 1354 | $file = str_replace("''.", '', $file); |
| 1355 | 1355 | $file = str_replace(constant($dir), '', $file); |
| 1356 | 1356 | } |
@@ -1363,7 +1363,7 @@ discard block |
||
| 1363 | 1363 | $content .= "// Pipeline $action \n" |
| 1364 | 1364 | . "function execute_pipeline_$action(&\$val){\n" |
| 1365 | 1365 | . $s_inc |
| 1366 | - . ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '') |
|
| 1366 | + . ((isset($prepend_code[$action]) && strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '') |
|
| 1367 | 1367 | . $s_call |
| 1368 | 1368 | . "return \$val;\n}\n"; |
| 1369 | 1369 | } |
@@ -1419,9 +1419,9 @@ discard block |
||
| 1419 | 1419 | $result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec')); |
| 1420 | 1420 | if (_IS_CLI) { |
| 1421 | 1421 | include_spip('inc/filtres'); |
| 1422 | - $trace = ltrim(textebrut($trace) . "\n" . $result); |
|
| 1423 | - $trace = ' ' . str_replace("\n", "\n ", $trace); |
|
| 1424 | - echo "\n" . ($ok ? 'OK ' : '/!\ ') . textebrut($titre) . "\n", |
|
| 1422 | + $trace = ltrim(textebrut($trace)."\n".$result); |
|
| 1423 | + $trace = ' '.str_replace("\n", "\n ", $trace); |
|
| 1424 | + echo "\n".($ok ? 'OK ' : '/!\ ').textebrut($titre)."\n", |
|
| 1425 | 1425 | $trace, |
| 1426 | 1426 | "\n"; |
| 1427 | 1427 | } |
@@ -1456,15 +1456,15 @@ discard block |
||
| 1456 | 1456 | $GLOBALS['fichier_php_compile_recent'] = 0; |
| 1457 | 1457 | } |
| 1458 | 1458 | |
| 1459 | - $contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>'; |
|
| 1459 | + $contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>'; |
|
| 1460 | 1460 | // si un fichier existe deja on verifie que son contenu change avant de l'ecraser |
| 1461 | 1461 | // si pas de modif on ne touche pas au fichier initial |
| 1462 | 1462 | if (file_exists($nom)) { |
| 1463 | 1463 | if (str_ends_with($nom, '.php')) { |
| 1464 | - $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
|
| 1464 | + $fichier_tmp = substr($nom, 0, -4).'.tmp.php'; |
|
| 1465 | 1465 | } |
| 1466 | 1466 | else { |
| 1467 | - $fichier_tmp = $nom . '.tmp'; |
|
| 1467 | + $fichier_tmp = $nom.'.tmp'; |
|
| 1468 | 1468 | } |
| 1469 | 1469 | file_put_contents($fichier_tmp, $contenu); |
| 1470 | 1470 | if (md5_file($nom) == md5_file($fichier_tmp)) { |