@@ -303,9 +303,9 @@ |
||
| 303 | 303 | // et dans ce cas il faut verifier que l'ecriture en base a bien eu lieu a l'identique si il y a des planes dans la chaine |
| 304 | 304 | // car sinon ca casse le serialize PHP - par exemple si on est en mysql utf8 (non mb4) |
| 305 | 305 | if ($has_planes) { |
| 306 | - $check_store = sql_getfetsel('valeur', 'spip_' . $table, 'nom=' . sql_quote($casier)); |
|
| 306 | + $check_store = sql_getfetsel('valeur', 'spip_'.$table, 'nom='.sql_quote($casier)); |
|
| 307 | 307 | if ($check_store !== $serialized_store) { |
| 308 | - array_walk_recursive($store, function (&$value, $key) { |
|
| 308 | + array_walk_recursive($store, function(&$value, $key) { |
|
| 309 | 309 | if (is_string($value)) { |
| 310 | 310 | $value = utf8_noplanes($value); |
| 311 | 311 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | define('_INC_DISTANT_CONTENT_ENCODING', 'gzip'); |
| 27 | 27 | } |
| 28 | 28 | if (!defined('_INC_DISTANT_USER_AGENT')) { |
| 29 | - define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')'); |
|
| 29 | + define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')'); |
|
| 30 | 30 | } |
| 31 | 31 | if (!defined('_INC_DISTANT_MAX_SIZE')) { |
| 32 | 32 | define('_INC_DISTANT_MAX_SIZE', 2_097_152); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | define('_INC_DISTANT_CONNECT_TIMEOUT', 10); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -define('_REGEXP_COPIE_LOCALE', ',' . |
|
| 38 | +define('_REGEXP_COPIE_LOCALE', ','. |
|
| 39 | 39 | preg_replace( |
| 40 | 40 | '@^https?:@', |
| 41 | 41 | 'https?:', |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | // si c'est la protection de soi-meme, retourner le path |
| 74 | 74 | if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) { |
| 75 | - $source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]); |
|
| 75 | + $source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]); |
|
| 76 | 76 | |
| 77 | 77 | return @file_exists($source) ? $source : false; |
| 78 | 78 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - $localrac = _DIR_RACINE . $local; |
|
| 95 | + $localrac = _DIR_RACINE.$local; |
|
| 96 | 96 | $t = ($mode === 'force') ? false : @file_exists($localrac); |
| 97 | 97 | |
| 98 | 98 | // test d'existence du fichier |
@@ -112,18 +112,18 @@ discard block |
||
| 112 | 112 | if (!$taille_max) { |
| 113 | 113 | $taille_max = _COPIE_LOCALE_MAX_SIZE; |
| 114 | 114 | } |
| 115 | - $localrac_tmp = $localrac . '.tmp'; |
|
| 115 | + $localrac_tmp = $localrac.'.tmp'; |
|
| 116 | 116 | $res = recuperer_url( |
| 117 | 117 | $source, |
| 118 | 118 | ['file' => $localrac_tmp, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : ''] |
| 119 | 119 | ); |
| 120 | 120 | |
| 121 | 121 | if (!$res or (!$res['length'] and $res['status'] != 304)) { |
| 122 | - spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : " . ($res ? $res['status'] : '-'), 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 122 | + spip_log("copie_locale : Echec recuperation $source sur $localrac_tmp status : ".($res ? $res['status'] : '-'), 'distant'._LOG_INFO_IMPORTANTE); |
|
| 123 | 123 | @unlink($localrac_tmp); |
| 124 | 124 | } |
| 125 | 125 | else { |
| 126 | - spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille " . $res['length'] . ' status ' . $res['status'], 'distant'); |
|
| 126 | + spip_log("copie_locale : recuperation $source sur $localrac_tmp OK | taille ".$res['length'].' status '.$res['status'], 'distant'); |
|
| 127 | 127 | } |
| 128 | 128 | if (!$res or !$res['length']) { |
| 129 | 129 | // si $t c'est sans doute juste un not-modified-since |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | and is_callable($callback_valider_url) |
| 137 | 137 | and !$callback_valider_url($res['url']) |
| 138 | 138 | ) { |
| 139 | - spip_log('copie_locale : url finale ' . $res['url'] . " non valide, on refuse le fichier $localrac_tmp", 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 139 | + spip_log('copie_locale : url finale '.$res['url']." non valide, on refuse le fichier $localrac_tmp", 'distant'._LOG_INFO_IMPORTANTE); |
|
| 140 | 140 | @unlink($localrac_tmp); |
| 141 | 141 | return $t ? $local : false; |
| 142 | 142 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | if (!$is_known_host) { |
| 229 | 229 | $host = trim($parsed_url['host'], '.'); |
| 230 | - if (! $ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 230 | + if (!$ip = filter_var($host, FILTER_VALIDATE_IP)) { |
|
| 231 | 231 | $ip = gethostbyname($host); |
| 232 | 232 | if ($ip === $host) { |
| 233 | 233 | // Error condition for gethostbyname() |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | if ($ip) { |
| 251 | - if (! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 251 | + if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { |
|
| 252 | 252 | return false; |
| 253 | 253 | } |
| 254 | 254 | } |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | $port = $parsed_url['port']; |
| 262 | - if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 262 | + if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 263 | 263 | return $url; |
| 264 | 264 | } |
| 265 | 265 | |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | if ($taille > 500) { |
| 332 | - $boundary = substr(md5(random_int(0, mt_getrandmax()) . 'spip'), 0, 8); |
|
| 332 | + $boundary = substr(md5(random_int(0, mt_getrandmax()).'spip'), 0, 8); |
|
| 333 | 333 | } |
| 334 | 334 | } |
| 335 | 335 | |
@@ -357,16 +357,16 @@ discard block |
||
| 357 | 357 | } |
| 358 | 358 | } else { |
| 359 | 359 | // fabrique une chaine HTTP simple pour un POST |
| 360 | - $entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; |
|
| 360 | + $entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n"; |
|
| 361 | 361 | $chaine = []; |
| 362 | 362 | if (is_array($donnees)) { |
| 363 | 363 | foreach ($donnees as $cle => $valeur) { |
| 364 | 364 | if (is_array($valeur)) { |
| 365 | 365 | foreach ($valeur as $val2) { |
| 366 | - $chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2); |
|
| 366 | + $chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2); |
|
| 367 | 367 | } |
| 368 | 368 | } else { |
| 369 | - $chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur); |
|
| 369 | + $chaine[] = rawurlencode($cle).'='.rawurlencode($valeur); |
|
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | $chaine = implode('&', $chaine); |
@@ -471,13 +471,13 @@ discard block |
||
| 471 | 471 | $options['taille_max'] = $copy ? _COPIE_LOCALE_MAX_SIZE : _INC_DISTANT_MAX_SIZE; |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | - spip_log('recuperer_url ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG); |
|
| 474 | + spip_log('recuperer_url '.$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 475 | 475 | |
| 476 | 476 | // Ajout des en-têtes spécifiques si besoin |
| 477 | 477 | $formatted_data = ''; |
| 478 | 478 | if (!empty($options['headers'])) { |
| 479 | 479 | foreach ($options['headers'] as $champ => $valeur) { |
| 480 | - $formatted_data .= $champ . ': ' . $valeur . "\r\n"; |
|
| 480 | + $formatted_data .= $champ.': '.$valeur."\r\n"; |
|
| 481 | 481 | } |
| 482 | 482 | } |
| 483 | 483 | |
@@ -485,9 +485,9 @@ discard block |
||
| 485 | 485 | [$head, $postdata] = prepare_donnees_post($options['datas'], $options['boundary']); |
| 486 | 486 | $head .= $formatted_data; |
| 487 | 487 | if (stripos($head, 'Content-Length:') === false) { |
| 488 | - $head .= 'Content-Length: ' . strlen($postdata) . "\r\n"; |
|
| 488 | + $head .= 'Content-Length: '.strlen($postdata)."\r\n"; |
|
| 489 | 489 | } |
| 490 | - $formatted_data = $head . "\r\n" . $postdata; |
|
| 490 | + $formatted_data = $head."\r\n".$postdata; |
|
| 491 | 491 | if ( |
| 492 | 492 | strlen($postdata) |
| 493 | 493 | and !$methode_demandee |
@@ -501,9 +501,9 @@ discard block |
||
| 501 | 501 | // Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole |
| 502 | 502 | $url = preg_replace(',^feed://,i', 'http://', $url); |
| 503 | 503 | if (!tester_url_absolue($url)) { |
| 504 | - $url = 'http://' . $url; |
|
| 504 | + $url = 'http://'.$url; |
|
| 505 | 505 | } elseif (strncmp($url, '//', 2) == 0) { |
| 506 | - $url = 'http:' . $url; |
|
| 506 | + $url = 'http:'.$url; |
|
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | $url = url_to_ascii($url); |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | $options['if_modified_since'] |
| 533 | 533 | ); |
| 534 | 534 | if (!$handle) { |
| 535 | - spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR); |
|
| 535 | + spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR); |
|
| 536 | 536 | |
| 537 | 537 | return false; |
| 538 | 538 | } |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | 'status' => 200, |
| 563 | 563 | ]; |
| 564 | 564 | } else { |
| 565 | - spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR); |
|
| 565 | + spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR); |
|
| 566 | 566 | return false; |
| 567 | 567 | } |
| 568 | 568 | } elseif ($res['location'] and $options['follow_location']) { |
@@ -578,11 +578,11 @@ discard block |
||
| 578 | 578 | $options['datas'] = ''; |
| 579 | 579 | } |
| 580 | 580 | } |
| 581 | - spip_log('recuperer_url recommence ' . $options['methode'] . " sur $url", 'distant' . _LOG_DEBUG); |
|
| 581 | + spip_log('recuperer_url recommence '.$options['methode']." sur $url", 'distant'._LOG_DEBUG); |
|
| 582 | 582 | |
| 583 | 583 | return recuperer_url($url, $options); |
| 584 | 584 | } elseif ($res['status'] !== 200) { |
| 585 | - spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant'); |
|
| 585 | + spip_log('HTTP status '.$res['status']." pour $url", 'distant'); |
|
| 586 | 586 | } |
| 587 | 587 | $result['status'] = $res['status']; |
| 588 | 588 | if (isset($res['headers'])) { |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | |
| 599 | 599 | // on ne veut que les entetes |
| 600 | 600 | if (!$options['taille_max'] or $options['methode'] == 'HEAD' or $result['status'] == '304') { |
| 601 | - spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($result), 'distant' . _LOG_DEBUG); |
|
| 601 | + spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($result), 'distant'._LOG_DEBUG); |
|
| 602 | 602 | return $result; |
| 603 | 603 | } |
| 604 | 604 | |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | |
| 609 | 609 | $gz = false; |
| 610 | 610 | if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) { |
| 611 | - $gz = (_DIR_TMP . md5(uniqid(random_int(0, mt_getrandmax()))) . '.tmp.gz'); |
|
| 611 | + $gz = (_DIR_TMP.md5(uniqid(random_int(0, mt_getrandmax()))).'.tmp.gz'); |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | // si on a pas deja recuperer le contenu par une methode detournee |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | |
| 645 | 645 | $trace = json_decode(json_encode($result), true); |
| 646 | 646 | $trace['page'] = '...'; |
| 647 | - spip_log('RESULTAT recuperer_url ' . $options['methode'] . " sur $url : " . json_encode($trace), 'distant' . _LOG_DEBUG); |
|
| 647 | + spip_log('RESULTAT recuperer_url '.$options['methode']." sur $url : ".json_encode($trace), 'distant'._LOG_DEBUG); |
|
| 648 | 648 | |
| 649 | 649 | return $result; |
| 650 | 650 | } |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | $sig['url'] = $url; |
| 699 | 699 | |
| 700 | 700 | $dir = sous_repertoire(_DIR_CACHE, 'curl'); |
| 701 | - $cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 701 | + $cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 702 | 702 | $sub = sous_repertoire($dir, substr($cache, 0, 2)); |
| 703 | 703 | $cache = "$sub$cache"; |
| 704 | 704 | |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | $fp = false; |
| 753 | 753 | if ($fichier) { |
| 754 | 754 | include_spip('inc/acces'); |
| 755 | - $tmpfile = "$fichier." . creer_uniqid() . '.tmp'; |
|
| 755 | + $tmpfile = "$fichier.".creer_uniqid().'.tmp'; |
|
| 756 | 756 | $fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX); |
| 757 | 757 | if (!$fp and file_exists($fichier)) { |
| 758 | 758 | return filesize($fichier); |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | } |
| 812 | 812 | $result['status'] = intval($r[1]); |
| 813 | 813 | while ($s = trim(fgets($handle, 16384))) { |
| 814 | - $result['headers'][] = $s . "\n"; |
|
| 814 | + $result['headers'][] = $s."\n"; |
|
| 815 | 815 | preg_match(',^([^:]*): *(.*)$,i', $s, $r); |
| 816 | 816 | [, $d, $v] = $r; |
| 817 | 817 | if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) { |
@@ -860,13 +860,13 @@ discard block |
||
| 860 | 860 | |
| 861 | 861 | // on se place tout le temps comme si on etait a la racine |
| 862 | 862 | if (_DIR_RACINE) { |
| 863 | - $d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d); |
|
| 863 | + $d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d); |
|
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | $m = md5($source); |
| 867 | 867 | |
| 868 | 868 | return $d |
| 869 | - . substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12) |
|
| 869 | + . substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12) |
|
| 870 | 870 | . substr($m, 0, 4) |
| 871 | 871 | . ".$extension"; |
| 872 | 872 | } |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | // Si c'est deja local pas de souci |
| 890 | 890 | if (!tester_url_absolue($source)) { |
| 891 | 891 | if (_DIR_RACINE) { |
| 892 | - $source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source); |
|
| 892 | + $source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source); |
|
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | return $source; |
@@ -907,7 +907,7 @@ discard block |
||
| 907 | 907 | $ext |
| 908 | 908 | and preg_match(',^\w+$,', $ext) // pas de php?truc=1&... |
| 909 | 909 | and $f = nom_fichier_copie_locale($source, $ext) |
| 910 | - and file_exists(_DIR_RACINE . $f) |
|
| 910 | + and file_exists(_DIR_RACINE.$f) |
|
| 911 | 911 | ) { |
| 912 | 912 | return $f; |
| 913 | 913 | } |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | |
| 916 | 916 | // Si c'est deja dans la table des documents, |
| 917 | 917 | // ramener le nom de sa copie potentielle |
| 918 | - $ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''"); |
|
| 918 | + $ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''"); |
|
| 919 | 919 | |
| 920 | 920 | if ($ext) { |
| 921 | 921 | return nom_fichier_copie_locale($source, $ext); |
@@ -926,9 +926,9 @@ discard block |
||
| 926 | 926 | |
| 927 | 927 | $ext = $path_parts ? $path_parts['extension'] : ''; |
| 928 | 928 | |
| 929 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 929 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 930 | 930 | $f = nom_fichier_copie_locale($source, $ext); |
| 931 | - if (file_exists(_DIR_RACINE . $f)) { |
|
| 931 | + if (file_exists(_DIR_RACINE.$f)) { |
|
| 932 | 932 | return $f; |
| 933 | 933 | } |
| 934 | 934 | } |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | // Ping pour voir si son extension est connue et autorisee |
| 937 | 937 | // avec mise en cache du resultat du ping |
| 938 | 938 | |
| 939 | - $cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source); |
|
| 939 | + $cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source); |
|
| 940 | 940 | if ( |
| 941 | 941 | !@file_exists($cache) |
| 942 | 942 | or !$path_parts = @unserialize(spip_file_get_contents($cache)) |
@@ -946,10 +946,10 @@ discard block |
||
| 946 | 946 | ecrire_fichier($cache, serialize($path_parts)); |
| 947 | 947 | } |
| 948 | 948 | $ext = !empty($path_parts['extension']) ? $path_parts['extension'] : ''; |
| 949 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 949 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 950 | 950 | return nom_fichier_copie_locale($source, $ext); |
| 951 | 951 | } |
| 952 | - spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR); |
|
| 952 | + spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR); |
|
| 953 | 953 | } |
| 954 | 954 | |
| 955 | 955 | |
@@ -1047,7 +1047,7 @@ discard block |
||
| 1047 | 1047 | } else { |
| 1048 | 1048 | if ($a['body']) { |
| 1049 | 1049 | $a['extension'] = $extension; |
| 1050 | - $a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension); |
|
| 1050 | + $a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension); |
|
| 1051 | 1051 | ecrire_fichier($a['fichier'], $a['body']); |
| 1052 | 1052 | $size_image = @spip_getimagesize($a['fichier']); |
| 1053 | 1053 | $a['largeur'] = intval($size_image[0]); |
@@ -1115,20 +1115,20 @@ discard block |
||
| 1115 | 1115 | !$t |
| 1116 | 1116 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1117 | 1117 | ) { |
| 1118 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1118 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1119 | 1119 | } |
| 1120 | 1120 | if ( |
| 1121 | 1121 | !$t |
| 1122 | 1122 | and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 1123 | 1123 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 1124 | 1124 | ) { |
| 1125 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1125 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1126 | 1126 | } |
| 1127 | 1127 | } |
| 1128 | 1128 | |
| 1129 | 1129 | // Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
| 1130 | 1130 | if (!$t) { |
| 1131 | - $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type)); |
|
| 1131 | + $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type)); |
|
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | 1134 | // Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
@@ -1139,11 +1139,11 @@ discard block |
||
| 1139 | 1139 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1140 | 1140 | ) { |
| 1141 | 1141 | # eviter xxx.3 => 3gp (> SPIP 3) |
| 1142 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1142 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote(corriger_extension($rext[1]), '', 'text')); |
|
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | if ($t) { |
| 1146 | - spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant'); |
|
| 1146 | + spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant'); |
|
| 1147 | 1147 | return $t['extension']; |
| 1148 | 1148 | } else { |
| 1149 | 1149 | # par defaut on retombe sur '.bin' si c'est autorise |
@@ -1246,7 +1246,7 @@ discard block |
||
| 1246 | 1246 | } |
| 1247 | 1247 | } else { |
| 1248 | 1248 | $scheme = $t['scheme']; |
| 1249 | - $noproxy = $scheme . '://'; |
|
| 1249 | + $noproxy = $scheme.'://'; |
|
| 1250 | 1250 | } |
| 1251 | 1251 | if (isset($t['user'])) { |
| 1252 | 1252 | $user = [$t['user'], $t['pass']]; |
@@ -1260,7 +1260,7 @@ discard block |
||
| 1260 | 1260 | } |
| 1261 | 1261 | |
| 1262 | 1262 | if (!empty($t['query'])) { |
| 1263 | - $path .= '?' . $t['query']; |
|
| 1263 | + $path .= '?'.$t['query']; |
|
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | 1266 | $f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date); |
@@ -1334,29 +1334,29 @@ discard block |
||
| 1334 | 1334 | $proxy_user = ''; |
| 1335 | 1335 | $http_proxy = need_proxy($host); |
| 1336 | 1336 | if ($user) { |
| 1337 | - $user = urlencode($user[0]) . ':' . urlencode($user[1]); |
|
| 1337 | + $user = urlencode($user[0]).':'.urlencode($user[1]); |
|
| 1338 | 1338 | } |
| 1339 | 1339 | |
| 1340 | 1340 | $connect = ''; |
| 1341 | 1341 | if ($http_proxy) { |
| 1342 | - if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls','ssl'])) { |
|
| 1343 | - $path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : ''); |
|
| 1344 | - $connect = 'CONNECT ' . $path_host . " $vers\r\n" |
|
| 1342 | + if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, ['tls', 'ssl'])) { |
|
| 1343 | + $path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : ''); |
|
| 1344 | + $connect = 'CONNECT '.$path_host." $vers\r\n" |
|
| 1345 | 1345 | . "Host: $path_host\r\n" |
| 1346 | 1346 | . "Proxy-Connection: Keep-Alive\r\n"; |
| 1347 | 1347 | } else { |
| 1348 | - $path = (in_array($scheme, ['tls','ssl']) ? 'https://' : "$scheme://") |
|
| 1348 | + $path = (in_array($scheme, ['tls', 'ssl']) ? 'https://' : "$scheme://") |
|
| 1349 | 1349 | . (!$user ? '' : "$user@") |
| 1350 | - . "$host" . (($port != 80) ? ":$port" : '') . $path; |
|
| 1350 | + . "$host".(($port != 80) ? ":$port" : '').$path; |
|
| 1351 | 1351 | } |
| 1352 | 1352 | $t2 = @parse_url($http_proxy); |
| 1353 | 1353 | $first_host = $t2['host']; |
| 1354 | 1354 | $port = ($t2['port'] ?? null) ?: 80; |
| 1355 | 1355 | if ($t2['user'] ?? null) { |
| 1356 | - $proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']); |
|
| 1356 | + $proxy_user = base64_encode($t2['user'].':'.$t2['pass']); |
|
| 1357 | 1357 | } |
| 1358 | 1358 | } else { |
| 1359 | - $first_host = $noproxy . $host; |
|
| 1359 | + $first_host = $noproxy.$host; |
|
| 1360 | 1360 | } |
| 1361 | 1361 | |
| 1362 | 1362 | if ($connect) { |
@@ -1378,7 +1378,7 @@ discard block |
||
| 1378 | 1378 | ); |
| 1379 | 1379 | spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect'); |
| 1380 | 1380 | if (!$f) { |
| 1381 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1381 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1382 | 1382 | return $errno; |
| 1383 | 1383 | } |
| 1384 | 1384 | stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT); |
@@ -1391,7 +1391,7 @@ discard block |
||
| 1391 | 1391 | or !count($res = explode(' ', $res)) |
| 1392 | 1392 | or $res[1] !== '200' |
| 1393 | 1393 | ) { |
| 1394 | - spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE); |
|
| 1394 | + spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE); |
|
| 1395 | 1395 | fclose($f); |
| 1396 | 1396 | |
| 1397 | 1397 | return false; |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | } while (!$f and $ntry-- and $errno !== 110 and sleep(1)); |
| 1409 | 1409 | spip_log("Recuperer $path sur $first_host:$port par $f"); |
| 1410 | 1410 | if (!$f) { |
| 1411 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1411 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1412 | 1412 | |
| 1413 | 1413 | return $errno; |
| 1414 | 1414 | } |
@@ -1418,16 +1418,16 @@ discard block |
||
| 1418 | 1418 | $site = $GLOBALS['meta']['adresse_site'] ?? ''; |
| 1419 | 1419 | |
| 1420 | 1420 | $host_port = $host; |
| 1421 | - if ($port != (in_array($scheme, ['tls','ssl']) ? 443 : 80)) { |
|
| 1421 | + if ($port != (in_array($scheme, ['tls', 'ssl']) ? 443 : 80)) { |
|
| 1422 | 1422 | $host_port .= ":$port"; |
| 1423 | 1423 | } |
| 1424 | 1424 | $req = "$method $path $vers\r\n" |
| 1425 | 1425 | . "Host: $host_port\r\n" |
| 1426 | - . 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n" |
|
| 1427 | - . ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n")) |
|
| 1426 | + . 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n" |
|
| 1427 | + . ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n")) |
|
| 1428 | 1428 | . (!$site ? '' : "Referer: $site/$referer\r\n") |
| 1429 | - . (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n")) |
|
| 1430 | - . (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n")) |
|
| 1429 | + . (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n")) |
|
| 1430 | + . (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n")) |
|
| 1431 | 1431 | . (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n") |
| 1432 | 1432 | . (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n"); |
| 1433 | 1433 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $adresse_ldap = filter_var($adresse_ldap, FILTER_SANITIZE_URL) ?: ''; |
| 49 | 49 | |
| 50 | 50 | $ldap_link = ldap_connect($adresse_ldap, $port_ldap); |
| 51 | - $erreur = 'ldap_connect(' . spip_htmlspecialchars($adresse_ldap) . ', ' . spip_htmlspecialchars($port_ldap) . ')'; |
|
| 51 | + $erreur = 'ldap_connect('.spip_htmlspecialchars($adresse_ldap).', '.spip_htmlspecialchars($port_ldap).')'; |
|
| 52 | 52 | |
| 53 | 53 | if ($ldap_link) { |
| 54 | 54 | if (!ldap_set_option($ldap_link, LDAP_OPT_PROTOCOL_VERSION, $protocole_ldap)) { |
@@ -57,19 +57,19 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | if ($tls === true) { |
| 59 | 59 | if (!ldap_start_tls($ldap_link)) { |
| 60 | - $erreur = 'ldap_start_tls(' . spip_htmlspecialchars($ldap_link) |
|
| 61 | - . ' ' . spip_htmlspecialchars($adresse_ldap) |
|
| 62 | - . ', ' . spip_htmlspecialchars($port_ldap) . ')'; |
|
| 60 | + $erreur = 'ldap_start_tls('.spip_htmlspecialchars($ldap_link) |
|
| 61 | + . ' '.spip_htmlspecialchars($adresse_ldap) |
|
| 62 | + . ', '.spip_htmlspecialchars($port_ldap).')'; |
|
| 63 | 63 | $ldap_link = false; |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | if ($ldap_link) { |
| 67 | 67 | $ldap_link = ldap_bind($ldap_link, $login_ldap, $pass_ldap); |
| 68 | - $erreur = "ldap_bind('" . spip_htmlspecialchars($ldap_link) |
|
| 69 | - . "', '" . spip_htmlspecialchars($login_ldap) |
|
| 70 | - . "', '" . spip_htmlspecialchars($pass_ldap) |
|
| 71 | - . "'): " . spip_htmlspecialchars($adresse_ldap) |
|
| 72 | - . ', ' . spip_htmlspecialchars($port_ldap); |
|
| 68 | + $erreur = "ldap_bind('".spip_htmlspecialchars($ldap_link) |
|
| 69 | + . "', '".spip_htmlspecialchars($login_ldap) |
|
| 70 | + . "', '".spip_htmlspecialchars($pass_ldap) |
|
| 71 | + . "'): ".spip_htmlspecialchars($adresse_ldap) |
|
| 72 | + . ', '.spip_htmlspecialchars($port_ldap); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
@@ -77,22 +77,22 @@ discard block |
||
| 77 | 77 | echo info_etape( |
| 78 | 78 | _T('titre_connexion_ldap'), |
| 79 | 79 | info_progression_etape(2, 'etape_ldap', 'install/') |
| 80 | - ), _T('info_connexion_ldap_ok'); |
|
| 80 | + ), _T('info_connexion_ldap_ok'); |
|
| 81 | 81 | echo generer_form_ecrire('install', ( |
| 82 | 82 | "\n<input type='hidden' name='etape' value='ldap3' />" |
| 83 | - . "\n<input type='hidden' name='adresse_ldap' value=\"" . spip_htmlspecialchars($adresse_ldap) . '" />' |
|
| 84 | - . "\n<input type='hidden' name='port_ldap' value=\"" . spip_htmlspecialchars($port_ldap) . '" />' |
|
| 85 | - . "\n<input type='hidden' name='login_ldap' value=\"" . spip_htmlspecialchars($login_ldap) . '" />' |
|
| 86 | - . "\n<input type='hidden' name='pass_ldap' value=\"" . spip_htmlspecialchars($pass_ldap) . '" />' |
|
| 87 | - . "\n<input type='hidden' name='protocole_ldap' value=\"" . spip_htmlspecialchars($protocole_ldap) . '" />' |
|
| 88 | - . "\n<input type='hidden' name='tls_ldap' value=\"" . spip_htmlspecialchars($tls_ldap) . '" />' |
|
| 83 | + . "\n<input type='hidden' name='adresse_ldap' value=\"".spip_htmlspecialchars($adresse_ldap).'" />' |
|
| 84 | + . "\n<input type='hidden' name='port_ldap' value=\"".spip_htmlspecialchars($port_ldap).'" />' |
|
| 85 | + . "\n<input type='hidden' name='login_ldap' value=\"".spip_htmlspecialchars($login_ldap).'" />' |
|
| 86 | + . "\n<input type='hidden' name='pass_ldap' value=\"".spip_htmlspecialchars($pass_ldap).'" />' |
|
| 87 | + . "\n<input type='hidden' name='protocole_ldap' value=\"".spip_htmlspecialchars($protocole_ldap).'" />' |
|
| 88 | + . "\n<input type='hidden' name='tls_ldap' value=\"".spip_htmlspecialchars($tls_ldap).'" />' |
|
| 89 | 89 | . bouton_suivant())); |
| 90 | 90 | } else { |
| 91 | 91 | echo info_etape(_T('titre_connexion_ldap')), info_progression_etape(1, 'etape_ldap', 'install/', true), |
| 92 | - "<div class='error'><p>" . _T('avis_connexion_ldap_echec_1') . '</p>', |
|
| 93 | - '<p>' . _T('avis_connexion_ldap_echec_2') . |
|
| 94 | - "<br />\n" . _T('avis_connexion_ldap_echec_3') . |
|
| 95 | - '<br /><br />' . $erreur . '<b> ?</b></p></div>'; |
|
| 92 | + "<div class='error'><p>"._T('avis_connexion_ldap_echec_1').'</p>', |
|
| 93 | + '<p>'._T('avis_connexion_ldap_echec_2'). |
|
| 94 | + "<br />\n"._T('avis_connexion_ldap_echec_3'). |
|
| 95 | + '<br /><br />'.$erreur.'<b> ?</b></p></div>'; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | echo install_fin_html(); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | = spip_connect_db($adresse_db, $port, $login_db, $pass_db, '', $server_db); |
| 45 | 45 | |
| 46 | 46 | $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']] |
| 47 | - = $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']]; |
|
| 47 | + = $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']]; |
|
| 48 | 48 | |
| 49 | 49 | $fquery = sql_serveur('query', $server_db); |
| 50 | 50 | if ($choix_db == 'new_spip') { |
@@ -54,13 +54,13 @@ discard block |
||
| 54 | 54 | if (!$ok) { |
| 55 | 55 | $re = "Impossible de creer la base $re"; |
| 56 | 56 | spip_log($re); |
| 57 | - return '<p>' . _T('avis_connexion_erreur_creer_base') . "</p><!--\n$re\n-->"; |
|
| 57 | + return '<p>'._T('avis_connexion_erreur_creer_base')."</p><!--\n$re\n-->"; |
|
| 58 | 58 | } |
| 59 | 59 | } else { |
| 60 | 60 | $re = "Le nom de la base doit correspondre a $re"; |
| 61 | 61 | spip_log($re); |
| 62 | 62 | |
| 63 | - return '<p>' . _T('avis_connexion_erreur_nom_base') . "</p><!--\n$re\n-->"; |
|
| 63 | + return '<p>'._T('avis_connexion_erreur_nom_base')."</p><!--\n$re\n-->"; |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
@@ -71,14 +71,14 @@ discard block |
||
| 71 | 71 | = spip_connect_db($adresse_db, $port, $login_db, $pass_db, $sel_db, $server_db); |
| 72 | 72 | |
| 73 | 73 | $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']] |
| 74 | - = $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']]; |
|
| 74 | + = $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']]; |
|
| 75 | 75 | |
| 76 | 76 | // Completer le tableau decrivant la connexion |
| 77 | 77 | |
| 78 | 78 | $GLOBALS['connexions'][$server_db]['prefixe'] = $table_prefix; |
| 79 | 79 | $GLOBALS['connexions'][$server_db]['db'] = $sel_db; |
| 80 | 80 | |
| 81 | - $old = sql_showbase($table_prefix . '_meta', $server_db); |
|
| 81 | + $old = sql_showbase($table_prefix.'_meta', $server_db); |
|
| 82 | 82 | if ($old) { |
| 83 | 83 | $old = sql_fetch($old, $server_db); |
| 84 | 84 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $charset['charset']; |
| 98 | 98 | $charsetbase = $charset['charset']; |
| 99 | 99 | } else { |
| 100 | - spip_log(_DEFAULT_CHARSET . ' inconnu du serveur SQL'); |
|
| 100 | + spip_log(_DEFAULT_CHARSET.' inconnu du serveur SQL'); |
|
| 101 | 101 | $charsetbase = 'standard'; |
| 102 | 102 | } |
| 103 | 103 | spip_log("Creation des tables. Codage $charsetbase"); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | if ($r) { |
| 148 | 148 | $r = sql_fetch($r, $server_db); |
| 149 | 149 | } |
| 150 | - $version_installee = !$r ? 0 : (double)$r['valeur']; |
|
| 150 | + $version_installee = !$r ? 0 : (double) $r['valeur']; |
|
| 151 | 151 | if (!$version_installee or ($GLOBALS['spip_version_base'] < $version_installee)) { |
| 152 | 152 | $fupdateq( |
| 153 | 153 | 'spip_meta', |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | '', |
| 157 | 157 | $server_db |
| 158 | 158 | ); |
| 159 | - spip_log('nouvelle version installee: ' . $GLOBALS['spip_version_base']); |
|
| 159 | + spip_log('nouvelle version installee: '.$GLOBALS['spip_version_base']); |
|
| 160 | 160 | } |
| 161 | 161 | // eliminer la derniere operation d'admin mal terminee |
| 162 | 162 | // notamment la mise a jour |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | if ($chmod_db) { |
| 184 | 184 | install_fichier_connexion( |
| 185 | 185 | _FILE_CHMOD_TMP, |
| 186 | - "if (!defined('_SPIP_CHMOD')) define('_SPIP_CHMOD', " . sprintf('0%3o', $chmod_db) . ");\n" |
|
| 186 | + "if (!defined('_SPIP_CHMOD')) define('_SPIP_CHMOD', ".sprintf('0%3o', $chmod_db).");\n" |
|
| 187 | 187 | ); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -246,16 +246,16 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | |
| 248 | 248 | function install_premier_auteur($email, $login, $nom, $pass, $hidden, $auteur_obligatoire) { |
| 249 | - return info_progression_etape(3, 'etape_', 'install/') . |
|
| 249 | + return info_progression_etape(3, 'etape_', 'install/'). |
|
| 250 | 250 | info_etape( |
| 251 | 251 | _T('info_informations_personnelles'), |
| 252 | - '<b>' . _T('texte_informations_personnelles_1') . '</b>' . |
|
| 253 | - aider('install5', true) . |
|
| 254 | - '<p>' . |
|
| 252 | + '<b>'._T('texte_informations_personnelles_1').'</b>'. |
|
| 253 | + aider('install5', true). |
|
| 254 | + '<p>'. |
|
| 255 | 255 | ($auteur_obligatoire ? |
| 256 | 256 | '' |
| 257 | 257 | : |
| 258 | - _T('texte_informations_personnelles_2') . ' ' . _T('info_laisser_champs_vides') |
|
| 258 | + _T('texte_informations_personnelles_2').' '._T('info_laisser_champs_vides') |
|
| 259 | 259 | ) |
| 260 | 260 | ) |
| 261 | 261 | . generer_form_ecrire('install', ( |
@@ -265,12 +265,12 @@ discard block |
||
| 265 | 265 | _T('info_identification_publique'), |
| 266 | 266 | [ |
| 267 | 267 | 'nom' => [ |
| 268 | - 'label' => '<b>' . _T('entree_signature') . "</b><br />\n" . _T('entree_nom_pseudo_1') . "\n", |
|
| 268 | + 'label' => '<b>'._T('entree_signature')."</b><br />\n"._T('entree_nom_pseudo_1')."\n", |
|
| 269 | 269 | 'valeur' => $nom, |
| 270 | 270 | 'required' => $auteur_obligatoire, |
| 271 | 271 | ], |
| 272 | 272 | 'email' => [ |
| 273 | - 'label' => '<b>' . _T('entree_adresse_email') . "</b>\n", |
|
| 273 | + 'label' => '<b>'._T('entree_adresse_email')."</b>\n", |
|
| 274 | 274 | 'valeur' => $email, |
| 275 | 275 | ] |
| 276 | 276 | ] |
@@ -280,23 +280,23 @@ discard block |
||
| 280 | 280 | _T('entree_identifiants_connexion'), |
| 281 | 281 | [ |
| 282 | 282 | 'login' => [ |
| 283 | - 'label' => '<b>' . _T('entree_login') . "</b><br />\n" . _T( |
|
| 283 | + 'label' => '<b>'._T('entree_login')."</b><br />\n"._T( |
|
| 284 | 284 | 'info_login_trop_court_car_pluriel', |
| 285 | 285 | ['nb' => _LOGIN_TROP_COURT] |
| 286 | - ) . "\n", |
|
| 286 | + )."\n", |
|
| 287 | 287 | 'valeur' => $login, |
| 288 | 288 | 'required' => $auteur_obligatoire, |
| 289 | 289 | ], |
| 290 | 290 | 'pass' => [ |
| 291 | - 'label' => '<b>' . _T('entree_mot_passe') . "</b><br />\n" . _T( |
|
| 291 | + 'label' => '<b>'._T('entree_mot_passe')."</b><br />\n"._T( |
|
| 292 | 292 | 'info_passe_trop_court_car_pluriel', |
| 293 | 293 | ['nb' => _PASS_LONGUEUR_MINI] |
| 294 | - ) . "\n", |
|
| 294 | + )."\n", |
|
| 295 | 295 | 'valeur' => $pass, |
| 296 | 296 | 'required' => $auteur_obligatoire, |
| 297 | 297 | ], |
| 298 | 298 | 'pass_verif' => [ |
| 299 | - 'label' => '<b>' . _T('info_confirmer_passe') . "</b><br />\n", |
|
| 299 | + 'label' => '<b>'._T('info_confirmer_passe')."</b><br />\n", |
|
| 300 | 300 | 'valeur' => $pass, |
| 301 | 301 | 'required' => $auteur_obligatoire, |
| 302 | 302 | ] |
@@ -340,9 +340,9 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | if ($res) { |
| 342 | 342 | $res = info_progression_etape(2, 'etape_', 'install/', true) |
| 343 | - . "<div class='error'><h3>" . _T('avis_operation_echec') . '</h3>' |
|
| 343 | + . "<div class='error'><h3>"._T('avis_operation_echec').'</h3>' |
|
| 344 | 344 | . $res |
| 345 | - . '<p>' . _T('texte_operation_echec') . '</p>' |
|
| 345 | + . '<p>'._T('texte_operation_echec').'</p>' |
|
| 346 | 346 | . '</div>'; |
| 347 | 347 | } |
| 348 | 348 | } else { |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | |
| 367 | 367 | $hidden = predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db) |
| 368 | 368 | . (defined('_INSTALL_NAME_DB') ? '' |
| 369 | - : "\n<input type='hidden' name='sel_db' value=\"" . spip_htmlspecialchars($sel_db) . '" />'); |
|
| 369 | + : "\n<input type='hidden' name='sel_db' value=\"".spip_htmlspecialchars($sel_db).'" />'); |
|
| 370 | 370 | |
| 371 | 371 | $auteur_obligatoire = ($ldap_present ? 0 : !sql_countsel('spip_auteurs', '', '', '', $server_db)); |
| 372 | 372 | |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if ($query) { |
| 48 | - $url .= '?' . $query; |
|
| 48 | + $url .= '?'.$query; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - return '/' . preg_replace(',^/,S', '', $url); |
|
| 51 | + return '/'.preg_replace(',^/,S', '', $url); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | if (preg_match(';^((?:[a-z]{3,33}:)?//.*?)(/.*)?$;iS', $lien, $r)) { |
| 79 | 79 | $r = array_pad($r, 3, ''); |
| 80 | 80 | |
| 81 | - return $r[1] . resolve_path($r[2]); |
|
| 81 | + return $r[1].resolve_path($r[2]); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | # L'url site spip est un lien absolu aussi |
@@ -99,13 +99,13 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | switch (substr($lien, 0, 1)) { |
| 101 | 101 | case '/': |
| 102 | - return $debut . resolve_path($lien); |
|
| 102 | + return $debut.resolve_path($lien); |
|
| 103 | 103 | case '#': |
| 104 | - return $debut . resolve_path($dir . $mot . $get . $lien); |
|
| 104 | + return $debut.resolve_path($dir.$mot.$get.$lien); |
|
| 105 | 105 | case '': |
| 106 | - return $debut . resolve_path($dir . $mot . $get . $hash); |
|
| 106 | + return $debut.resolve_path($dir.$mot.$get.$hash); |
|
| 107 | 107 | default: |
| 108 | - return $debut . resolve_path($dir . $lien); |
|
| 108 | + return $debut.resolve_path($dir.$lien); |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | return ''; |
| 134 | 134 | } |
| 135 | 135 | if (!$base) { |
| 136 | - $base = url_de_base() . (_DIR_RACINE ? _DIR_RESTREINT_ABS : ''); |
|
| 136 | + $base = url_de_base().(_DIR_RACINE ? _DIR_RESTREINT_ABS : ''); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | return suivre_lien($base, $url); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * @param array $protocoles_autorises |
| 157 | 157 | * @return bool |
| 158 | 158 | */ |
| 159 | -function protocole_verifier($url_absolue, $protocoles_autorises = ['http','https']) { |
|
| 159 | +function protocole_verifier($url_absolue, $protocoles_autorises = ['http', 'https']) { |
|
| 160 | 160 | |
| 161 | 161 | if (preg_match(';^([a-z]{3,7})://;i', $url_absolue, $m)) { |
| 162 | 162 | $protocole = $m[1]; |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | */ |
| 359 | 359 | function balise_DOSSIER_SQUELETTE_dist($p) { |
| 360 | 360 | $code = substr(addslashes(dirname($p->descr['sourcefile'])), strlen(_DIR_RACINE)); |
| 361 | - $p->code = "_DIR_RACINE . '$code'" . |
|
| 361 | + $p->code = "_DIR_RACINE . '$code'". |
|
| 362 | 362 | $p->interdire_scripts = false; |
| 363 | 363 | |
| 364 | 364 | return $p; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | */ |
| 378 | 378 | function balise_SQUELETTE_dist($p) { |
| 379 | 379 | $code = addslashes($p->descr['sourcefile']); |
| 380 | - $p->code = "'$code'" . |
|
| 380 | + $p->code = "'$code'". |
|
| 381 | 381 | $p->interdire_scripts = false; |
| 382 | 382 | |
| 383 | 383 | return $p; |
@@ -429,9 +429,9 @@ discard block |
||
| 429 | 429 | **/ |
| 430 | 430 | function balise_NOM_SITE_dist($p) { |
| 431 | 431 | if (!$p->etoile) { |
| 432 | - $p->code = 'supprimer_numero(calculer_url(' . |
|
| 433 | - champ_sql('url_site', $p) . ',' . |
|
| 434 | - champ_sql('nom_site', $p) . |
|
| 432 | + $p->code = 'supprimer_numero(calculer_url('. |
|
| 433 | + champ_sql('url_site', $p).','. |
|
| 434 | + champ_sql('nom_site', $p). |
|
| 435 | 435 | ", 'titre', \$connect, false))"; |
| 436 | 436 | } else { |
| 437 | 437 | $p->code = champ_sql('nom_site', $p); |
@@ -582,8 +582,8 @@ discard block |
||
| 582 | 582 | * Pile complétée par le code à générer |
| 583 | 583 | **/ |
| 584 | 584 | function balise_POPULARITE_ABSOLUE_dist($p) { |
| 585 | - $p->code = 'ceil(' . |
|
| 586 | - champ_sql('popularite', $p) . |
|
| 585 | + $p->code = 'ceil('. |
|
| 586 | + champ_sql('popularite', $p). |
|
| 587 | 587 | ')'; |
| 588 | 588 | $p->interdire_scripts = false; |
| 589 | 589 | |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | $p->code = index_pile($p->id_boucle, 'valeur', $p->boucles, $b); |
| 665 | 665 | ; |
| 666 | 666 | if (($v = interprete_argument_balise(1, $p)) !== null) { |
| 667 | - $p->code = 'table_valeur(' . $p->code . ', ' . $v . ')'; |
|
| 667 | + $p->code = 'table_valeur('.$p->code.', '.$v.')'; |
|
| 668 | 668 | } |
| 669 | 669 | $p->interdire_scripts = true; |
| 670 | 670 | |
@@ -804,16 +804,16 @@ discard block |
||
| 804 | 804 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 805 | 805 | if ($desc = $trouver_table(table_objet_sql($type_objet))) { |
| 806 | 806 | if (isset($desc['field']['descriptif'])) { |
| 807 | - $_ligne .= "'descriptif' => " . champ_sql('descriptif', $p) . ','; |
|
| 807 | + $_ligne .= "'descriptif' => ".champ_sql('descriptif', $p).','; |
|
| 808 | 808 | } |
| 809 | 809 | if (isset($desc['field']['texte'])) { |
| 810 | - $_ligne .= "'texte' => " . champ_sql('texte', $p) . ','; |
|
| 810 | + $_ligne .= "'texte' => ".champ_sql('texte', $p).','; |
|
| 811 | 811 | } |
| 812 | 812 | if (isset($desc['field']['chapo'])) { |
| 813 | - $_ligne .= "'chapo' => " . champ_sql('chapo', $p) . ','; |
|
| 813 | + $_ligne .= "'chapo' => ".champ_sql('chapo', $p).','; |
|
| 814 | 814 | } |
| 815 | 815 | if (isset($desc['introduction_longueur'])) { |
| 816 | - $_introduction_longueur = "'" . $desc['introduction_longueur'] . "'"; |
|
| 816 | + $_introduction_longueur = "'".$desc['introduction_longueur']."'"; |
|
| 817 | 817 | } |
| 818 | 818 | } |
| 819 | 819 | $_ligne .= ')'; |
@@ -909,10 +909,10 @@ discard block |
||
| 909 | 909 | $p->code = sprintf( |
| 910 | 910 | CODE_RECUPERER_FOND, |
| 911 | 911 | "'modeles/lesauteurs'", |
| 912 | - "array('objet'=>'" . $objet . |
|
| 913 | - "','id_objet' => " . champ_sql($id_table_objet, $p) . |
|
| 914 | - ",'$id_table_objet' => " . champ_sql($id_table_objet, $p) . |
|
| 915 | - ($objet == 'article' ? '' : ",'id_article' => " . champ_sql('id_article', $p)) . |
|
| 912 | + "array('objet'=>'".$objet. |
|
| 913 | + "','id_objet' => ".champ_sql($id_table_objet, $p). |
|
| 914 | + ",'$id_table_objet' => ".champ_sql($id_table_objet, $p). |
|
| 915 | + ($objet == 'article' ? '' : ",'id_article' => ".champ_sql('id_article', $p)). |
|
| 916 | 916 | ')', |
| 917 | 917 | "'trim'=>true, 'compil'=>array($c)", |
| 918 | 918 | _q($connect) |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | $m = trim($m); |
| 982 | 982 | if ($m != "''") { |
| 983 | 983 | if (!preg_match(',\W,', $m)) { |
| 984 | - $m = $boucle->id_table . ".$m"; |
|
| 984 | + $m = $boucle->id_table.".$m"; |
|
| 985 | 985 | } |
| 986 | 986 | |
| 987 | 987 | $m .= ' AS titre_rang'; |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | $f_pagination = chercher_filtre('pagination'); |
| 1143 | 1143 | $type = $p->boucles[$b]->modificateur['debut_nom']; |
| 1144 | 1144 | $modif = ($type[0] !== "'") ? "'debut'.$type" |
| 1145 | - : ("'debut" . substr($type, 1)); |
|
| 1145 | + : ("'debut".substr($type, 1)); |
|
| 1146 | 1146 | |
| 1147 | 1147 | $p->code = sprintf( |
| 1148 | 1148 | CODE_PAGINATION, |
@@ -1285,7 +1285,7 @@ discard block |
||
| 1285 | 1285 | $msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN']]; |
| 1286 | 1286 | erreur_squelette($msg, $p); |
| 1287 | 1287 | } else { |
| 1288 | - $p->code = 'find_in_path((string)' . $arg . ')'; |
|
| 1288 | + $p->code = 'find_in_path((string)'.$arg.')'; |
|
| 1289 | 1289 | } |
| 1290 | 1290 | |
| 1291 | 1291 | $p->interdire_scripts = false; |
@@ -1320,7 +1320,7 @@ discard block |
||
| 1320 | 1320 | $msg = ['zbug_balise_sans_argument', ['balise' => ' CHEMIN_IMAGE']]; |
| 1321 | 1321 | erreur_squelette($msg, $p); |
| 1322 | 1322 | } else { |
| 1323 | - $p->code = 'chemin_image((string)' . $arg . ')'; |
|
| 1323 | + $p->code = 'chemin_image((string)'.$arg.')'; |
|
| 1324 | 1324 | } |
| 1325 | 1325 | |
| 1326 | 1326 | $p->interdire_scripts = false; |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | // cas de #ENV sans argument : on retourne le serialize() du tableau |
| 1375 | 1375 | // une belle fonction [(#ENV|affiche_env)] serait pratique |
| 1376 | 1376 | if ($src) { |
| 1377 | - $p->code = '(is_array($a = (' . $src . ')) ? serialize($a) : "")'; |
|
| 1377 | + $p->code = '(is_array($a = ('.$src.')) ? serialize($a) : "")'; |
|
| 1378 | 1378 | } else { |
| 1379 | 1379 | $p->code = 'serialize($Pile[0]??[])'; |
| 1380 | 1380 | } |
@@ -1427,8 +1427,8 @@ discard block |
||
| 1427 | 1427 | $_sinon = interprete_argument_balise(2, $p); |
| 1428 | 1428 | $_unserialize = sinon(interprete_argument_balise(3, $p), 'false'); |
| 1429 | 1429 | |
| 1430 | - $p->code = '(include_spip(\'inc/config\')?lire_config(' . $arg . ',' . |
|
| 1431 | - ($_sinon && $_sinon != "''" ? $_sinon : 'null') . ',' . $_unserialize . "):'')"; |
|
| 1430 | + $p->code = '(include_spip(\'inc/config\')?lire_config('.$arg.','. |
|
| 1431 | + ($_sinon && $_sinon != "''" ? $_sinon : 'null').','.$_unserialize."):'')"; |
|
| 1432 | 1432 | |
| 1433 | 1433 | return $p; |
| 1434 | 1434 | } |
@@ -1521,7 +1521,7 @@ discard block |
||
| 1521 | 1521 | $err_b_s_a = ['zbug_balise_sans_argument', ['balise' => 'SESSION_SET']]; |
| 1522 | 1522 | erreur_squelette($err_b_s_a, $p); |
| 1523 | 1523 | } else { |
| 1524 | - $p->code = '(include_spip("inc/session") AND session_set(' . $_nom . ',' . $_val . '))'; |
|
| 1524 | + $p->code = '(include_spip("inc/session") AND session_set('.$_nom.','.$_val.'))'; |
|
| 1525 | 1525 | } |
| 1526 | 1526 | |
| 1527 | 1527 | $p->interdire_scripts = false; |
@@ -1569,7 +1569,7 @@ discard block |
||
| 1569 | 1569 | ) |
| 1570 | 1570 | ) { |
| 1571 | 1571 | $p->code = /* $r[1]. */ |
| 1572 | - '(' . $r[2] . ')'; |
|
| 1572 | + '('.$r[2].')'; |
|
| 1573 | 1573 | } else { |
| 1574 | 1574 | $p->code = "eval('return '.$php.';')"; |
| 1575 | 1575 | } |
@@ -1813,9 +1813,9 @@ discard block |
||
| 1813 | 1813 | |
| 1814 | 1814 | // noter la duree du cache dans un entete proprietaire |
| 1815 | 1815 | |
| 1816 | - $code = "'<'.'" . '?php header("X-Spip-Cache: ' |
|
| 1816 | + $code = "'<'.'".'?php header("X-Spip-Cache: ' |
|
| 1817 | 1817 | . $duree |
| 1818 | - . '"); ?' . "'.'>'"; |
|
| 1818 | + . '"); ?'."'.'>'"; |
|
| 1819 | 1819 | |
| 1820 | 1820 | // Remplir le header Cache-Control |
| 1821 | 1821 | // cas #CACHE{0} |
@@ -1836,9 +1836,9 @@ discard block |
||
| 1836 | 1836 | $pa == 'cache-client' |
| 1837 | 1837 | and $duree > 0 |
| 1838 | 1838 | ) { |
| 1839 | - $code .= ".'<'.'" . '?php header("Cache-Control: max-age=' |
|
| 1839 | + $code .= ".'<'.'".'?php header("Cache-Control: max-age=' |
|
| 1840 | 1840 | . $duree |
| 1841 | - . '"); ?' . "'.'>'"; |
|
| 1841 | + . '"); ?'."'.'>'"; |
|
| 1842 | 1842 | // il semble logique, si on cache-client, de ne pas invalider |
| 1843 | 1843 | $pa = 'statique'; |
| 1844 | 1844 | } |
@@ -1847,7 +1847,7 @@ discard block |
||
| 1847 | 1847 | $pa == 'statique' |
| 1848 | 1848 | and $duree > 0 |
| 1849 | 1849 | ) { |
| 1850 | - $code .= ".'<'.'" . '?php header("X-Spip-Statique: oui"); ?' . "'.'>'"; |
|
| 1850 | + $code .= ".'<'.'".'?php header("X-Spip-Statique: oui"); ?'."'.'>'"; |
|
| 1851 | 1851 | } |
| 1852 | 1852 | } |
| 1853 | 1853 | } else { |
@@ -2011,9 +2011,9 @@ discard block |
||
| 2011 | 2011 | if ($p->etoile) { |
| 2012 | 2012 | $_options[] = "'etoile'=>true"; |
| 2013 | 2013 | } |
| 2014 | - $_options[] = "'compil'=>array(" . memoriser_contexte_compil($p) . ')'; |
|
| 2014 | + $_options[] = "'compil'=>array(".memoriser_contexte_compil($p).')'; |
|
| 2015 | 2015 | |
| 2016 | - $_l = 'array(' . join(",\n\t", $_contexte) . ')'; |
|
| 2016 | + $_l = 'array('.join(",\n\t", $_contexte).')'; |
|
| 2017 | 2017 | if ($flag_env) { |
| 2018 | 2018 | $_l = "array_merge(\$Pile[0],$_l)"; |
| 2019 | 2019 | } |
@@ -2023,7 +2023,7 @@ discard block |
||
| 2023 | 2023 | $msg = ['zbug_balise_sans_argument', ['balise' => ' INCLURE']]; |
| 2024 | 2024 | erreur_squelette($msg, $p); |
| 2025 | 2025 | } else { |
| 2026 | - $p->code = 'charge_scripts(' . $_contexte[1] . ',false)'; |
|
| 2026 | + $p->code = 'charge_scripts('.$_contexte[1].',false)'; |
|
| 2027 | 2027 | } |
| 2028 | 2028 | |
| 2029 | 2029 | $p->interdire_scripts = false; // la securite est assuree par recuperer_fond |
@@ -2071,7 +2071,7 @@ discard block |
||
| 2071 | 2071 | unset($_contexte[1]); |
| 2072 | 2072 | |
| 2073 | 2073 | if (preg_match("/^\s*'[^']*'/s", $nom)) { |
| 2074 | - $nom = "'modeles/" . substr($nom, 1); |
|
| 2074 | + $nom = "'modeles/".substr($nom, 1); |
|
| 2075 | 2075 | } else { |
| 2076 | 2076 | $nom = "'modeles/' . $nom"; |
| 2077 | 2077 | } |
@@ -2088,8 +2088,8 @@ discard block |
||
| 2088 | 2088 | $primary = $p->boucles[$p->id_boucle]->primary; |
| 2089 | 2089 | if (!strpos($primary, ',')) { |
| 2090 | 2090 | $id = champ_sql($primary, $p); |
| 2091 | - $_contexte[] = "'$primary'=>" . $id; |
|
| 2092 | - $_contexte[] = "'id'=>" . $id; |
|
| 2091 | + $_contexte[] = "'$primary'=>".$id; |
|
| 2092 | + $_contexte[] = "'id'=>".$id; |
|
| 2093 | 2093 | } |
| 2094 | 2094 | } |
| 2095 | 2095 | $_contexte[] = "'recurs'=>(++\$recurs)"; |
@@ -2101,11 +2101,11 @@ discard block |
||
| 2101 | 2101 | $_options = memoriser_contexte_compil($p); |
| 2102 | 2102 | $_options = "'compil'=>array($_options), 'trim'=>true"; |
| 2103 | 2103 | if (isset($_contexte['ajax'])) { |
| 2104 | - $_options .= ', ' . preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']); |
|
| 2104 | + $_options .= ', '.preg_replace(',=>(.*)$,ims', '=> ($v=(\\1))?$v:true', $_contexte['ajax']); |
|
| 2105 | 2105 | unset($_contexte['ajax']); |
| 2106 | 2106 | } |
| 2107 | 2107 | |
| 2108 | - $_l = 'array(' . join(",\n\t", $_contexte) . ')'; |
|
| 2108 | + $_l = 'array('.join(",\n\t", $_contexte).')'; |
|
| 2109 | 2109 | if ($flag_env) { |
| 2110 | 2110 | $_l = "array_merge(\$Pile[0],$_l)"; |
| 2111 | 2111 | } |
@@ -2215,12 +2215,12 @@ discard block |
||
| 2215 | 2215 | function balise_DOUBLONS_dist($p) { |
| 2216 | 2216 | if ($type = interprete_argument_balise(1, $p)) { |
| 2217 | 2217 | if ($famille = interprete_argument_balise(2, $p)) { |
| 2218 | - $type .= '.' . $famille; |
|
| 2218 | + $type .= '.'.$famille; |
|
| 2219 | 2219 | } |
| 2220 | - $p->code = '(isset($doublons[' . $type . ']) ? $doublons[' . $type . '] : "")'; |
|
| 2220 | + $p->code = '(isset($doublons['.$type.']) ? $doublons['.$type.'] : "")'; |
|
| 2221 | 2221 | if (!$p->etoile) { |
| 2222 | 2222 | $p->code = 'array_filter(array_map("intval",explode(",",' |
| 2223 | - . $p->code . ')))'; |
|
| 2223 | + . $p->code.')))'; |
|
| 2224 | 2224 | } |
| 2225 | 2225 | } else { |
| 2226 | 2226 | $p->code = '$doublons'; |
@@ -2349,7 +2349,7 @@ discard block |
||
| 2349 | 2349 | $_code[] = "$_key => $_val"; |
| 2350 | 2350 | } |
| 2351 | 2351 | } while ($_key && $_val); |
| 2352 | - $p->code = 'array(' . join(', ', $_code) . ')'; |
|
| 2352 | + $p->code = 'array('.join(', ', $_code).')'; |
|
| 2353 | 2353 | $p->interdire_scripts = false; |
| 2354 | 2354 | |
| 2355 | 2355 | return $p; |
@@ -2376,7 +2376,7 @@ discard block |
||
| 2376 | 2376 | while ($_val = interprete_argument_balise($n++, $p)) { |
| 2377 | 2377 | $_code[] = $_val; |
| 2378 | 2378 | } |
| 2379 | - $p->code = 'array(' . join(', ', $_code) . ')'; |
|
| 2379 | + $p->code = 'array('.join(', ', $_code).')'; |
|
| 2380 | 2380 | $p->interdire_scripts = false; |
| 2381 | 2381 | |
| 2382 | 2382 | return $p; |
@@ -2421,10 +2421,10 @@ discard block |
||
| 2421 | 2421 | $_code[] = $_v; |
| 2422 | 2422 | } |
| 2423 | 2423 | |
| 2424 | - $p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser(' . join( |
|
| 2424 | + $p->code = '((function_exists("autoriser")||include_spip("inc/autoriser"))&&autoriser('.join( |
|
| 2425 | 2425 | ', ', |
| 2426 | 2426 | $_code |
| 2427 | - ) . ')?" ":"")'; |
|
| 2427 | + ).')?" ":"")'; |
|
| 2428 | 2428 | $p->interdire_scripts = false; |
| 2429 | 2429 | |
| 2430 | 2430 | return $p; |
@@ -2457,7 +2457,7 @@ discard block |
||
| 2457 | 2457 | $type_info = isset($type_info) ? str_replace('\'', '"', $type_info) : '"est_actif"'; |
| 2458 | 2458 | |
| 2459 | 2459 | $f = chercher_filtre('info_plugin'); |
| 2460 | - $p->code = $f . '(' . $plugin . ', ' . $type_info . ')'; |
|
| 2460 | + $p->code = $f.'('.$plugin.', '.$type_info.')'; |
|
| 2461 | 2461 | |
| 2462 | 2462 | return $p; |
| 2463 | 2463 | } |
@@ -2689,7 +2689,7 @@ discard block |
||
| 2689 | 2689 | } |
| 2690 | 2690 | |
| 2691 | 2691 | // Différentes infos relatives au tri présentes dans les modificateurs |
| 2692 | - $_tri_nom = $boucle->modificateur['tri_nom'] ; // nom du paramètre définissant le tri |
|
| 2692 | + $_tri_nom = $boucle->modificateur['tri_nom']; // nom du paramètre définissant le tri |
|
| 2693 | 2693 | $_tri_champ = $boucle->modificateur['tri_champ']; // champ actuel utilisé le tri |
| 2694 | 2694 | $_tri_sens = $boucle->modificateur['tri_sens']; // sens de tri actuel |
| 2695 | 2695 | $_tri_liste_sens_defaut = $boucle->modificateur['tri_liste_sens_defaut']; // sens par défaut pour chaque champ |
@@ -2784,7 +2784,7 @@ discard block |
||
| 2784 | 2784 | $connect = $p->boucles[$p->id_boucle]->sql_serveur; |
| 2785 | 2785 | } |
| 2786 | 2786 | |
| 2787 | - $p->code = '(objet_test_si_publie(' . $_type . ',intval(' . $_id . '),' . _q($connect) . ")?' ':'')"; |
|
| 2787 | + $p->code = '(objet_test_si_publie('.$_type.',intval('.$_id.'),'._q($connect).")?' ':'')"; |
|
| 2788 | 2788 | $p->interdire_scripts = false; |
| 2789 | 2789 | |
| 2790 | 2790 | return $p; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $nonce = random_bytes(\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); |
| 32 | 32 | $padded_message = sodium_pad($message, 16); |
| 33 | 33 | $encrypted = sodium_crypto_secretbox($padded_message, $nonce, $key); |
| 34 | - $encoded = base64_encode($salt . $nonce . $encrypted); |
|
| 34 | + $encoded = base64_encode($salt.$nonce.$encrypted); |
|
| 35 | 35 | sodium_memzero($key); |
| 36 | 36 | sodium_memzero($nonce); |
| 37 | 37 | sodium_memzero($salt); |
@@ -48,14 +48,14 @@ discard block |
||
| 48 | 48 | $decoded = base64_decode($encoded); |
| 49 | 49 | $salt = substr($decoded, 0, \SODIUM_CRYPTO_PWHASH_SALTBYTES); |
| 50 | 50 | $nonce = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES, \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); |
| 51 | - $encrypted = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES + \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); |
|
| 51 | + $encrypted = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES +\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); |
|
| 52 | 52 | $key = self::deriveKeyFromPassword($key, $salt); |
| 53 | 53 | $padded_message = sodium_crypto_secretbox_open($encrypted, $nonce, $key); |
| 54 | 54 | sodium_memzero($key); |
| 55 | 55 | sodium_memzero($nonce); |
| 56 | 56 | sodium_memzero($salt); |
| 57 | 57 | if ($padded_message === false) { |
| 58 | - spip_log("dechiffrer() chiffre corrompu `$encoded`", 'chiffrer' . _LOG_DEBUG); |
|
| 58 | + spip_log("dechiffrer() chiffre corrompu `$encoded`", 'chiffrer'._LOG_DEBUG); |
|
| 59 | 59 | return null; |
| 60 | 60 | } |
| 61 | 61 | $message = sodium_unpad($padded_message, 16); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $texte = $intro; |
| 85 | 85 | } else { |
| 86 | 86 | if ( |
| 87 | - strpos("\n" . $texte, "\n|") === false |
|
| 87 | + strpos("\n".$texte, "\n|") === false |
|
| 88 | 88 | and strlen($texte) > 2.5 * $longueur |
| 89 | 89 | ) { |
| 90 | 90 | if (strpos($texte, '<multi') !== false) { |
@@ -168,12 +168,12 @@ discard block |
||
| 168 | 168 | if ($pas < 1) { |
| 169 | 169 | return ''; |
| 170 | 170 | } |
| 171 | - $ancre = 'pagination' . $nom; // #pagination_articles |
|
| 172 | - $debut = 'debut' . $nom; // 'debut_articles' |
|
| 171 | + $ancre = 'pagination'.$nom; // #pagination_articles |
|
| 172 | + $debut = 'debut'.$nom; // 'debut_articles' |
|
| 173 | 173 | |
| 174 | 174 | // n'afficher l'ancre qu'une fois |
| 175 | 175 | if (!isset($ancres[$ancre])) { |
| 176 | - $bloc_ancre = $ancres[$ancre] = "<a id='" . $ancre . "' class='pagination_ancre'></a>"; |
|
| 176 | + $bloc_ancre = $ancres[$ancre] = "<a id='".$ancre."' class='pagination_ancre'></a>"; |
|
| 177 | 177 | } else { |
| 178 | 178 | $bloc_ancre = ''; |
| 179 | 179 | } |
@@ -205,8 +205,8 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | if ($modele) { |
| 207 | 207 | $pagination['type_pagination'] = $modele; |
| 208 | - if (trouver_fond('pagination_' . $modele, 'modeles')) { |
|
| 209 | - $modele = '_' . $modele; |
|
| 208 | + if (trouver_fond('pagination_'.$modele, 'modeles')) { |
|
| 209 | + $modele = '_'.$modele; |
|
| 210 | 210 | } |
| 211 | 211 | else { |
| 212 | 212 | $modele = ''; |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | function lister_objets_avec_logos($type) { |
| 292 | 292 | |
| 293 | 293 | $objet = objet_type($type); |
| 294 | - $ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote('logoon') . ' AND L.objet=' . sql_quote($objet)); |
|
| 294 | + $ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode='.sql_quote('logoon').' AND L.objet='.sql_quote($objet)); |
|
| 295 | 295 | if ($ids) { |
| 296 | 296 | $ids = array_column($ids, 'id_objet'); |
| 297 | 297 | return implode(',', $ids); |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | |
| 485 | 485 | // Classes : on indique le sens de tri et l'item exposé |
| 486 | 486 | if (!$is_sens_fixe) { |
| 487 | - $classe .= ' item-tri item-tri_' . ($tri_sens_actuel === 1 ? 'asc' : 'desc'); |
|
| 487 | + $classe .= ' item-tri item-tri_'.($tri_sens_actuel === 1 ? 'asc' : 'desc'); |
|
| 488 | 488 | } |
| 489 | 489 | if ($champ_ou_sens === $tri_champ) { |
| 490 | 490 | $classe .= ' item-tri_actif'; |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | */ |
| 524 | 524 | function tri_champ_order($t, $from = null, $senstri = '') { |
| 525 | 525 | if (strncmp($t, 'multi ', 6) == 0) { |
| 526 | - return 'multi' . $senstri; |
|
| 526 | + return 'multi'.$senstri; |
|
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | $champ = $t; |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | case 'sinum ': |
| 558 | 558 | return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}"; |
| 559 | 559 | default: |
| 560 | - return $champ . $senstri; |
|
| 560 | + return $champ.$senstri; |
|
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | 563 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $res['message_ok'] = _T('info_modification_enregistree'); |
| 101 | 101 | if ($retour) { |
| 102 | 102 | if (strncmp($retour, 'javascript:', 11) == 0) { |
| 103 | - $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>'; |
|
| 103 | + $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>'; |
|
| 104 | 104 | $res['editable'] = true; |
| 105 | 105 | } else { |
| 106 | 106 | $res['redirect'] = parametre_url($retour, $id_table_objet, $id); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | if (!isset($erreurs[$champ])) { |
| 141 | 141 | $erreurs[$champ] = ''; |
| 142 | 142 | } |
| 143 | - $erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>'; |
|
| 143 | + $erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | if ( |
| 221 | 221 | $config_fonc |
| 222 | 222 | and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
| 223 | - and $config_fonc !== $table_objet . '_edit_config' |
|
| 223 | + and $config_fonc !== $table_objet.'_edit_config' |
|
| 224 | 224 | ) { |
| 225 | 225 | if ( |
| 226 | 226 | $args = test_formulaire_inclus_par_modele() |
@@ -235,12 +235,12 @@ discard block |
||
| 235 | 235 | // Appel direct dans un squelette |
| 236 | 236 | if (!$row) { |
| 237 | 237 | if (!$new or $lier_trad) { |
| 238 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 238 | + if ($select = charger_fonction('precharger_'.$type, 'inc', true)) { |
|
| 239 | 239 | $row = $select($id, $id_parent, $lier_trad); |
| 240 | 240 | // si on a une fonction precharger, elle pu faire un reglage de langue |
| 241 | 241 | $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
| 242 | 242 | } else { |
| 243 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 243 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id)); |
|
| 244 | 244 | } |
| 245 | 245 | if (!$new) { |
| 246 | 246 | $md5 = controles_md5($row ?: []); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | if ($config_fonc) { |
| 291 | 291 | $contexte['config'] = $config = $config_fonc($contexte); |
| 292 | 292 | if (!$lang_default) { |
| 293 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 293 | + $lang_default = $config['langue'] ?? session_get('lang'); |
|
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | 296 | $config = $config + [ |
@@ -314,13 +314,12 @@ discard block |
||
| 314 | 314 | unset($contexte['lang']); |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 318 | - (!$lier_trad ? '' : |
|
| 319 | - ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 320 | - $lier_trad . |
|
| 321 | - "' />" . |
|
| 322 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 323 | - $lang_default . |
|
| 317 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n". |
|
| 318 | + (!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='". |
|
| 319 | + $lier_trad. |
|
| 320 | + "' />". |
|
| 321 | + "\n<input type='hidden' name='changer_lang' value='". |
|
| 322 | + $lang_default. |
|
| 324 | 323 | "' />")) |
| 325 | 324 | . $hidden |
| 326 | 325 | . ($md5 ?? ''); |
@@ -360,14 +359,14 @@ discard block |
||
| 360 | 359 | $aider = charger_fonction('aider', 'inc'); |
| 361 | 360 | if (strlen($texte) > 28 * 1024) { |
| 362 | 361 | $texte = str_replace("\r\n", "\n", $texte); |
| 363 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 362 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 364 | 363 | if ($pos > 0 and $pos < 32 * 1024) { |
| 365 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 364 | + $debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n"; |
|
| 366 | 365 | $suite = substr($texte, $pos + 2); |
| 367 | 366 | } else { |
| 368 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 367 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 369 | 368 | if (!($pos > 0 and $pos < 32 * 1024)) { |
| 370 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 369 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 371 | 370 | $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
| 372 | 371 | } else { |
| 373 | 372 | $decalage = 1; |
@@ -398,13 +397,13 @@ discard block |
||
| 398 | 397 | } |
| 399 | 398 | |
| 400 | 399 | include_spip('inc/barre'); |
| 401 | - $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 400 | + $textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n"; |
|
| 402 | 401 | $nombre = 0; |
| 403 | 402 | |
| 404 | 403 | while (strlen($texte) > 29 * 1024) { |
| 405 | 404 | $nombre++; |
| 406 | 405 | [$texte1, $texte] = coupe_trop_long($texte); |
| 407 | - $textes_supplement .= '<br />' . |
|
| 406 | + $textes_supplement .= '<br />'. |
|
| 408 | 407 | "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
| 409 | 408 | } |
| 410 | 409 | |
@@ -487,7 +486,7 @@ discard block |
||
| 487 | 486 | $ctr = []; |
| 488 | 487 | foreach ($data as $key => $val) { |
| 489 | 488 | $m = md5($val ?? ''); |
| 490 | - $k = $prefixe . $key; |
|
| 489 | + $k = $prefixe.$key; |
|
| 491 | 490 | |
| 492 | 491 | switch ($format) { |
| 493 | 492 | case 'html': |
@@ -500,7 +499,7 @@ discard block |
||
| 500 | 499 | } |
| 501 | 500 | |
| 502 | 501 | if ($format === 'html') { |
| 503 | - return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 502 | + return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n"; |
|
| 504 | 503 | } else { |
| 505 | 504 | return $ctr; |
| 506 | 505 | } |
@@ -652,7 +651,7 @@ discard block |
||
| 652 | 651 | // On elimine les donnees non modifiees par le formulaire (mais |
| 653 | 652 | // potentiellement modifiees entre temps par un autre utilisateur) |
| 654 | 653 | foreach ($champs as $key => $val) { |
| 655 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 654 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 656 | 655 | if (is_scalar($val) and $m == md5($val)) { |
| 657 | 656 | unset($champs[$key]); |
| 658 | 657 | } |
@@ -681,7 +680,7 @@ discard block |
||
| 681 | 680 | // de conflit. |
| 682 | 681 | $ctrh = $ctrq = $conflits = []; |
| 683 | 682 | foreach (array_keys($champs) as $key) { |
| 684 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 683 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 685 | 684 | $ctrh[$key] = $m; |
| 686 | 685 | $ctrq[] = $key; |
| 687 | 686 | } |
@@ -715,8 +714,8 @@ discard block |
||
| 715 | 714 | */ |
| 716 | 715 | function display_conflit_champ($x) { |
| 717 | 716 | if (strstr($x, "\n") or strlen($x) > 80) { |
| 718 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 717 | + return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n"; |
|
| 719 | 718 | } else { |
| 720 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 719 | + return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n"; |
|
| 721 | 720 | } |
| 722 | 721 | } |