@@ -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 | list ($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) ? $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 ? $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 ? $one_time_encoding : $this->_api_encoding)); |
|
| 293 | + $this->_error('Unsupported input format: '.($one_time_encoding ? $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 | } |
@@ -869,7 +866,7 @@ discard block |
||
| 869 | 866 | $output[$out_len] = $v; |
| 870 | 867 | ++$out_len; |
| 871 | 868 | if ('add' == $mode) { |
| 872 | - $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
| 869 | + $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
| 873 | 870 | return false; |
| 874 | 871 | } |
| 875 | 872 | continue; |
@@ -894,7 +891,7 @@ discard block |
||
| 894 | 891 | $next_byte = 4; |
| 895 | 892 | $v = ($v - 252) << 30; |
| 896 | 893 | } else { |
| 897 | - $this->_error('This might be UTF-8, but I don\'t understand it at byte ' . $k); |
|
| 894 | + $this->_error('This might be UTF-8, but I don\'t understand it at byte '.$k); |
|
| 898 | 895 | return false; |
| 899 | 896 | } |
| 900 | 897 | if ('add' == $mode) { |
@@ -907,7 +904,7 @@ discard block |
||
| 907 | 904 | if (!$this->_allow_overlong && $test == 'range') { |
| 908 | 905 | $test = 'none'; |
| 909 | 906 | if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { |
| 910 | - $this->_error('Bogus UTF-8 character detected (out of legal range) at byte ' . $k); |
|
| 907 | + $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k); |
|
| 911 | 908 | return false; |
| 912 | 909 | } |
| 913 | 910 | } |
@@ -916,7 +913,7 @@ discard block |
||
| 916 | 913 | $output[($out_len - 1)] += $v; |
| 917 | 914 | --$next_byte; |
| 918 | 915 | } else { |
| 919 | - $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
| 916 | + $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
| 920 | 917 | return false; |
| 921 | 918 | } |
| 922 | 919 | if ($next_byte < 0) { |
@@ -940,13 +937,13 @@ discard block |
||
| 940 | 937 | if ($v < 128) { // 7bit are transferred literally |
| 941 | 938 | $output .= chr($v); |
| 942 | 939 | } elseif ($v < (1 << 11)) { // 2 bytes |
| 943 | - $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); |
|
| 940 | + $output .= chr(192 + ($v >> 6)).chr(128 + ($v & 63)); |
|
| 944 | 941 | } elseif ($v < (1 << 16)) { // 3 bytes |
| 945 | - $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
| 942 | + $output .= chr(224 + ($v >> 12)).chr(128 + (($v >> 6) & 63)).chr(128 + ($v & 63)); |
|
| 946 | 943 | } elseif ($v < (1 << 21)) { // 4 bytes |
| 947 | - $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
| 944 | + $output .= chr(240 + ($v >> 18)).chr(128 + (($v >> 12) & 63)).chr(128 + (($v >> 6) & 63)).chr(128 + ($v & 63)); |
|
| 948 | 945 | } else { |
| 949 | - $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte ' . $k); |
|
| 946 | + $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k); |
|
| 950 | 947 | return false; |
| 951 | 948 | } |
| 952 | 949 | } |
@@ -965,7 +962,7 @@ discard block |
||
| 965 | 962 | // Take array values and split output to 4 bytes per value |
| 966 | 963 | // The bit mask is 255, which reads &11111111 |
| 967 | 964 | foreach ($input as $v) { |
| 968 | - $output .= chr(($v >> 24) & 255) . chr(($v >> 16) & 255) . chr(($v >> 8) & 255) . chr($v & 255); |
|
| 965 | + $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255); |
|
| 969 | 966 | } |
| 970 | 967 | return $output; |
| 971 | 968 | } |
@@ -995,7 +992,7 @@ discard block |
||
| 995 | 992 | $out_len++; |
| 996 | 993 | $output[$out_len] = 0; |
| 997 | 994 | } |
| 998 | - $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); |
|
| 995 | + $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4))); |
|
| 999 | 996 | } |
| 1000 | 997 | return $output; |
| 1001 | 998 | } |
@@ -19,8 +19,8 @@ |
||
| 19 | 19 | $primary = id_table_objet($objet); |
| 20 | 20 | |
| 21 | 21 | $select = "$primary as id,lang"; |
| 22 | - $where = 'id_trad=' . intval($id_trad); |
|
| 23 | - $trouver_table = charger_fonction('trouver_table','base'); |
|
| 22 | + $where = 'id_trad='.intval($id_trad); |
|
| 23 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 24 | 24 | $desc = $trouver_table($table_objet_sql); |
| 25 | 25 | if (isset($desc['field']['statut'])) { |
| 26 | 26 | $select .= ',statut'; |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | ) { |
| 155 | 155 | return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self()); |
| 156 | 156 | } elseif (strlen($email) and autoriser('voir', 'auteur', $id_auteur)) { |
| 157 | - return 'mailto:' . $email; |
|
| 157 | + return 'mailto:'.$email; |
|
| 158 | 158 | } else { |
| 159 | 159 | return ''; |
| 160 | 160 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | $les_couleurs = $couleurs(array(), true); |
| 47 | 47 | foreach ($les_couleurs as $k => $c) { |
| 48 | 48 | $valeurs['_couleurs_url'][$k] = generer_url_public('style_prive.css', 'ltr=' |
| 49 | - . $GLOBALS['spip_lang_left'] . '&' |
|
| 49 | + . $GLOBALS['spip_lang_left'].'&' |
|
| 50 | 50 | . $couleurs($k)); |
| 51 | 51 | $valeurs['couleurs'][$k] = $c; |
| 52 | 52 | } |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | '_publiable' => $publiable, |
| 108 | 108 | '_label' => isset($desc['texte_changer_statut']) ? $desc['texte_changer_statut'] : 'texte_article_statut', |
| 109 | 109 | '_aide' => isset($desc['aide_changer_statut']) ? $desc['aide_changer_statut'] : '', |
| 110 | - '_hidden' => "<input type='hidden' name='statut_old' value='" . $v['statut'] . "' />", |
|
| 110 | + '_hidden' => "<input type='hidden' name='statut_old' value='".$v['statut']."' />", |
|
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | 113 | #if (!count($valeurs['statuts'])) |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | unset($erreurs['new_login']); |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - $auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 170 | + $auth_methode = sql_getfetsel('source', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 171 | 171 | $auth_methode = ($auth_methode ? $auth_methode : 'spip'); |
| 172 | 172 | include_spip('inc/auth'); |
| 173 | 173 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | if (!autoriser('modifier', 'auteur', $id_auteur, null, array('email' => '?')) |
| 183 | 183 | and $GLOBALS['visiteur_session']['id_auteur'] == $id_auteur |
| 184 | 184 | and !strlen(trim($email)) |
| 185 | - and $email != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur=' . intval($id_auteur))) |
|
| 185 | + and $email != ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.intval($id_auteur))) |
|
| 186 | 186 | ) { |
| 187 | 187 | $erreurs['email'] = (($id_auteur == $GLOBALS['visiteur_session']['id_auteur']) ? _T('form_email_non_valide') : _T('form_prop_indiquer_email')); |
| 188 | 188 | } else { |
@@ -197,18 +197,18 @@ discard block |
||
| 197 | 197 | #Nouvel auteur |
| 198 | 198 | if (intval($id_auteur) == 0) { |
| 199 | 199 | #Un auteur existe deja avec cette adresse ? |
| 200 | - if (sql_countsel('spip_auteurs', 'email=' . sql_quote($email)) > 0) { |
|
| 200 | + if (sql_countsel('spip_auteurs', 'email='.sql_quote($email)) > 0) { |
|
| 201 | 201 | $erreurs['email'] = _T('erreur_email_deja_existant'); |
| 202 | 202 | } |
| 203 | 203 | } else { |
| 204 | 204 | #Un auteur existe deja avec cette adresse ? et n'est pas le user courant. |
| 205 | 205 | if ((sql_countsel( |
| 206 | 206 | 'spip_auteurs', |
| 207 | - 'email=' . sql_quote($email) |
|
| 207 | + 'email='.sql_quote($email) |
|
| 208 | 208 | ) > 0) and ($id_auteur != ($id_auteur_ancien = sql_getfetsel( |
| 209 | 209 | 'id_auteur', |
| 210 | 210 | 'spip_auteurs', |
| 211 | - 'email=' . sql_quote($email) |
|
| 211 | + 'email='.sql_quote($email) |
|
| 212 | 212 | )))) { |
| 213 | 213 | $erreurs['email'] = _T('erreur_email_deja_existant'); |
| 214 | 214 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | // corriger un cas si frequent : www.example.org sans le http:// qui precede |
| 226 | 226 | if ($url = _request('url_site') and !tester_url_absolue($url)) { |
| 227 | 227 | if (strpos($url, ':') === false and strncasecmp($url, 'www.', 4) === 0) { |
| 228 | - $url = 'http://' . $url; |
|
| 228 | + $url = 'http://'.$url; |
|
| 229 | 229 | set_request('url_site', $url); |
| 230 | 230 | } |
| 231 | 231 | } |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | // et de revenir sur son profil |
| 323 | 323 | if ($GLOBALS['visiteur_session']['id_auteur'] == $id_auteur |
| 324 | 324 | and $email_nouveau != |
| 325 | - ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur=' . intval($id_auteur))) |
|
| 325 | + ($email_ancien = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.intval($id_auteur))) |
|
| 326 | 326 | ) { |
| 327 | 327 | $envoyer_mail = charger_fonction('envoyer_mail', 'inc'); |
| 328 | 328 | $texte = _T( |
@@ -352,11 +352,11 @@ discard block |
||
| 352 | 352 | $erreurs = auteur_reset_password($res['id_auteur'], $erreurs); |
| 353 | 353 | if (isset($erreurs['message_ok'])) { |
| 354 | 354 | if (!isset($res['message_ok'])) $res['message_ok'] = ''; |
| 355 | - $res['message_ok'] = trim($res['message_ok'] . ' ' . $erreurs['message_ok']); |
|
| 355 | + $res['message_ok'] = trim($res['message_ok'].' '.$erreurs['message_ok']); |
|
| 356 | 356 | } |
| 357 | 357 | if (isset($erreurs['message_erreur']) and $erreurs['message_erreur']) { |
| 358 | 358 | if (!isset($res['message_erreur'])) $res['message_erreur'] = ''; |
| 359 | - $res['message_erreur'] = trim($res['message_erreur'] . ' ' . $erreurs['message_erreur']); |
|
| 359 | + $res['message_erreur'] = trim($res['message_erreur'].' '.$erreurs['message_erreur']); |
|
| 360 | 360 | } |
| 361 | 361 | } |
| 362 | 362 | |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | |
| 384 | 384 | |
| 385 | 385 | function auteur_reset_password($id_auteur, $erreurs = array()) { |
| 386 | - $auteur = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . intval($id_auteur)); |
|
| 386 | + $auteur = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 387 | 387 | $config = auteurs_edit_config($auteur); |
| 388 | 388 | |
| 389 | 389 | if ($config['edit_pass']) { |
@@ -409,21 +409,21 @@ discard block |
||
| 409 | 409 | * @param array $contexte |
| 410 | 410 | * @return string |
| 411 | 411 | */ |
| 412 | -function auteur_regenerer_identifiants($id_auteur, $notifier=true, $contexte = array()) { |
|
| 413 | - if ($id_auteur){ |
|
| 412 | +function auteur_regenerer_identifiants($id_auteur, $notifier = true, $contexte = array()) { |
|
| 413 | + if ($id_auteur) { |
|
| 414 | 414 | $set = array(); |
| 415 | 415 | include_spip('inc/access'); |
| 416 | 416 | $set['pass'] = creer_pass_aleatoire(); |
| 417 | 417 | |
| 418 | 418 | include_spip('action/editer_auteur'); |
| 419 | - auteur_modifier($id_auteur,$set); |
|
| 419 | + auteur_modifier($id_auteur, $set); |
|
| 420 | 420 | |
| 421 | - $row = sql_fetsel('*','spip_auteurs','id_auteur='.intval($id_auteur)); |
|
| 421 | + $row = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($id_auteur)); |
|
| 422 | 422 | include_spip('inc/filtres'); |
| 423 | 423 | if ($notifier |
| 424 | 424 | and $row['email'] |
| 425 | 425 | and email_valide($row['email']) |
| 426 | - and trouver_fond($fond = 'modeles/mail_nouveaux_identifiants')){ |
|
| 426 | + and trouver_fond($fond = 'modeles/mail_nouveaux_identifiants')) { |
|
| 427 | 427 | // envoyer l'email avec login/pass |
| 428 | 428 | $c = array( |
| 429 | 429 | 'id_auteur' => $id_auteur, |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | $contexte = array_merge($contexte, $c); |
| 437 | 437 | $message = recuperer_fond($fond, $contexte); |
| 438 | 438 | include_spip("inc/notifications"); |
| 439 | - notifications_envoyer_mails($row['email'],$message); |
|
| 439 | + notifications_envoyer_mails($row['email'], $message); |
|
| 440 | 440 | |
| 441 | 441 | return $row['email']; |
| 442 | 442 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | // un checkbox seul de name X non coche n'est pas poste. |
| 40 | 40 | // on verifie le champ X_check qui indique que la checkbox etait presente dans le formulaire. |
| 41 | 41 | foreach (array('multi_secteurs') as $m) { |
| 42 | - if (!is_null(_request($m . '_check'))) { |
|
| 42 | + if (!is_null(_request($m.'_check'))) { |
|
| 43 | 43 | ecrire_meta($m, _request($m) ? 'oui' : 'non'); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | . "'>" |
| 113 | 113 | . "<input type='hidden' name='{$name}[]' value='$code_langue'>" // necessaire ... |
| 114 | 114 | . "<input type='checkbox' name='{$name}[]' id='{$name}_$code_langue' value='$code_langue' checked='checked' disabled='disabled' />" |
| 115 | - . "<label for='{$name}_$code_langue'>" . $nom_langue . " <span class='code_langue'>[$code_langue]</span></label>" |
|
| 115 | + . "<label for='{$name}_$code_langue'>".$nom_langue." <span class='code_langue'>[$code_langue]</span></label>" |
|
| 116 | 116 | . '</li>'; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if ($res) { |
| 120 | - $res = "<ul id='langues_bloquees'>" . $res . "</ul><div class='nettoyeur'></div>"; |
|
| 120 | + $res = "<ul id='langues_bloquees'>".$res."</ul><div class='nettoyeur'></div>"; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | $res .= "<ul id='langues_proposees'>"; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | . "<label for='{$name}_$code_langue'" |
| 138 | 138 | . ($checked ? " class='on'" : '') |
| 139 | 139 | . '>' |
| 140 | - . $nom_langue . " <span class='code_langue'>[$code_langue]</span></label>" |
|
| 140 | + . $nom_langue." <span class='code_langue'>[$code_langue]</span></label>" |
|
| 141 | 141 | . '</li>'; |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -62,5 +62,5 @@ |
||
| 62 | 62 | $reload = texte_script(couper(_request('nom_site'), 35)); |
| 63 | 63 | $reload = "<script type='text/javascript'>if (window.jQuery) jQuery('#bando_identite .nom_site_spip .nom').html('$reload');</script>"; |
| 64 | 64 | |
| 65 | - return array('message_ok' => _T('config_info_enregistree') . $reload, 'editable' => true); |
|
| 65 | + return array('message_ok' => _T('config_info_enregistree').$reload, 'editable' => true); |
|
| 66 | 66 | } |
@@ -80,13 +80,13 @@ discard block |
||
| 80 | 80 | // Attention a l'ordre: |
| 81 | 81 | // si l'un des 3 est un sous-rep d'un autre, le mettre avant. |
| 82 | 82 | |
| 83 | -define('_EXTRAIRE_PLUGIN', '@(' . _DIR_PLUGINS_AUTO . '|' . _DIR_PLUGINS . '|' . _DIR_PLUGINS_DIST . ')/?([^/]+)/@'); |
|
| 83 | +define('_EXTRAIRE_PLUGIN', '@('._DIR_PLUGINS_AUTO.'|'._DIR_PLUGINS.'|'._DIR_PLUGINS_DIST.')/?([^/]+)/@'); |
|
| 84 | 84 | |
| 85 | 85 | // Recuperer la version compilee de plugin.xml et normaliser |
| 86 | 86 | // Si ce n'est pas un plugin, dire qu'il faut prendre la table std des meta. |
| 87 | 87 | function formulaires_configurer_metas_infos($form) { |
| 88 | 88 | |
| 89 | - $path = find_in_path($form . '.' . _EXTENSION_SQUELETTES, 'formulaires/'); |
|
| 89 | + $path = find_in_path($form.'.'._EXTENSION_SQUELETTES, 'formulaires/'); |
|
| 90 | 90 | if (!$path) { |
| 91 | 91 | return ''; |
| 92 | 92 | } // cas traite en amont normalement. |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $prefix = $infos['prefix']; |
| 106 | 106 | $infos['path'] = $path; |
| 107 | 107 | if (!isset($infos['meta'])) { |
| 108 | - $infos['meta'] = ($prefix . '_metas'); |
|
| 108 | + $infos['meta'] = ($prefix.'_metas'); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $infos; |