@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $les_couleurs = $couleurs(); |
| 46 | 46 | foreach ($les_couleurs as $k => $c) { |
| 47 | 47 | $valeurs['_couleurs_url'][$k] = generer_url_public('style_prive.css', 'ltr=' |
| 48 | - . $GLOBALS['spip_lang_left'] . '&' |
|
| 48 | + . $GLOBALS['spip_lang_left'].'&' |
|
| 49 | 49 | . $couleurs($k)); |
| 50 | 50 | $valeurs['couleurs'][$k] = $c; |
| 51 | 51 | } |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | $blue = dechex($blue); |
| 45 | 45 | |
| 46 | 46 | if (strlen($red) == 1) { |
| 47 | - $red = "0" . $red; |
|
| 47 | + $red = "0".$red; |
|
| 48 | 48 | } |
| 49 | 49 | if (strlen($green) == 1) { |
| 50 | - $green = "0" . $green; |
|
| 50 | + $green = "0".$green; |
|
| 51 | 51 | } |
| 52 | 52 | if (strlen($blue) == 1) { |
| 53 | - $blue = "0" . $blue; |
|
| 53 | + $blue = "0".$blue; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return "$red$green$blue"; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $couleur = couleur_html_to_hex($couleur); |
| 69 | 69 | $couleur = ltrim($couleur, '#'); |
| 70 | 70 | if (strlen($couleur) === 3) { |
| 71 | - $couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2]; |
|
| 71 | + $couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2]; |
|
| 72 | 72 | } |
| 73 | 73 | $retour = []; |
| 74 | 74 | $retour["red"] = hexdec(substr($couleur, 0, 2)); |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | $var_G = ($G / 255); |
| 126 | 126 | $var_B = ($B / 255); |
| 127 | 127 | |
| 128 | - $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 129 | - $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 130 | - $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 128 | + $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 129 | + $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 130 | + $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 131 | 131 | |
| 132 | 132 | $L = ($var_Max + $var_Min) / 2; |
| 133 | 133 | |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | and $extension = _image_trouver_extension_depuis_mime("image/".$regs[1]) |
| 322 | 322 | and in_array($extension, _image_extensions_acceptees_en_entree()) |
| 323 | 323 | ) { |
| 324 | - $local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension); |
|
| 324 | + $local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension); |
|
| 325 | 325 | if (!file_exists($local)) { |
| 326 | 326 | ecrire_fichier($local, base64_decode($regs[2])); |
| 327 | 327 | } |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | // les protocoles web prennent au moins 3 lettres |
| 336 | 336 | if (tester_url_absolue($source)) { |
| 337 | 337 | include_spip('inc/distant'); |
| 338 | - $fichier = _DIR_RACINE . copie_locale($source); |
|
| 338 | + $fichier = _DIR_RACINE.copie_locale($source); |
|
| 339 | 339 | if (!$fichier) { |
| 340 | 340 | return ""; |
| 341 | 341 | } |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | |
| 361 | 361 | if ($forcer_format !== false |
| 362 | 362 | // ignorer forcer_format si on a une image svg, que le filtre appelant ne supporte pas SVG, et que le forcage est un autre format image |
| 363 | - and ($terminaison_dest !== 'svg' or $support_svg or !in_array($forcer_format,_image_extensions_acceptees_en_sortie()))) { |
|
| 363 | + and ($terminaison_dest !== 'svg' or $support_svg or !in_array($forcer_format, _image_extensions_acceptees_en_sortie()))) { |
|
| 364 | 364 | $terminaison_dest = $forcer_format; |
| 365 | 365 | } |
| 366 | 366 | |
@@ -422,9 +422,9 @@ discard block |
||
| 422 | 422 | // on garde la terminaison initiale car image simplement copiee |
| 423 | 423 | // et on postfixe son nom avec un md5 du path |
| 424 | 424 | $terminaison_dest = $terminaison; |
| 425 | - $fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5); |
|
| 425 | + $fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5); |
|
| 426 | 426 | } else { |
| 427 | - $fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5); |
|
| 427 | + $fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5); |
|
| 428 | 428 | } |
| 429 | 429 | $cache = sous_repertoire(_DIR_VAR, $cache); |
| 430 | 430 | $cache = sous_repertoire($cache, $effet); |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | $fichier_dest = substr($fichier_dest, 2); |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | - $fichier_dest = $cache . $fichier_dest . "." . $terminaison_dest; |
|
| 438 | + $fichier_dest = $cache.$fichier_dest.".".$terminaison_dest; |
|
| 439 | 439 | |
| 440 | 440 | $GLOBALS["images_calculees"][] = $fichier_dest; |
| 441 | 441 | |
@@ -471,14 +471,14 @@ discard block |
||
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | if ($creer) { |
| 474 | - spip_log("filtre image " . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier", |
|
| 475 | - "images" . _LOG_DEBUG); |
|
| 474 | + spip_log("filtre image ".($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier", |
|
| 475 | + "images"._LOG_DEBUG); |
|
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | $term_fonction = _image_trouver_extension_pertinente($fichier); |
| 479 | - $ret["fonction_imagecreatefrom"] = "_imagecreatefrom" . $term_fonction; |
|
| 479 | + $ret["fonction_imagecreatefrom"] = "_imagecreatefrom".$term_fonction; |
|
| 480 | 480 | $ret["fichier"] = $fichier; |
| 481 | - $ret["fonction_image"] = "_image_image" . $terminaison_dest; |
|
| 481 | + $ret["fonction_image"] = "_image_image".$terminaison_dest; |
|
| 482 | 482 | $ret["fichier_dest"] = $fichier_dest; |
| 483 | 483 | $ret["format_source"] = _image_extension_normalisee($terminaison); |
| 484 | 484 | $ret["format_dest"] = $terminaison_dest; |
@@ -552,9 +552,9 @@ discard block |
||
| 552 | 552 | /** |
| 553 | 553 | * @return array|string[]|null |
| 554 | 554 | */ |
| 555 | -function _image_extensions_acceptees_en_sortie(){ |
|
| 555 | +function _image_extensions_acceptees_en_sortie() { |
|
| 556 | 556 | static $extensions = null; |
| 557 | - if (empty($extensions)){ |
|
| 557 | + if (empty($extensions)) { |
|
| 558 | 558 | $extensions = _image_extensions_acceptees_en_entree(); |
| 559 | 559 | $extensions = array_diff($extensions, ['jpeg']); |
| 560 | 560 | if (in_array('gif', $extensions) and !function_exists('imagegif')) { |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | return $extensions; |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | -function _image_extension_normalisee($extension){ |
|
| 571 | +function _image_extension_normalisee($extension) { |
|
| 572 | 572 | $extension = strtolower($extension); |
| 573 | 573 | if ($extension === 'jpeg') { |
| 574 | 574 | $extension = 'jpg'; |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | return $extension; |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | -function _image_extensions_conservent_transparence(){ |
|
| 579 | +function _image_extensions_conservent_transparence() { |
|
| 580 | 580 | return ['png', 'webp']; |
| 581 | 581 | } |
| 582 | 582 | |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | |
| 627 | 627 | $_terminaison = _image_trouver_extension_depuis_mime($mime); |
| 628 | 628 | if ($_terminaison and $_terminaison !== $terminaison) { |
| 629 | - spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", "images." . _LOG_INFO_IMPORTANTE); |
|
| 629 | + spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", "images."._LOG_INFO_IMPORTANTE); |
|
| 630 | 630 | $terminaison = $_terminaison; |
| 631 | 631 | } |
| 632 | 632 | return $terminaison; |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | if (!function_exists('imagepng')) { |
| 784 | 784 | return false; |
| 785 | 785 | } |
| 786 | - $tmp = $fichier . ".tmp"; |
|
| 786 | + $tmp = $fichier.".tmp"; |
|
| 787 | 787 | $ret = imagepng($img, $tmp); |
| 788 | 788 | if (file_exists($tmp)) { |
| 789 | 789 | $taille_test = getimagesize($tmp); |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | if (!function_exists('imagegif')) { |
| 819 | 819 | return false; |
| 820 | 820 | } |
| 821 | - $tmp = $fichier . ".tmp"; |
|
| 821 | + $tmp = $fichier.".tmp"; |
|
| 822 | 822 | $ret = imagegif($img, $tmp); |
| 823 | 823 | if (file_exists($tmp)) { |
| 824 | 824 | $taille_test = getimagesize($tmp); |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | if (!function_exists('imagejpeg')) { |
| 859 | 859 | return false; |
| 860 | 860 | } |
| 861 | - $tmp = $fichier . ".tmp"; |
|
| 861 | + $tmp = $fichier.".tmp"; |
|
| 862 | 862 | |
| 863 | 863 | // Enable interlancing |
| 864 | 864 | imageinterlace($img, true); |
@@ -919,7 +919,7 @@ discard block |
||
| 919 | 919 | if (!function_exists('imagewebp')) { |
| 920 | 920 | return false; |
| 921 | 921 | } |
| 922 | - $tmp = $fichier . ".tmp"; |
|
| 922 | + $tmp = $fichier.".tmp"; |
|
| 923 | 923 | $ret = imagewebp($img, $tmp, $qualite); |
| 924 | 924 | if (file_exists($tmp)) { |
| 925 | 925 | $taille_test = getimagesize($tmp); |
@@ -953,7 +953,7 @@ discard block |
||
| 953 | 953 | */ |
| 954 | 954 | function _image_imagesvg($img, $fichier) { |
| 955 | 955 | |
| 956 | - $tmp = $fichier . ".tmp"; |
|
| 956 | + $tmp = $fichier.".tmp"; |
|
| 957 | 957 | if (strpos($img, "<") === false) { |
| 958 | 958 | $img = supprimer_timestamp($img); |
| 959 | 959 | if (!file_exists($img)) { |
@@ -1010,13 +1010,13 @@ discard block |
||
| 1010 | 1010 | */ |
| 1011 | 1011 | function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) { |
| 1012 | 1012 | if (is_null($fonction)) { |
| 1013 | - $fonction = "_image_image" . $valeurs['format_dest']; |
|
| 1013 | + $fonction = "_image_image".$valeurs['format_dest']; |
|
| 1014 | 1014 | } |
| 1015 | 1015 | $ret = false; |
| 1016 | 1016 | #un flag pour reperer les images gravees |
| 1017 | 1017 | $lock = |
| 1018 | 1018 | !statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout |
| 1019 | - or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src')); |
|
| 1019 | + or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src')); |
|
| 1020 | 1020 | if ( |
| 1021 | 1021 | function_exists($fonction) |
| 1022 | 1022 | && ($ret = $fonction($img, $valeurs['fichier_dest'], $qualite)) # on a reussi a creer l'image |
@@ -1027,7 +1027,7 @@ discard block |
||
| 1027 | 1027 | // dans tous les cas mettre a jour la taille de l'image finale |
| 1028 | 1028 | list($valeurs["hauteur_dest"], $valeurs["largeur_dest"]) = taille_image($valeurs['fichier_dest']); |
| 1029 | 1029 | $valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition |
| 1030 | - ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true); |
|
| 1030 | + ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true); |
|
| 1031 | 1031 | } |
| 1032 | 1032 | } |
| 1033 | 1033 | |
@@ -1046,7 +1046,7 @@ discard block |
||
| 1046 | 1046 | function reconstruire_image_intermediaire($fichier_manquant) { |
| 1047 | 1047 | $reconstruire = array(); |
| 1048 | 1048 | $fichier = $fichier_manquant; |
| 1049 | - while (strpos($fichier,"://")===false |
|
| 1049 | + while (strpos($fichier, "://") === false |
|
| 1050 | 1050 | and !@file_exists($fichier) |
| 1051 | 1051 | and lire_fichier($src = "$fichier.src", $source) |
| 1052 | 1052 | and $valeurs = unserialize($source) |
@@ -1083,7 +1083,7 @@ discard block |
||
| 1083 | 1083 | * Chemin du fichier d'image calculé |
| 1084 | 1084 | **/ |
| 1085 | 1085 | function ramasse_miettes($fichier) { |
| 1086 | - if (strpos($fichier,"://")!==false |
|
| 1086 | + if (strpos($fichier, "://") !== false |
|
| 1087 | 1087 | or !lire_fichier($src = "$fichier.src", $source) |
| 1088 | 1088 | or !$valeurs = unserialize($source) |
| 1089 | 1089 | ) { |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | } |
| 1140 | 1140 | # si jamais le fichier final n'a pas ete calcule car suppose temporaire |
| 1141 | 1141 | # et qu'il ne s'agit pas d'une URL |
| 1142 | - if (strpos($fichier,"://")===false and !@file_exists($fichier)) { |
|
| 1142 | + if (strpos($fichier, "://") === false and !@file_exists($fichier)) { |
|
| 1143 | 1143 | reconstruire_image_intermediaire($fichier); |
| 1144 | 1144 | } |
| 1145 | 1145 | ramasse_miettes($fichier); |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | |
| 1237 | 1237 | // attributs deprecies. Transformer en CSS |
| 1238 | 1238 | if ($espace = extraire_attribut($tag, 'hspace')) { |
| 1239 | - $style = "margin:${espace}px;" . $style; |
|
| 1239 | + $style = "margin:${espace}px;".$style; |
|
| 1240 | 1240 | $tag = inserer_attribut($tag, 'hspace', ''); |
| 1241 | 1241 | } |
| 1242 | 1242 | |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | $image = $valeurs['fichier']; |
| 1361 | 1361 | $format = $valeurs['format_source']; |
| 1362 | 1362 | $destdir = dirname($valeurs['fichier_dest']); |
| 1363 | - $destfile = basename($valeurs['fichier_dest'], "." . $valeurs["format_dest"]); |
|
| 1363 | + $destfile = basename($valeurs['fichier_dest'], ".".$valeurs["format_dest"]); |
|
| 1364 | 1364 | |
| 1365 | 1365 | $format_sortie = $valeurs['format_dest']; |
| 1366 | 1366 | |
@@ -1392,14 +1392,14 @@ discard block |
||
| 1392 | 1392 | |
| 1393 | 1393 | // Si l'image est de la taille demandee (ou plus petite), simplement la retourner |
| 1394 | 1394 | if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) { |
| 1395 | - $vignette = $destination . '.' . $format; |
|
| 1395 | + $vignette = $destination.'.'.$format; |
|
| 1396 | 1396 | @copy($image, $vignette); |
| 1397 | 1397 | } |
| 1398 | 1398 | |
| 1399 | 1399 | elseif ($valeurs["format_source"] === 'svg') { |
| 1400 | - if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)){ |
|
| 1400 | + if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
|
| 1401 | 1401 | $format_sortie = 'svg'; |
| 1402 | - $vignette = $destination . "." . $format_sortie; |
|
| 1402 | + $vignette = $destination.".".$format_sortie; |
|
| 1403 | 1403 | $valeurs['fichier_dest'] = $vignette; |
| 1404 | 1404 | _image_gd_output($svg, $valeurs); |
| 1405 | 1405 | } |
@@ -1411,9 +1411,9 @@ discard block |
||
| 1411 | 1411 | define('_CONVERT_COMMAND', 'convert'); |
| 1412 | 1412 | } // Securite : mes_options.php peut preciser le chemin absolu |
| 1413 | 1413 | if (!defined('_RESIZE_COMMAND')) { |
| 1414 | - define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest'); |
|
| 1414 | + define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest'); |
|
| 1415 | 1415 | } |
| 1416 | - $vignette = $destination . "." . $format_sortie; |
|
| 1416 | + $vignette = $destination.".".$format_sortie; |
|
| 1417 | 1417 | $commande = str_replace( |
| 1418 | 1418 | array('%x', '%y', '%src', '%dest'), |
| 1419 | 1419 | array( |
@@ -1428,13 +1428,13 @@ discard block |
||
| 1428 | 1428 | if (!@file_exists($vignette)) { |
| 1429 | 1429 | spip_log("echec convert sur $vignette"); |
| 1430 | 1430 | |
| 1431 | - return; // echec commande |
|
| 1431 | + return; // echec commande |
|
| 1432 | 1432 | } |
| 1433 | 1433 | } |
| 1434 | 1434 | |
| 1435 | 1435 | // php5 imagemagick |
| 1436 | 1436 | elseif ($process == 'imagick') { |
| 1437 | - $vignette = "$destination." . $format_sortie; |
|
| 1437 | + $vignette = "$destination.".$format_sortie; |
|
| 1438 | 1438 | |
| 1439 | 1439 | if (!class_exists('Imagick')) { |
| 1440 | 1440 | spip_log("Classe Imagick absente !", _LOG_ERREUR); |
@@ -1444,7 +1444,7 @@ discard block |
||
| 1444 | 1444 | $imagick = new Imagick(); |
| 1445 | 1445 | $imagick->readImage($image); |
| 1446 | 1446 | $imagick->resizeImage($destWidth, $destHeight, Imagick::FILTER_LANCZOS, |
| 1447 | - 1);//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1447 | + 1); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1448 | 1448 | $imagick->writeImage($vignette); |
| 1449 | 1449 | |
| 1450 | 1450 | if (!@file_exists($vignette)) { |
@@ -1462,12 +1462,12 @@ discard block |
||
| 1462 | 1462 | if (_PNMSCALE_COMMAND == '') { |
| 1463 | 1463 | return; |
| 1464 | 1464 | } |
| 1465 | - $vignette = $destination . "." . $format_sortie; |
|
| 1465 | + $vignette = $destination.".".$format_sortie; |
|
| 1466 | 1466 | $pnmtojpeg_command = str_replace("pnmscale", "pnmtojpeg", _PNMSCALE_COMMAND); |
| 1467 | 1467 | if ($format == "jpg") { |
| 1468 | 1468 | |
| 1469 | 1469 | $jpegtopnm_command = str_replace("pnmscale", "jpegtopnm", _PNMSCALE_COMMAND); |
| 1470 | - exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1470 | + exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1471 | 1471 | if (!($s = @filesize($vignette))) { |
| 1472 | 1472 | spip_unlink($vignette); |
| 1473 | 1473 | } |
@@ -1479,7 +1479,7 @@ discard block |
||
| 1479 | 1479 | } else { |
| 1480 | 1480 | if ($format == "gif") { |
| 1481 | 1481 | $giftopnm_command = str_replace("pnmscale", "giftopnm", _PNMSCALE_COMMAND); |
| 1482 | - exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1482 | + exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1483 | 1483 | if (!($s = @filesize($vignette))) { |
| 1484 | 1484 | spip_unlink($vignette); |
| 1485 | 1485 | } |
@@ -1491,7 +1491,7 @@ discard block |
||
| 1491 | 1491 | } else { |
| 1492 | 1492 | if ($format == "png") { |
| 1493 | 1493 | $pngtopnm_command = str_replace("pnmscale", "pngtopnm", _PNMSCALE_COMMAND); |
| 1494 | - exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1494 | + exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1495 | 1495 | if (!($s = @filesize($vignette))) { |
| 1496 | 1496 | spip_unlink($vignette); |
| 1497 | 1497 | } |
@@ -1513,7 +1513,7 @@ discard block |
||
| 1513 | 1513 | return; |
| 1514 | 1514 | } |
| 1515 | 1515 | if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) { |
| 1516 | - spip_log("vignette gd1/gd2 impossible : " . $srcWidth * $srcHeight . "pixels"); |
|
| 1516 | + spip_log("vignette gd1/gd2 impossible : ".$srcWidth * $srcHeight."pixels"); |
|
| 1517 | 1517 | |
| 1518 | 1518 | return; |
| 1519 | 1519 | } |
@@ -1818,7 +1818,7 @@ discard block |
||
| 1818 | 1818 | // de l'image, de facon a tromper le cache du navigateur |
| 1819 | 1819 | // quand on fait supprimer/reuploader un logo |
| 1820 | 1820 | // (pas de filemtime si SAFE MODE) |
| 1821 | - $date = test_espace_prive() ? ('?' . $date) : ''; |
|
| 1821 | + $date = test_espace_prive() ? ('?'.$date) : ''; |
|
| 1822 | 1822 | |
| 1823 | 1823 | return _image_ecrire_tag($image, array('src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight)); |
| 1824 | 1824 | } |
@@ -1865,7 +1865,7 @@ discard block |
||
| 1865 | 1865 | public static function LittleEndian2String($number, $minbytes = 1) { |
| 1866 | 1866 | $intstring = ''; |
| 1867 | 1867 | while ($number > 0) { |
| 1868 | - $intstring = $intstring . chr($number & 255); |
|
| 1868 | + $intstring = $intstring.chr($number & 255); |
|
| 1869 | 1869 | $number >>= 8; |
| 1870 | 1870 | } |
| 1871 | 1871 | |
@@ -1898,9 +1898,9 @@ discard block |
||
| 1898 | 1898 | $b = $argb['blue']; |
| 1899 | 1899 | |
| 1900 | 1900 | if ($bpp[$key] == 32) { |
| 1901 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a); |
|
| 1901 | + $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a); |
|
| 1902 | 1902 | } elseif ($bpp[$key] == 24) { |
| 1903 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r); |
|
| 1903 | + $icXOR[$key] .= chr($b).chr($g).chr($r); |
|
| 1904 | 1904 | } |
| 1905 | 1905 | |
| 1906 | 1906 | if ($a < 128) { |
@@ -1928,44 +1928,44 @@ discard block |
||
| 1928 | 1928 | |
| 1929 | 1929 | // BITMAPINFOHEADER - 40 bytes |
| 1930 | 1930 | $BitmapInfoHeader[$key] = ''; |
| 1931 | - $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1932 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1931 | + $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1932 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1933 | 1933 | // The biHeight member specifies the combined |
| 1934 | 1934 | // height of the XOR and AND masks. |
| 1935 | 1935 | $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG biHeight; |
| 1936 | - $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1937 | - $BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00"; // wBitCount; |
|
| 1938 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1939 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1940 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1941 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1942 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1943 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1936 | + $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1937 | + $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount; |
|
| 1938 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1939 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1940 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1941 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1942 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1943 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1944 | 1944 | } |
| 1945 | 1945 | |
| 1946 | 1946 | |
| 1947 | - $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1948 | - $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1949 | - $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1947 | + $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1948 | + $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1949 | + $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1950 | 1950 | |
| 1951 | 1951 | $dwImageOffset = 6 + (count($gd_image_array) * 16); |
| 1952 | 1952 | foreach ($gd_image_array as $key => $gd_image) { |
| 1953 | 1953 | // ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) |
| 1954 | 1954 | |
| 1955 | - $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1956 | - $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1957 | - $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1958 | - $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1955 | + $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1956 | + $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1957 | + $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1958 | + $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1959 | 1959 | |
| 1960 | - $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1961 | - $icondata .= chr($bpp[$key]) . "\x00"; // wBitCount; // Bits per pixel |
|
| 1960 | + $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1961 | + $icondata .= chr($bpp[$key])."\x00"; // wBitCount; // Bits per pixel |
|
| 1962 | 1962 | |
| 1963 | 1963 | $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]); |
| 1964 | 1964 | $icondata .= phpthumb_functions::LittleEndian2String($dwBytesInRes, |
| 1965 | - 4); // dwBytesInRes; // How many bytes in this resource? |
|
| 1965 | + 4); // dwBytesInRes; // How many bytes in this resource? |
|
| 1966 | 1966 | |
| 1967 | 1967 | $icondata .= phpthumb_functions::LittleEndian2String($dwImageOffset, |
| 1968 | - 4); // dwImageOffset; // Where in the file is this image? |
|
| 1968 | + 4); // dwImageOffset; // Where in the file is this image? |
|
| 1969 | 1969 | $dwImageOffset += strlen($BitmapInfoHeader[$key]); |
| 1970 | 1970 | $dwImageOffset += strlen($icXOR[$key]); |
| 1971 | 1971 | $dwImageOffset += strlen($icAND[$key]); |
@@ -66,13 +66,13 @@ |
||
| 66 | 66 | // compat < SPIP 3.3 |
| 67 | 67 | include_spip('inc/filtres_images_mini'); |
| 68 | 68 | $c["couleur_foncee"] = $c["couleur_theme"]; |
| 69 | - $c["couleur_claire"] = '#' . couleur_eclaircir($c["couleur_theme"], .5); |
|
| 69 | + $c["couleur_claire"] = '#'.couleur_eclaircir($c["couleur_theme"], .5); |
|
| 70 | 70 | |
| 71 | 71 | return |
| 72 | - 'couleur_theme=' . substr($c['couleur_theme'], 1) |
|
| 72 | + 'couleur_theme='.substr($c['couleur_theme'], 1) |
|
| 73 | 73 | // compat < SPIP 3.3 |
| 74 | - . '&couleur_claire=' . substr($c['couleur_claire'], 1) |
|
| 75 | - . '&couleur_foncee=' . substr($c['couleur_foncee'], 1); |
|
| 74 | + . '&couleur_claire='.substr($c['couleur_claire'], 1) |
|
| 75 | + . '&couleur_foncee='.substr($c['couleur_foncee'], 1); |
|
| 76 | 76 | } else { |
| 77 | 77 | if (is_array($choix)) { |
| 78 | 78 | // compat < SPIP 3.3 |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $titre = "[" |
| 91 | 91 | . $nom_site_spip |
| 92 | 92 | . "]" |
| 93 | - . ($titre ? " " . textebrut(typo($titre)) : ""); |
|
| 93 | + . ($titre ? " ".textebrut(typo($titre)) : ""); |
|
| 94 | 94 | |
| 95 | 95 | return _DOCTYPE_ECRIRE |
| 96 | 96 | . html_lang_attributes() |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | function init_body($rubrique = 'accueil', $sous_rubrique = 'accueil', $id_rubrique = '', $menu = true) { |
| 134 | 134 | |
| 135 | 135 | $res = pipeline('body_prive', "<body class='" |
| 136 | - . init_body_class() . " " . _request('exec') . "'" |
|
| 136 | + . init_body_class()." "._request('exec')."'" |
|
| 137 | 137 | . ($GLOBALS['spip_lang_rtl'] ? " dir='rtl'" : "") |
| 138 | 138 | . '>'); |
| 139 | 139 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $couleur = isset($prefs['couleur']) ? (int) $prefs['couleur'] : 9; |
| 178 | 178 | |
| 179 | - $classes = $GLOBALS['spip_ecran'] . " spip-theme-colors-$couleur $spip_display_navigation $spip_display_outils " . $display_class[$GLOBALS['spip_display']]; |
|
| 179 | + $classes = $GLOBALS['spip_ecran']." spip-theme-colors-$couleur $spip_display_navigation $spip_display_outils ".$display_class[$GLOBALS['spip_display']]; |
|
| 180 | 180 | return spip_sanitize_classname($classes); |
| 181 | 181 | } |
| 182 | 182 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | // ceci est la RegExp NO_REAL_NAME faisant hurler SpamAssassin |
| 136 | 136 | if (preg_match('/^["\s]*\<?\S+\@\S+\>?\s*$/', $from)) { |
| 137 | - $from .= ' (' . str_replace(')', '', translitteration(str_replace('@', ' at ', $from))) . ')'; |
|
| 137 | + $from .= ' ('.str_replace(')', '', translitteration(str_replace('@', ' at ', $from))).')'; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | // nettoyer les é ’, &emdash; etc... |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | if (!_TEST_EMAIL_DEST) { |
| 172 | 172 | return false; |
| 173 | 173 | } else { |
| 174 | - $texte = "Dest : $destinataire\r\n" . $texte; |
|
| 174 | + $texte = "Dest : $destinataire\r\n".$texte; |
|
| 175 | 175 | $destinataire = _TEST_EMAIL_DEST; |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | // Ajouter le Content-Type et consort s'il n'y est pas deja |
| 196 | 196 | if (strpos($headers, 'Content-Type: ') === false) { |
| 197 | 197 | $type = |
| 198 | - "Content-Type: text/plain;charset=\"$charset\";\n" . |
|
| 198 | + "Content-Type: text/plain;charset=\"$charset\";\n". |
|
| 199 | 199 | "Content-Transfer-Encoding: 8bit\n"; |
| 200 | 200 | } else { |
| 201 | 201 | $type = ''; |
@@ -209,15 +209,15 @@ discard block |
||
| 209 | 209 | else { |
| 210 | 210 | $domain = "@unknown-".md5($from).'.org'; |
| 211 | 211 | } |
| 212 | - $uniq = rand() . '_' . md5($to . $texte) . $domain; |
|
| 212 | + $uniq = rand().'_'.md5($to.$texte).$domain; |
|
| 213 | 213 | |
| 214 | 214 | // Si multi-part, s'en servir comme borne ... |
| 215 | 215 | if ($parts) { |
| 216 | - $texte = "--$uniq\n$type\n" . $texte . "\n"; |
|
| 216 | + $texte = "--$uniq\n$type\n".$texte."\n"; |
|
| 217 | 217 | foreach ($parts as $part) { |
| 218 | - $n = strlen($part[1]) . ($part[0] ? "\n" : ''); |
|
| 218 | + $n = strlen($part[1]).($part[0] ? "\n" : ''); |
|
| 219 | 219 | $e = join("\n", $part[0]); |
| 220 | - $texte .= "\n--$uniq\nContent-Length: $n$e\n\n" . $part[1]; |
|
| 220 | + $texte .= "\n--$uniq\nContent-Length: $n$e\n\n".$part[1]; |
|
| 221 | 221 | } |
| 222 | 222 | $texte .= "\n\n--$uniq--\n"; |
| 223 | 223 | // Si boundary n'est pas entre guillemets, |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | // .. et s'en servir pour plaire a SpamAssassin |
| 229 | 229 | |
| 230 | - $mid = 'Message-Id: <' . $uniq . '>'; |
|
| 230 | + $mid = 'Message-Id: <'.$uniq.'>'; |
|
| 231 | 231 | |
| 232 | 232 | // indispensable pour les sites qui collent d'office From: serveur-http |
| 233 | 233 | // sauf si deja mis par l'envoyeur |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * Mot de passe |
| 32 | 32 | **/ |
| 33 | 33 | function creer_pass_aleatoire($longueur = 16, $sel = '') { |
| 34 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 34 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 35 | 35 | |
| 36 | 36 | mt_srand($seed); |
| 37 | 37 | srand($seed); |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | if (!$s) { |
| 44 | 44 | $s = rand(); |
| 45 | 45 | } |
| 46 | - $s = substr(md5(uniqid($s) . $sel), 0, 16); |
|
| 46 | + $s = substr(md5(uniqid($s).$sel), 0, 16); |
|
| 47 | 47 | } |
| 48 | - $r = unpack('Cr', pack('H2', $s . $s)); |
|
| 48 | + $r = unpack('Cr', pack('H2', $s.$s)); |
|
| 49 | 49 | $x = $r['r'] & 63; |
| 50 | 50 | if ($x < 10) { |
| 51 | 51 | $x = chr($x + 48); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | static $seeded; |
| 84 | 84 | |
| 85 | 85 | if (!$seeded) { |
| 86 | - $seed = (int)round(((float)microtime() + 1) * time()); |
|
| 86 | + $seed = (int) round(((float) microtime() + 1) * time()); |
|
| 87 | 87 | mt_srand($seed); |
| 88 | 88 | srand($seed); |
| 89 | 89 | $seeded = true; |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | foreach ($args as $val => $var) { |
| 193 | 193 | if ($var) { |
| 194 | 194 | if ($val <> 'statut') { |
| 195 | - $a .= ':' . $val . '-' . $var; |
|
| 195 | + $a .= ':'.$val.'-'.$var; |
|
| 196 | 196 | } |
| 197 | - $b .= $val . '=' . $var . '&'; |
|
| 197 | + $b .= $val.'='.$var.'&'; |
|
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | $a = substr($a, 1); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | * Clé |
| 225 | 225 | **/ |
| 226 | 226 | function afficher_low_sec($id_auteur, $action = '') { |
| 227 | - return substr(md5($action . low_sec($id_auteur)), 0, 8); |
|
| 227 | + return substr(md5($action.low_sec($id_auteur)), 0, 8); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | function initialiser_sel() { |
| 267 | 267 | if (!isset($GLOBALS['htsalt'])) { |
| 268 | 268 | if (CRYPT_MD5) { |
| 269 | - $GLOBALS['htsalt'] = '$1$' . creer_pass_aleatoire(); |
|
| 269 | + $GLOBALS['htsalt'] = '$1$'.creer_pass_aleatoire(); |
|
| 270 | 270 | } else { |
| 271 | 271 | $GLOBALS['htsalt'] = ''; |
| 272 | 272 | } |
@@ -288,8 +288,8 @@ discard block |
||
| 288 | 288 | * - void sinon. |
| 289 | 289 | **/ |
| 290 | 290 | function ecrire_acces() { |
| 291 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 292 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 291 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 292 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 293 | 293 | |
| 294 | 294 | // Cette variable de configuration peut etre posee par un plugin |
| 295 | 295 | // par exemple acces_restreint ; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | and !@file_exists($htaccess) |
| 300 | 300 | ) { |
| 301 | 301 | spip_unlink($htpasswd); |
| 302 | - spip_unlink($htpasswd . '-admin'); |
|
| 302 | + spip_unlink($htpasswd.'-admin'); |
|
| 303 | 303 | return; |
| 304 | 304 | } |
| 305 | 305 | |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | $res = sql_select('login, htpass, statut', 'spip_auteurs', "htpass!='' AND login!='' AND ".sql_in('statut', ['1comite', '0minirezo', 'nouveau'])); |
| 332 | 332 | while ($row = sql_fetch($res)) { |
| 333 | 333 | if (strlen($row['login']) and strlen($row['htpass'])) { |
| 334 | - $ligne = $row['login'] . ':' . $row['htpass'] . "\n"; |
|
| 334 | + $ligne = $row['login'].':'.$row['htpass']."\n"; |
|
| 335 | 335 | $pwd_all .= $ligne; |
| 336 | 336 | if ($row['statut'] == '0minirezo') { |
| 337 | 337 | $pwd_admin .= $ligne; |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | * @return boolean |
| 377 | 377 | */ |
| 378 | 378 | function verifier_htaccess($rep, $force = false) { |
| 379 | - $htaccess = rtrim($rep, '/') . '/' . _ACCESS_FILE_NAME; |
|
| 379 | + $htaccess = rtrim($rep, '/').'/'._ACCESS_FILE_NAME; |
|
| 380 | 380 | if (((@file_exists($htaccess)) or defined('_TEST_DIRS')) and !$force) { |
| 381 | 381 | return true; |
| 382 | 382 | } |
@@ -403,19 +403,19 @@ discard block |
||
| 403 | 403 | fputs($ht, $deny); |
| 404 | 404 | fclose($ht); |
| 405 | 405 | @chmod($htaccess, _SPIP_CHMOD & 0666); |
| 406 | - $t = rtrim($rep, '/') . '/.ok'; |
|
| 406 | + $t = rtrim($rep, '/').'/.ok'; |
|
| 407 | 407 | if ($ht = @fopen($t, 'w')) { |
| 408 | 408 | @fclose($ht); |
| 409 | 409 | include_spip('inc/distant'); |
| 410 | 410 | $t = substr($t, strlen(_DIR_RACINE)); |
| 411 | - $t = url_de_base() . $t; |
|
| 411 | + $t = url_de_base().$t; |
|
| 412 | 412 | $ht = recuperer_lapage($t, false, 'HEAD', 0); |
| 413 | 413 | // htaccess inoperant si on a recupere des entetes HTTP |
| 414 | 414 | // (ignorer la reussite si connexion par fopen) |
| 415 | 415 | $ht = !(isset($ht[0]) and $ht[0]); |
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | - spip_log("Creation de $htaccess " . ($ht ? ' reussie' : ' manquee')); |
|
| 418 | + spip_log("Creation de $htaccess ".($ht ? ' reussie' : ' manquee')); |
|
| 419 | 419 | |
| 420 | 420 | return $ht; |
| 421 | 421 | } |
@@ -441,11 +441,11 @@ discard block |
||
| 441 | 441 | $dirs = sql_allfetsel('extension', 'spip_types_documents'); |
| 442 | 442 | $dirs[] = array('extension' => 'distant'); |
| 443 | 443 | foreach ($dirs as $e) { |
| 444 | - if (is_dir($dir = _DIR_IMG . $e['extension'])) { |
|
| 444 | + if (is_dir($dir = _DIR_IMG.$e['extension'])) { |
|
| 445 | 445 | if ($f) { |
| 446 | 446 | verifier_htaccess($dir); |
| 447 | 447 | } else { |
| 448 | - spip_unlink($dir . '/' . _ACCESS_FILE_NAME); |
|
| 448 | + spip_unlink($dir.'/'._ACCESS_FILE_NAME); |
|
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | } |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | // https://code.spip.net/@_sqlite_func_preg_replace |
| 254 | 254 | function _sqlite_func_preg_replace($quoi, $cherche, $remplace) { |
| 255 | - $return = preg_replace('%' . $cherche . '%', $remplace, $quoi); |
|
| 255 | + $return = preg_replace('%'.$cherche.'%', $remplace, $quoi); |
|
| 256 | 256 | |
| 257 | 257 | #spip_log("preg_replace : $quoi, $cherche, $remplace, $return",'sqlite.'._LOG_DEBUG); |
| 258 | 258 | return $return; |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | return false; |
| 309 | 309 | } |
| 310 | 310 | $u = isset($GLOBALS['meta']['pcre_u']) ? $GLOBALS['meta']['pcre_u'] : 'u'; |
| 311 | - $return = preg_match('%' . $cherche . '%imsS' . $u, $quoi); |
|
| 311 | + $return = preg_match('%'.$cherche.'%imsS'.$u, $quoi); |
|
| 312 | 312 | |
| 313 | 313 | #spip_log("regexp_replace : $quoi, $cherche, $remplace, $return",'sqlite.'._LOG_DEBUG); |
| 314 | 314 | return $return; |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | $count = 0; |
| 358 | 358 | str_replace($mysql_to_strftime_not_ok, '', $conv, $count); |
| 359 | 359 | if ($count > 0) { |
| 360 | - spip_log("DATE_FORMAT : At least one parameter can't be parsed by strftime with format '$conv'", 'sqlite.' . _LOG_ERREUR); |
|
| 360 | + spip_log("DATE_FORMAT : At least one parameter can't be parsed by strftime with format '$conv'", 'sqlite.'._LOG_ERREUR); |
|
| 361 | 361 | } |
| 362 | 362 | $to_strftime[$conv] = str_replace(array_keys($mysql_to_strftime), $mysql_to_strftime, $conv); |
| 363 | 363 | } |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | function _sqlite_func_to_days($d) { |
| 376 | 376 | static $offset = 719528; // nb de jour entre 0000-00-00 et timestamp 0=1970-01-01 |
| 377 | - $result = $offset + (int)ceil(_sqlite_func_unix_timestamp($d) / (24 * 3600)); |
|
| 377 | + $result = $offset + (int) ceil(_sqlite_func_unix_timestamp($d) / (24 * 3600)); |
|
| 378 | 378 | |
| 379 | 379 | #spip_log("Passage avec TO_DAYS : $d, $result",'sqlite.'._LOG_DEBUG); |
| 380 | 380 | return $result; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | if ($res) { |
| 55 | 55 | return $res; |
| 56 | 56 | } |
| 57 | - spip_log("meta: $script " . print_r($_POST, true)); |
|
| 57 | + spip_log("meta: $script ".print_r($_POST, true)); |
|
| 58 | 58 | ecrire_meta($script, serialize($_POST)); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | // on pourrait statuer automatiquement les webmestres a l'init d'une action auth par ftp ... ? |
| 124 | 124 | |
| 125 | - spip_log("admin $pref" . ($valeur ? ' (reprise)' : ' (init)'), $journal); |
|
| 125 | + spip_log("admin $pref".($valeur ? ' (reprise)' : ' (init)'), $journal); |
|
| 126 | 126 | |
| 127 | 127 | return ''; |
| 128 | 128 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | if (autoriser('configurer')) { |
| 141 | 141 | return _DIR_TMP; |
| 142 | 142 | } else { |
| 143 | - return _DIR_TRANSFERT . $GLOBALS['visiteur_session']['login'] . '/'; |
|
| 143 | + return _DIR_TRANSFERT.$GLOBALS['visiteur_session']['login'].'/'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | * Nom du fichier |
| 159 | 159 | **/ |
| 160 | 160 | function fichier_admin($action, $pref = 'admin_') { |
| 161 | - return $pref . |
|
| 162 | - substr(md5($action . (time() & ~2047) . $GLOBALS['visiteur_session']['login']), 0, 10); |
|
| 161 | + return $pref. |
|
| 162 | + substr(md5($action.(time() & ~2047).$GLOBALS['visiteur_session']['login']), 0, 10); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | } else { |
| 193 | 193 | $dir = dir_admin(); |
| 194 | 194 | $signal = fichier_admin($script); |
| 195 | - if (@file_exists($dir . $signal)) { |
|
| 195 | + if (@file_exists($dir.$signal)) { |
|
| 196 | 196 | spip_log("Action admin: $action"); |
| 197 | 197 | |
| 198 | 198 | return ''; |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | return ''; |
| 211 | 211 | } |
| 212 | - $corps .= '<input type="hidden" name="validation_admin" value="' . $signal . '" />'; |
|
| 212 | + $corps .= '<input type="hidden" name="validation_admin" value="'.$signal.'" />'; |
|
| 213 | 213 | $suivant = _T('bouton_valider'); |
| 214 | 214 | $js = ''; |
| 215 | 215 | } else { |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | . "</legend>\n<label for='fichier'>" |
| 225 | 225 | . _T('info_creer_repertoire') |
| 226 | 226 | . "</label>\n" |
| 227 | - . "<span id='signal' class='formo'>" . $signal . '</span>' |
|
| 227 | + . "<span id='signal' class='formo'>".$signal.'</span>' |
|
| 228 | 228 | . "<input type='hidden' id='fichier' name='fichier' value='" |
| 229 | 229 | . $signal |
| 230 | 230 | . "' />" |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | * Nom de l'action (en base) qui a été exécutée |
| 262 | 262 | **/ |
| 263 | 263 | function fin_admin($action) { |
| 264 | - $signal = dir_admin() . fichier_admin($action); |
|
| 264 | + $signal = dir_admin().fichier_admin($action); |
|
| 265 | 265 | spip_unlink($signal); |
| 266 | 266 | if ($action != 'delete_all') { |
| 267 | 267 | effacer_meta($action); |
@@ -289,8 +289,8 @@ discard block |
||
| 289 | 289 | include_spip('inc/filtres'); |
| 290 | 290 | foreach (array_merge($_POST, $_GET) as $n => $c) { |
| 291 | 291 | if (!in_array($n, array('fichier', 'exec', 'validation_admin')) and !is_array($c)) { |
| 292 | - $suite .= "\n<input type='hidden' name='" . spip_htmlspecialchars($n) . "' value='" . |
|
| 293 | - entites_html($c) . |
|
| 292 | + $suite .= "\n<input type='hidden' name='".spip_htmlspecialchars($n)."' value='". |
|
| 293 | + entites_html($c). |
|
| 294 | 294 | "' />"; |
| 295 | 295 | } |
| 296 | 296 | } |
@@ -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 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | // on accepte pas une fonction de config inconnue si elle vient d'un modele |
| 216 | 216 | if ($config_fonc |
| 217 | 217 | and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
| 218 | - and $config_fonc !== $table_objet . '_edit_config') { |
|
| 218 | + and $config_fonc !== $table_objet.'_edit_config') { |
|
| 219 | 219 | if ($args = test_formulaire_inclus_par_modele() |
| 220 | 220 | and in_array($config_fonc, $args)) { |
| 221 | 221 | $config_fonc = ''; |
@@ -227,12 +227,12 @@ discard block |
||
| 227 | 227 | // Appel direct dans un squelette |
| 228 | 228 | if (!$row) { |
| 229 | 229 | if (!$new or $lier_trad) { |
| 230 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 230 | + if ($select = charger_fonction('precharger_'.$type, 'inc', true)) { |
|
| 231 | 231 | $row = $select($id, $id_parent, $lier_trad); |
| 232 | 232 | // si on a une fonction precharger, elle pu faire un reglage de langue |
| 233 | 233 | $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
| 234 | 234 | } else { |
| 235 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 235 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id)); |
|
| 236 | 236 | } |
| 237 | 237 | if (!$new) { |
| 238 | 238 | $md5 = controles_md5($row); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | if ($config_fonc) { |
| 282 | 282 | $contexte['config'] = $config = $config_fonc($contexte); |
| 283 | 283 | if (!$lang_default) { |
| 284 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 284 | + $lang_default = $config['langue'] ?? session_get('lang'); |
|
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | $config = $config + array( |
@@ -305,13 +305,12 @@ discard block |
||
| 305 | 305 | unset($contexte['lang']); |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 309 | - (!$lier_trad ? '' : |
|
| 310 | - ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 311 | - $lier_trad . |
|
| 312 | - "' />" . |
|
| 313 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 314 | - $lang_default . |
|
| 308 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n". |
|
| 309 | + (!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='". |
|
| 310 | + $lier_trad. |
|
| 311 | + "' />". |
|
| 312 | + "\n<input type='hidden' name='changer_lang' value='". |
|
| 313 | + $lang_default. |
|
| 315 | 314 | "' />")) |
| 316 | 315 | . $hidden |
| 317 | 316 | . (isset($md5) ? $md5 : ''); |
@@ -325,8 +324,8 @@ discard block |
||
| 325 | 324 | $contexte['_action'] = array("editer_$type", $id); |
| 326 | 325 | |
| 327 | 326 | // et in fine placer l'autorisation |
| 328 | - if (intval($id)){ |
|
| 329 | - if (!autoriser('modifier', $type, intval($id))){ |
|
| 327 | + if (intval($id)) { |
|
| 328 | + if (!autoriser('modifier', $type, intval($id))) { |
|
| 330 | 329 | $valeurs['editable'] = ''; |
| 331 | 330 | } |
| 332 | 331 | } |
@@ -350,14 +349,14 @@ discard block |
||
| 350 | 349 | $aider = charger_fonction('aider', 'inc'); |
| 351 | 350 | if (strlen($texte) > 28 * 1024) { |
| 352 | 351 | $texte = str_replace("\r\n", "\n", $texte); |
| 353 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 352 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 354 | 353 | if ($pos > 0 and $pos < 32 * 1024) { |
| 355 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 354 | + $debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n"; |
|
| 356 | 355 | $suite = substr($texte, $pos + 2); |
| 357 | 356 | } else { |
| 358 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 357 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 359 | 358 | if (!($pos > 0 and $pos < 32 * 1024)) { |
| 360 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 359 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 361 | 360 | $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
| 362 | 361 | } else { |
| 363 | 362 | $decalage = 1; |
@@ -387,13 +386,13 @@ discard block |
||
| 387 | 386 | } |
| 388 | 387 | |
| 389 | 388 | include_spip('inc/barre'); |
| 390 | - $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 389 | + $textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n"; |
|
| 391 | 390 | $nombre = 0; |
| 392 | 391 | |
| 393 | 392 | while (strlen($texte) > 29 * 1024) { |
| 394 | 393 | $nombre++; |
| 395 | 394 | list($texte1, $texte) = coupe_trop_long($texte); |
| 396 | - $textes_supplement .= '<br />' . |
|
| 395 | + $textes_supplement .= '<br />'. |
|
| 397 | 396 | "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
| 398 | 397 | } |
| 399 | 398 | |
@@ -481,7 +480,7 @@ discard block |
||
| 481 | 480 | $ctr = array(); |
| 482 | 481 | foreach ($data as $key => $val) { |
| 483 | 482 | $m = md5($val); |
| 484 | - $k = $prefixe . $key; |
|
| 483 | + $k = $prefixe.$key; |
|
| 485 | 484 | |
| 486 | 485 | switch ($format) { |
| 487 | 486 | case 'html': |
@@ -494,7 +493,7 @@ discard block |
||
| 494 | 493 | } |
| 495 | 494 | |
| 496 | 495 | if ($format == 'html') { |
| 497 | - return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 496 | + return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n"; |
|
| 498 | 497 | } else { |
| 499 | 498 | return $ctr; |
| 500 | 499 | } |
@@ -645,7 +644,7 @@ discard block |
||
| 645 | 644 | // On elimine les donnees non modifiees par le formulaire (mais |
| 646 | 645 | // potentiellement modifiees entre temps par un autre utilisateur) |
| 647 | 646 | foreach ($champs as $key => $val) { |
| 648 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 647 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 649 | 648 | if (is_scalar($val) and $m == md5($val)) { |
| 650 | 649 | unset($champs[$key]); |
| 651 | 650 | } |
@@ -674,7 +673,7 @@ discard block |
||
| 674 | 673 | // de conflit. |
| 675 | 674 | $ctrh = $ctrq = $conflits = array(); |
| 676 | 675 | foreach (array_keys($champs) as $key) { |
| 677 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 676 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 678 | 677 | $ctrh[$key] = $m; |
| 679 | 678 | $ctrq[] = $key; |
| 680 | 679 | } |
@@ -707,9 +706,9 @@ discard block |
||
| 707 | 706 | */ |
| 708 | 707 | function display_conflit_champ($x) { |
| 709 | 708 | if (strstr($x, "\n") or strlen($x) > 80) { |
| 710 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 709 | + return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n"; |
|
| 711 | 710 | } else { |
| 712 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 711 | + return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n"; |
|
| 713 | 712 | } |
| 714 | 713 | } |
| 715 | 714 | |
@@ -749,11 +748,11 @@ discard block |
||
| 749 | 748 | ) : $champ; |
| 750 | 749 | |
| 751 | 750 | $diffs[] = "<h2>$titre</h2>\n" |
| 752 | - . '<h3>' . _T('info_conflit_edition_differences') . "</h3>\n" |
|
| 753 | - . "<div style='max-height:8em; overflow: auto; width:99%;'>" . $d . "</div>\n" |
|
| 754 | - . '<h4>' . _T('info_conflit_edition_votre_version') . '</h4>' |
|
| 751 | + . '<h3>'._T('info_conflit_edition_differences')."</h3>\n" |
|
| 752 | + . "<div style='max-height:8em; overflow: auto; width:99%;'>".$d."</div>\n" |
|
| 753 | + . '<h4>'._T('info_conflit_edition_votre_version').'</h4>' |
|
| 755 | 754 | . display_conflit_champ($a['post']) |
| 756 | - . '<h4>' . _T('info_conflit_edition_version_enregistree') . '</h4>' |
|
| 755 | + . '<h4>'._T('info_conflit_edition_version_enregistree').'</h4>' |
|
| 757 | 756 | . display_conflit_champ($base); |
| 758 | 757 | } |
| 759 | 758 | |
@@ -761,16 +760,16 @@ discard block |
||
| 761 | 760 | $id = uniqid(rand()); |
| 762 | 761 | $redirect = "<form action='$redirect' method='get' |
| 763 | 762 | id='$id' |
| 764 | - style='float:" . $GLOBALS['spip_lang_right'] . "; margin-top:2em;'>\n" |
|
| 763 | + style='float:".$GLOBALS['spip_lang_right']."; margin-top:2em;'>\n" |
|
| 765 | 764 | . form_hidden($redirect) |
| 766 | - . "<input type='submit' value='" . _T('icone_retour') . "' /> |
|
| 765 | + . "<input type='submit' value='"._T('icone_retour')."' /> |
|
| 767 | 766 | </form>\n"; |
| 768 | 767 | |
| 769 | 768 | // pour les documents, on est probablement en ajax : il faut ajaxer |
| 770 | 769 | if (_AJAX) { |
| 771 | 770 | $redirect .= '<script type="text/javascript">' |
| 772 | - . 'setTimeout(function(){$("#' . $id . '") |
|
| 773 | - .ajaxForm({target:$("#' . $id . '").parent()}); |
|
| 771 | + . 'setTimeout(function(){$("#'.$id.'") |
|
| 772 | + .ajaxForm({target:$("#' . $id.'").parent()}); |
|
| 774 | 773 | }, 200);' |
| 775 | 774 | . "</script>\n"; |
| 776 | 775 | } |
@@ -789,9 +788,9 @@ discard block |
||
| 789 | 788 | .diff-para-deplace .diff-supprime { background: #ffb8b8; border: 1px solid #808080; } |
| 790 | 789 | .diff-para-deplace .diff-deplace { background: #b8b8ff; border: 1px solid #808080; } |
| 791 | 790 | </style>' |
| 792 | - . '<p>' . _T('info_conflit_edition_avis_non_sauvegarde') . '</p>' |
|
| 793 | - . '<p>' . _T('texte_conflit_edition_correction') . '</p>' |
|
| 794 | - . "<div style='text-align:" . $GLOBALS['spip_lang_left'] . ";'>" |
|
| 791 | + . '<p>'._T('info_conflit_edition_avis_non_sauvegarde').'</p>' |
|
| 792 | + . '<p>'._T('texte_conflit_edition_correction').'</p>' |
|
| 793 | + . "<div style='text-align:".$GLOBALS['spip_lang_left'].";'>" |
|
| 795 | 794 | . join("\n", $diffs) |
| 796 | 795 | . "</div>\n" |
| 797 | 796 | |