@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | $blue = dechex($blue); |
| 44 | 44 | |
| 45 | 45 | if (strlen($red) == 1) { |
| 46 | - $red = '0' . $red; |
|
| 46 | + $red = '0'.$red; |
|
| 47 | 47 | } |
| 48 | 48 | if (strlen($green) == 1) { |
| 49 | - $green = '0' . $green; |
|
| 49 | + $green = '0'.$green; |
|
| 50 | 50 | } |
| 51 | 51 | if (strlen($blue) == 1) { |
| 52 | - $blue = '0' . $blue; |
|
| 52 | + $blue = '0'.$blue; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | return "$red$green$blue"; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $couleur = couleur_html_to_hex($couleur); |
| 68 | 68 | $couleur = ltrim($couleur, '#'); |
| 69 | 69 | if (strlen($couleur) === 3) { |
| 70 | - $couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2]; |
|
| 70 | + $couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2]; |
|
| 71 | 71 | } |
| 72 | 72 | $retour = []; |
| 73 | 73 | $retour['red'] = hexdec(substr($couleur, 0, 2)); |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | $var_G = ($G / 255); |
| 126 | 126 | $var_B = ($B / 255); |
| 127 | 127 | |
| 128 | - $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 129 | - $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 130 | - $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 128 | + $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 129 | + $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 130 | + $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 131 | 131 | |
| 132 | 132 | $L = ($var_Max + $var_Min) / 2; |
| 133 | 133 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | function _couleur_hsl_to_rgb($H, $S, $L) { |
| 191 | 191 | // helper |
| 192 | - $hue_2_rgb = function ($v1, $v2, $vH) { |
|
| 192 | + $hue_2_rgb = function($v1, $v2, $vH) { |
|
| 193 | 193 | if ($vH < 0) { |
| 194 | 194 | $vH += 1; |
| 195 | 195 | } |
@@ -321,11 +321,11 @@ discard block |
||
| 321 | 321 | $img = "<img src='$source' />"; |
| 322 | 322 | } elseif ( |
| 323 | 323 | preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs) |
| 324 | - and $extension = _image_trouver_extension_depuis_mime('image/' . $regs[1]) |
|
| 324 | + and $extension = _image_trouver_extension_depuis_mime('image/'.$regs[1]) |
|
| 325 | 325 | and in_array($extension, _image_extensions_acceptees_en_entree()) |
| 326 | 326 | ) { |
| 327 | 327 | # gerer img src="data:....base64" |
| 328 | - $local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension); |
|
| 328 | + $local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension); |
|
| 329 | 329 | if (!file_exists($local)) { |
| 330 | 330 | ecrire_fichier($local, base64_decode($regs[2])); |
| 331 | 331 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | // les protocoles web prennent au moins 3 lettres |
| 343 | 343 | if (tester_url_absolue($source)) { |
| 344 | 344 | include_spip('inc/distant'); |
| 345 | - $fichier = _DIR_RACINE . copie_locale($source); |
|
| 345 | + $fichier = _DIR_RACINE.copie_locale($source); |
|
| 346 | 346 | if (!$fichier) { |
| 347 | 347 | return ''; |
| 348 | 348 | } |
@@ -440,9 +440,9 @@ discard block |
||
| 440 | 440 | // on garde la terminaison initiale car image simplement copiee |
| 441 | 441 | // et on postfixe son nom avec un md5 du path |
| 442 | 442 | $terminaison_dest = $terminaison; |
| 443 | - $fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5); |
|
| 443 | + $fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5); |
|
| 444 | 444 | } else { |
| 445 | - $fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5); |
|
| 445 | + $fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5); |
|
| 446 | 446 | } |
| 447 | 447 | $cache = sous_repertoire(_DIR_VAR, $cache); |
| 448 | 448 | $cache = sous_repertoire($cache, $effet); |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $fichier_dest = substr($fichier_dest, 2); |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | - $fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest; |
|
| 456 | + $fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest; |
|
| 457 | 457 | |
| 458 | 458 | $GLOBALS['images_calculees'][] = $fichier_dest; |
| 459 | 459 | |
@@ -491,15 +491,15 @@ discard block |
||
| 491 | 491 | |
| 492 | 492 | if ($creer) { |
| 493 | 493 | spip_log( |
| 494 | - 'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier", |
|
| 495 | - 'images' . _LOG_DEBUG |
|
| 494 | + 'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier", |
|
| 495 | + 'images'._LOG_DEBUG |
|
| 496 | 496 | ); |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | $term_fonction = _image_trouver_extension_pertinente($fichier); |
| 500 | - $ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction; |
|
| 500 | + $ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction; |
|
| 501 | 501 | $ret['fichier'] = $fichier; |
| 502 | - $ret['fonction_image'] = '_image_image' . $terminaison_dest; |
|
| 502 | + $ret['fonction_image'] = '_image_image'.$terminaison_dest; |
|
| 503 | 503 | $ret['fichier_dest'] = $fichier_dest; |
| 504 | 504 | $ret['format_source'] = _image_extension_normalisee($terminaison); |
| 505 | 505 | $ret['format_dest'] = $terminaison_dest; |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | |
| 649 | 649 | $_terminaison = _image_trouver_extension_depuis_mime($mime); |
| 650 | 650 | if ($_terminaison and $_terminaison !== $terminaison) { |
| 651 | - spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE); |
|
| 651 | + spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE); |
|
| 652 | 652 | $terminaison = $_terminaison; |
| 653 | 653 | } |
| 654 | 654 | return $terminaison; |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | if (!function_exists('imagepng')) { |
| 806 | 806 | return false; |
| 807 | 807 | } |
| 808 | - $tmp = $fichier . '.tmp'; |
|
| 808 | + $tmp = $fichier.'.tmp'; |
|
| 809 | 809 | $ret = imagepng($img, $tmp); |
| 810 | 810 | if (file_exists($tmp)) { |
| 811 | 811 | $taille_test = getimagesize($tmp); |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | if (!function_exists('imagegif')) { |
| 841 | 841 | return false; |
| 842 | 842 | } |
| 843 | - $tmp = $fichier . '.tmp'; |
|
| 843 | + $tmp = $fichier.'.tmp'; |
|
| 844 | 844 | $ret = imagegif($img, $tmp); |
| 845 | 845 | if (file_exists($tmp)) { |
| 846 | 846 | $taille_test = getimagesize($tmp); |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | if (!function_exists('imagejpeg')) { |
| 881 | 881 | return false; |
| 882 | 882 | } |
| 883 | - $tmp = $fichier . '.tmp'; |
|
| 883 | + $tmp = $fichier.'.tmp'; |
|
| 884 | 884 | |
| 885 | 885 | // Enable interlancing |
| 886 | 886 | imageinterlace($img, true); |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | if (!function_exists('imagewebp')) { |
| 942 | 942 | return false; |
| 943 | 943 | } |
| 944 | - $tmp = $fichier . '.tmp'; |
|
| 944 | + $tmp = $fichier.'.tmp'; |
|
| 945 | 945 | $ret = imagewebp($img, $tmp, $qualite); |
| 946 | 946 | if (file_exists($tmp)) { |
| 947 | 947 | $taille_test = getimagesize($tmp); |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | */ |
| 976 | 976 | function _image_imagesvg($img, $fichier) { |
| 977 | 977 | |
| 978 | - $tmp = $fichier . '.tmp'; |
|
| 978 | + $tmp = $fichier.'.tmp'; |
|
| 979 | 979 | if (strpos($img, '<') === false) { |
| 980 | 980 | $img = supprimer_timestamp($img); |
| 981 | 981 | if (!file_exists($img)) { |
@@ -1032,14 +1032,14 @@ discard block |
||
| 1032 | 1032 | */ |
| 1033 | 1033 | function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) { |
| 1034 | 1034 | if (is_null($fonction)) { |
| 1035 | - $fonction = '_image_image' . $valeurs['format_dest']; |
|
| 1035 | + $fonction = '_image_image'.$valeurs['format_dest']; |
|
| 1036 | 1036 | } |
| 1037 | 1037 | $ret = false; |
| 1038 | 1038 | #un flag pour reperer les images gravees |
| 1039 | 1039 | $lock = ( |
| 1040 | 1040 | !statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout |
| 1041 | 1041 | or |
| 1042 | - (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src')) |
|
| 1042 | + (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src')) |
|
| 1043 | 1043 | ); |
| 1044 | 1044 | if ( |
| 1045 | 1045 | function_exists($fonction) |
@@ -1051,7 +1051,7 @@ discard block |
||
| 1051 | 1051 | // dans tous les cas mettre a jour la taille de l'image finale |
| 1052 | 1052 | [$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']); |
| 1053 | 1053 | $valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition |
| 1054 | - ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true); |
|
| 1054 | + ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true); |
|
| 1055 | 1055 | } |
| 1056 | 1056 | } |
| 1057 | 1057 | |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | |
| 1227 | 1227 | // attributs deprecies. Transformer en CSS |
| 1228 | 1228 | if ($espace = extraire_attribut($tag, 'hspace')) { |
| 1229 | - $style = "margin:${espace}px;" . $style; |
|
| 1229 | + $style = "margin:${espace}px;".$style; |
|
| 1230 | 1230 | $tag = inserer_attribut($tag, 'hspace', ''); |
| 1231 | 1231 | } |
| 1232 | 1232 | |
@@ -1353,7 +1353,7 @@ discard block |
||
| 1353 | 1353 | $image = $valeurs['fichier']; |
| 1354 | 1354 | $format = $valeurs['format_source']; |
| 1355 | 1355 | $destdir = dirname($valeurs['fichier_dest']); |
| 1356 | - $destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']); |
|
| 1356 | + $destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']); |
|
| 1357 | 1357 | |
| 1358 | 1358 | $format_sortie = $valeurs['format_dest']; |
| 1359 | 1359 | |
@@ -1385,14 +1385,14 @@ discard block |
||
| 1385 | 1385 | |
| 1386 | 1386 | // Si l'image est de la taille demandee (ou plus petite), simplement la retourner |
| 1387 | 1387 | if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) { |
| 1388 | - $vignette = $destination . '.' . $format; |
|
| 1388 | + $vignette = $destination.'.'.$format; |
|
| 1389 | 1389 | @copy($image, $vignette); |
| 1390 | 1390 | } |
| 1391 | 1391 | |
| 1392 | 1392 | elseif ($valeurs['format_source'] === 'svg') { |
| 1393 | 1393 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1394 | 1394 | $format_sortie = 'svg'; |
| 1395 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1395 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1396 | 1396 | $valeurs['fichier_dest'] = $vignette; |
| 1397 | 1397 | _image_gd_output($svg, $valeurs); |
| 1398 | 1398 | } |
@@ -1404,9 +1404,9 @@ discard block |
||
| 1404 | 1404 | define('_CONVERT_COMMAND', 'convert'); |
| 1405 | 1405 | } // Securite : mes_options.php peut preciser le chemin absolu |
| 1406 | 1406 | if (!defined('_RESIZE_COMMAND')) { |
| 1407 | - define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest'); |
|
| 1407 | + define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest'); |
|
| 1408 | 1408 | } |
| 1409 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1409 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1410 | 1410 | $commande = str_replace( |
| 1411 | 1411 | ['%x', '%y', '%src', '%dest'], |
| 1412 | 1412 | [ |
@@ -1422,7 +1422,7 @@ discard block |
||
| 1422 | 1422 | if (!@file_exists($vignette)) { |
| 1423 | 1423 | spip_log("echec convert sur $vignette"); |
| 1424 | 1424 | |
| 1425 | - return; // echec commande |
|
| 1425 | + return; // echec commande |
|
| 1426 | 1426 | } |
| 1427 | 1427 | } |
| 1428 | 1428 | |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | if (!$output) { |
| 1441 | 1441 | return; |
| 1442 | 1442 | } |
| 1443 | - $vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie; |
|
| 1443 | + $vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie; |
|
| 1444 | 1444 | |
| 1445 | 1445 | $imagick = new Imagick(); |
| 1446 | 1446 | $imagick->readImage(realpath($image)); |
@@ -1449,7 +1449,7 @@ discard block |
||
| 1449 | 1449 | $destHeight, |
| 1450 | 1450 | Imagick::FILTER_LANCZOS, |
| 1451 | 1451 | 1 |
| 1452 | - );//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1452 | + ); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1453 | 1453 | $imagick->writeImage($vignette); |
| 1454 | 1454 | |
| 1455 | 1455 | if (!@file_exists($vignette)) { |
@@ -1458,7 +1458,7 @@ discard block |
||
| 1458 | 1458 | return; |
| 1459 | 1459 | } |
| 1460 | 1460 | // remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester) |
| 1461 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1461 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1462 | 1462 | } |
| 1463 | 1463 | |
| 1464 | 1464 | // netpbm |
@@ -1469,11 +1469,11 @@ discard block |
||
| 1469 | 1469 | if (_PNMSCALE_COMMAND == '') { |
| 1470 | 1470 | return; |
| 1471 | 1471 | } |
| 1472 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1472 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1473 | 1473 | $pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND); |
| 1474 | 1474 | if ($format == 'jpg') { |
| 1475 | 1475 | $jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND); |
| 1476 | - exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1476 | + exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1477 | 1477 | if (!($s = @filesize($vignette))) { |
| 1478 | 1478 | spip_unlink($vignette); |
| 1479 | 1479 | } |
@@ -1485,7 +1485,7 @@ discard block |
||
| 1485 | 1485 | } else { |
| 1486 | 1486 | if ($format == 'gif') { |
| 1487 | 1487 | $giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND); |
| 1488 | - exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1488 | + exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1489 | 1489 | if (!($s = @filesize($vignette))) { |
| 1490 | 1490 | spip_unlink($vignette); |
| 1491 | 1491 | } |
@@ -1497,7 +1497,7 @@ discard block |
||
| 1497 | 1497 | } else { |
| 1498 | 1498 | if ($format == 'png') { |
| 1499 | 1499 | $pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND); |
| 1500 | - exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1500 | + exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1501 | 1501 | if (!($s = @filesize($vignette))) { |
| 1502 | 1502 | spip_unlink($vignette); |
| 1503 | 1503 | } |
@@ -1519,7 +1519,7 @@ discard block |
||
| 1519 | 1519 | return; |
| 1520 | 1520 | } |
| 1521 | 1521 | if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) { |
| 1522 | - spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels'); |
|
| 1522 | + spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels'); |
|
| 1523 | 1523 | |
| 1524 | 1524 | return; |
| 1525 | 1525 | } |
@@ -1831,7 +1831,7 @@ discard block |
||
| 1831 | 1831 | // de l'image, de facon a tromper le cache du navigateur |
| 1832 | 1832 | // quand on fait supprimer/reuploader un logo |
| 1833 | 1833 | // (pas de filemtime si SAFE MODE) |
| 1834 | - $date = test_espace_prive() ? ('?' . $date) : ''; |
|
| 1834 | + $date = test_espace_prive() ? ('?'.$date) : ''; |
|
| 1835 | 1835 | |
| 1836 | 1836 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1837 | 1837 | } |
@@ -1877,7 +1877,7 @@ discard block |
||
| 1877 | 1877 | public static function LittleEndian2String($number, $minbytes = 1) { |
| 1878 | 1878 | $intstring = ''; |
| 1879 | 1879 | while ($number > 0) { |
| 1880 | - $intstring = $intstring . chr($number & 255); |
|
| 1880 | + $intstring = $intstring.chr($number & 255); |
|
| 1881 | 1881 | $number >>= 8; |
| 1882 | 1882 | } |
| 1883 | 1883 | |
@@ -1909,9 +1909,9 @@ discard block |
||
| 1909 | 1909 | $b = $argb['blue']; |
| 1910 | 1910 | |
| 1911 | 1911 | if ($bpp[$key] == 32) { |
| 1912 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a); |
|
| 1912 | + $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a); |
|
| 1913 | 1913 | } elseif ($bpp[$key] == 24) { |
| 1914 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r); |
|
| 1914 | + $icXOR[$key] .= chr($b).chr($g).chr($r); |
|
| 1915 | 1915 | } |
| 1916 | 1916 | |
| 1917 | 1917 | if ($a < 128) { |
@@ -1938,48 +1938,48 @@ discard block |
||
| 1938 | 1938 | |
| 1939 | 1939 | // BITMAPINFOHEADER - 40 bytes |
| 1940 | 1940 | $BitmapInfoHeader[$key] = ''; |
| 1941 | - $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1942 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1941 | + $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1942 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1943 | 1943 | // The biHeight member specifies the combined |
| 1944 | 1944 | // height of the XOR and AND masks. |
| 1945 | 1945 | $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG biHeight; |
| 1946 | - $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1947 | - $BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00"; // wBitCount; |
|
| 1948 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1949 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1950 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1951 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1952 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1953 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1946 | + $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1947 | + $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount; |
|
| 1948 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1949 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1950 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1951 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1952 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1953 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1954 | 1954 | } |
| 1955 | 1955 | |
| 1956 | 1956 | |
| 1957 | - $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1958 | - $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1959 | - $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1957 | + $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1958 | + $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1959 | + $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1960 | 1960 | |
| 1961 | 1961 | $dwImageOffset = 6 + (count($gd_image_array) * 16); |
| 1962 | 1962 | foreach ($gd_image_array as $key => $gd_image) { |
| 1963 | 1963 | // ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) |
| 1964 | 1964 | |
| 1965 | - $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1966 | - $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1967 | - $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1968 | - $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1965 | + $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1966 | + $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1967 | + $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1968 | + $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1969 | 1969 | |
| 1970 | - $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1971 | - $icondata .= chr($bpp[$key]) . "\x00"; // wBitCount; // Bits per pixel |
|
| 1970 | + $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1971 | + $icondata .= chr($bpp[$key])."\x00"; // wBitCount; // Bits per pixel |
|
| 1972 | 1972 | |
| 1973 | 1973 | $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]); |
| 1974 | 1974 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1975 | 1975 | $dwBytesInRes, |
| 1976 | 1976 | 4 |
| 1977 | - ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1977 | + ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1978 | 1978 | |
| 1979 | 1979 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1980 | 1980 | $dwImageOffset, |
| 1981 | 1981 | 4 |
| 1982 | - ); // dwImageOffset; // Where in the file is this image? |
|
| 1982 | + ); // dwImageOffset; // Where in the file is this image? |
|
| 1983 | 1983 | $dwImageOffset += strlen($BitmapInfoHeader[$key]); |
| 1984 | 1984 | $dwImageOffset += strlen($icXOR[$key]); |
| 1985 | 1985 | $dwImageOffset += strlen($icAND[$key]); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | // L'éditabilité :) est définie par un test permanent (par exemple "associermots") ET le 4ème argument |
| 107 | 107 | include_spip('inc/autoriser'); |
| 108 | - $editable = ($editable and autoriser('associer' . $table_source, $objet, $id_objet) |
|
| 108 | + $editable = ($editable and autoriser('associer'.$table_source, $objet, $id_objet) |
|
| 109 | 109 | and autoriser('modifier', $objet, $id_objet)); |
| 110 | 110 | |
| 111 | 111 | if ( |
@@ -119,15 +119,15 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | // squelettes de vue et de d'association |
| 121 | 121 | // ils sont différents si des rôles sont définis. |
| 122 | - $skel_vue = $table_source . '_lies'; |
|
| 123 | - $skel_ajout = $table_source . '_associer'; |
|
| 122 | + $skel_vue = $table_source.'_lies'; |
|
| 123 | + $skel_ajout = $table_source.'_associer'; |
|
| 124 | 124 | |
| 125 | 125 | // description des roles |
| 126 | 126 | include_spip('inc/roles'); |
| 127 | 127 | if ($roles = roles_presents($objet_source, $objet)) { |
| 128 | 128 | // on demande de nouveaux squelettes en conséquence |
| 129 | - $skel_vue = $table_source . '_roles_lies'; |
|
| 130 | - $skel_ajout = $table_source . '_roles_associer'; |
|
| 129 | + $skel_vue = $table_source.'_roles_lies'; |
|
| 130 | + $skel_ajout = $table_source.'_roles_associer'; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | $oups = ''; |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | function lien_retrouver_qualif($objet_lien, $lien) { |
| 427 | 427 | // un role est défini dans la liaison |
| 428 | 428 | $defs = explode('-', $lien); |
| 429 | - [$objet1, , $objet2, , $role] = array_pad($defs, 5, null); |
|
| 429 | + [$objet1,, $objet2,, $role] = array_pad($defs, 5, null); |
|
| 430 | 430 | if ($objet_lien == $objet1) { |
| 431 | 431 | $colonne_role = roles_colonne($objet1, $objet2); |
| 432 | 432 | } else { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | include_fichiers_fonctions(); |
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 99 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 100 | 100 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 101 | 101 | if (is_callable($f)) { |
| 102 | 102 | return $f; |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | // affichage "GIT [master: abcdef]" |
| 235 | 235 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 236 | 236 | if ($desc['branch']) { |
| 237 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 237 | + $commit = $desc['branch'].': '.$commit; |
|
| 238 | 238 | } |
| 239 | 239 | return "{$desc['vcs']} [$commit]"; |
| 240 | 240 | } |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | // version installee par GIT |
| 256 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 256 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 257 | 257 | $currentHead = trim(substr($c, 4)); |
| 258 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 258 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 259 | 259 | return [ |
| 260 | 260 | 'vcs' => 'GIT', |
| 261 | 261 | 'branch' => basename($currentHead), |
@@ -282,8 +282,8 @@ discard block |
||
| 282 | 282 | $dir = '.'; |
| 283 | 283 | } |
| 284 | 284 | // version installee par SVN |
| 285 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 286 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 285 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 286 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 287 | 287 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 288 | 288 | if ($result) { |
| 289 | 289 | $row = $result->fetchArray(); |
@@ -301,12 +301,12 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 303 | 303 | // et laisser passer les fonctions personnelles baptisees image_... |
| 304 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 305 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 306 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 307 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 308 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 309 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 304 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 305 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 306 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 307 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 308 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 309 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 310 | 310 | |
| 311 | 311 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 312 | 312 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -465,8 +465,8 @@ discard block |
||
| 465 | 465 | */ |
| 466 | 466 | function filtre_debug($val, $key = null) { |
| 467 | 467 | $debug = ( |
| 468 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 469 | - ) . var_export($val, true); |
|
| 468 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 469 | + ).var_export($val, true); |
|
| 470 | 470 | |
| 471 | 471 | include_spip('inc/autoriser'); |
| 472 | 472 | if (autoriser('webmestre')) { |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | $is_file = false; |
| 523 | 523 | } |
| 524 | 524 | if ($is_file) { |
| 525 | - $is_local_file = function ($path) { |
|
| 525 | + $is_local_file = function($path) { |
|
| 526 | 526 | if (strpos($path, '?') !== false) { |
| 527 | 527 | $path = supprimer_timestamp($path); |
| 528 | 528 | // remove ?24px added by find_in_theme on .svg files |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | if ($mouseover = extraire_attribut($reduit, 'onmouseover')) { |
| 572 | 572 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 573 | 573 | $srcover = $match[1]; |
| 574 | - $srcover_filter = $filtre("<img src='" . $match[1] . "' />", ...$args); |
|
| 574 | + $srcover_filter = $filtre("<img src='".$match[1]."' />", ...$args); |
|
| 575 | 575 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 576 | 576 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
| 577 | 577 | } |
@@ -972,7 +972,7 @@ discard block |
||
| 972 | 972 | // " -> " et tout ce genre de choses |
| 973 | 973 | $u = $GLOBALS['meta']['pcre_u']; |
| 974 | 974 | $texte = str_replace(' ', ' ', $texte); |
| 975 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 975 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 976 | 976 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 977 | 977 | $texte = entites_html($texte, false, false); |
| 978 | 978 | // mais bien echapper les double quotes ! |
@@ -1032,7 +1032,7 @@ discard block |
||
| 1032 | 1032 | **/ |
| 1033 | 1033 | function supprimer_numero($texte) { |
| 1034 | 1034 | return preg_replace( |
| 1035 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1035 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1036 | 1036 | '', |
| 1037 | 1037 | $texte |
| 1038 | 1038 | ); |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | function recuperer_numero($texte) { |
| 1061 | 1061 | if ( |
| 1062 | 1062 | preg_match( |
| 1063 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1063 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1064 | 1064 | $texte, |
| 1065 | 1065 | $regs |
| 1066 | 1066 | ) |
@@ -1151,8 +1151,8 @@ discard block |
||
| 1151 | 1151 | **/ |
| 1152 | 1152 | function textebrut($texte) { |
| 1153 | 1153 | $u = $GLOBALS['meta']['pcre_u']; |
| 1154 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1155 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1154 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1155 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1156 | 1156 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1157 | 1157 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1158 | 1158 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1186,7 +1186,7 @@ discard block |
||
| 1186 | 1186 | ) |
| 1187 | 1187 | ) { |
| 1188 | 1188 | foreach ($liens[0] as $a) { |
| 1189 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1189 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1190 | 1190 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1191 | 1191 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1192 | 1192 | $texte = str_replace($a, $ablank, $texte); |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | foreach ($regs[0] as $a) { |
| 1212 | 1212 | $rel = extraire_attribut($a, 'rel') ?? ''; |
| 1213 | 1213 | if (strpos($rel, 'nofollow') === false) { |
| 1214 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1214 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1215 | 1215 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1216 | 1216 | $texte = str_replace($a, $anofollow, $texte); |
| 1217 | 1217 | } |
@@ -1240,7 +1240,7 @@ discard block |
||
| 1240 | 1240 | $u = $GLOBALS['meta']['pcre_u']; |
| 1241 | 1241 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1242 | 1242 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1243 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1243 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1244 | 1244 | |
| 1245 | 1245 | return $texte; |
| 1246 | 1246 | } |
@@ -1271,7 +1271,7 @@ discard block |
||
| 1271 | 1271 | return $texte; |
| 1272 | 1272 | } |
| 1273 | 1273 | include_spip('inc/texte'); |
| 1274 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1274 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1275 | 1275 | 'div' : 'span'; |
| 1276 | 1276 | |
| 1277 | 1277 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1383,7 +1383,7 @@ discard block |
||
| 1383 | 1383 | } |
| 1384 | 1384 | $u = $GLOBALS['meta']['pcre_u']; |
| 1385 | 1385 | if ($textebrut) { |
| 1386 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1386 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1387 | 1387 | } |
| 1388 | 1388 | $texte = texte_backend($texte); |
| 1389 | 1389 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1418,7 +1418,7 @@ discard block |
||
| 1418 | 1418 | # un message pour abs_url |
| 1419 | 1419 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1420 | 1420 | $url = trim($url); |
| 1421 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1421 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1422 | 1422 | |
| 1423 | 1423 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1424 | 1424 | } |
@@ -1618,14 +1618,14 @@ discard block |
||
| 1618 | 1618 | if (strpos($texte, '<') !== false) { |
| 1619 | 1619 | include_spip('inc/lien'); |
| 1620 | 1620 | if (defined('_PREG_MODELE')) { |
| 1621 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1621 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1622 | 1622 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1623 | 1623 | } |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | 1626 | $debut = ''; |
| 1627 | 1627 | $suite = $texte; |
| 1628 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1628 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1629 | 1629 | $debut .= substr($suite, 0, $t - 1); |
| 1630 | 1630 | $suite = substr($suite, $t); |
| 1631 | 1631 | $car = substr($suite, 0, 1); |
@@ -1643,11 +1643,11 @@ discard block |
||
| 1643 | 1643 | $suite = substr($suite, strlen($regs[0])); |
| 1644 | 1644 | } |
| 1645 | 1645 | } |
| 1646 | - $texte = $debut . $suite; |
|
| 1646 | + $texte = $debut.$suite; |
|
| 1647 | 1647 | |
| 1648 | 1648 | $texte = echappe_retour($texte); |
| 1649 | 1649 | |
| 1650 | - return $texte . $fin; |
|
| 1650 | + return $texte.$fin; |
|
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | |
@@ -1709,7 +1709,7 @@ discard block |
||
| 1709 | 1709 | } |
| 1710 | 1710 | |
| 1711 | 1711 | foreach ($regs as $reg) { |
| 1712 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1712 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1713 | 1713 | $desc = $traduire($cle, $lang, true); |
| 1714 | 1714 | $l = $desc->langue; |
| 1715 | 1715 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1823,9 +1823,9 @@ discard block |
||
| 1823 | 1823 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1824 | 1824 | include_spip('inc/texte'); |
| 1825 | 1825 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1826 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1826 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1827 | 1827 | if ($mode === 'div') { |
| 1828 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1828 | + $trad = rtrim($trad)."\n\n"; |
|
| 1829 | 1829 | } |
| 1830 | 1830 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1831 | 1831 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -2025,7 +2025,7 @@ discard block |
||
| 2025 | 2025 | if (is_array($balise)) { |
| 2026 | 2026 | array_walk( |
| 2027 | 2027 | $balise, |
| 2028 | - function (&$a, $key, $t) { |
|
| 2028 | + function(&$a, $key, $t) { |
|
| 2029 | 2029 | $a = extraire_attribut($a, $t); |
| 2030 | 2030 | }, |
| 2031 | 2031 | $attribut |
@@ -2122,14 +2122,14 @@ discard block |
||
| 2122 | 2122 | |
| 2123 | 2123 | if ($old !== null) { |
| 2124 | 2124 | // Remplacer l'ancien attribut du meme nom |
| 2125 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2125 | + $balise = $r[1].$insert.$r[5]; |
|
| 2126 | 2126 | } else { |
| 2127 | 2127 | // preferer une balise " />" (comme <img />) |
| 2128 | 2128 | if (preg_match(',/>,', $balise)) { |
| 2129 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2129 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2130 | 2130 | } // sinon une balise <a ...> ... </a> |
| 2131 | 2131 | else { |
| 2132 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2132 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2133 | 2133 | } |
| 2134 | 2134 | } |
| 2135 | 2135 | |
@@ -2184,7 +2184,7 @@ discard block |
||
| 2184 | 2184 | if ( |
| 2185 | 2185 | $class_courante |
| 2186 | 2186 | and strpos($class_courante, (string) $c) !== false |
| 2187 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2187 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2188 | 2188 | ) { |
| 2189 | 2189 | $is_class_presente = true; |
| 2190 | 2190 | } |
@@ -2192,12 +2192,12 @@ discard block |
||
| 2192 | 2192 | in_array($operation, ['ajouter', 'commuter']) |
| 2193 | 2193 | and !$is_class_presente |
| 2194 | 2194 | ) { |
| 2195 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2195 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2196 | 2196 | } elseif ( |
| 2197 | 2197 | in_array($operation, ['supprimer', 'commuter']) |
| 2198 | 2198 | and $is_class_presente |
| 2199 | 2199 | ) { |
| 2200 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2200 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2201 | 2201 | } |
| 2202 | 2202 | } |
| 2203 | 2203 | |
@@ -2260,7 +2260,7 @@ discard block |
||
| 2260 | 2260 | // Quelques fonctions de calcul arithmetique |
| 2261 | 2261 | // |
| 2262 | 2262 | function floatstr($a) { |
| 2263 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2263 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2264 | 2264 | } |
| 2265 | 2265 | function strize($f, $a, $b) { |
| 2266 | 2266 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2396,13 +2396,13 @@ discard block |
||
| 2396 | 2396 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2397 | 2397 | define('_TAGS_NOM_AUTEUR', ''); |
| 2398 | 2398 | } |
| 2399 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2399 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2400 | 2400 | foreach ($tags_acceptes as $tag) { |
| 2401 | 2401 | if (strlen($tag)) { |
| 2402 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2403 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2404 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2405 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2402 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2403 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2404 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2405 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2406 | 2406 | } |
| 2407 | 2407 | } |
| 2408 | 2408 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2522,10 +2522,10 @@ discard block |
||
| 2522 | 2522 | $fichier = basename($url); |
| 2523 | 2523 | |
| 2524 | 2524 | return '<a rel="enclosure"' |
| 2525 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2526 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2527 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2528 | - . '>' . $fichier . '</a>'; |
|
| 2525 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2526 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2527 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2528 | + . '>'.$fichier.'</a>'; |
|
| 2529 | 2529 | } |
| 2530 | 2530 | |
| 2531 | 2531 | /** |
@@ -2553,9 +2553,9 @@ discard block |
||
| 2553 | 2553 | } # vieux data |
| 2554 | 2554 | $fichier = basename($url); |
| 2555 | 2555 | $enclosures[] = '<enclosure' |
| 2556 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2557 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2558 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2556 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2557 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2558 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2559 | 2559 | . ' />'; |
| 2560 | 2560 | } |
| 2561 | 2561 | } |
@@ -2581,7 +2581,7 @@ discard block |
||
| 2581 | 2581 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2582 | 2582 | $subjects .= '<dc:subject>' |
| 2583 | 2583 | . texte_backend(textebrut($e)) |
| 2584 | - . '</dc:subject>' . "\n"; |
|
| 2584 | + . '</dc:subject>'."\n"; |
|
| 2585 | 2585 | } |
| 2586 | 2586 | } |
| 2587 | 2587 | |
@@ -2617,7 +2617,7 @@ discard block |
||
| 2617 | 2617 | if (is_array($texte)) { |
| 2618 | 2618 | array_walk( |
| 2619 | 2619 | $texte, |
| 2620 | - function (&$a, $key, $t) { |
|
| 2620 | + function(&$a, $key, $t) { |
|
| 2621 | 2621 | $a = extraire_balise($a, $t); |
| 2622 | 2622 | }, |
| 2623 | 2623 | $tag |
@@ -2665,7 +2665,7 @@ discard block |
||
| 2665 | 2665 | if (is_array($texte)) { |
| 2666 | 2666 | array_walk( |
| 2667 | 2667 | $texte, |
| 2668 | - function (&$a, $key, $t) { |
|
| 2668 | + function(&$a, $key, $t) { |
|
| 2669 | 2669 | $a = extraire_balises($a, $t); |
| 2670 | 2670 | }, |
| 2671 | 2671 | $tag |
@@ -2798,7 +2798,7 @@ discard block |
||
| 2798 | 2798 | if ($fond != '404') { |
| 2799 | 2799 | $contexte = array_shift($p); |
| 2800 | 2800 | $contexte['page'] = $fond; |
| 2801 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2801 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2802 | 2802 | } |
| 2803 | 2803 | } |
| 2804 | 2804 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2853,9 +2853,9 @@ discard block |
||
| 2853 | 2853 | . '"' |
| 2854 | 2854 | . (is_null($val) |
| 2855 | 2855 | ? '' |
| 2856 | - : ' value="' . entites_html($val) . '"' |
|
| 2856 | + : ' value="'.entites_html($val).'"' |
|
| 2857 | 2857 | ) |
| 2858 | - . ' type="hidden"' . "\n/>"; |
|
| 2858 | + . ' type="hidden"'."\n/>"; |
|
| 2859 | 2859 | } |
| 2860 | 2860 | |
| 2861 | 2861 | return join('', $hidden); |
@@ -2965,7 +2965,7 @@ discard block |
||
| 2965 | 2965 | |
| 2966 | 2966 | return preg_replace_callback( |
| 2967 | 2967 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2968 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2968 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2969 | 2969 | $contenu |
| 2970 | 2970 | ); |
| 2971 | 2971 | } |
@@ -3026,14 +3026,14 @@ discard block |
||
| 3026 | 3026 | ) { |
| 3027 | 3027 | $distant = true; |
| 3028 | 3028 | $cssf = parse_url($css); |
| 3029 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 3029 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 3030 | 3030 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 3031 | 3031 | } else { |
| 3032 | 3032 | $distant = false; |
| 3033 | 3033 | $cssf = $css; |
| 3034 | 3034 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 3035 | 3035 | //propose (rien a faire dans ce cas) |
| 3036 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 3036 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 3037 | 3037 | if (@file_exists($f)) { |
| 3038 | 3038 | return $f; |
| 3039 | 3039 | } |
@@ -3043,7 +3043,7 @@ discard block |
||
| 3043 | 3043 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 3044 | 3044 | $f = $dir_var |
| 3045 | 3045 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 3046 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 3046 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3047 | 3047 | |
| 3048 | 3048 | // la css peut etre distante (url absolue !) |
| 3049 | 3049 | if ($distant) { |
@@ -3089,8 +3089,8 @@ discard block |
||
| 3089 | 3089 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3090 | 3090 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3091 | 3091 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3092 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3093 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3092 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3093 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3094 | 3094 | } |
| 3095 | 3095 | $src[] = $regs[0][$k]; |
| 3096 | 3096 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3139,7 +3139,7 @@ discard block |
||
| 3139 | 3139 | |
| 3140 | 3140 | $f = basename($css, '.css'); |
| 3141 | 3141 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3142 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3142 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3143 | 3143 | . '.css'; |
| 3144 | 3144 | |
| 3145 | 3145 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3149,7 +3149,7 @@ discard block |
||
| 3149 | 3149 | if ($url_absolue_css == $css) { |
| 3150 | 3150 | if ( |
| 3151 | 3151 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3152 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3152 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3153 | 3153 | ) { |
| 3154 | 3154 | include_spip('inc/distant'); |
| 3155 | 3155 | $contenu = recuperer_url($css); |
@@ -3261,7 +3261,7 @@ discard block |
||
| 3261 | 3261 | $expression = str_replace('\/', '/', $expression); |
| 3262 | 3262 | $expression = str_replace('/', '\/', $expression); |
| 3263 | 3263 | |
| 3264 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3264 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3265 | 3265 | if (isset($r[$capte])) { |
| 3266 | 3266 | return $r[$capte]; |
| 3267 | 3267 | } else { |
@@ -3299,7 +3299,7 @@ discard block |
||
| 3299 | 3299 | $expression = str_replace('\/', '/', $expression); |
| 3300 | 3300 | $expression = str_replace('/', '\/', $expression); |
| 3301 | 3301 | |
| 3302 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3302 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3303 | 3303 | } |
| 3304 | 3304 | |
| 3305 | 3305 | |
@@ -3318,7 +3318,7 @@ discard block |
||
| 3318 | 3318 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3319 | 3319 | |
| 3320 | 3320 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3321 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3321 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3322 | 3322 | |
| 3323 | 3323 | if ( |
| 3324 | 3324 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3332,7 +3332,7 @@ discard block |
||
| 3332 | 3332 | if (!isset($doublons['documents'])) { |
| 3333 | 3333 | $doublons['documents'] = ''; |
| 3334 | 3334 | } |
| 3335 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3335 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3336 | 3336 | } |
| 3337 | 3337 | |
| 3338 | 3338 | return $letexte; |
@@ -3389,7 +3389,7 @@ discard block |
||
| 3389 | 3389 | if ($env) { |
| 3390 | 3390 | foreach ($env as $i => $j) { |
| 3391 | 3391 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3392 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3392 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3393 | 3393 | } |
| 3394 | 3394 | } |
| 3395 | 3395 | } |
@@ -3428,7 +3428,7 @@ discard block |
||
| 3428 | 3428 | if ($env) { |
| 3429 | 3429 | foreach ($env as $i => $j) { |
| 3430 | 3430 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3431 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3431 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3432 | 3432 | } |
| 3433 | 3433 | } |
| 3434 | 3434 | } |
@@ -3502,10 +3502,10 @@ discard block |
||
| 3502 | 3502 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3503 | 3503 | if ( |
| 3504 | 3504 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3505 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3505 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3506 | 3506 | and file_exists($variante_svg_generique) |
| 3507 | 3507 | ) { |
| 3508 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3508 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3509 | 3509 | $img_file = $variante_svg_size; |
| 3510 | 3510 | } |
| 3511 | 3511 | else { |
@@ -3563,7 +3563,7 @@ discard block |
||
| 3563 | 3563 | return ''; |
| 3564 | 3564 | } |
| 3565 | 3565 | } |
| 3566 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3566 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3567 | 3567 | } |
| 3568 | 3568 | |
| 3569 | 3569 | if (file_exists($img_file)) { |
@@ -3573,14 +3573,14 @@ discard block |
||
| 3573 | 3573 | $alt = ''; |
| 3574 | 3574 | } |
| 3575 | 3575 | elseif ($alt or $alt === '') { |
| 3576 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3576 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3577 | 3577 | } |
| 3578 | 3578 | else { |
| 3579 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3579 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3580 | 3580 | } |
| 3581 | - return "<img src='" . attribut_html($img_file) . "'$alt" |
|
| 3582 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3583 | - . ' ' . ltrim($atts) |
|
| 3581 | + return "<img src='".attribut_html($img_file)."'$alt" |
|
| 3582 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3583 | + . ' '.ltrim($atts) |
|
| 3584 | 3584 | . ' />'; |
| 3585 | 3585 | } |
| 3586 | 3586 | |
@@ -3594,10 +3594,10 @@ discard block |
||
| 3594 | 3594 | */ |
| 3595 | 3595 | function http_style_background($img, $att = '', $size = null) { |
| 3596 | 3596 | if ($size and is_numeric($size)) { |
| 3597 | - $size = trim($size) . 'px'; |
|
| 3597 | + $size = trim($size).'px'; |
|
| 3598 | 3598 | } |
| 3599 | - return " style='background" . |
|
| 3600 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3599 | + return " style='background". |
|
| 3600 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3601 | 3601 | . ($size ? "background-size:{$size};" : '') |
| 3602 | 3602 | . "'"; |
| 3603 | 3603 | } |
@@ -3712,7 +3712,7 @@ discard block |
||
| 3712 | 3712 | $img = http_img_pack( |
| 3713 | 3713 | $img, |
| 3714 | 3714 | $alt, |
| 3715 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3715 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3716 | 3716 | '', |
| 3717 | 3717 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3718 | 3718 | ); |
@@ -3797,7 +3797,7 @@ discard block |
||
| 3797 | 3797 | $balise_svg_source = $balise_svg; |
| 3798 | 3798 | |
| 3799 | 3799 | // entete XML à supprimer |
| 3800 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3800 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3801 | 3801 | |
| 3802 | 3802 | // IE est toujours mon ami |
| 3803 | 3803 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3815,9 +3815,9 @@ discard block |
||
| 3815 | 3815 | // regler le alt |
| 3816 | 3816 | if ($alt) { |
| 3817 | 3817 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3818 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3818 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3819 | 3819 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3820 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3820 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3821 | 3821 | $balise_svg .= $title; |
| 3822 | 3822 | } |
| 3823 | 3823 | else { |
@@ -3865,7 +3865,7 @@ discard block |
||
| 3865 | 3865 | if (is_array($tableau)) { |
| 3866 | 3866 | foreach ($tableau as $k => $v) { |
| 3867 | 3867 | $res = recuperer_fond( |
| 3868 | - 'modeles/' . $modele, |
|
| 3868 | + 'modeles/'.$modele, |
|
| 3869 | 3869 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3870 | 3870 | ); |
| 3871 | 3871 | $texte .= $res; |
@@ -4050,7 +4050,7 @@ discard block |
||
| 4050 | 4050 | } |
| 4051 | 4051 | |
| 4052 | 4052 | $c = serialize($c); |
| 4053 | - $cle = calculer_cle_action($form . $c); |
|
| 4053 | + $cle = calculer_cle_action($form.$c); |
|
| 4054 | 4054 | $c = "$cle:$c"; |
| 4055 | 4055 | |
| 4056 | 4056 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4108,15 +4108,15 @@ discard block |
||
| 4108 | 4108 | } |
| 4109 | 4109 | // toujours encoder l'url source dans le bloc ajax |
| 4110 | 4110 | $r = self(); |
| 4111 | - $r = ' data-origin="' . $r . '"'; |
|
| 4111 | + $r = ' data-origin="'.$r.'"'; |
|
| 4112 | 4112 | $class = 'ajaxbloc'; |
| 4113 | 4113 | if ($ajaxid and is_string($ajaxid)) { |
| 4114 | 4114 | // ajaxid est normalement conforme a un nom de classe css |
| 4115 | 4115 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4116 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4116 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4117 | 4117 | } |
| 4118 | 4118 | |
| 4119 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4119 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4120 | 4120 | } |
| 4121 | 4121 | |
| 4122 | 4122 | /** |
@@ -4160,7 +4160,7 @@ discard block |
||
| 4160 | 4160 | $cle = substr($c, 0, $p); |
| 4161 | 4161 | $c = substr($c, $p + 1); |
| 4162 | 4162 | |
| 4163 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4163 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4164 | 4164 | $env = @unserialize($c); |
| 4165 | 4165 | return $env; |
| 4166 | 4166 | } |
@@ -4281,13 +4281,13 @@ discard block |
||
| 4281 | 4281 | } |
| 4282 | 4282 | } |
| 4283 | 4283 | } |
| 4284 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4284 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4285 | 4285 | } else { |
| 4286 | 4286 | $bal = 'a'; |
| 4287 | 4287 | $att = "href='$url'" |
| 4288 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4289 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4290 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4288 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4289 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4290 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4291 | 4291 | . $evt; |
| 4292 | 4292 | } |
| 4293 | 4293 | if ($libelle === null) { |
@@ -4426,7 +4426,7 @@ discard block |
||
| 4426 | 4426 | |
| 4427 | 4427 | // Icône |
| 4428 | 4428 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4429 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4429 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4430 | 4430 | |
| 4431 | 4431 | // Markup final |
| 4432 | 4432 | if ($type == 'lien') { |
@@ -4701,20 +4701,20 @@ discard block |
||
| 4701 | 4701 | $class_form = 'ajax'; |
| 4702 | 4702 | $class = str_replace('ajax', '', $class); |
| 4703 | 4703 | } |
| 4704 | - $class_btn = 'submit ' . trim($class); |
|
| 4704 | + $class_btn = 'submit '.trim($class); |
|
| 4705 | 4705 | |
| 4706 | 4706 | if ($confirm) { |
| 4707 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4707 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4708 | 4708 | if ($callback) { |
| 4709 | 4709 | $callback = "$confirm?($callback):false"; |
| 4710 | 4710 | } else { |
| 4711 | 4711 | $callback = $confirm; |
| 4712 | 4712 | } |
| 4713 | 4713 | } |
| 4714 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4714 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4715 | 4715 | $title = $title ? " title='$title'" : ''; |
| 4716 | 4716 | |
| 4717 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4717 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4718 | 4718 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4719 | 4719 | } |
| 4720 | 4720 | |
@@ -4779,14 +4779,14 @@ discard block |
||
| 4779 | 4779 | $champ_titre = ''; |
| 4780 | 4780 | if ($demande_titre) { |
| 4781 | 4781 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4782 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4782 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4783 | 4783 | } |
| 4784 | 4784 | include_spip('base/abstract_sql'); |
| 4785 | 4785 | include_spip('base/connect_sql'); |
| 4786 | 4786 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4787 | - '*' . $champ_titre, |
|
| 4787 | + '*'.$champ_titre, |
|
| 4788 | 4788 | $desc['table_sql'], |
| 4789 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4789 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4790 | 4790 | ); |
| 4791 | 4791 | |
| 4792 | 4792 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4879,8 +4879,7 @@ discard block |
||
| 4879 | 4879 | if (isset($ligne_sql['chapo'])) { |
| 4880 | 4880 | $chapo = $ligne_sql['chapo']; |
| 4881 | 4881 | $texte = strlen($descriptif) ? |
| 4882 | - '' : |
|
| 4883 | - "$chapo \n\n $texte"; |
|
| 4882 | + '' : "$chapo \n\n $texte"; |
|
| 4884 | 4883 | } |
| 4885 | 4884 | |
| 4886 | 4885 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4955,7 +4954,7 @@ discard block |
||
| 4955 | 4954 | return $texte; |
| 4956 | 4955 | } |
| 4957 | 4956 | |
| 4958 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4957 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4959 | 4958 | |
| 4960 | 4959 | // signaler qu'on est dans l'espace prive pour les filtres qui se servent de ce flag |
| 4961 | 4960 | if (test_espace_prive()) { |
@@ -4994,7 +4993,7 @@ discard block |
||
| 4994 | 4993 | } |
| 4995 | 4994 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4996 | 4995 | |
| 4997 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4996 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4998 | 4997 | } |
| 4999 | 4998 | |
| 5000 | 4999 | /** |
@@ -5020,10 +5019,10 @@ discard block |
||
| 5020 | 5019 | function wrap($texte, $wrap) { |
| 5021 | 5020 | $balises = extraire_balises($wrap); |
| 5022 | 5021 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 5023 | - $texte = $wrap . $texte; |
|
| 5022 | + $texte = $wrap.$texte; |
|
| 5024 | 5023 | $regs = array_reverse($regs[1]); |
| 5025 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 5026 | - $texte = $texte . $wrap; |
|
| 5024 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 5025 | + $texte = $texte.$wrap; |
|
| 5027 | 5026 | } |
| 5028 | 5027 | |
| 5029 | 5028 | return $texte; |
@@ -5054,7 +5053,7 @@ discard block |
||
| 5054 | 5053 | |
| 5055 | 5054 | // caster $u en array si besoin |
| 5056 | 5055 | if (is_object($u)) { |
| 5057 | - $u = (array)$u; |
|
| 5056 | + $u = (array) $u; |
|
| 5058 | 5057 | } |
| 5059 | 5058 | |
| 5060 | 5059 | if (is_array($u)) { |
@@ -5076,7 +5075,7 @@ discard block |
||
| 5076 | 5075 | // sinon on passe a la ligne et on indente |
| 5077 | 5076 | $i_str = str_pad('', $indent, ' '); |
| 5078 | 5077 | foreach ($u as $k => $v) { |
| 5079 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5078 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5080 | 5079 | } |
| 5081 | 5080 | |
| 5082 | 5081 | return $out; |
@@ -5130,7 +5129,7 @@ discard block |
||
| 5130 | 5129 | * @return string |
| 5131 | 5130 | */ |
| 5132 | 5131 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5133 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5132 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5134 | 5133 | $icone = chemin_image($icone); |
| 5135 | 5134 | $balise_img = charger_filtre('balise_img'); |
| 5136 | 5135 | |
@@ -5156,7 +5155,7 @@ discard block |
||
| 5156 | 5155 | */ |
| 5157 | 5156 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5158 | 5157 | $chaine = explode(':', $chaine); |
| 5159 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5158 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5160 | 5159 | return $t; |
| 5161 | 5160 | } |
| 5162 | 5161 | $chaine = implode(':', $chaine); |
@@ -5222,7 +5221,7 @@ discard block |
||
| 5222 | 5221 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5223 | 5222 | |
| 5224 | 5223 | // calculer le nom de la css |
| 5225 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5224 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5226 | 5225 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5227 | 5226 | $contexte_implicite = calculer_contexte_implicite(); |
| 5228 | 5227 | |
@@ -5230,14 +5229,14 @@ discard block |
||
| 5230 | 5229 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5231 | 5230 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5232 | 5231 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5233 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5232 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5234 | 5233 | } |
| 5235 | 5234 | else { |
| 5236 | 5235 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5237 | 5236 | ksort($contexte); |
| 5238 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5237 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5239 | 5238 | } |
| 5240 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5239 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5241 | 5240 | |
| 5242 | 5241 | // mettre a jour le fichier si il n'existe pas |
| 5243 | 5242 | // ou trop ancien |
@@ -5245,8 +5244,8 @@ discard block |
||
| 5245 | 5244 | // et recopie sur le fichier cible uniquement si il change |
| 5246 | 5245 | if ( |
| 5247 | 5246 | !file_exists($filename) |
| 5248 | - or !file_exists($filename . '.last') |
|
| 5249 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5247 | + or !file_exists($filename.'.last') |
|
| 5248 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5250 | 5249 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5251 | 5250 | ) { |
| 5252 | 5251 | $contenu = $cache['texte']; |
@@ -5270,10 +5269,10 @@ discard block |
||
| 5270 | 5269 | } |
| 5271 | 5270 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5272 | 5271 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5273 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5272 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5274 | 5273 | } |
| 5275 | 5274 | // et ecrire le fichier si il change |
| 5276 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5275 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5277 | 5276 | } |
| 5278 | 5277 | |
| 5279 | 5278 | return timestamp($filename); |
@@ -5506,7 +5505,7 @@ discard block |
||
| 5506 | 5505 | if ($e > 0 and strlen($mid) > 8) { |
| 5507 | 5506 | $mid = '***...***'; |
| 5508 | 5507 | } |
| 5509 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5508 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5510 | 5509 | } |
| 5511 | 5510 | |
| 5512 | 5511 | |
@@ -5568,7 +5567,7 @@ discard block |
||
| 5568 | 5567 | case 'id': |
| 5569 | 5568 | case 'anchor': |
| 5570 | 5569 | if (preg_match(',^\d,', $texte)) { |
| 5571 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5570 | + $texte = substr($type, 0, 1).$texte; |
|
| 5572 | 5571 | } |
| 5573 | 5572 | } |
| 5574 | 5573 | |
@@ -5578,9 +5577,9 @@ discard block |
||
| 5578 | 5577 | |
| 5579 | 5578 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5580 | 5579 | if (preg_match(',^\d,', $texte)) { |
| 5581 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5580 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5582 | 5581 | } |
| 5583 | - $texte .= $separateur . md5($original); |
|
| 5582 | + $texte .= $separateur.md5($original); |
|
| 5584 | 5583 | $texte = substr($texte, 0, $longueur_mini); |
| 5585 | 5584 | } |
| 5586 | 5585 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $GLOBALS['debug_objets']['courant'] = $nom; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - $phpfile = sous_repertoire(_DIR_SKELS, '', false, true) . $nom . '.php'; |
|
| 58 | + $phpfile = sous_repertoire(_DIR_SKELS, '', false, true).$nom.'.php'; |
|
| 59 | 59 | |
| 60 | 60 | // si squelette est deja compile et perenne, le charger |
| 61 | 61 | if (!squelette_obsolete($phpfile, $source)) { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | #} |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if (file_exists($lib = $squelette . '_fonctions' . '.php')) { |
|
| 71 | + if (file_exists($lib = $squelette.'_fonctions'.'.php')) { |
|
| 72 | 72 | include_once $lib; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | eval("return true; $f ;"); |
| 97 | 97 | } catch (\ParseError $e) { |
| 98 | 98 | // Code syntaxiquement faux (critere etc mal programme') |
| 99 | - $msg = _T('zbug_erreur_compilation') . ' | Line ' . $e->getLine() . ' : ' . $e->getMessage(); |
|
| 99 | + $msg = _T('zbug_erreur_compilation').' | Line '.$e->getLine().' : '.$e->getMessage(); |
|
| 100 | 100 | erreur_squelette($msg, $boucle); |
| 101 | 101 | // continuer pour trouver d'autres fautes eventuelles |
| 102 | 102 | // mais prevenir que c'est mort |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | if (defined('_VAR_MODE') and _VAR_MODE == 'debug') { |
| 126 | 126 | // Tracer ce qui vient d'etre compile |
| 127 | - $GLOBALS['debug_objets']['code'][$nom . 'tout'] = $code; |
|
| 127 | + $GLOBALS['debug_objets']['code'][$nom.'tout'] = $code; |
|
| 128 | 128 | |
| 129 | 129 | // si c'est ce que demande le debusqueur, lui passer la main |
| 130 | 130 | if ( |
@@ -148,13 +148,13 @@ discard block |
||
| 148 | 148 | $code = " |
| 149 | 149 | /* |
| 150 | 150 | * Squelette : $sourcefile |
| 151 | - * Date : " . gmdate('D, d M Y H:i:s', @filemtime($sourcefile)) . ' GMT |
|
| 152 | - * Compile : ' . gmdate('D, d M Y H:i:s', time()) . ' GMT |
|
| 153 | - * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : ' . $noms)) . ' |
|
| 151 | + * Date : ".gmdate('D, d M Y H:i:s', @filemtime($sourcefile)).' GMT |
|
| 152 | + * Compile : ' . gmdate('D, d M Y H:i:s', time()).' GMT |
|
| 153 | + * ' . (!$boucles ? 'Pas de boucle' : ('Boucles : '.$noms)).' |
|
| 154 | 154 | */ '; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - $code = '<' . "?php\n" . $code . join('', $boucles) . "\n"; |
|
| 157 | + $code = '<'."?php\n".$code.join('', $boucles)."\n"; |
|
| 158 | 158 | if (!defined('_VAR_NOCACHE') or !_VAR_NOCACHE) { |
| 159 | 159 | ecrire_fichier($phpfile, $code); |
| 160 | 160 | } |
@@ -216,18 +216,18 @@ discard block |
||
| 216 | 216 | $j = join('-', array_map('ucwords', explode('-', strtolower($r[2])))); |
| 217 | 217 | |
| 218 | 218 | if ($j == 'X-Spip-Filtre' and isset($headers[$j])) { |
| 219 | - $headers[$j] .= '|' . $r[3]; |
|
| 219 | + $headers[$j] .= '|'.$r[3]; |
|
| 220 | 220 | } else { |
| 221 | - $headers[$j] = str_replace(['\\\\',"\\'",'\\"'], ['\\',"'",'"'],$r[3]); |
|
| 221 | + $headers[$j] = str_replace(['\\\\', "\\'", '\\"'], ['\\', "'", '"'], $r[3]); |
|
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | // S'agit-il d'un resultat constant ou contenant du code php |
| 226 | 226 | $process_ins = ( |
| 227 | - strpos($corps, '<' . '?') === false |
|
| 227 | + strpos($corps, '<'.'?') === false |
|
| 228 | 228 | or |
| 229 | - (strpos($corps, '<' . '?xml') !== false and |
|
| 230 | - strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false) |
|
| 229 | + (strpos($corps, '<'.'?xml') !== false and |
|
| 230 | + strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false) |
|
| 231 | 231 | ) |
| 232 | 232 | ? 'html' |
| 233 | 233 | : 'php'; |
@@ -256,10 +256,10 @@ discard block |
||
| 256 | 256 | |
| 257 | 257 | if ($process_ins == 'html') { |
| 258 | 258 | $skel['process_ins'] = ( |
| 259 | - strpos($corps, '<' . '?') === false |
|
| 259 | + strpos($corps, '<'.'?') === false |
|
| 260 | 260 | or |
| 261 | - (strpos($corps, '<' . '?xml') !== false and |
|
| 262 | - strpos(str_replace('<' . '?xml', '', $corps), '<' . '?') === false) |
|
| 261 | + (strpos($corps, '<'.'?xml') !== false and |
|
| 262 | + strpos(str_replace('<'.'?xml', '', $corps), '<'.'?') === false) |
|
| 263 | 263 | ) |
| 264 | 264 | ? 'html' |
| 265 | 265 | : 'php'; |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | // |
| 278 | 278 | |
| 279 | 279 | /** Code PHP pour inclure une balise dynamique à l'exécution d'une page */ |
| 280 | -define('CODE_INCLURE_BALISE', '<' . '?php |
|
| 280 | +define('CODE_INCLURE_BALISE', '<'.'?php |
|
| 281 | 281 | include_once("%s"); |
| 282 | 282 | if ($lang_select = "%s") $lang_select = lang_select($lang_select); |
| 283 | 283 | inserer_balise_dynamique(balise_%s_dyn(%s), array(%s)); |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | // pas de lien symbolique sous Windows |
| 309 | 309 | and !(stristr(PHP_OS, 'WIN') and strpos($file, ':') !== false) |
| 310 | 310 | ) { |
| 311 | - $file = './" . _DIR_RACINE . "' . $file; |
|
| 311 | + $file = './" . _DIR_RACINE . "'.$file; |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | $lang = $context_compil[4]; |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | |
| 319 | 319 | $args = array_map('argumenter_squelette', $args); |
| 320 | 320 | if (!empty($context_compil['appel_php_depuis_modele'])) { |
| 321 | - $args[0] = 'arguments_balise_dyn_depuis_modele(' . $args[0] . ')'; |
|
| 321 | + $args[0] = 'arguments_balise_dyn_depuis_modele('.$args[0].')'; |
|
| 322 | 322 | } |
| 323 | 323 | $args = join(', ', $args); |
| 324 | 324 | |
@@ -352,14 +352,14 @@ discard block |
||
| 352 | 352 | if (is_object($v)) { |
| 353 | 353 | return var_export($v, true); |
| 354 | 354 | } elseif (!is_array($v)) { |
| 355 | - return "'" . texte_script((string) $v) . "'"; |
|
| 355 | + return "'".texte_script((string) $v)."'"; |
|
| 356 | 356 | } else { |
| 357 | 357 | $out = []; |
| 358 | 358 | foreach ($v as $k => $val) { |
| 359 | - $out [] = argumenter_squelette($k) . '=>' . argumenter_squelette($val); |
|
| 359 | + $out [] = argumenter_squelette($k).'=>'.argumenter_squelette($val); |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | - return 'array(' . join(', ', $out) . ')'; |
|
| 362 | + return 'array('.join(', ', $out).')'; |
|
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | // Y a-t-il une fonction de traitement des arguments ? |
| 440 | - $f = 'balise_' . $nom_balise . '_stat'; |
|
| 440 | + $f = 'balise_'.$nom_balise.'_stat'; |
|
| 441 | 441 | |
| 442 | 442 | $r = !function_exists($f) ? $args : $f($args, $context_compil); |
| 443 | 443 | |
@@ -447,18 +447,18 @@ discard block |
||
| 447 | 447 | |
| 448 | 448 | // verifier que la fonction dyn est la, |
| 449 | 449 | // sinon se replier sur la generique si elle existe |
| 450 | - if (!function_exists('balise_' . $nom_balise . '_dyn')) { |
|
| 450 | + if (!function_exists('balise_'.$nom_balise.'_dyn')) { |
|
| 451 | 451 | if ( |
| 452 | 452 | $balise_generique = chercher_balise_generique($nom) |
| 453 | 453 | and $nom_balise_generique = $balise_generique['nom_generique'] |
| 454 | - and $file = include_spip('balise/' . strtolower($nom_balise_generique)) |
|
| 455 | - and function_exists('balise_' . $nom_balise_generique . '_dyn') |
|
| 454 | + and $file = include_spip('balise/'.strtolower($nom_balise_generique)) |
|
| 455 | + and function_exists('balise_'.$nom_balise_generique.'_dyn') |
|
| 456 | 456 | ) { |
| 457 | 457 | // et lui injecter en premier arg le nom de la balise |
| 458 | 458 | array_unshift($r, $nom); |
| 459 | 459 | $nom_balise = $nom_balise_generique; |
| 460 | 460 | if (!_DIR_RESTREINT) { |
| 461 | - $file = _DIR_RESTREINT_ABS . $file; |
|
| 461 | + $file = _DIR_RESTREINT_ABS.$file; |
|
| 462 | 462 | } |
| 463 | 463 | } else { |
| 464 | 464 | $msg = ['zbug_balise_inexistante', ['from' => 'CVT', 'balise' => $nom]]; |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | $n = ''; |
| 560 | 560 | foreach (explode(',', $liste) as $val) { |
| 561 | 561 | if ($a = intval($val) and $val === strval($a)) { |
| 562 | - $n .= ',' . $val; |
|
| 562 | + $n .= ','.$val; |
|
| 563 | 563 | } |
| 564 | 564 | } |
| 565 | 565 | if (strlen($n)) { |
@@ -738,8 +738,8 @@ discard block |
||
| 738 | 738 | // on construit le where une fois, puis on ajoute les where complentaires si besoin, et on reconstruit le where en fonction |
| 739 | 739 | $i = 0; |
| 740 | 740 | do { |
| 741 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 742 | - [$sous[1] . ' AS id'], |
|
| 741 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 742 | + [$sous[1].' AS id'], |
|
| 743 | 743 | $from, |
| 744 | 744 | $from_type, |
| 745 | 745 | $wheresub, |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | $id, |
| 753 | 753 | $serveur, |
| 754 | 754 | false |
| 755 | - ) . ')'); |
|
| 755 | + ).')'); |
|
| 756 | 756 | if (!$i) { |
| 757 | 757 | $i = 1; |
| 758 | 758 | $wherestring = calculer_where_to_string($where[$k]); |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | if ($sous[0] == 'SUBSELECT') { |
| 773 | 773 | // c'est une sous requete explicite sous la forme identique a sql_select : (SUBSELECT,$select,$from,$where,$groupby,$orderby,$limit,$having) |
| 774 | 774 | array_push($where_simples, $sous[3]); // est-ce utile dans ce cas ? |
| 775 | - $where[$k] = remplace_sous_requete($w, '(' . calculer_select( |
|
| 775 | + $where[$k] = remplace_sous_requete($w, '('.calculer_select( |
|
| 776 | 776 | $sous[1], # select |
| 777 | 777 | $sous[2], #from |
| 778 | 778 | [], #from_type |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | $id, |
| 788 | 788 | $serveur, |
| 789 | 789 | false |
| 790 | - ) . ')'); |
|
| 790 | + ).')'); |
|
| 791 | 791 | } |
| 792 | 792 | array_pop($where_simples); |
| 793 | 793 | } |
@@ -850,15 +850,15 @@ discard block |
||
| 850 | 850 | // sans recours a preg_match |
| 851 | 851 | // un implode(' ',..) est fait dans reinjecte_joint un peu plus bas |
| 852 | 852 | $afrom[$t][$cle] = [ |
| 853 | - "\n" . |
|
| 854 | - ($from_type[$cle] ?? 'INNER') . ' JOIN', |
|
| 853 | + "\n". |
|
| 854 | + ($from_type[$cle] ?? 'INNER').' JOIN', |
|
| 855 | 855 | $from[$cle], |
| 856 | 856 | "AS $cle", |
| 857 | 857 | 'ON (', |
| 858 | 858 | "$cle.$c", |
| 859 | 859 | '=', |
| 860 | 860 | "$t.$carr", |
| 861 | - ($and ? 'AND ' . $and : '') . |
|
| 861 | + ($and ? 'AND '.$and : ''). |
|
| 862 | 862 | ')' |
| 863 | 863 | ]; |
| 864 | 864 | if (isset($afrom[$cle])) { |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | $t = key($from); |
| 897 | 897 | $c = current($from); |
| 898 | 898 | reset($from); |
| 899 | - $e = '/\b(' . "$t\\." . join('|' . $t . '\.', $equiv) . ')\b/'; |
|
| 899 | + $e = '/\b('."$t\\.".join('|'.$t.'\.', $equiv).')\b/'; |
|
| 900 | 900 | if ( |
| 901 | 901 | !(strpos($t, ' ') or // jointure des le depart cf boucle_doc |
| 902 | 902 | calculer_jointnul($t, $select, $e) or |
@@ -914,7 +914,7 @@ discard block |
||
| 914 | 914 | unset($afrom[$t][$nt]); |
| 915 | 915 | $afrom[$nt] = $afrom[$t]; |
| 916 | 916 | unset($afrom[$t]); |
| 917 | - $e = '/\b' . preg_quote($nfrom[6]) . '\b/'; |
|
| 917 | + $e = '/\b'.preg_quote($nfrom[6]).'\b/'; |
|
| 918 | 918 | $t = $nfrom[4]; |
| 919 | 919 | $alias = ''; |
| 920 | 920 | // verifier que les deux cles sont homonymes, sinon installer un alias dans le select |
@@ -925,14 +925,14 @@ discard block |
||
| 925 | 925 | if ($newcle != $oldcle) { |
| 926 | 926 | // si l'ancienne cle etait deja dans le select avec un AS |
| 927 | 927 | // reprendre simplement ce AS |
| 928 | - $as = '/\b' . preg_quote($nfrom[6]) . '\s+(AS\s+\w+)\b/'; |
|
| 928 | + $as = '/\b'.preg_quote($nfrom[6]).'\s+(AS\s+\w+)\b/'; |
|
| 929 | 929 | if (preg_match($as, implode(',', $select), $m)) { |
| 930 | 930 | $alias = ''; |
| 931 | 931 | } else { |
| 932 | - $alias = ', ' . $nfrom[4] . " AS $oldcle"; |
|
| 932 | + $alias = ', '.$nfrom[4]." AS $oldcle"; |
|
| 933 | 933 | } |
| 934 | 934 | } |
| 935 | - $select = remplacer_jointnul($t . $alias, $select, $e); |
|
| 935 | + $select = remplacer_jointnul($t.$alias, $select, $e); |
|
| 936 | 936 | $join = remplacer_jointnul($t, $join, $e); |
| 937 | 937 | $where = remplacer_jointnul($t, $where, $e); |
| 938 | 938 | $having = remplacer_jointnul($t, $having, $e); |
@@ -982,9 +982,9 @@ discard block |
||
| 982 | 982 | } else { |
| 983 | 983 | $exp = ''; |
| 984 | 984 | if (strtoupper($join) === 'AND') { |
| 985 | - return $exp . join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 985 | + return $exp.join(" $join ", array_map('calculer_where_to_string', $v)); |
|
| 986 | 986 | } else { |
| 987 | - return $exp . join($join, $v); |
|
| 987 | + return $exp.join($join, $v); |
|
| 988 | 988 | } |
| 989 | 989 | } |
| 990 | 990 | } |
@@ -1046,6 +1046,6 @@ discard block |
||
| 1046 | 1046 | } |
| 1047 | 1047 | |
| 1048 | 1048 | return $mime_type |
| 1049 | - . (!$connect ? '' : preg_replace('/\W/', '_', $connect)) . '_' |
|
| 1050 | - . md5($GLOBALS['spip_version_code'] . ' * ' . $skel . (isset($GLOBALS['marqueur_skel']) ? '*' . $GLOBALS['marqueur_skel'] : '')); |
|
| 1049 | + . (!$connect ? '' : preg_replace('/\W/', '_', $connect)).'_' |
|
| 1050 | + . md5($GLOBALS['spip_version_code'].' * '.$skel.(isset($GLOBALS['marqueur_skel']) ? '*'.$GLOBALS['marqueur_skel'] : '')); |
|
| 1051 | 1051 | } |