@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | if (!$max_age) { |
| 107 | 107 | $max_age = _DEFAULT_LOCKTIME; |
| 108 | 108 | } |
| 109 | - $lock_file = _DIR_TMP . _NAME_LOCK . '-' . substr(md5($fichier), 0, 8); |
|
| 109 | + $lock_file = _DIR_TMP._NAME_LOCK.'-'.substr(md5($fichier), 0, 8); |
|
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | /* |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | |
| 117 | 117 | $id = creer_uniqid(); |
| 118 | - $tpath = _DIR_TMP . "slock.$id"; |
|
| 118 | + $tpath = _DIR_TMP."slock.$id"; |
|
| 119 | 119 | $tmpfd = @fopen($tpath, 'w'); // hum, le 'x' necessite php4,3,2 ... |
| 120 | 120 | if (!$tmpfd) { /* open failed */ |
| 121 | 121 | @fclose($tmpfd); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * thinks the current time is (our_tmp.st_ctime).. |
| 242 | 242 | */ |
| 243 | 243 | |
| 244 | - $tpath = _DIR_TMP . "stime.$id"; |
|
| 244 | + $tpath = _DIR_TMP."stime.$id"; |
|
| 245 | 245 | $tmpfd = @fopen($tpath, 'w'); |
| 246 | 246 | if ( |
| 247 | 247 | (!$tmpfd) |
@@ -255,14 +255,14 @@ discard block |
||
| 255 | 255 | return false; //(NFSL_SYSF); |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - @fclose($tmpfd); /* We don't need this once we have our_tmp.st_ctime. */ |
|
| 258 | + @fclose($tmpfd); /* We don't need this once we have our_tmp.st_ctime. */ |
|
| 259 | 259 | spip_unlink($tpath); |
| 260 | 260 | |
| 261 | 261 | /* |
| 262 | 262 | * 2. make fullpath, a buffer for the full pathname of the lock file |
| 263 | 263 | */ |
| 264 | 264 | |
| 265 | - $lock_file = _DIR_TMP . _NAME_LOCK . '-' . substr(md5($fichier), 0, 8); |
|
| 265 | + $lock_file = _DIR_TMP._NAME_LOCK.'-'.substr(md5($fichier), 0, 8); |
|
| 266 | 266 | |
| 267 | 267 | /* |
| 268 | 268 | * 3. If the ctime hasn't been modified, unlink the file and return. If the |
@@ -282,10 +282,10 @@ discard block |
||
| 282 | 282 | if (!$test) { |
| 283 | 283 | return false; |
| 284 | 284 | } //(NFSL_LOST); |
| 285 | - sleep(1 + (random_int(0, 4))); /* so sleep a bit */ |
|
| 285 | + sleep(1 + (random_int(0, 4))); /* so sleep a bit */ |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - return true;//(NFSL_OK); /* success */ |
|
| 288 | + return true; //(NFSL_OK); /* success */ |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /* |
@@ -87,12 +87,12 @@ |
||
| 87 | 87 | } |
| 88 | 88 | // si une seule colonne, en faire le titre |
| 89 | 89 | if (preg_match("/^([^$sep]+)$sep+\$/", $entete, $l)) { |
| 90 | - $caption = "\n||" . $l[1] . '|'; |
|
| 90 | + $caption = "\n||".$l[1].'|'; |
|
| 91 | 91 | [$entete, $corps] = explode("\n", $corps, 2); |
| 92 | 92 | } |
| 93 | 93 | // si premiere colonne vide, le raccourci doit quand meme produire <th... |
| 94 | 94 | if ($entete[0] == $sep) { |
| 95 | - $entete = ' ' . $entete; |
|
| 95 | + $entete = ' '.$entete; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $lignes = explode("\n", $corps); |
@@ -37,16 +37,16 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // Regarder dans le repertoire local des images TeX et blocs MathML |
| 40 | - if (!@is_dir($dir_tex = _DIR_VAR . 'cache-TeX/')) { |
|
| 40 | + if (!@is_dir($dir_tex = _DIR_VAR.'cache-TeX/')) { |
|
| 41 | 41 | @mkdir($dir_tex, _SPIP_CHMOD); |
| 42 | 42 | } |
| 43 | - $fichier = $dir_tex . md5(trim($tex)) . $ext; |
|
| 43 | + $fichier = $dir_tex.md5(trim($tex)).$ext; |
|
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | if (!@file_exists($fichier)) { |
| 47 | 47 | // Aller chercher l'image sur le serveur |
| 48 | 48 | if ($server) { |
| 49 | - spip_log($url = $server . '?' . rawurlencode($tex)); |
|
| 49 | + spip_log($url = $server.'?'.rawurlencode($tex)); |
|
| 50 | 50 | include_spip('inc/distant'); |
| 51 | 51 | recuperer_url($url, ['file' => $fichier]); |
| 52 | 52 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return implode('', file($fichier)); |
| 62 | 62 | } // TeX |
| 63 | 63 | else { |
| 64 | - [, , , $size] = @spip_getimagesize($fichier); |
|
| 64 | + [,,, $size] = @spip_getimagesize($fichier); |
|
| 65 | 65 | $alt = "alt=\"$tex\" title=\"$tex\""; |
| 66 | 66 | |
| 67 | 67 | return "<img src=\"$fichier\" style=\"vertical-align:middle;\" $size $alt />"; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | if ($defaire_amp) { |
| 129 | 129 | $expression = str_replace('&', '&', $expression); |
| 130 | 130 | } |
| 131 | - $echap = "\n<p class=\"spip\" style=\"text-align: center;\">" . produire_image_math($expression) . "</p>\n"; |
|
| 131 | + $echap = "\n<p class=\"spip\" style=\"text-align: center;\">".produire_image_math($expression)."</p>\n"; |
|
| 132 | 132 | $pos = strpos($texte_milieu, (string) $regs[0]); |
| 133 | 133 | $texte_milieu = substr($texte_milieu, 0, $pos) |
| 134 | 134 | . code_echappement($echap, $source) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | . substr($texte_milieu, $pos + strlen($regs[0])); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - $texte_a_voir = $texte_debut . $texte_milieu . $texte_fin; |
|
| 151 | + $texte_a_voir = $texte_debut.$texte_milieu.$texte_fin; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | return $texte_a_voir; |
@@ -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 | } |
@@ -320,11 +320,11 @@ discard block |
||
| 320 | 320 | $img = "<img src='$source' />"; |
| 321 | 321 | } elseif ( |
| 322 | 322 | preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs) |
| 323 | - and $extension = _image_trouver_extension_depuis_mime('image/' . $regs[1]) |
|
| 323 | + and $extension = _image_trouver_extension_depuis_mime('image/'.$regs[1]) |
|
| 324 | 324 | and in_array($extension, _image_extensions_acceptees_en_entree()) |
| 325 | 325 | ) { |
| 326 | 326 | # gerer img src="data:....base64" |
| 327 | - $local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension); |
|
| 327 | + $local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension); |
|
| 328 | 328 | if (!file_exists($local)) { |
| 329 | 329 | ecrire_fichier($local, base64_decode($regs[2])); |
| 330 | 330 | } |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | // les protocoles web prennent au moins 3 lettres |
| 342 | 342 | if (tester_url_absolue($source)) { |
| 343 | 343 | include_spip('inc/distant'); |
| 344 | - $fichier = _DIR_RACINE . copie_locale($source); |
|
| 344 | + $fichier = _DIR_RACINE.copie_locale($source); |
|
| 345 | 345 | if (!$fichier) { |
| 346 | 346 | return ''; |
| 347 | 347 | } |
@@ -439,9 +439,9 @@ discard block |
||
| 439 | 439 | // on garde la terminaison initiale car image simplement copiee |
| 440 | 440 | // et on postfixe son nom avec un md5 du path |
| 441 | 441 | $terminaison_dest = $terminaison; |
| 442 | - $fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5); |
|
| 442 | + $fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5); |
|
| 443 | 443 | } else { |
| 444 | - $fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5); |
|
| 444 | + $fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5); |
|
| 445 | 445 | } |
| 446 | 446 | $cache = sous_repertoire(_DIR_VAR, $cache); |
| 447 | 447 | $cache = sous_repertoire($cache, $effet); |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | $fichier_dest = substr($fichier_dest, 2); |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | - $fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest; |
|
| 455 | + $fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest; |
|
| 456 | 456 | |
| 457 | 457 | $GLOBALS['images_calculees'][] = $fichier_dest; |
| 458 | 458 | |
@@ -490,15 +490,15 @@ discard block |
||
| 490 | 490 | |
| 491 | 491 | if ($creer) { |
| 492 | 492 | spip_log( |
| 493 | - 'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier", |
|
| 494 | - 'images' . _LOG_DEBUG |
|
| 493 | + 'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier", |
|
| 494 | + 'images'._LOG_DEBUG |
|
| 495 | 495 | ); |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | $term_fonction = _image_trouver_extension_pertinente($fichier); |
| 499 | - $ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction; |
|
| 499 | + $ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction; |
|
| 500 | 500 | $ret['fichier'] = $fichier; |
| 501 | - $ret['fonction_image'] = '_image_image' . $terminaison_dest; |
|
| 501 | + $ret['fonction_image'] = '_image_image'.$terminaison_dest; |
|
| 502 | 502 | $ret['fichier_dest'] = $fichier_dest; |
| 503 | 503 | $ret['format_source'] = _image_extension_normalisee($terminaison); |
| 504 | 504 | $ret['format_dest'] = $terminaison_dest; |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | |
| 648 | 648 | $_terminaison = _image_trouver_extension_depuis_mime($mime); |
| 649 | 649 | if ($_terminaison and $_terminaison !== $terminaison) { |
| 650 | - spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE); |
|
| 650 | + spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE); |
|
| 651 | 651 | $terminaison = $_terminaison; |
| 652 | 652 | } |
| 653 | 653 | return $terminaison; |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | if (!function_exists('imagepng')) { |
| 805 | 805 | return false; |
| 806 | 806 | } |
| 807 | - $tmp = $fichier . '.tmp'; |
|
| 807 | + $tmp = $fichier.'.tmp'; |
|
| 808 | 808 | $ret = imagepng($img, $tmp); |
| 809 | 809 | if (file_exists($tmp)) { |
| 810 | 810 | $taille_test = getimagesize($tmp); |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | if (!function_exists('imagegif')) { |
| 840 | 840 | return false; |
| 841 | 841 | } |
| 842 | - $tmp = $fichier . '.tmp'; |
|
| 842 | + $tmp = $fichier.'.tmp'; |
|
| 843 | 843 | $ret = imagegif($img, $tmp); |
| 844 | 844 | if (file_exists($tmp)) { |
| 845 | 845 | $taille_test = getimagesize($tmp); |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | if (!function_exists('imagejpeg')) { |
| 880 | 880 | return false; |
| 881 | 881 | } |
| 882 | - $tmp = $fichier . '.tmp'; |
|
| 882 | + $tmp = $fichier.'.tmp'; |
|
| 883 | 883 | |
| 884 | 884 | // Enable interlancing |
| 885 | 885 | imageinterlace($img, true); |
@@ -940,7 +940,7 @@ discard block |
||
| 940 | 940 | if (!function_exists('imagewebp')) { |
| 941 | 941 | return false; |
| 942 | 942 | } |
| 943 | - $tmp = $fichier . '.tmp'; |
|
| 943 | + $tmp = $fichier.'.tmp'; |
|
| 944 | 944 | $ret = imagewebp($img, $tmp, $qualite); |
| 945 | 945 | if (file_exists($tmp)) { |
| 946 | 946 | $taille_test = getimagesize($tmp); |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | */ |
| 975 | 975 | function _image_imagesvg($img, $fichier) { |
| 976 | 976 | |
| 977 | - $tmp = $fichier . '.tmp'; |
|
| 977 | + $tmp = $fichier.'.tmp'; |
|
| 978 | 978 | if (strpos($img, '<') === false) { |
| 979 | 979 | $img = supprimer_timestamp($img); |
| 980 | 980 | if (!file_exists($img)) { |
@@ -1031,13 +1031,13 @@ discard block |
||
| 1031 | 1031 | */ |
| 1032 | 1032 | function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) { |
| 1033 | 1033 | if (is_null($fonction)) { |
| 1034 | - $fonction = '_image_image' . $valeurs['format_dest']; |
|
| 1034 | + $fonction = '_image_image'.$valeurs['format_dest']; |
|
| 1035 | 1035 | } |
| 1036 | 1036 | $ret = false; |
| 1037 | 1037 | #un flag pour reperer les images gravees |
| 1038 | 1038 | $lock = |
| 1039 | 1039 | !statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout |
| 1040 | - or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src')); |
|
| 1040 | + or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src')); |
|
| 1041 | 1041 | if ( |
| 1042 | 1042 | function_exists($fonction) |
| 1043 | 1043 | && ($ret = $fonction($img, $valeurs['fichier_dest'], $qualite)) # on a reussi a creer l'image |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | // dans tous les cas mettre a jour la taille de l'image finale |
| 1049 | 1049 | [$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']); |
| 1050 | 1050 | $valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition |
| 1051 | - ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true); |
|
| 1051 | + ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true); |
|
| 1052 | 1052 | } |
| 1053 | 1053 | } |
| 1054 | 1054 | |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | |
| 1264 | 1264 | // attributs deprecies. Transformer en CSS |
| 1265 | 1265 | if ($espace = extraire_attribut($tag, 'hspace')) { |
| 1266 | - $style = "margin:${espace}px;" . $style; |
|
| 1266 | + $style = "margin:${espace}px;".$style; |
|
| 1267 | 1267 | $tag = inserer_attribut($tag, 'hspace', ''); |
| 1268 | 1268 | } |
| 1269 | 1269 | |
@@ -1390,7 +1390,7 @@ discard block |
||
| 1390 | 1390 | $image = $valeurs['fichier']; |
| 1391 | 1391 | $format = $valeurs['format_source']; |
| 1392 | 1392 | $destdir = dirname($valeurs['fichier_dest']); |
| 1393 | - $destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']); |
|
| 1393 | + $destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']); |
|
| 1394 | 1394 | |
| 1395 | 1395 | $format_sortie = $valeurs['format_dest']; |
| 1396 | 1396 | |
@@ -1422,14 +1422,14 @@ discard block |
||
| 1422 | 1422 | |
| 1423 | 1423 | // Si l'image est de la taille demandee (ou plus petite), simplement la retourner |
| 1424 | 1424 | if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) { |
| 1425 | - $vignette = $destination . '.' . $format; |
|
| 1425 | + $vignette = $destination.'.'.$format; |
|
| 1426 | 1426 | @copy($image, $vignette); |
| 1427 | 1427 | } |
| 1428 | 1428 | |
| 1429 | 1429 | elseif ($valeurs['format_source'] === 'svg') { |
| 1430 | 1430 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1431 | 1431 | $format_sortie = 'svg'; |
| 1432 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1432 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1433 | 1433 | $valeurs['fichier_dest'] = $vignette; |
| 1434 | 1434 | _image_gd_output($svg, $valeurs); |
| 1435 | 1435 | } |
@@ -1441,9 +1441,9 @@ discard block |
||
| 1441 | 1441 | define('_CONVERT_COMMAND', 'convert'); |
| 1442 | 1442 | } // Securite : mes_options.php peut preciser le chemin absolu |
| 1443 | 1443 | if (!defined('_RESIZE_COMMAND')) { |
| 1444 | - define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest'); |
|
| 1444 | + define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest'); |
|
| 1445 | 1445 | } |
| 1446 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1446 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1447 | 1447 | $commande = str_replace( |
| 1448 | 1448 | ['%x', '%y', '%src', '%dest'], |
| 1449 | 1449 | [ |
@@ -1459,13 +1459,13 @@ discard block |
||
| 1459 | 1459 | if (!@file_exists($vignette)) { |
| 1460 | 1460 | spip_log("echec convert sur $vignette"); |
| 1461 | 1461 | |
| 1462 | - return; // echec commande |
|
| 1462 | + return; // echec commande |
|
| 1463 | 1463 | } |
| 1464 | 1464 | } |
| 1465 | 1465 | |
| 1466 | 1466 | // php5 imagemagick |
| 1467 | 1467 | elseif ($process == 'imagick') { |
| 1468 | - $vignette = "$destination." . $format_sortie; |
|
| 1468 | + $vignette = "$destination.".$format_sortie; |
|
| 1469 | 1469 | |
| 1470 | 1470 | if (!class_exists(\Imagick::class)) { |
| 1471 | 1471 | spip_log('Classe Imagick absente !', _LOG_ERREUR); |
@@ -1479,7 +1479,7 @@ discard block |
||
| 1479 | 1479 | $destHeight, |
| 1480 | 1480 | Imagick::FILTER_LANCZOS, |
| 1481 | 1481 | 1 |
| 1482 | - );//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1482 | + ); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1483 | 1483 | $imagick->writeImage($vignette); |
| 1484 | 1484 | |
| 1485 | 1485 | if (!@file_exists($vignette)) { |
@@ -1497,11 +1497,11 @@ discard block |
||
| 1497 | 1497 | if (_PNMSCALE_COMMAND == '') { |
| 1498 | 1498 | return; |
| 1499 | 1499 | } |
| 1500 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1500 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1501 | 1501 | $pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND); |
| 1502 | 1502 | if ($format == 'jpg') { |
| 1503 | 1503 | $jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND); |
| 1504 | - exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1504 | + exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1505 | 1505 | if (!($s = @filesize($vignette))) { |
| 1506 | 1506 | spip_unlink($vignette); |
| 1507 | 1507 | } |
@@ -1513,7 +1513,7 @@ discard block |
||
| 1513 | 1513 | } else { |
| 1514 | 1514 | if ($format == 'gif') { |
| 1515 | 1515 | $giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND); |
| 1516 | - exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1516 | + exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1517 | 1517 | if (!($s = @filesize($vignette))) { |
| 1518 | 1518 | spip_unlink($vignette); |
| 1519 | 1519 | } |
@@ -1525,7 +1525,7 @@ discard block |
||
| 1525 | 1525 | } else { |
| 1526 | 1526 | if ($format == 'png') { |
| 1527 | 1527 | $pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND); |
| 1528 | - exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1528 | + exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1529 | 1529 | if (!($s = @filesize($vignette))) { |
| 1530 | 1530 | spip_unlink($vignette); |
| 1531 | 1531 | } |
@@ -1547,7 +1547,7 @@ discard block |
||
| 1547 | 1547 | return; |
| 1548 | 1548 | } |
| 1549 | 1549 | if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) { |
| 1550 | - spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels'); |
|
| 1550 | + spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels'); |
|
| 1551 | 1551 | |
| 1552 | 1552 | return; |
| 1553 | 1553 | } |
@@ -1859,7 +1859,7 @@ discard block |
||
| 1859 | 1859 | // de l'image, de facon a tromper le cache du navigateur |
| 1860 | 1860 | // quand on fait supprimer/reuploader un logo |
| 1861 | 1861 | // (pas de filemtime si SAFE MODE) |
| 1862 | - $date = test_espace_prive() ? ('?' . $date) : ''; |
|
| 1862 | + $date = test_espace_prive() ? ('?'.$date) : ''; |
|
| 1863 | 1863 | |
| 1864 | 1864 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1865 | 1865 | } |
@@ -1906,7 +1906,7 @@ discard block |
||
| 1906 | 1906 | public static function LittleEndian2String($number, $minbytes = 1) { |
| 1907 | 1907 | $intstring = ''; |
| 1908 | 1908 | while ($number > 0) { |
| 1909 | - $intstring = $intstring . chr($number & 255); |
|
| 1909 | + $intstring = $intstring.chr($number & 255); |
|
| 1910 | 1910 | $number >>= 8; |
| 1911 | 1911 | } |
| 1912 | 1912 | |
@@ -1938,9 +1938,9 @@ discard block |
||
| 1938 | 1938 | $b = $argb['blue']; |
| 1939 | 1939 | |
| 1940 | 1940 | if ($bpp[$key] == 32) { |
| 1941 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a); |
|
| 1941 | + $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a); |
|
| 1942 | 1942 | } elseif ($bpp[$key] == 24) { |
| 1943 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r); |
|
| 1943 | + $icXOR[$key] .= chr($b).chr($g).chr($r); |
|
| 1944 | 1944 | } |
| 1945 | 1945 | |
| 1946 | 1946 | if ($a < 128) { |
@@ -1967,48 +1967,48 @@ discard block |
||
| 1967 | 1967 | |
| 1968 | 1968 | // BITMAPINFOHEADER - 40 bytes |
| 1969 | 1969 | $BitmapInfoHeader[$key] = ''; |
| 1970 | - $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1971 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1970 | + $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1971 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1972 | 1972 | // The biHeight member specifies the combined |
| 1973 | 1973 | // height of the XOR and AND masks. |
| 1974 | 1974 | $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG biHeight; |
| 1975 | - $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1976 | - $BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00"; // wBitCount; |
|
| 1977 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1978 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1979 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1980 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1981 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1982 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1975 | + $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1976 | + $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount; |
|
| 1977 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1978 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1979 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1980 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1981 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1982 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1983 | 1983 | } |
| 1984 | 1984 | |
| 1985 | 1985 | |
| 1986 | - $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1987 | - $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1988 | - $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1986 | + $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1987 | + $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1988 | + $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1989 | 1989 | |
| 1990 | 1990 | $dwImageOffset = 6 + (count($gd_image_array) * 16); |
| 1991 | 1991 | foreach ($gd_image_array as $key => $gd_image) { |
| 1992 | 1992 | // ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) |
| 1993 | 1993 | |
| 1994 | - $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1995 | - $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1996 | - $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1997 | - $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1994 | + $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1995 | + $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1996 | + $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1997 | + $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1998 | 1998 | |
| 1999 | - $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 2000 | - $icondata .= chr($bpp[$key]) . "\x00"; // wBitCount; // Bits per pixel |
|
| 1999 | + $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 2000 | + $icondata .= chr($bpp[$key])."\x00"; // wBitCount; // Bits per pixel |
|
| 2001 | 2001 | |
| 2002 | 2002 | $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]); |
| 2003 | 2003 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 2004 | 2004 | $dwBytesInRes, |
| 2005 | 2005 | 4 |
| 2006 | - ); // dwBytesInRes; // How many bytes in this resource? |
|
| 2006 | + ); // dwBytesInRes; // How many bytes in this resource? |
|
| 2007 | 2007 | |
| 2008 | 2008 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 2009 | 2009 | $dwImageOffset, |
| 2010 | 2010 | 4 |
| 2011 | - ); // dwImageOffset; // Where in the file is this image? |
|
| 2011 | + ); // dwImageOffset; // Where in the file is this image? |
|
| 2012 | 2012 | $dwImageOffset += strlen($BitmapInfoHeader[$key]); |
| 2013 | 2013 | $dwImageOffset += strlen($icXOR[$key]); |
| 2014 | 2014 | $dwImageOffset += strlen($icAND[$key]); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | return $fichier; |
| 57 | 57 | } |
| 58 | 58 | if (!file_exists($fichier)) { |
| 59 | - $fichier = supprimer_timestamp($fichier); |
|
| 59 | + $fichier = supprimer_timestamp($fichier); |
|
| 60 | 60 | if (!file_exists($fichier)) { |
| 61 | 61 | return false; |
| 62 | 62 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | function svg_change_balise_svg($svg, $old_balise_svg, $attributs) { |
| 171 | 171 | $new_balise_svg = '<svg'; |
| 172 | 172 | foreach ($attributs as $k => $v) { |
| 173 | - $new_balise_svg .= " $k=\"" . entites_html($v) . '"'; |
|
| 173 | + $new_balise_svg .= " $k=\"".entites_html($v).'"'; |
|
| 174 | 174 | } |
| 175 | 175 | $new_balise_svg .= '>'; |
| 176 | 176 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | function svg_insert_shapes($svg, $shapes, $start = true) { |
| 190 | 190 | |
| 191 | 191 | if ($start === false or $start === 'end') { |
| 192 | - $svg = str_replace('</svg>', $shapes . '</svg>', $svg); |
|
| 192 | + $svg = str_replace('</svg>', $shapes.'</svg>', $svg); |
|
| 193 | 193 | } |
| 194 | 194 | else { |
| 195 | 195 | $p = stripos($svg, '<svg'); |
@@ -210,10 +210,10 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | function svg_clip_in_box($svg, $x, $y, $width, $height) { |
| 212 | 212 | $rect = "<rect x=\"$x\" y=\"$y\" width=\"$width\" height=\"$height\" />"; |
| 213 | - $id = 'clip-' . substr(md5($rect . strlen($svg)), 0, 8); |
|
| 213 | + $id = 'clip-'.substr(md5($rect.strlen($svg)), 0, 8); |
|
| 214 | 214 | $clippath = "<clipPath id=\"$id\">$rect</clipPath>"; |
| 215 | 215 | $g = "<g clip-path=\"url(#$id)\">"; |
| 216 | - $svg = svg_insert_shapes($svg, $clippath . $g); |
|
| 216 | + $svg = svg_insert_shapes($svg, $clippath.$g); |
|
| 217 | 217 | $svg = svg_insert_shapes($svg, '</g>', false); |
| 218 | 218 | return $svg; |
| 219 | 219 | } |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | ) { |
| 233 | 233 | [$balise_svg, $attributs] = $svg_infos; |
| 234 | 234 | if (!isset($attributs['viewBox'])) { |
| 235 | - $attributs['viewBox'] = '0 0 ' . $attributs['width'] . ' ' . $attributs['height']; |
|
| 235 | + $attributs['viewBox'] = '0 0 '.$attributs['width'].' '.$attributs['height']; |
|
| 236 | 236 | } |
| 237 | 237 | $attributs['width'] = strval($new_width); |
| 238 | 238 | $attributs['height'] = strval($new_height); |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | else { |
| 258 | 258 | $couleur = couleur_html_to_hex($couleur); |
| 259 | 259 | } |
| 260 | - $couleur = '#' . ltrim($couleur, '#'); |
|
| 260 | + $couleur = '#'.ltrim($couleur, '#'); |
|
| 261 | 261 | return $couleur; |
| 262 | 262 | } |
| 263 | 263 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | function svg_couleur_to_rgb($couleur) { |
| 270 | 270 | if (strpos($couleur, 'rgb(') === 0) { |
| 271 | 271 | $c = explode(',', substr($couleur, 4)); |
| 272 | - return ['red' => intval($c[0]),'green' => intval($c[1]),'blue' => intval($c[2])]; |
|
| 272 | + return ['red' => intval($c[0]), 'green' => intval($c[1]), 'blue' => intval($c[2])]; |
|
| 273 | 273 | } |
| 274 | 274 | return _couleur_hex_to_dec($couleur); |
| 275 | 275 | } |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | $background_color = svg_couleur_to_hexa($background_color); |
| 475 | 475 | if (isset($attributs['viewBox'])) { |
| 476 | 476 | $viewBox = explode(' ', $attributs['viewBox']); |
| 477 | - $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>"; |
|
| 477 | + $rect = '<rect x="'.$viewBox[0].'" y="'.$viewBox[1].'" width="'.$viewBox[2].'" height="'.$viewBox[3]."\" fill=\"$background_color\"/>"; |
|
| 478 | 478 | } |
| 479 | 479 | else { |
| 480 | 480 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | $background_color = svg_couleur_to_hexa($background_color); |
| 505 | 505 | if (isset($attributs['viewBox'])) { |
| 506 | 506 | $viewBox = explode(' ', $attributs['viewBox']); |
| 507 | - $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
|
| 507 | + $rect = '<rect x="'.$viewBox[0].'" y="'.$viewBox[1].'" width="'.$viewBox[2].'" height="'.$viewBox[3]."\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
|
| 508 | 508 | } |
| 509 | 509 | else { |
| 510 | 510 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | $g = '<g'; |
| 534 | 534 | foreach ($attributs as $k => $v) { |
| 535 | 535 | if (strlen($v)) { |
| 536 | - $g .= " $k=\"" . attribut_html($v) . '"'; |
|
| 536 | + $g .= " $k=\"".attribut_html($v).'"'; |
|
| 537 | 537 | } |
| 538 | 538 | } |
| 539 | 539 | if (strlen($g) > 2) { |
@@ -561,10 +561,10 @@ discard block |
||
| 561 | 561 | ) { |
| 562 | 562 | if ($filter_def) { |
| 563 | 563 | [$balise_svg, ] = $svg_infos; |
| 564 | - $filter_id = 'filter-' . substr(md5($filter_def . strlen($svg)), 0, 8); |
|
| 564 | + $filter_id = 'filter-'.substr(md5($filter_def.strlen($svg)), 0, 8); |
|
| 565 | 565 | $filter = "<defs><filter id=\"$filter_id\">$filter_def</filter></defs>"; |
| 566 | 566 | $g = "<g filter=\"url(#$filter_id)\">"; |
| 567 | - $svg = svg_insert_shapes($svg, $filter . $g); |
|
| 567 | + $svg = svg_insert_shapes($svg, $filter.$g); |
|
| 568 | 568 | $svg = svg_insert_shapes($svg, '</g>', false); |
| 569 | 569 | } |
| 570 | 570 | return $svg; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | if (substr($recherche, 0, 1) == '/' and substr($recherche, -1, 1) == '/' and strlen($recherche) > 2) { |
| 101 | 101 | // c'est une preg |
| 102 | 102 | $recherche_trans = translitteration($recherche); |
| 103 | - $preg = $recherche_trans . $options['preg_flags']; |
|
| 103 | + $preg = $recherche_trans.$options['preg_flags']; |
|
| 104 | 104 | $is_preg = true; |
| 105 | 105 | } else { |
| 106 | 106 | // s'il y a plusieurs mots il faut les chercher tous : oblige REGEXP, |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if (preg_match(',\s+,' . $u, $recherche_mod)) { |
|
| 123 | + if (preg_match(',\s+,'.$u, $recherche_mod)) { |
|
| 124 | 124 | $is_preg = true; |
| 125 | 125 | |
| 126 | 126 | $recherche_inter = '|'; |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | foreach ($recherche_mots as $mot) { |
| 131 | 131 | if (strlen($mot) >= $min_long) { |
| 132 | 132 | // echapper les caracteres de regexp qui sont eventuellement dans la recherche |
| 133 | - $recherche_inter .= preg_quote($mot) . ' '; |
|
| 133 | + $recherche_inter .= preg_quote($mot).' '; |
|
| 134 | 134 | $petits_mots = false; |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -138,14 +138,14 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | // mais on cherche quand même l'expression complète, même si elle |
| 140 | 140 | // comporte des mots de moins de quatre lettres |
| 141 | - $recherche = trim(preg_replace(',\s+,' . $u, '|', $recherche_inter), '|'); |
|
| 141 | + $recherche = trim(preg_replace(',\s+,'.$u, '|', $recherche_inter), '|'); |
|
| 142 | 142 | if (!$recherche or $petits_mots) { |
| 143 | 143 | $recherche = preg_quote($recherche_org); |
| 144 | 144 | } |
| 145 | 145 | $recherche_trans = translitteration($recherche); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - $preg = '/' . str_replace('/', '\\/', $recherche_trans) . '/' . $options['preg_flags']; |
|
| 148 | + $preg = '/'.str_replace('/', '\\/', $recherche_trans).'/'.$options['preg_flags']; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // Si la chaine est inactive, on va utiliser LIKE pour aller plus vite |
@@ -185,11 +185,11 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | $q = sql_quote( |
| 187 | 187 | '%' |
| 188 | - . preg_replace(',\s+,' . $u, '%', $q) |
|
| 188 | + . preg_replace(',\s+,'.$u, '%', $q) |
|
| 189 | 189 | . '%' |
| 190 | 190 | ); |
| 191 | 191 | |
| 192 | - $preg = '/' . preg_replace(',\s+,' . $u, '.+', trim($recherche_mod)) . '/' . $options['preg_flags']; |
|
| 192 | + $preg = '/'.preg_replace(',\s+,'.$u, '.+', trim($recherche_mod)).'/'.$options['preg_flags']; |
|
| 193 | 193 | } else { |
| 194 | 194 | $methode = 'REGEXP'; |
| 195 | 195 | $q = sql_quote(trim($recherche, '/')); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | foreach ($tables as $table => $champs) { |
| 312 | 312 | # lock via memoization, si dispo |
| 313 | 313 | if (function_exists('cache_lock')) { |
| 314 | - cache_lock($lock = _RECHERCHE_LOCK_KEY . ' ' . $table . ' ' . $recherche); |
|
| 314 | + cache_lock($lock = _RECHERCHE_LOCK_KEY.' '.$table.' '.$recherche); |
|
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | spip_timer('rech'); |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | |
| 327 | 327 | |
| 328 | 328 | spip_log( |
| 329 | - "recherche $table ($recherche) : " . (is_countable($results[$table]) ? count($results[$table]) : 0) . ' resultats ' . spip_timer('rech'), |
|
| 329 | + "recherche $table ($recherche) : ".(is_countable($results[$table]) ? count($results[$table]) : 0).' resultats '.spip_timer('rech'), |
|
| 330 | 330 | 'recherche' |
| 331 | 331 | ); |
| 332 | 332 | |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | |
| 362 | 362 | $results = recherche_en_base($recherche, $tables, $options); |
| 363 | 363 | |
| 364 | - $preg = '/' . str_replace('/', '\\/', $recherche) . '/' . $options['preg_flags']; |
|
| 364 | + $preg = '/'.str_replace('/', '\\/', $recherche).'/'.$options['preg_flags']; |
|
| 365 | 365 | |
| 366 | 366 | foreach ($results as $table => $r) { |
| 367 | 367 | $_id_table = id_table_objet($table); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $n = 0; |
| 46 | 46 | $time = $GLOBALS['meta']['cache_mark'] ?? 0; |
| 47 | 47 | for ($i = 0; $i < 256; $i++) { |
| 48 | - $dir = _DIR_CACHE . sprintf('%02s', dechex($i)); |
|
| 48 | + $dir = _DIR_CACHE.sprintf('%02s', dechex($i)); |
|
| 49 | 49 | if (@is_dir($dir) and is_readable($dir) and $d = opendir($dir)) { |
| 50 | 50 | while (($f = readdir($d)) !== false) { |
| 51 | 51 | if (preg_match(',^[[0-9a-f]+\.cache$,S', $f) and $a = stat("$dir/$f")) { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | // stocker la date_modif_$objet (ne sert a rien pour le moment) |
| 104 | 104 | if (isset($objet)) { |
| 105 | - ecrire_meta('derniere_modif_' . $objet, time()); |
|
| 105 | + ecrire_meta('derniere_modif_'.$objet, time()); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | // si $derniere_modif_invalide est un array('article', 'rubrique') |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | // sur certains sites on veut absolument garder certains caches référencés dans un CDN |
| 147 | 147 | // on peut donc inhiber la purge de ces répertoires pour eviter tout probleme |
| 148 | - if (file_exists(rtrim($dir, '/') . '/inhib_purger_repertoire.txt')) { |
|
| 148 | + if (file_exists(rtrim($dir, '/').'/inhib_purger_repertoire.txt')) { |
|
| 149 | 149 | return 0; |
| 150 | 150 | } |
| 151 | 151 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | ) |
| 209 | 209 | ) { |
| 210 | 210 | // supprimer le fichier (de facon propre) |
| 211 | - supprimer_fichier(_DIR_CACHE . $cache); |
|
| 211 | + supprimer_fichier(_DIR_CACHE.$cache); |
|
| 212 | 212 | } else { |
| 213 | 213 | spip_log("Nom de fichier cache incorrect : $cache"); |
| 214 | 214 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if (find_in_path($charset . '.php', 'charsets/', true)) { |
|
| 76 | + if (find_in_path($charset.'.php', 'charsets/', true)) { |
|
| 77 | 77 | return $charset; |
| 78 | 78 | } else { |
| 79 | 79 | spip_log("Erreur: pas de fichier de conversion 'charsets/$charset'"); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | static $pcre_ok = 0; |
| 161 | 161 | |
| 162 | 162 | if (!$pcre_ok) { |
| 163 | - $s = ' ' . chr(195) . chr(169) . 't' . chr(195) . chr(169) . ' '; |
|
| 163 | + $s = ' '.chr(195).chr(169).'t'.chr(195).chr(169).' '; |
|
| 164 | 164 | if (preg_match(',\W...\W,u', $s)) { |
| 165 | 165 | $pcre_ok = 1; |
| 166 | 166 | } else { |
@@ -261,38 +261,38 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | if (!isset($trans[$charset][$charset_cible])) { |
| 263 | 263 | $trans[$charset][$charset_cible] = [ |
| 264 | - $p . chr(128) => '€', |
|
| 265 | - $p . chr(129) => ' ', # pas affecte |
|
| 266 | - $p . chr(130) => '‚', |
|
| 267 | - $p . chr(131) => 'ƒ', |
|
| 268 | - $p . chr(132) => '„', |
|
| 269 | - $p . chr(133) => '…', |
|
| 270 | - $p . chr(134) => '†', |
|
| 271 | - $p . chr(135) => '‡', |
|
| 272 | - $p . chr(136) => 'ˆ', |
|
| 273 | - $p . chr(137) => '‰', |
|
| 274 | - $p . chr(138) => 'Š', |
|
| 275 | - $p . chr(139) => '‹', |
|
| 276 | - $p . chr(140) => 'Œ', |
|
| 277 | - $p . chr(141) => ' ', # pas affecte |
|
| 278 | - $p . chr(142) => 'Ž', |
|
| 279 | - $p . chr(143) => ' ', # pas affecte |
|
| 280 | - $p . chr(144) => ' ', # pas affecte |
|
| 281 | - $p . chr(145) => '‘', |
|
| 282 | - $p . chr(146) => '’', |
|
| 283 | - $p . chr(147) => '“', |
|
| 284 | - $p . chr(148) => '”', |
|
| 285 | - $p . chr(149) => '•', |
|
| 286 | - $p . chr(150) => '–', |
|
| 287 | - $p . chr(151) => '—', |
|
| 288 | - $p . chr(152) => '˜', |
|
| 289 | - $p . chr(153) => '™', |
|
| 290 | - $p . chr(154) => 'š', |
|
| 291 | - $p . chr(155) => '›', |
|
| 292 | - $p . chr(156) => 'œ', |
|
| 293 | - $p . chr(157) => ' ', # pas affecte |
|
| 294 | - $p . chr(158) => 'ž', |
|
| 295 | - $p . chr(159) => 'Ÿ', |
|
| 264 | + $p.chr(128) => '€', |
|
| 265 | + $p.chr(129) => ' ', # pas affecte |
|
| 266 | + $p.chr(130) => '‚', |
|
| 267 | + $p.chr(131) => 'ƒ', |
|
| 268 | + $p.chr(132) => '„', |
|
| 269 | + $p.chr(133) => '…', |
|
| 270 | + $p.chr(134) => '†', |
|
| 271 | + $p.chr(135) => '‡', |
|
| 272 | + $p.chr(136) => 'ˆ', |
|
| 273 | + $p.chr(137) => '‰', |
|
| 274 | + $p.chr(138) => 'Š', |
|
| 275 | + $p.chr(139) => '‹', |
|
| 276 | + $p.chr(140) => 'Œ', |
|
| 277 | + $p.chr(141) => ' ', # pas affecte |
|
| 278 | + $p.chr(142) => 'Ž', |
|
| 279 | + $p.chr(143) => ' ', # pas affecte |
|
| 280 | + $p.chr(144) => ' ', # pas affecte |
|
| 281 | + $p.chr(145) => '‘', |
|
| 282 | + $p.chr(146) => '’', |
|
| 283 | + $p.chr(147) => '“', |
|
| 284 | + $p.chr(148) => '”', |
|
| 285 | + $p.chr(149) => '•', |
|
| 286 | + $p.chr(150) => '–', |
|
| 287 | + $p.chr(151) => '—', |
|
| 288 | + $p.chr(152) => '˜', |
|
| 289 | + $p.chr(153) => '™', |
|
| 290 | + $p.chr(154) => 'š', |
|
| 291 | + $p.chr(155) => '›', |
|
| 292 | + $p.chr(156) => 'œ', |
|
| 293 | + $p.chr(157) => ' ', # pas affecte |
|
| 294 | + $p.chr(158) => 'ž', |
|
| 295 | + $p.chr(159) => 'Ÿ', |
|
| 296 | 296 | ]; |
| 297 | 297 | if ($charset_cible != 'unicode') { |
| 298 | 298 | foreach ($trans[$charset][$charset_cible] as $k => $c) { |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | and is_array($GLOBALS['CHARSET'][$cset]) |
| 434 | 434 | ) { |
| 435 | 435 | foreach ($GLOBALS['CHARSET'][$cset] as $key => $val) { |
| 436 | - $trans[$charset][chr($key)] = '&#' . $val . ';'; |
|
| 436 | + $trans[$charset][chr($key)] = '&#'.$val.';'; |
|
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | } |
@@ -500,11 +500,11 @@ discard block |
||
| 500 | 500 | $h = dechex($e); |
| 501 | 501 | if ($s = isset($CHARSET_REVERSE[$charset][$e])) { |
| 502 | 502 | $s = $CHARSET_REVERSE[$charset][$e]; |
| 503 | - $t['&#' . $e . ';'] = $t['�' . $e . ';'] = $t['�' . $e . ';'] = chr($s); |
|
| 504 | - $t['&#x' . $h . ';'] = $t['�' . $h . ';'] = $t['�' . $h . ';'] = chr($s); |
|
| 503 | + $t['&#'.$e.';'] = $t['�'.$e.';'] = $t['�'.$e.';'] = chr($s); |
|
| 504 | + $t['&#x'.$h.';'] = $t['�'.$h.';'] = $t['�'.$h.';'] = chr($s); |
|
| 505 | 505 | } else { |
| 506 | - $t['&#' . $e . ';'] = $t['�' . $e . ';'] = $t['�' . $e . ';'] = chr($e); |
|
| 507 | - $t['&#x' . $h . ';'] = $t['�' . $h . ';'] = $t['�' . $h . ';'] = chr($e); |
|
| 506 | + $t['&#'.$e.';'] = $t['�'.$e.';'] = $t['�'.$e.';'] = chr($e); |
|
| 507 | + $t['&#x'.$h.';'] = $t['�'.$h.';'] = $t['�'.$h.';'] = chr($e); |
|
| 508 | 508 | } |
| 509 | 509 | } |
| 510 | 510 | } |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | and is_array($GLOBALS['CHARSET'][$cset]) |
| 552 | 552 | ) { |
| 553 | 553 | foreach ($GLOBALS['CHARSET'][$cset] as $key => $val) { |
| 554 | - $trans[$charset][chr($key)] = unicode2charset('&#' . $val . ';'); |
|
| 554 | + $trans[$charset][chr($key)] = unicode2charset('&#'.$val.';'); |
|
| 555 | 555 | } |
| 556 | 556 | } |
| 557 | 557 | } |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | } |
| 659 | 659 | $thisPos++; |
| 660 | 660 | } |
| 661 | - $encodedLetter = '&#' . preg_replace('/^0+/', '', $decimalCode) . ';'; |
|
| 661 | + $encodedLetter = '&#'.preg_replace('/^0+/', '', $decimalCode).';'; |
|
| 662 | 662 | $encodedString .= $encodedLetter; |
| 663 | 663 | } |
| 664 | 664 | } |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | } // ignorer le BOM - http://www.unicode.org/faq/utf_bom.html |
| 702 | 702 | else { |
| 703 | 703 | if ($word != 65279) { |
| 704 | - $texte .= '&#' . $word . ';'; |
|
| 704 | + $texte .= '&#'.$word.';'; |
|
| 705 | 705 | } |
| 706 | 706 | } |
| 707 | 707 | } |
@@ -729,13 +729,13 @@ discard block |
||
| 729 | 729 | return chr($num); |
| 730 | 730 | } |
| 731 | 731 | if ($num < 2048) { |
| 732 | - return chr(($num >> 6) + 192) . chr(($num & 63) + 128); |
|
| 732 | + return chr(($num >> 6) + 192).chr(($num & 63) + 128); |
|
| 733 | 733 | } |
| 734 | 734 | if ($num < 65536) { |
| 735 | - return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); |
|
| 735 | + return chr(($num >> 12) + 224).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128); |
|
| 736 | 736 | } |
| 737 | 737 | if ($num < 1_114_112) { |
| 738 | - return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); |
|
| 738 | + return chr(($num >> 18) + 240).chr((($num >> 12) & 63) + 128).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128); |
|
| 739 | 739 | } |
| 740 | 740 | |
| 741 | 741 | return ''; |
@@ -802,7 +802,7 @@ discard block |
||
| 802 | 802 | while (preg_match(',�*([0-9]+);,S', $texte, $regs) and !isset($vu[$regs[1]])) { |
| 803 | 803 | $num = $regs[1]; |
| 804 | 804 | $vu[$num] = true; |
| 805 | - $s = '\u' . sprintf('%04x', $num); |
|
| 805 | + $s = '\u'.sprintf('%04x', $num); |
|
| 806 | 806 | $texte = str_replace($regs[0], $s, $texte); |
| 807 | 807 | } |
| 808 | 808 | |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | **/ |
| 820 | 820 | function javascript_to_unicode($texte) { |
| 821 | 821 | while (preg_match(',%u([0-9A-F][0-9A-F][0-9A-F][0-9A-F]),', $texte, $regs)) { |
| 822 | - $texte = str_replace($regs[0], '&#' . hexdec($regs[1]) . ';', $texte); |
|
| 822 | + $texte = str_replace($regs[0], '&#'.hexdec($regs[1]).';', $texte); |
|
| 823 | 823 | } |
| 824 | 824 | |
| 825 | 825 | return $texte; |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | return $texte; |
| 865 | 865 | } |
| 866 | 866 | |
| 867 | - $table_translit = 'translit' . $complexe; |
|
| 867 | + $table_translit = 'translit'.$complexe; |
|
| 868 | 868 | |
| 869 | 869 | // 2. Translitterer grace a la table predefinie |
| 870 | 870 | if (!isset($trans[$complexe])) { |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | * true s'il a un BOM |
| 956 | 956 | **/ |
| 957 | 957 | function bom_utf8($texte) { |
| 958 | - return (substr($texte, 0, 3) == chr(0xEF) . chr(0xBB) . chr(0xBF)); |
|
| 958 | + return (substr($texte, 0, 3) == chr(0xEF).chr(0xBB).chr(0xBF)); |
|
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | /** |
@@ -1151,7 +1151,7 @@ discard block |
||
| 1151 | 1151 | // on prend n fois la longueur desiree, pour etre surs d'avoir tout |
| 1152 | 1152 | // (un caractere utf-8 prenant au maximum n bytes) |
| 1153 | 1153 | $n = 0; |
| 1154 | - while (preg_match(',[\x80-\xBF]{' . (++$n) . '},', $c)) { |
|
| 1154 | + while (preg_match(',[\x80-\xBF]{'.(++$n).'},', $c)) { |
|
| 1155 | 1155 | ; |
| 1156 | 1156 | } |
| 1157 | 1157 | $c = substr($c, 0, $n * $length); |
@@ -1185,7 +1185,7 @@ discard block |
||
| 1185 | 1185 | |
| 1186 | 1186 | $lettre1 = mb_strtoupper(spip_substr($c, 0, 1)); |
| 1187 | 1187 | |
| 1188 | - return $lettre1 . spip_substr($c, 1); |
|
| 1188 | + return $lettre1.spip_substr($c, 1); |
|
| 1189 | 1189 | } |
| 1190 | 1190 | |
| 1191 | 1191 | /** |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | $res = sql_select( |
| 36 | 36 | 'rub1.id_rubrique, rub1.titre, rub1.id_parent, rub1.lang, rub1.langue_choisie, rub2.id_rubrique AS id_enfant', |
| 37 | 37 | 'spip_rubriques AS rub1 LEFT JOIN spip_rubriques AS rub2 ON (rub1.id_rubrique = rub2.id_parent)', |
| 38 | - 'rub1.id_parent = ' . sql_quote($id_rubrique) . ' |
|
| 39 | - AND rub1.id_rubrique!=' . sql_quote($exclu) . ' |
|
| 40 | - AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=' . sql_quote($exclu) . ')', |
|
| 38 | + 'rub1.id_parent = '.sql_quote($id_rubrique).' |
|
| 39 | + AND rub1.id_rubrique!=' . sql_quote($exclu).' |
|
| 40 | + AND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=' . sql_quote($exclu).')', |
|
| 41 | 41 | '', |
| 42 | 42 | '0+rub1.titre,rub1.titre' |
| 43 | 43 | ); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | if ($row['langue_choisie'] != 'oui') { |
| 51 | 51 | $t .= ' <small title="' |
| 52 | 52 | . traduire_nom_langue($row['lang']) |
| 53 | - . '">[' . $row['lang'] . ']</small>'; |
|
| 53 | + . '">['.$row['lang'].']</small>'; |
|
| 54 | 54 | } |
| 55 | 55 | $ordre[$row['id_rubrique']] = $t; |
| 56 | 56 | } |
@@ -58,14 +58,14 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | $next = $list[$col] ?? 0; |
| 60 | 60 | if ($ordre) { |
| 61 | - $rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=" . ($col + 1)); |
|
| 61 | + $rec = generer_url_ecrire('plonger', "rac=$idom&exclus=$exclu&do=$do&col=".($col + 1)); |
|
| 62 | 62 | $info = generer_url_ecrire('informer', "type=rubrique&rac=$idom&do=$do&id="); |
| 63 | - $args = "'$idom',this,$col,'" . $GLOBALS['spip_lang_left'] . "','$info',event"; |
|
| 63 | + $args = "'$idom',this,$col,'".$GLOBALS['spip_lang_left']."','$info',event"; |
|
| 64 | 64 | |
| 65 | 65 | foreach ($ordre as $id => $titrebrut) { |
| 66 | 66 | $titre = supprimer_numero($titrebrut); |
| 67 | 67 | |
| 68 | - $classe1 = 'petit-item ' . ($id_rubrique ? 'petite-rubrique' : 'petit-secteur'); |
|
| 68 | + $classe1 = 'petit-item '.($id_rubrique ? 'petite-rubrique' : 'petit-secteur'); |
|
| 69 | 69 | if (isset($rub[$id]['enfants'])) { |
| 70 | 70 | $classe2 = " class='rub-ouverte'"; |
| 71 | 71 | $url = "\nhref='$rec&id=$id'"; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $url = "\nhref='javascript:void(0)'"; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $js_func = $do . '_selection_titre'; |
|
| 77 | + $js_func = $do.'_selection_titre'; |
|
| 78 | 78 | $click = "\nonclick=\"changerhighlight(this.parentNode.parentNode.parentNode);\nreturn " |
| 79 | 79 | . (!is_array($list) ? ' false' |
| 80 | 80 | : "aff_selection_provisoire($id,$args)") |
@@ -101,17 +101,17 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $idom2 = $idom . '_col_' . ($col + 1); |
|
| 104 | + $idom2 = $idom.'_col_'.($col + 1); |
|
| 105 | 105 | $left = ($col * 250); |
| 106 | 106 | |
| 107 | 107 | return http_img_pack( |
| 108 | 108 | 'loader.svg', |
| 109 | 109 | '', |
| 110 | - "class='loader' style='visibility: hidden; position: absolute; " . $GLOBALS['spip_lang_left'] . ': ' |
|
| 110 | + "class='loader' style='visibility: hidden; position: absolute; ".$GLOBALS['spip_lang_left'].': ' |
|
| 111 | 111 | . ($left - 30) |
| 112 | 112 | . "px; top: 2px; z-index: 2;' id='img_$idom2'" |
| 113 | 113 | ) |
| 114 | - . "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; " . $GLOBALS['spip_lang_left'] . ': ' |
|
| 114 | + . "<div style='width: 250px; height: 100%; overflow: auto; position: absolute; top: 0px; ".$GLOBALS['spip_lang_left'].': ' |
|
| 115 | 115 | . ($left - 250) |
| 116 | 116 | . "px;'>" |
| 117 | 117 | . $ret |