@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | ) { |
| 39 | 39 | // Pour tous les formulaires CONFIGURER, ayant une fonction charger ou pas, on teste si autorisé |
| 40 | 40 | include_spip('inc/autoriser'); |
| 41 | - if (!autoriser('configurer', '_' . substr($form, 11))) { |
|
| 41 | + if (!autoriser('configurer', '_'.substr($form, 11))) { |
|
| 42 | 42 | return false; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | and !charger_fonction('traiter', "formulaires/$form/", true) // sans fonction traiter() |
| 73 | 73 | ) { |
| 74 | 74 | $trace = cvtconf_formulaires_configurer_enregistre($form, $flux['args']['args']); |
| 75 | - $flux['data'] = ['message_ok' => _T('config_info_enregistree') . $trace, 'editable' => true]; |
|
| 75 | + $flux['data'] = ['message_ok' => _T('config_info_enregistree').$trace, 'editable' => true]; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | return $flux; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $prefixe = $valeurs['_meta_prefixe']; |
| 147 | 147 | } |
| 148 | 148 | if (isset($valeurs['_meta_stockage'])) { |
| 149 | - $stockage = $valeurs['_meta_stockage'] . '::'; |
|
| 149 | + $stockage = $valeurs['_meta_stockage'].'::'; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | // si on indique juste une table, il faut vider les autres proprietes |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | // sinon cas analyse du squelette |
| 173 | 173 | if ( |
| 174 | - $f = find_in_path($form . '.' . _EXTENSION_SQUELETTES, 'formulaires/') |
|
| 174 | + $f = find_in_path($form.'.'._EXTENSION_SQUELETTES, 'formulaires/') |
|
| 175 | 175 | and lire_fichier($f, $contenu) |
| 176 | 176 | ) { |
| 177 | 177 | for ($i = 0; $i < 2; $i++) { |
@@ -228,14 +228,14 @@ discard block |
||
| 228 | 228 | lire_metas($table); |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - $prefixe = ($prefixe ? $prefixe . '_' : ''); |
|
| 231 | + $prefixe = ($prefixe ? $prefixe.'_' : ''); |
|
| 232 | 232 | $table = ($table) ? "/$table/" : ''; |
| 233 | - $casier = ($casier) ? rtrim($casier, '/') . '/' : ''; // slash final, sinon rien |
|
| 233 | + $casier = ($casier) ? rtrim($casier, '/').'/' : ''; // slash final, sinon rien |
|
| 234 | 234 | |
| 235 | 235 | foreach ($store as $k => $v) { |
| 236 | 236 | ecrire_config("$stockage$table$prefixe$casier$k", $v); |
| 237 | 237 | if (_request('var_mode') == 'configurer' and autoriser('webmestre')) { |
| 238 | - $trace .= "<br />table $table : " . $prefixe . $k . " = $v;"; |
|
| 238 | + $trace .= "<br />table $table : ".$prefixe.$k." = $v;"; |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | [$table, $casier, $prefixe, $stockage] = cvtconf_definir_configurer_conteneur($form, $valeurs); |
| 253 | 253 | |
| 254 | 254 | $table = ($table) ? "/$table/" : ''; |
| 255 | - $prefixe = ($prefixe ? $prefixe . '_' : ''); |
|
| 255 | + $prefixe = ($prefixe ? $prefixe.'_' : ''); |
|
| 256 | 256 | if ($casier) { |
| 257 | 257 | $meta = lire_config("$stockage$table$prefixe$casier"); |
| 258 | 258 | $prefixe = ''; |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | foreach ($valeurs as $k => $v) { |
| 265 | 265 | if (substr($k, 0, 1) !== '_') { |
| 266 | - $valeurs[$k] = ($meta[$prefixe . $k] ?? null); |
|
| 266 | + $valeurs[$k] = ($meta[$prefixe.$k] ?? null); |
|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | } |
@@ -73,16 +73,16 @@ discard block |
||
| 73 | 73 | protected $_lcount = 19; |
| 74 | 74 | protected $_vcount = 21; |
| 75 | 75 | protected $_tcount = 28; |
| 76 | - protected $_ncount = 588; // _vcount * _tcount |
|
| 76 | + protected $_ncount = 588; // _vcount * _tcount |
|
| 77 | 77 | protected $_scount = 11172; // _lcount * _tcount * _vcount |
| 78 | 78 | protected $_error = false; |
| 79 | 79 | protected static $_mb_string_overload = null; |
| 80 | 80 | // See {@link set_paramter()} for details of how to change the following |
| 81 | 81 | // settings from within your script / application |
| 82 | - protected $_api_encoding = 'utf8'; // Default input charset is UTF-8 |
|
| 83 | - protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden |
|
| 84 | - protected $_strict_mode = false; // Behave strict or not |
|
| 85 | - protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008 |
|
| 82 | + protected $_api_encoding = 'utf8'; // Default input charset is UTF-8 |
|
| 83 | + protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden |
|
| 84 | + protected $_strict_mode = false; // Behave strict or not |
|
| 85 | + protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008 |
|
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * the constructor |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $this->_api_encoding = $v; |
| 141 | 141 | break; |
| 142 | 142 | default: |
| 143 | - $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k); |
|
| 143 | + $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
| 144 | 144 | return false; |
| 145 | 145 | } |
| 146 | 146 | break; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | if (in_array($v, array('2003', '2008'))) { |
| 155 | 155 | $this->_idn_version = $v; |
| 156 | 156 | } else { |
| 157 | - $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k); |
|
| 157 | + $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
| 158 | 158 | } |
| 159 | 159 | break; |
| 160 | 160 | case 'encode_german_sz': // Deprecated |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | break; |
| 167 | 167 | default: |
| 168 | - $this->_error('Set Parameter: Unknown option ' . $k); |
|
| 168 | + $this->_error('Set Parameter: Unknown option '.$k); |
|
| 169 | 169 | return false; |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | case 'ucs4_array': |
| 189 | 189 | break; |
| 190 | 190 | default: |
| 191 | - $this->_error('Unknown encoding ' . $one_time_encoding); |
|
| 191 | + $this->_error('Unknown encoding '.$one_time_encoding); |
|
| 192 | 192 | return false; |
| 193 | 193 | } |
| 194 | 194 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | [$email_pref, $input] = explode('@', $input, 2); |
| 207 | 207 | $arr = explode('.', $input); |
| 208 | 208 | foreach ($arr as $k => $v) { |
| 209 | - if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) { |
|
| 209 | + if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) { |
|
| 210 | 210 | $conv = $this->_decode($v); |
| 211 | 211 | if ($conv) { |
| 212 | 212 | $arr[$k] = $conv; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $input = join('.', $arr); |
| 217 | 217 | $arr = explode('.', $email_pref); |
| 218 | 218 | foreach ($arr as $k => $v) { |
| 219 | - if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) { |
|
| 219 | + if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) { |
|
| 220 | 220 | $conv = $this->_decode($v); |
| 221 | 221 | if ($conv) { |
| 222 | 222 | $arr[$k] = $conv; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | $email_pref = join('.', $arr); |
| 227 | - $return = $email_pref . '@' . $input; |
|
| 227 | + $return = $email_pref.'@'.$input; |
|
| 228 | 228 | } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters) |
| 229 | 229 | // No no in strict mode |
| 230 | 230 | if ($this->_strict_mode) { |
@@ -241,13 +241,13 @@ discard block |
||
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | $parsed['host'] = join('.', $arr); |
| 244 | - $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 245 | - (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@'). |
|
| 244 | + $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 245 | + (empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@'). |
|
| 246 | 246 | $parsed['host']. |
| 247 | - (empty($parsed['port']) ? '' : ':' . $parsed['port']). |
|
| 247 | + (empty($parsed['port']) ? '' : ':'.$parsed['port']). |
|
| 248 | 248 | (empty($parsed['path']) ? '' : $parsed['path']). |
| 249 | - (empty($parsed['query']) ? '' : '?' . $parsed['query']). |
|
| 250 | - (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']); |
|
| 249 | + (empty($parsed['query']) ? '' : '?'.$parsed['query']). |
|
| 250 | + (empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']); |
|
| 251 | 251 | } else { // parse_url seems to have failed, try without it |
| 252 | 252 | $arr = explode('.', $input); |
| 253 | 253 | foreach ($arr as $k => $v) { |
@@ -265,8 +265,8 @@ discard block |
||
| 265 | 265 | // The output is UTF-8 by default, other output formats need conversion here |
| 266 | 266 | // If one time encoding is given, use this, else the objects property |
| 267 | 267 | switch ($one_time_encoding ?: $this->_api_encoding) { |
| 268 | - case 'utf8': return $return; // break; |
|
| 269 | - case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); // break; |
|
| 268 | + case 'utf8' : return $return; // break; |
|
| 269 | + case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); // break; |
|
| 270 | 270 | case 'ucs4_array': return $this->_utf8_to_ucs4($return); // break; |
| 271 | 271 | default: $this->_error('Unsupported output format'); return false; |
| 272 | 272 | } |
@@ -283,15 +283,14 @@ discard block |
||
| 283 | 283 | // Forcing conversion of input to UCS4 array |
| 284 | 284 | // If one time encoding is given, use this, else the objects property |
| 285 | 285 | switch ($one_time_encoding ?: $this->_api_encoding) { |
| 286 | - case 'utf8': |
|
| 287 | - $decoded = $this->_utf8_to_ucs4($decoded); |
|
| 286 | + case 'utf8' : $decoded = $this->_utf8_to_ucs4($decoded); |
|
| 288 | 287 | break; |
| 289 | 288 | case 'ucs4_string': |
| 290 | 289 | $decoded = $this->_ucs4_string_to_ucs4($decoded); |
| 291 | 290 | case 'ucs4_array': |
| 292 | 291 | break; |
| 293 | 292 | default: |
| 294 | - $this->_error('Unsupported input format: ' . ($one_time_encoding ?: $this->_api_encoding)); |
|
| 293 | + $this->_error('Unsupported input format: '.($one_time_encoding ?: $this->_api_encoding)); |
|
| 295 | 294 | return false; |
| 296 | 295 | } |
| 297 | 296 | |
@@ -380,13 +379,13 @@ discard block |
||
| 380 | 379 | } |
| 381 | 380 | } |
| 382 | 381 | $parsed['host'] = join('.', $arr); |
| 383 | - $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 384 | - (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@'). |
|
| 382 | + $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 383 | + (empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@'). |
|
| 385 | 384 | $parsed['host']. |
| 386 | - (empty($parsed['port']) ? '' : ':' . $parsed['port']). |
|
| 385 | + (empty($parsed['port']) ? '' : ':'.$parsed['port']). |
|
| 387 | 386 | (empty($parsed['path']) ? '' : $parsed['path']). |
| 388 | - (empty($parsed['query']) ? '' : '?' . $parsed['query']). |
|
| 389 | - (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']); |
|
| 387 | + (empty($parsed['query']) ? '' : '?'.$parsed['query']). |
|
| 388 | + (empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']); |
|
| 390 | 389 | return $return; |
| 391 | 390 | } |
| 392 | 391 | |
@@ -409,11 +408,11 @@ discard block |
||
| 409 | 408 | { |
| 410 | 409 | $decoded = array(); |
| 411 | 410 | // find the Punycode prefix |
| 412 | - if (!preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $encoded)) { |
|
| 411 | + if (!preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $encoded)) { |
|
| 413 | 412 | $this->_error('This is not a punycode string'); |
| 414 | 413 | return false; |
| 415 | 414 | } |
| 416 | - $encode_test = preg_replace('!^' . preg_quote($this->_punycode_prefix, '!') . '!', '', $encoded); |
|
| 415 | + $encode_test = preg_replace('!^'.preg_quote($this->_punycode_prefix, '!').'!', '', $encoded); |
|
| 417 | 416 | // If nothing left after removing the prefix, it is hopeless |
| 418 | 417 | if (!$encode_test) { |
| 419 | 418 | $this->_error('The given encoded string was empty'); |
@@ -439,8 +438,7 @@ discard block |
||
| 439 | 438 | for ($old_idx = $idx, $w = 1, $k = $this->_base; 1; $k += $this->_base) { |
| 440 | 439 | $digit = $this->_decode_digit($encoded[$enco_idx++]); |
| 441 | 440 | $idx += $digit * $w; |
| 442 | - $t = ($k <= $bias) ? $this->_tmin : |
|
| 443 | - (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); |
|
| 441 | + $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); |
|
| 444 | 442 | if ($digit < $t) { |
| 445 | 443 | break; |
| 446 | 444 | } |
@@ -513,7 +511,7 @@ discard block |
||
| 513 | 511 | return $encoded; // All codepoints were basic ones |
| 514 | 512 | } |
| 515 | 513 | // Start with the prefix; copy it to output |
| 516 | - $encoded = $this->_punycode_prefix . $encoded; |
|
| 514 | + $encoded = $this->_punycode_prefix.$encoded; |
|
| 517 | 515 | // If we have basic code points in output, add an hyphen to the end |
| 518 | 516 | if ($codecount) { |
| 519 | 517 | $encoded .= '-'; |
@@ -540,8 +538,7 @@ discard block |
||
| 540 | 538 | $delta++; |
| 541 | 539 | } elseif ($decoded[$i] == $cur_code) { |
| 542 | 540 | for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) { |
| 543 | - $t = ($k <= $bias) ? $this->_tmin : |
|
| 544 | - (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); |
|
| 541 | + $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); |
|
| 545 | 542 | if ($q < $t) { |
| 546 | 543 | break; |
| 547 | 544 | } |
@@ -628,12 +625,12 @@ discard block |
||
| 628 | 625 | } |
| 629 | 626 | // Try to find prohibited input |
| 630 | 627 | if (in_array($v, self::$NP['prohibit']) || in_array($v, self::$NP['general_prohibited'])) { |
| 631 | - $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v)); |
|
| 628 | + $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v)); |
|
| 632 | 629 | return false; |
| 633 | 630 | } |
| 634 | 631 | foreach (self::$NP['prohibit_ranges'] as $range) { |
| 635 | 632 | if ($range[0] <= $v && $v <= $range[1]) { |
| 636 | - $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v)); |
|
| 633 | + $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v)); |
|
| 637 | 634 | return false; |
| 638 | 635 | } |
| 639 | 636 | } |
@@ -871,7 +868,7 @@ discard block |
||
| 871 | 868 | $output[$out_len] = $v; |
| 872 | 869 | ++$out_len; |
| 873 | 870 | if ('add' == $mode) { |
| 874 | - $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
| 871 | + $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
| 875 | 872 | return false; |
| 876 | 873 | } |
| 877 | 874 | continue; |
@@ -896,7 +893,7 @@ discard block |
||
| 896 | 893 | $next_byte = 4; |
| 897 | 894 | $v = ($v - 252) << 30; |
| 898 | 895 | } else { |
| 899 | - $this->_error('This might be UTF-8, but I don\'t understand it at byte ' . $k); |
|
| 896 | + $this->_error('This might be UTF-8, but I don\'t understand it at byte '.$k); |
|
| 900 | 897 | return false; |
| 901 | 898 | } |
| 902 | 899 | if ('add' == $mode) { |
@@ -909,7 +906,7 @@ discard block |
||
| 909 | 906 | if (!$this->_allow_overlong && $test == 'range') { |
| 910 | 907 | $test = 'none'; |
| 911 | 908 | if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { |
| 912 | - $this->_error('Bogus UTF-8 character detected (out of legal range) at byte ' . $k); |
|
| 909 | + $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k); |
|
| 913 | 910 | return false; |
| 914 | 911 | } |
| 915 | 912 | } |
@@ -918,7 +915,7 @@ discard block |
||
| 918 | 915 | $output[($out_len - 1)] += $v; |
| 919 | 916 | --$next_byte; |
| 920 | 917 | } else { |
| 921 | - $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
| 918 | + $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
| 922 | 919 | return false; |
| 923 | 920 | } |
| 924 | 921 | if ($next_byte < 0) { |
@@ -942,13 +939,13 @@ discard block |
||
| 942 | 939 | if ($v < 128) { // 7bit are transferred literally |
| 943 | 940 | $output .= chr($v); |
| 944 | 941 | } elseif ($v < (1 << 11)) { // 2 bytes |
| 945 | - $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); |
|
| 942 | + $output .= chr(192 + ($v >> 6)).chr(128 + ($v & 63)); |
|
| 946 | 943 | } elseif ($v < (1 << 16)) { // 3 bytes |
| 947 | - $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
| 944 | + $output .= chr(224 + ($v >> 12)).chr(128 + (($v >> 6) & 63)).chr(128 + ($v & 63)); |
|
| 948 | 945 | } elseif ($v < (1 << 21)) { // 4 bytes |
| 949 | - $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
| 946 | + $output .= chr(240 + ($v >> 18)).chr(128 + (($v >> 12) & 63)).chr(128 + (($v >> 6) & 63)).chr(128 + ($v & 63)); |
|
| 950 | 947 | } else { |
| 951 | - $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte ' . $k); |
|
| 948 | + $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k); |
|
| 952 | 949 | return false; |
| 953 | 950 | } |
| 954 | 951 | } |
@@ -967,7 +964,7 @@ discard block |
||
| 967 | 964 | // Take array values and split output to 4 bytes per value |
| 968 | 965 | // The bit mask is 255, which reads &11111111 |
| 969 | 966 | foreach ($input as $v) { |
| 970 | - $output .= chr(($v >> 24) & 255) . chr(($v >> 16) & 255) . chr(($v >> 8) & 255) . chr($v & 255); |
|
| 967 | + $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255); |
|
| 971 | 968 | } |
| 972 | 969 | return $output; |
| 973 | 970 | } |
@@ -997,7 +994,7 @@ discard block |
||
| 997 | 994 | $out_len++; |
| 998 | 995 | $output[$out_len] = 0; |
| 999 | 996 | } |
| 1000 | - $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) ); |
|
| 997 | + $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4))); |
|
| 1001 | 998 | } |
| 1002 | 999 | return $output; |
| 1003 | 1000 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | /** l'adresse du repertoire de telechargement et de decompactage des plugins */ |
| 24 | 24 | if (!defined('_DIR_PLUGINS_AUTO')) { |
| 25 | - define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/'); |
|
| 25 | + define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins. |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | if ($dir) { |
| 374 | 374 | $dir .= '/'; |
| 375 | 375 | } |
| 376 | - $dir .= 'procure:' . $procure['nom']; |
|
| 376 | + $dir .= 'procure:'.$procure['nom']; |
|
| 377 | 377 | |
| 378 | 378 | $procure['etat'] = '?'; |
| 379 | 379 | $procure['dir_type'] = $resume['dir_type']; |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | $plug = $resume['dir']; |
| 558 | 558 | $k = $infos[$dir_type][$plug]; |
| 559 | 559 | |
| 560 | - $plug = constant($dir_type) . $plug; |
|
| 560 | + $plug = constant($dir_type).$plug; |
|
| 561 | 561 | if (!isset($msg[$p])) { |
| 562 | 562 | if (isset($resume['erreur']) and $resume['erreur']) { |
| 563 | 563 | $msg[$p] = [$resume['erreur']]; |
@@ -600,10 +600,10 @@ discard block |
||
| 600 | 600 | $list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation']; |
| 601 | 601 | } elseif (!$raw) { |
| 602 | 602 | foreach ($list as $plug => $msg) { |
| 603 | - $list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 604 | - . '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>'; |
|
| 603 | + $list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 604 | + . '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>'; |
|
| 605 | 605 | } |
| 606 | - $list = '<ul>' . join("\n", $list) . '</ul>'; |
|
| 606 | + $list = '<ul>'.join("\n", $list).'</ul>'; |
|
| 607 | 607 | } |
| 608 | 608 | if ($raz) { |
| 609 | 609 | effacer_meta('plugin_erreur_activation'); |
@@ -717,13 +717,13 @@ discard block |
||
| 717 | 717 | if ($minimum_inclus and spip_version_compare($version, $minimum, '<')) { |
| 718 | 718 | return _T("plugin_${balise}_${type}", [ |
| 719 | 719 | 'plugin' => $nom, |
| 720 | - 'version' => ' ≥ ' . $minimum |
|
| 720 | + 'version' => ' ≥ '.$minimum |
|
| 721 | 721 | ]); |
| 722 | 722 | } |
| 723 | 723 | if (!$minimum_inclus and spip_version_compare($version, $minimum, '<=')) { |
| 724 | 724 | return _T("plugin_${balise}_${type}", [ |
| 725 | 725 | 'plugin' => $nom, |
| 726 | - 'version' => ' > ' . $minimum |
|
| 726 | + 'version' => ' > '.$minimum |
|
| 727 | 727 | ]); |
| 728 | 728 | } |
| 729 | 729 | } |
@@ -732,13 +732,13 @@ discard block |
||
| 732 | 732 | if ($maximum_inclus and spip_version_compare($version, $maximum, '>')) { |
| 733 | 733 | return _T("plugin_${balise}_${type}", [ |
| 734 | 734 | 'plugin' => $nom, |
| 735 | - 'version' => ' ≤ ' . $maximum |
|
| 735 | + 'version' => ' ≤ '.$maximum |
|
| 736 | 736 | ]); |
| 737 | 737 | } |
| 738 | 738 | if (!$maximum_inclus and spip_version_compare($version, $maximum, '>=')) { |
| 739 | 739 | return _T("plugin_${balise}_plugin", [ |
| 740 | 740 | 'plugin' => $nom, |
| 741 | - 'version' => ' < ' . $maximum |
|
| 741 | + 'version' => ' < '.$maximum |
|
| 742 | 742 | ]); |
| 743 | 743 | } |
| 744 | 744 | } |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | include_spip('inc/charger_plugin'); |
| 758 | 758 | $url = '<br />' . bouton_telechargement_plugin($url, 'lib'); |
| 759 | 759 | }*/ |
| 760 | - return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>"; |
|
| 760 | + return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>"; |
|
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | |
@@ -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 (0 !== strpos($p, 'PHP:') and $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']) or !$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 | } |
@@ -972,13 +972,13 @@ discard block |
||
| 972 | 972 | $dir = ''; |
| 973 | 973 | } |
| 974 | 974 | if (strlen($dir)) { |
| 975 | - $dir = rtrim($dir, '/') . '/'; |
|
| 975 | + $dir = rtrim($dir, '/').'/'; |
|
| 976 | 976 | } |
| 977 | 977 | if (!isset($chemin['type']) or $chemin['type'] == 'public') { |
| 978 | - $chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 978 | + $chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 979 | 979 | } |
| 980 | 980 | if (!isset($chemin['type']) or $chemin['type'] == 'prive') { |
| 981 | - $chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 981 | + $chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 982 | 982 | } |
| 983 | 983 | } |
| 984 | 984 | } |
@@ -987,11 +987,11 @@ discard block |
||
| 987 | 987 | } |
| 988 | 988 | } |
| 989 | 989 | if (count($chemins['public']) or count($chemins['prive'])) { |
| 990 | - $contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode( |
|
| 990 | + $contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode( |
|
| 991 | 991 | ',', |
| 992 | 992 | array_reverse($chemins['public']) |
| 993 | - ) . "]);\n" |
|
| 994 | - . 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n"; |
|
| 993 | + )."]);\n" |
|
| 994 | + . 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n"; |
|
| 995 | 995 | } |
| 996 | 996 | |
| 997 | 997 | ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu); |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | and strpos($dir, ':') === false // exclure le cas des procure: |
| 1041 | 1041 | and file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml |
| 1042 | 1042 | ) { |
| 1043 | - if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) { |
|
| 1043 | + if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) { |
|
| 1044 | 1044 | $info[$charge] = [$file]; |
| 1045 | 1045 | } |
| 1046 | 1046 | } |
@@ -1057,7 +1057,7 @@ discard block |
||
| 1057 | 1057 | ) { |
| 1058 | 1058 | unset($info[$charge][$k]); |
| 1059 | 1059 | } else { |
| 1060 | - $_file = $root_dir_type . ".'$plug/$file'"; |
|
| 1060 | + $_file = $root_dir_type.".'$plug/$file'"; |
|
| 1061 | 1061 | $contenu[$charge] .= "include_once_check($_file);\n"; |
| 1062 | 1062 | } |
| 1063 | 1063 | } |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | } |
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | - $contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options']; |
|
| 1070 | + $contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options']; |
|
| 1071 | 1071 | $contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons) |
| 1072 | 1072 | . plugin_ongletbouton('onglets_plugins', $onglets); |
| 1073 | 1073 | |
@@ -1102,12 +1102,12 @@ discard block |
||
| 1102 | 1102 | define("_UPDATED_$nom", $val); |
| 1103 | 1103 | define("_UPDATED_md5_$nom", $md5); |
| 1104 | 1104 | } |
| 1105 | - $val = "unserialize('" . str_replace("'", "\'", $val) . "')"; |
|
| 1105 | + $val = "unserialize('".str_replace("'", "\'", $val)."')"; |
|
| 1106 | 1106 | |
| 1107 | 1107 | return |
| 1108 | 1108 | "if (!function_exists('$nom')) {\n" |
| 1109 | 1109 | . "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n" |
| 1110 | - . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n" |
|
| 1110 | + . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n" |
|
| 1111 | 1111 | . "}\n"; |
| 1112 | 1112 | } |
| 1113 | 1113 | |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | if (@is_readable(_CACHE_PLUGINS_OPT)) { |
| 1131 | 1131 | include_once(_CACHE_PLUGINS_OPT); |
| 1132 | 1132 | } else { |
| 1133 | - spip_log('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT); |
|
| 1133 | + spip_log('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT); |
|
| 1134 | 1134 | } |
| 1135 | 1135 | } |
| 1136 | 1136 | |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | $dir_type = $plugin_valides[$p]['dir_type']; |
| 1168 | 1168 | $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type); |
| 1169 | 1169 | $plug = $plugin_valides[$p]['dir']; |
| 1170 | - $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_'); |
|
| 1170 | + $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_'); |
|
| 1171 | 1171 | if (isset($info['pipeline']) and is_array($info['pipeline'])) { |
| 1172 | 1172 | foreach ($info['pipeline'] as $pipe) { |
| 1173 | 1173 | $nom = $pipe['nom']; |
@@ -1201,7 +1201,7 @@ discard block |
||
| 1201 | 1201 | } |
| 1202 | 1202 | if (isset($pipe['inclure'])) { |
| 1203 | 1203 | $GLOBALS['spip_matrice']["$prefix$action"] = |
| 1204 | - "$root_dir_type:$plug/" . $pipe['inclure']; |
|
| 1204 | + "$root_dir_type:$plug/".$pipe['inclure']; |
|
| 1205 | 1205 | } |
| 1206 | 1206 | } |
| 1207 | 1207 | } |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | $prepend_code['taches_generales_cron'] = ''; |
| 1212 | 1212 | } |
| 1213 | 1213 | foreach ($info['genie'] as $genie) { |
| 1214 | - $nom = $prefix . $genie['nom']; |
|
| 1214 | + $nom = $prefix.$genie['nom']; |
|
| 1215 | 1215 | $periode = max(60, intval($genie['periode'])); |
| 1216 | 1216 | if (charger_fonction($nom, 'genie', true)) { |
| 1217 | 1217 | $prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n"; |
@@ -1229,13 +1229,13 @@ discard block |
||
| 1229 | 1229 | } |
| 1230 | 1230 | foreach ($info['style'] as $style) { |
| 1231 | 1231 | if (isset($style['path']) and $style['path']) { |
| 1232 | - $code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) "; |
|
| 1232 | + $code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) "; |
|
| 1233 | 1233 | } else { |
| 1234 | - $code = "if (\$f='" . addslashes($style['url']) . "') "; |
|
| 1234 | + $code = "if (\$f='".addslashes($style['url'])."') "; |
|
| 1235 | 1235 | } |
| 1236 | 1236 | $code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\""; |
| 1237 | 1237 | if (isset($style['media']) and strlen($style['media'])) { |
| 1238 | - $code .= ' media="' . addslashes($style['media']) . '"'; |
|
| 1238 | + $code .= ' media="'.addslashes($style['media']).'"'; |
|
| 1239 | 1239 | } |
| 1240 | 1240 | $code .= "/>';\n"; |
| 1241 | 1241 | if ($style['type'] != 'prive') { |
@@ -1255,9 +1255,9 @@ discard block |
||
| 1255 | 1255 | if (isset($info['script']) and is_countable($info['script']) ? count($info['script']) : 0) { |
| 1256 | 1256 | foreach ($info['script'] as $script) { |
| 1257 | 1257 | if (isset($script['path']) and $script['path']) { |
| 1258 | - $code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) "; |
|
| 1258 | + $code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) "; |
|
| 1259 | 1259 | } else { |
| 1260 | - $code = "if (\$f='" . addslashes($script['url']) . "') "; |
|
| 1260 | + $code = "if (\$f='".addslashes($script['url'])."') "; |
|
| 1261 | 1261 | } |
| 1262 | 1262 | $code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n"; |
| 1263 | 1263 | if ($script['type'] != 'prive') { |
@@ -1320,10 +1320,10 @@ discard block |
||
| 1320 | 1320 | unset($GLOBALS['spip_pipeline']['all']); |
| 1321 | 1321 | $all_pipes = trim(array_shift($a)); |
| 1322 | 1322 | if ($all_pipes) { |
| 1323 | - $all_pipes = '|' . ltrim($all_pipes, '|'); |
|
| 1323 | + $all_pipes = '|'.ltrim($all_pipes, '|'); |
|
| 1324 | 1324 | } |
| 1325 | 1325 | if (count($a)) { |
| 1326 | - $all_pipes_end = '||' . array_shift($a); |
|
| 1326 | + $all_pipes_end = '||'.array_shift($a); |
|
| 1327 | 1327 | } |
| 1328 | 1328 | } |
| 1329 | 1329 | $content = ''; |
@@ -1340,7 +1340,7 @@ discard block |
||
| 1340 | 1340 | // Eclater le pipeline en filtres et appliquer chaque filtre |
| 1341 | 1341 | foreach ($pipe as $fonc) { |
| 1342 | 1342 | $fonc = trim($fonc); |
| 1343 | - $s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n"; |
|
| 1343 | + $s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n"; |
|
| 1344 | 1344 | if (isset($GLOBALS['spip_matrice'][$fonc])) { |
| 1345 | 1345 | $file = $GLOBALS['spip_matrice'][$fonc]; |
| 1346 | 1346 | $file = "'$file'"; |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | if (defined($root_dir)) { |
| 1352 | 1352 | $dir = $root_dir; |
| 1353 | 1353 | } |
| 1354 | - $file = str_replace($regs[0], "'." . $dir . ".'", $file); |
|
| 1354 | + $file = str_replace($regs[0], "'.".$dir.".'", $file); |
|
| 1355 | 1355 | $file = str_replace("''.", '', $file); |
| 1356 | 1356 | $file = str_replace(constant($dir), '', $file); |
| 1357 | 1357 | } |
@@ -1364,7 +1364,7 @@ discard block |
||
| 1364 | 1364 | $content .= "// Pipeline $action \n" |
| 1365 | 1365 | . "function execute_pipeline_$action(&\$val){\n" |
| 1366 | 1366 | . $s_inc |
| 1367 | - . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '') |
|
| 1367 | + . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '') |
|
| 1368 | 1368 | . $s_call |
| 1369 | 1369 | . "return \$val;\n}\n"; |
| 1370 | 1370 | } |
@@ -1420,9 +1420,9 @@ discard block |
||
| 1420 | 1420 | $result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec')); |
| 1421 | 1421 | if (_IS_CLI) { |
| 1422 | 1422 | include_spip('inc/filtres'); |
| 1423 | - $trace = ltrim(textebrut($trace) . "\n" . $result); |
|
| 1424 | - $trace = ' ' . str_replace("\n", "\n ", $trace); |
|
| 1425 | - echo "\n" . ($ok ? 'OK ' : '/!\ ') . textebrut($titre) . "\n", |
|
| 1423 | + $trace = ltrim(textebrut($trace)."\n".$result); |
|
| 1424 | + $trace = ' '.str_replace("\n", "\n ", $trace); |
|
| 1425 | + echo "\n".($ok ? 'OK ' : '/!\ ').textebrut($titre)."\n", |
|
| 1426 | 1426 | $trace, |
| 1427 | 1427 | "\n"; |
| 1428 | 1428 | } |
@@ -1457,15 +1457,15 @@ discard block |
||
| 1457 | 1457 | $GLOBALS['fichier_php_compile_recent'] = 0; |
| 1458 | 1458 | } |
| 1459 | 1459 | |
| 1460 | - $contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>'; |
|
| 1460 | + $contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>'; |
|
| 1461 | 1461 | // si un fichier existe deja on verifie que son contenu change avant de l'ecraser |
| 1462 | 1462 | // si pas de modif on ne touche pas au fichier initial |
| 1463 | 1463 | if (file_exists($nom)) { |
| 1464 | 1464 | if (substr($nom, -4) == '.php') { |
| 1465 | - $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
|
| 1465 | + $fichier_tmp = substr($nom, 0, -4).'.tmp.php'; |
|
| 1466 | 1466 | } |
| 1467 | 1467 | else { |
| 1468 | - $fichier_tmp = $nom . '.tmp'; |
|
| 1468 | + $fichier_tmp = $nom.'.tmp'; |
|
| 1469 | 1469 | } |
| 1470 | 1470 | file_put_contents($fichier_tmp, $contenu); |
| 1471 | 1471 | if (md5_file($nom) == md5_file($fichier_tmp)) { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $_id = $e['id_table_objet']; |
| 51 | 51 | if (isset($contexte[$_id]) and $id = intval($contexte[$_id])) { |
| 52 | 52 | $table = $e['table_objet_sql']; |
| 53 | - $row = sql_fetsel('*', $table, "$_id=" . intval($id)); |
|
| 53 | + $row = sql_fetsel('*', $table, "$_id=".intval($id)); |
|
| 54 | 54 | if (isset($row['id_rubrique'])) { |
| 55 | 55 | $contexte['id_rubrique'] = $row['id_rubrique']; |
| 56 | 56 | if (isset($row['id_secteur'])) { |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | $boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position) |
| 118 | 118 | + [ |
| 119 | 119 | $id => new Bouton( |
| 120 | - ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 121 | - $infos['titre'], // titre |
|
| 120 | + ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 121 | + $infos['titre'], // titre |
|
| 122 | 122 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 123 | 123 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 124 | 124 | ) |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | $boutons_admin = array_slice($boutons_admin, 0, $position) |
| 136 | 136 | + [ |
| 137 | 137 | $id => new Bouton( |
| 138 | - ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 139 | - $infos['titre'], // titre |
|
| 138 | + ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 139 | + $infos['titre'], // titre |
|
| 140 | 140 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 141 | 141 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 142 | 142 | ) |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $libelles = $isfavoris = $favoris = []; |
| 182 | 182 | foreach ($menu->sousmenu as $key => $item) { |
| 183 | 183 | $libelles[$key] = strtolower(translitteration(_T($item->libelle))); |
| 184 | - $isfavoris[$key] = (bool)$item->favori; |
|
| 184 | + $isfavoris[$key] = (bool) $item->favori; |
|
| 185 | 185 | $favoris[$key] = $item->favori; |
| 186 | 186 | } |
| 187 | 187 | if ($avec_favoris) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $url = str_replace('&', '&', $url); |
| 224 | 224 | while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) { |
| 225 | 225 | if ($matches[2] == 'id_secteur' and !isset($contexte['id_secteur']) and isset($contexte['id_rubrique'])) { |
| 226 | - $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($contexte['id_rubrique'])); |
|
| 226 | + $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($contexte['id_rubrique'])); |
|
| 227 | 227 | } |
| 228 | 228 | $val = _request($matches[2], $contexte); |
| 229 | 229 | $url = parametre_url($url, $matches[1], $val ?: '', '&'); |
@@ -204,8 +204,8 @@ discard block |
||
| 204 | 204 | $hsl = _couleur_hex_to_hsl($couleur); |
| 205 | 205 | $hsl = [ |
| 206 | 206 | 'h' => round($hsl['h'] * 360), |
| 207 | - 's' => round($hsl['s'] * 100) . '%', |
|
| 208 | - 'l' => round($hsl['l'] * 100) . '%' |
|
| 207 | + 's' => round($hsl['s'] * 100).'%', |
|
| 208 | + 'l' => round($hsl['l'] * 100).'%' |
|
| 209 | 209 | ]; |
| 210 | 210 | if ($format === null) { |
| 211 | 211 | return "hsl({$hsl['h']}, {$hsl['s']}, {$hsl['l']})"; |
@@ -384,11 +384,11 @@ discard block |
||
| 384 | 384 | $process = 'AUTO' |
| 385 | 385 | ) { |
| 386 | 386 | // PHP 7+ type hint |
| 387 | - $img = (string)$img; |
|
| 388 | - $taille_x = (int)$taille_x; |
|
| 389 | - $taille_y = (int)$taille_y; |
|
| 390 | - $force = (bool)$force; |
|
| 391 | - $process = (string)$process; |
|
| 387 | + $img = (string) $img; |
|
| 388 | + $taille_x = (int) $taille_x; |
|
| 389 | + $taille_y = (int) $taille_y; |
|
| 390 | + $force = (bool) $force; |
|
| 391 | + $process = (string) $process; |
|
| 392 | 392 | |
| 393 | 393 | if (!$img) { |
| 394 | 394 | return ''; |
@@ -465,11 +465,11 @@ discard block |
||
| 465 | 465 | $process = 'AUTO' |
| 466 | 466 | ) { |
| 467 | 467 | // PHP 7+ type hint |
| 468 | - $img = (string)$img; |
|
| 469 | - $taille = (int)$taille; |
|
| 470 | - $taille_y = (int)$taille_y; |
|
| 471 | - $force = (bool)$force; |
|
| 472 | - $process = (string)$process; |
|
| 468 | + $img = (string) $img; |
|
| 469 | + $taille = (int) $taille; |
|
| 470 | + $taille_y = (int) $taille_y; |
|
| 471 | + $force = (bool) $force; |
|
| 472 | + $process = (string) $process; |
|
| 473 | 473 | |
| 474 | 474 | // Determiner la taille x,y maxi |
| 475 | 475 | // prendre le reglage de previsu par defaut |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $background_color = 'white' |
| 513 | 513 | ) { |
| 514 | 514 | if (function_exists('image_recadre') && ($GLOBALS['meta']['image_process'] ?? '') === 'gd2') { |
| 515 | - return image_reduire(image_recadre($im, $width . ':' . $height, '-', $position, $background_color), $width, $height); |
|
| 515 | + return image_reduire(image_recadre($im, $width.':'.$height, '-', $position, $background_color), $width, $height); |
|
| 516 | 516 | } else { return image_passe_partout($im, $width, $height); |
| 517 | 517 | } |
| 518 | 518 | } |
@@ -533,9 +533,9 @@ discard block |
||
| 533 | 533 | **/ |
| 534 | 534 | function image_reduire_par($img, $val = 1, $force = false) { |
| 535 | 535 | // PHP 7+ type hint |
| 536 | - $img = (string)$img; |
|
| 537 | - $val = (int)$val; |
|
| 538 | - $force = (bool)$force; |
|
| 536 | + $img = (string) $img; |
|
| 537 | + $val = (int) $val; |
|
| 538 | + $force = (bool) $force; |
|
| 539 | 539 | |
| 540 | 540 | [$hauteur, $largeur] = taille_image($img); |
| 541 | 541 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | // ceci est la RegExp NO_REAL_NAME faisant hurler SpamAssassin |
| 136 | 136 | if (preg_match('/^["\s]*\<?\S+\@\S+\>?\s*$/', $from)) { |
| 137 | - $from .= ' (' . str_replace(')', '', translitteration(str_replace('@', ' at ', $from))) . ')'; |
|
| 137 | + $from .= ' ('.str_replace(')', '', translitteration(str_replace('@', ' at ', $from))).')'; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | // nettoyer les é ’, &emdash; etc... |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | if (!_TEST_EMAIL_DEST) { |
| 172 | 172 | return false; |
| 173 | 173 | } else { |
| 174 | - $texte = "Dest : $destinataire\r\n" . $texte; |
|
| 174 | + $texte = "Dest : $destinataire\r\n".$texte; |
|
| 175 | 175 | $destinataire = _TEST_EMAIL_DEST; |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | // Ajouter le Content-Type et consort s'il n'y est pas deja |
| 196 | 196 | if (strpos($headers, 'Content-Type: ') === false) { |
| 197 | 197 | $type = |
| 198 | - "Content-Type: text/plain;charset=\"$charset\";\n" . |
|
| 198 | + "Content-Type: text/plain;charset=\"$charset\";\n". |
|
| 199 | 199 | "Content-Transfer-Encoding: 8bit\n"; |
| 200 | 200 | } else { |
| 201 | 201 | $type = ''; |
@@ -207,17 +207,17 @@ discard block |
||
| 207 | 207 | $domain = $domain[0]; |
| 208 | 208 | } |
| 209 | 209 | else { |
| 210 | - $domain = '@unknown-' . md5($from) . '.org'; |
|
| 210 | + $domain = '@unknown-'.md5($from).'.org'; |
|
| 211 | 211 | } |
| 212 | - $uniq = random_int(0, mt_getrandmax()) . '_' . md5($to . $texte) . $domain; |
|
| 212 | + $uniq = random_int(0, mt_getrandmax()).'_'.md5($to.$texte).$domain; |
|
| 213 | 213 | |
| 214 | 214 | // Si multi-part, s'en servir comme borne ... |
| 215 | 215 | if ($parts) { |
| 216 | - $texte = "--$uniq\n$type\n" . $texte . "\n"; |
|
| 216 | + $texte = "--$uniq\n$type\n".$texte."\n"; |
|
| 217 | 217 | foreach ($parts as $part) { |
| 218 | - $n = strlen($part[1]) . ($part[0] ? "\n" : ''); |
|
| 218 | + $n = strlen($part[1]).($part[0] ? "\n" : ''); |
|
| 219 | 219 | $e = join("\n", $part[0]); |
| 220 | - $texte .= "\n--$uniq\nContent-Length: $n$e\n\n" . $part[1]; |
|
| 220 | + $texte .= "\n--$uniq\nContent-Length: $n$e\n\n".$part[1]; |
|
| 221 | 221 | } |
| 222 | 222 | $texte .= "\n\n--$uniq--\n"; |
| 223 | 223 | // Si boundary n'est pas entre guillemets, |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | // .. et s'en servir pour plaire a SpamAssassin |
| 229 | 229 | |
| 230 | - $mid = 'Message-Id: <' . $uniq . '>'; |
|
| 230 | + $mid = 'Message-Id: <'.$uniq.'>'; |
|
| 231 | 231 | |
| 232 | 232 | // indispensable pour les sites qui collent d'office From: serveur-http |
| 233 | 233 | // sauf si deja mis par l'envoyeur |
@@ -82,13 +82,13 @@ discard block |
||
| 82 | 82 | spip_log("supprimer sessions auteur $id_auteur", 'session'); |
| 83 | 83 | if ($toutes or $id_auteur !== $GLOBALS['visiteur_session']['id_auteur']) { |
| 84 | 84 | if ($dir = opendir(_DIR_SESSIONS)) { |
| 85 | - $t = $_SERVER['REQUEST_TIME'] - (4 * _RENOUVELLE_ALEA); // 48h par defaut |
|
| 86 | - $t_short = $_SERVER['REQUEST_TIME'] - max(_RENOUVELLE_ALEA / 4, 3 * 3600); // 3h par defaut |
|
| 85 | + $t = $_SERVER['REQUEST_TIME'] - (4 * _RENOUVELLE_ALEA); // 48h par defaut |
|
| 86 | + $t_short = $_SERVER['REQUEST_TIME'] - max(_RENOUVELLE_ALEA / 4, 3 * 3600); // 3h par defaut |
|
| 87 | 87 | $t = time() - (4 * _RENOUVELLE_ALEA); |
| 88 | 88 | while (($f = readdir($dir)) !== false) { |
| 89 | 89 | $nb_files++; |
| 90 | 90 | if (preg_match(',^[^\d-]*(-?\d+)_\w{32}\.php[3]?$,', $f, $regs)) { |
| 91 | - $f = _DIR_SESSIONS . $f; |
|
| 91 | + $f = _DIR_SESSIONS.$f; |
|
| 92 | 92 | if (($actives and $regs[1] == $id_auteur) or ($t > filemtime($f))) { |
| 93 | 93 | spip_unlink($f); |
| 94 | 94 | } |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | if ( |
| 173 | 173 | !isset($_COOKIE['spip_session']) |
| 174 | - or !preg_match(',^' . $id_auteur . '_,', $_COOKIE['spip_session']) |
|
| 174 | + or !preg_match(',^'.$id_auteur.'_,', $_COOKIE['spip_session']) |
|
| 175 | 175 | ) { |
| 176 | - $_COOKIE['spip_session'] = $id_auteur . '_' . md5(uniqid(random_int(0, mt_getrandmax()), true)); |
|
| 176 | + $_COOKIE['spip_session'] = $id_auteur.'_'.md5(uniqid(random_int(0, mt_getrandmax()), true)); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | // Maintenant on sait qu'on a des choses à écrire |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | } else { |
| 207 | 207 | $fichier_session = fichier_session('alea_ephemere'); |
| 208 | 208 | if (!ecrire_fichier_session($fichier_session, $auteur)) { |
| 209 | - spip_log('Echec ecriture fichier session ' . $fichier_session, 'session' . _LOG_HS); |
|
| 209 | + spip_log('Echec ecriture fichier session '.$fichier_session, 'session'._LOG_HS); |
|
| 210 | 210 | include_spip('inc/minipres'); |
| 211 | 211 | echo minipres(); |
| 212 | 212 | exit; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | include_spip('inc/autoriser'); |
| 230 | 230 | } |
| 231 | 231 | if (autoriser('ecrire', '', '', $auteur) and _DUREE_COOKIE_ADMIN) { |
| 232 | - spip_setcookie('spip_admin', '@' . ($auteur['email'] ?: $auteur['login']), [ |
|
| 232 | + spip_setcookie('spip_admin', '@'.($auteur['email'] ?: $auteur['login']), [ |
|
| 233 | 233 | 'expires' => time() + max(_DUREE_COOKIE_ADMIN, $duree) |
| 234 | 234 | ]); |
| 235 | 235 | } // sinon le supprimer ... |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $coef = 20; |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | - return (int)(_RENOUVELLE_ALEA * $coef); |
|
| 273 | + return (int) (_RENOUVELLE_ALEA * $coef); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /** |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | // Renouveler la session avec l'alea courant |
| 320 | 320 | include($fichier_session); |
| 321 | - spip_log('renouvelle session ' . $GLOBALS['visiteur_session']['id_auteur'], 'session'); |
|
| 321 | + spip_log('renouvelle session '.$GLOBALS['visiteur_session']['id_auteur'], 'session'); |
|
| 322 | 322 | spip_unlink($fichier_session); |
| 323 | 323 | ajouter_session($GLOBALS['visiteur_session']); |
| 324 | 324 | } |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | } |
| 351 | 351 | } else { |
| 352 | 352 | if ($change) { |
| 353 | - spip_log("rejoue session $fichier_session " . $_COOKIE['spip_session'], 'session'); |
|
| 353 | + spip_log("rejoue session $fichier_session ".$_COOKIE['spip_session'], 'session'); |
|
| 354 | 354 | if ($fichier_session) { |
| 355 | 355 | spip_unlink($fichier_session); |
| 356 | 356 | } |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | // liste des sessions |
| 570 | - $sessions = preg_files(_DIR_SESSIONS, '/' . $id_auteur . '_.*\.php$'); |
|
| 570 | + $sessions = preg_files(_DIR_SESSIONS, '/'.$id_auteur.'_.*\.php$'); |
|
| 571 | 571 | |
| 572 | 572 | // si on en a plus que la limite, supprimer les plus vieilles |
| 573 | 573 | // si ce ne sont pas des sessions anonymes car elles sont alors chacune differentes |
@@ -648,12 +648,12 @@ discard block |
||
| 648 | 648 | $auteur = preparer_ecriture_session($auteur); |
| 649 | 649 | |
| 650 | 650 | // enregistrer les autres donnees du visiteur |
| 651 | - $texte = '<' . "?php\n"; |
|
| 651 | + $texte = '<'."?php\n"; |
|
| 652 | 652 | foreach ($auteur as $var => $val) { |
| 653 | - $texte .= '$GLOBALS[\'visiteur_session\'][' . var_export($var, true) . '] = ' |
|
| 654 | - . var_export($val, true) . ";\n"; |
|
| 653 | + $texte .= '$GLOBALS[\'visiteur_session\']['.var_export($var, true).'] = ' |
|
| 654 | + . var_export($val, true).";\n"; |
|
| 655 | 655 | } |
| 656 | - $texte .= '?' . ">\n"; |
|
| 656 | + $texte .= '?'.">\n"; |
|
| 657 | 657 | |
| 658 | 658 | return ecrire_fichier($fichier, $texte); |
| 659 | 659 | } |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | $repertoire = sous_repertoire(_DIR_SESSIONS, '', false, $tantpis); |
| 684 | 684 | $c = $_COOKIE['spip_session']; |
| 685 | 685 | |
| 686 | - return $repertoire . intval($c) . '_' . md5($c . ' ' . $GLOBALS['meta'][$alea]) . '.php'; |
|
| 686 | + return $repertoire.intval($c).'_'.md5($c.' '.$GLOBALS['meta'][$alea]).'.php'; |
|
| 687 | 687 | } |
| 688 | 688 | } |
| 689 | 689 | |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | * @return string |
| 702 | 702 | */ |
| 703 | 703 | function rejouer_session() { |
| 704 | - return '<img src="' . generer_url_action('cookie', 'change_session=oui', true) . '" width="0" height="0" alt="" />'; |
|
| 704 | + return '<img src="'.generer_url_action('cookie', 'change_session=oui', true).'" width="0" height="0" alt="" />'; |
|
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | return $res; |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | - return $res = md5($GLOBALS['ip'] . ($_SERVER['HTTP_USER_AGENT'] ?? '')); |
|
| 719 | + return $res = md5($GLOBALS['ip'].($_SERVER['HTTP_USER_AGENT'] ?? '')); |
|
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | |
@@ -51,5 +51,5 @@ |
||
| 51 | 51 | } |
| 52 | 52 | $d = is_countable($delete) ? count($delete) : 0; |
| 53 | 53 | $r = count($res); |
| 54 | - spip_log("Tables detruites: $r sur $d: " . join(', ', $res), _LOG_INFO_IMPORTANTE); |
|
| 54 | + spip_log("Tables detruites: $r sur $d: ".join(', ', $res), _LOG_INFO_IMPORTANTE); |
|
| 55 | 55 | } |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | $infos['url_voir'] = $infos['type']; |
| 704 | 704 | } |
| 705 | 705 | if (!isset($infos['url_edit'])) { |
| 706 | - $infos['url_edit'] = $infos['url_voir'] . ($infos['editable'] ? '_edit' : ''); |
|
| 706 | + $infos['url_edit'] = $infos['url_voir'].($infos['editable'] ? '_edit' : ''); |
|
| 707 | 707 | } |
| 708 | 708 | if (!isset($infos['icone_objet'])) { |
| 709 | 709 | $infos['icone_objet'] = $infos['type']; |
@@ -715,48 +715,48 @@ discard block |
||
| 715 | 715 | $infos['texte_retour'] = 'icone_retour'; |
| 716 | 716 | } |
| 717 | 717 | if (!isset($infos['texte_modifier'])) { |
| 718 | - $infos['texte_modifier'] = $infos['type'] . ':' . 'icone_modifier_' . $infos['type']; |
|
| 718 | + $infos['texte_modifier'] = $infos['type'].':'.'icone_modifier_'.$infos['type']; |
|
| 719 | 719 | } |
| 720 | 720 | if (!isset($infos['texte_creer'])) { |
| 721 | - $infos['texte_creer'] = $infos['type'] . ':' . 'icone_creer_' . $infos['type']; |
|
| 721 | + $infos['texte_creer'] = $infos['type'].':'.'icone_creer_'.$infos['type']; |
|
| 722 | 722 | } |
| 723 | 723 | if (!isset($infos['texte_creer_associer'])) { |
| 724 | - $infos['texte_creer_associer'] = $infos['type'] . ':' . 'texte_creer_associer_' . $infos['type']; |
|
| 724 | + $infos['texte_creer_associer'] = $infos['type'].':'.'texte_creer_associer_'.$infos['type']; |
|
| 725 | 725 | } |
| 726 | 726 | if (!isset($infos['texte_ajouter'])) { |
| 727 | 727 | // Ajouter un X |
| 728 | - $infos['texte_ajouter'] = $infos['type'] . ':' . 'texte_ajouter_' . $infos['type']; |
|
| 728 | + $infos['texte_ajouter'] = $infos['type'].':'.'texte_ajouter_'.$infos['type']; |
|
| 729 | 729 | } |
| 730 | 730 | if (!isset($infos['texte_objets'])) { |
| 731 | - $infos['texte_objets'] = $infos['type'] . ':' . 'titre_' . $infos['table_objet']; |
|
| 731 | + $infos['texte_objets'] = $infos['type'].':'.'titre_'.$infos['table_objet']; |
|
| 732 | 732 | } |
| 733 | 733 | if (!isset($infos['texte_objet'])) { |
| 734 | - $infos['texte_objet'] = $infos['type'] . ':' . 'titre_' . $infos['type']; |
|
| 734 | + $infos['texte_objet'] = $infos['type'].':'.'titre_'.$infos['type']; |
|
| 735 | 735 | } |
| 736 | 736 | if (!isset($infos['texte_logo_objet'])) { |
| 737 | 737 | // objet:titre_logo_objet "Logo de ce X" |
| 738 | - $infos['texte_logo_objet'] = $infos['type'] . ':' . 'titre_logo_' . $infos['type']; |
|
| 738 | + $infos['texte_logo_objet'] = $infos['type'].':'.'titre_logo_'.$infos['type']; |
|
| 739 | 739 | } |
| 740 | 740 | if (!isset($infos['texte_langue_objet'])) { |
| 741 | 741 | // objet:texte_langue_objet "Langue de ce X" |
| 742 | - $infos['texte_langue_objet'] = $infos['type'] . ':' . 'titre_langue_' . $infos['type']; |
|
| 742 | + $infos['texte_langue_objet'] = $infos['type'].':'.'titre_langue_'.$infos['type']; |
|
| 743 | 743 | } |
| 744 | 744 | if (!isset($infos['texte_definir_comme_traduction_objet'])) { |
| 745 | 745 | // "Ce X est une traduction du X numéro :" |
| 746 | - $infos['texte_definir_comme_traduction_objet'] = $infos['type'] . ':' . 'texte_definir_comme_traduction_' . $infos['type']; |
|
| 746 | + $infos['texte_definir_comme_traduction_objet'] = $infos['type'].':'.'texte_definir_comme_traduction_'.$infos['type']; |
|
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | // objet:info_aucun_objet |
| 750 | 750 | if (!isset($infos['info_aucun_objet'])) { |
| 751 | - $infos['info_aucun_objet'] = $infos['type'] . ':' . 'info_aucun_' . $infos['type']; |
|
| 751 | + $infos['info_aucun_objet'] = $infos['type'].':'.'info_aucun_'.$infos['type']; |
|
| 752 | 752 | } |
| 753 | 753 | // objet:info_1_objet |
| 754 | 754 | if (!isset($infos['info_1_objet'])) { |
| 755 | - $infos['info_1_objet'] = $infos['type'] . ':' . 'info_1_' . $infos['type']; |
|
| 755 | + $infos['info_1_objet'] = $infos['type'].':'.'info_1_'.$infos['type']; |
|
| 756 | 756 | } |
| 757 | 757 | // objet:info_nb_objets |
| 758 | 758 | if (!isset($infos['info_nb_objets'])) { |
| 759 | - $infos['info_nb_objets'] = $infos['type'] . ':' . 'info_nb_' . $infos['table_objet']; |
|
| 759 | + $infos['info_nb_objets'] = $infos['type'].':'.'info_nb_'.$infos['table_objet']; |
|
| 760 | 760 | } |
| 761 | 761 | |
| 762 | 762 | if (!isset($infos['champs_editables'])) { |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | } |
| 957 | 957 | $ts = sql_alltable(null, $serveur); // toutes les tables "spip_" (ou prefixe perso) |
| 958 | 958 | $connexion = $GLOBALS['connexions'][$serveur ?: 0]; |
| 959 | - $spip = $connexion['prefixe'] . '_'; |
|
| 959 | + $spip = $connexion['prefixe'].'_'; |
|
| 960 | 960 | foreach ($ts as $t) { |
| 961 | 961 | $t = substr($t, strlen($spip)); |
| 962 | 962 | $tables[$serveur]["spip_$t"] = $t; |
@@ -1025,10 +1025,10 @@ discard block |
||
| 1025 | 1025 | if ($serveur !== false) { |
| 1026 | 1026 | $t = lister_tables_spip($serveur); |
| 1027 | 1027 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 1028 | - $typetrim = rtrim($type, 's') . 's'; |
|
| 1028 | + $typetrim = rtrim($type, 's').'s'; |
|
| 1029 | 1029 | if ( |
| 1030 | 1030 | (isset($t[$typetrim]) or in_array($typetrim, $t)) |
| 1031 | - and ($desc = $trouver_table(rtrim($type, 's') . 's', $serveur)) |
|
| 1031 | + and ($desc = $trouver_table(rtrim($type, 's').'s', $serveur)) |
|
| 1032 | 1032 | ) { |
| 1033 | 1033 | return $desc['id_table']; |
| 1034 | 1034 | } elseif ( |
@@ -1038,11 +1038,11 @@ discard block |
||
| 1038 | 1038 | return $desc['id_table']; |
| 1039 | 1039 | } |
| 1040 | 1040 | |
| 1041 | - spip_log('table_objet(' . $type . ') calculee sans verification'); |
|
| 1041 | + spip_log('table_objet('.$type.') calculee sans verification'); |
|
| 1042 | 1042 | #spip_log(debug_backtrace(),'db'); |
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | - return rtrim($type, 's') . 's'; # cas historique ne devant plus servir, sauf si $serveur=false |
|
| 1045 | + return rtrim($type, 's').'s'; # cas historique ne devant plus servir, sauf si $serveur=false |
|
| 1046 | 1046 | } |
| 1047 | 1047 | |
| 1048 | 1048 | /** |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | function objet_test_si_publie($objet, $id_objet, $serveur = '') { |
| 1227 | 1227 | // voir si une fonction est definie pour faire le boulot |
| 1228 | 1228 | // elle a la priorite dans ce cas |
| 1229 | - if ($f = charger_fonction($objet . '_test_si_publie', 'base', true)) { |
|
| 1229 | + if ($f = charger_fonction($objet.'_test_si_publie', 'base', true)) { |
|
| 1230 | 1230 | return $f($objet, $id_objet, $serveur); |
| 1231 | 1231 | } |
| 1232 | 1232 | |
@@ -1248,7 +1248,7 @@ discard block |
||
| 1248 | 1248 | $boucle->sql_serveur = $serveur; |
| 1249 | 1249 | $boucle->select[] = $id_table_objet; |
| 1250 | 1250 | $boucle->from[$table_objet] = table_objet_sql($objet, $serveur); |
| 1251 | - $boucle->where[] = $id_table . '.' . $id_table_objet . '=' . intval($id_objet); |
|
| 1251 | + $boucle->where[] = $id_table.'.'.$id_table_objet.'='.intval($id_objet); |
|
| 1252 | 1252 | |
| 1253 | 1253 | $boucle->descr['nom'] = 'objet_test_si_publie'; // eviter notice php |
| 1254 | 1254 | $boucle->descr['sourcefile'] = 'internal'; |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | ? "{$parent_methode['source_champ']} = $id_objet" |
| 1376 | 1376 | : "${cle_objet} = $id_objet"; |
| 1377 | 1377 | if (isset($parent_methode['source_champ_type'])) { |
| 1378 | - $where[] = "{$parent_methode['source_champ_type']} = " . sql_quote($objet); |
|
| 1378 | + $where[] = "{$parent_methode['source_champ_type']} = ".sql_quote($objet); |
|
| 1379 | 1379 | } |
| 1380 | 1380 | // -- Condition supplémentaire sur la détection du parent |
| 1381 | 1381 | if (isset($parent_methode['table_condition'])) { |
@@ -1499,11 +1499,11 @@ discard block |
||
| 1499 | 1499 | $where = []; |
| 1500 | 1500 | // -- L'identifiant du parent |
| 1501 | 1501 | if (isset($_methode_parent['champ'])) { |
| 1502 | - $where[] = $_methode_parent['champ'] . ' = ' . $id_objet; |
|
| 1502 | + $where[] = $_methode_parent['champ'].' = '.$id_objet; |
|
| 1503 | 1503 | } |
| 1504 | 1504 | // -- Si le parent est variable |
| 1505 | 1505 | if (isset($_methode_parent['champ_type'])) { |
| 1506 | - $where[] = $_methode_parent['champ_type'] . ' = ' . sql_quote($objet); |
|
| 1506 | + $where[] = $_methode_parent['champ_type'].' = '.sql_quote($objet); |
|
| 1507 | 1507 | } |
| 1508 | 1508 | |
| 1509 | 1509 | // On détermine la table, le champ id des enfants et on complète éventuellement les conditions |