@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | sql_updateq( |
| 135 | 135 | 'spip_rubriques', |
| 136 | 136 | ['statut' => 'publie', 'date' => date('Y-m-d H:i:s')], |
| 137 | - 'id_rubrique=' . intval($id_rubrique) |
|
| 137 | + 'id_rubrique='.intval($id_rubrique) |
|
| 138 | 138 | ); |
| 139 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique=' . intval($id_rubrique)); |
|
| 139 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques AS R', 'R.id_rubrique='.intval($id_rubrique)); |
|
| 140 | 140 | if (!$id_parent) { |
| 141 | 141 | break; |
| 142 | 142 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | return $id_pred != $id_rubrique; |
| 172 | 172 | } |
| 173 | 173 | // passer au parent si on a depublie |
| 174 | - $r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id_pred)); |
|
| 174 | + $r = sql_fetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id_pred)); |
|
| 175 | 175 | $id_pred = $r['id_parent']; |
| 176 | 176 | } |
| 177 | 177 | |
@@ -196,14 +196,14 @@ discard block |
||
| 196 | 196 | $date = date('Y-m-d H:i:s'); |
| 197 | 197 | } |
| 198 | 198 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 199 | - ' AND date <= ' . sql_quote($date) : ''; |
|
| 199 | + ' AND date <= '.sql_quote($date) : ''; |
|
| 200 | 200 | |
| 201 | 201 | if (!$id_rubrique = intval($id_rubrique)) { |
| 202 | 202 | return false; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | // verifier qu'elle existe et est bien publiee |
| 206 | - $r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 206 | + $r = sql_fetsel('id_rubrique,statut', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 207 | 207 | if (!$r or $r['statut'] !== 'publie') { |
| 208 | 208 | return false; |
| 209 | 209 | } |
@@ -213,12 +213,12 @@ discard block |
||
| 213 | 213 | $compte = [ |
| 214 | 214 | 'articles' => sql_countsel( |
| 215 | 215 | 'spip_articles', |
| 216 | - 'id_rubrique=' . intval($id_rubrique) . " AND statut='publie'$postdates" |
|
| 216 | + 'id_rubrique='.intval($id_rubrique)." AND statut='publie'$postdates" |
|
| 217 | 217 | ), |
| 218 | - 'rubriques' => sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique) . " AND statut='publie'"), |
|
| 218 | + 'rubriques' => sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)." AND statut='publie'"), |
|
| 219 | 219 | 'documents' => sql_countsel( |
| 220 | 220 | 'spip_documents AS D JOIN spip_documents_liens AS L ON D.id_document=L.id_document', |
| 221 | - 'L.id_objet=' . intval($id_rubrique) . " AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') " |
|
| 221 | + 'L.id_objet='.intval($id_rubrique)." AND L.objet='rubrique' and D.mode NOT IN('logoon', 'logooff') " |
|
| 222 | 222 | ) |
| 223 | 223 | ]; |
| 224 | 224 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique=' . intval($id_rubrique)); |
|
| 246 | + sql_updateq('spip_rubriques', ['statut' => 'prepa'], 'id_rubrique='.intval($id_rubrique)); |
|
| 247 | 247 | |
| 248 | 248 | # spip_log("depublier_rubrique $id_pred"); |
| 249 | 249 | return true; |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | // Afficher les articles post-dates ? |
| 308 | 308 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 309 | - 'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 309 | + 'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 310 | 310 | |
| 311 | 311 | $r = sql_select( |
| 312 | 312 | 'R.id_rubrique AS id, max(A.date) AS date_h', |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | sql_updateq( |
| 319 | 319 | 'spip_rubriques', |
| 320 | 320 | ['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']], |
| 321 | - 'id_rubrique=' . intval($row['id']) |
|
| 321 | + 'id_rubrique='.intval($row['id']) |
|
| 322 | 322 | ); |
| 323 | 323 | } |
| 324 | 324 | |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | sql_updateq( |
| 345 | 345 | 'spip_rubriques', |
| 346 | 346 | ['statut_tmp' => 'publie', 'date_tmp' => $row['date_h']], |
| 347 | - 'id_rubrique=' . intval($row['id']) |
|
| 347 | + 'id_rubrique='.intval($row['id']) |
|
| 348 | 348 | ); |
| 349 | 349 | $continuer = true; |
| 350 | 350 | } |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | and $rows = sql_allfetsel( |
| 398 | 398 | 'A.id_rubrique AS id, R.id_secteur AS id_secteur, R.profondeur+1 as profondeur', |
| 399 | 399 | 'spip_rubriques AS A JOIN spip_rubriques AS R ON A.id_parent = R.id_rubrique', |
| 400 | - 'R.profondeur=' . intval($prof) . ' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)', |
|
| 400 | + 'R.profondeur='.intval($prof).' AND (A.id_secteur <> R.id_secteur OR A.profondeur > R.profondeur+1)', |
|
| 401 | 401 | '', |
| 402 | 402 | 'R.id_secteur', |
| 403 | 403 | '0,100' |
@@ -436,11 +436,11 @@ discard block |
||
| 436 | 436 | and $rows = sql_allfetsel( |
| 437 | 437 | 'id_rubrique as id', |
| 438 | 438 | 'spip_rubriques', |
| 439 | - 'profondeur=' . intval($prof + 1) . ' AND id_parent NOT IN (' . sql_get_select( |
|
| 439 | + 'profondeur='.intval($prof + 1).' AND id_parent NOT IN ('.sql_get_select( |
|
| 440 | 440 | 'zzz.id_rubrique', |
| 441 | 441 | 'spip_rubriques AS zzz', |
| 442 | - 'zzz.profondeur=' . intval($prof) |
|
| 443 | - ) . ')', |
|
| 442 | + 'zzz.profondeur='.intval($prof) |
|
| 443 | + ).')', |
|
| 444 | 444 | '', |
| 445 | 445 | '', |
| 446 | 446 | '0,100' |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | // si pas de rubrique a profondeur $prof+1 pas la peine de continuer |
| 455 | 455 | // si il reste des rubriques non vues, c'est une branche morte ou reference circulaire (base foireuse) |
| 456 | 456 | // on arrete les frais |
| 457 | - if (sql_countsel('spip_rubriques', 'profondeur=' . intval($prof + 1))) { |
|
| 457 | + if (sql_countsel('spip_rubriques', 'profondeur='.intval($prof + 1))) { |
|
| 458 | 458 | $prof++; |
| 459 | 459 | $continuer = true; |
| 460 | 460 | } |
@@ -462,12 +462,12 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | // loger si la table des rubriques semble foireuse |
| 464 | 464 | // et mettre un id_secteur=0 sur ces rubriques pour eviter toute selection par les boucles |
| 465 | - if (sql_countsel('spip_rubriques', 'profondeur>' . intval($prof + 1))) { |
|
| 465 | + if (sql_countsel('spip_rubriques', 'profondeur>'.intval($prof + 1))) { |
|
| 466 | 466 | spip_log( |
| 467 | - 'Les rubriques de profondeur>' . ($prof + 1) . ' semblent suspectes (branches morte ou reference circulaire dans les parents)', |
|
| 467 | + 'Les rubriques de profondeur>'.($prof + 1).' semblent suspectes (branches morte ou reference circulaire dans les parents)', |
|
| 468 | 468 | _LOG_CRITIQUE |
| 469 | 469 | ); |
| 470 | - sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>' . intval($prof + 1)); |
|
| 470 | + sql_update('spip_rubriques', ['id_secteur' => 0], 'profondeur>'.intval($prof + 1)); |
|
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | // reparer les articles |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | ); |
| 479 | 479 | |
| 480 | 480 | while ($row = sql_fetch($r)) { |
| 481 | - sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article=' . intval($row['id'])); |
|
| 481 | + sql_update('spip_articles', ['id_secteur' => $row['secteur']], 'id_article='.intval($row['id'])); |
|
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | // avertir les plugins qui peuvent faire leur mises a jour egalement |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | $t = sql_updateq( |
| 510 | 510 | 'spip_rubriques', |
| 511 | 511 | ['lang' => $row['lang'], 'langue_choisie' => 'non'], |
| 512 | - 'id_rubrique=' . intval($id_rubrique) |
|
| 512 | + 'id_rubrique='.intval($id_rubrique) |
|
| 513 | 513 | ); |
| 514 | 514 | } |
| 515 | 515 | |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | sql_updateq( |
| 555 | 555 | 'spip_articles', |
| 556 | 556 | ['lang' => $row['lang'], 'langue_choisie' => 'non'], |
| 557 | - 'id_article=' . intval($id_article) |
|
| 557 | + 'id_article='.intval($id_article) |
|
| 558 | 558 | ); |
| 559 | 559 | } |
| 560 | 560 | |
@@ -629,11 +629,11 @@ discard block |
||
| 629 | 629 | ]; |
| 630 | 630 | // generer un nom de fonction "anonyme" unique |
| 631 | 631 | do { |
| 632 | - $functionname = 'f_calculer_langues_utilisees_' . $boucle->id_table . '_' . time() . '_' . rand(); |
|
| 632 | + $functionname = 'f_calculer_langues_utilisees_'.$boucle->id_table.'_'.time().'_'.rand(); |
|
| 633 | 633 | } while (function_exists($functionname)); |
| 634 | 634 | $code = calculer_boucle('calculer_langues_utilisees', $boucles); |
| 635 | - $code = '$SP=0; $command=array();$command["connect"] = $connect = "' . $serveur . '"; $Pile=array(0=>array());' . "\n" . $code; |
|
| 636 | - $code = 'function ' . $functionname . '(){' . $code . '};$res = ' . $functionname . '();'; |
|
| 635 | + $code = '$SP=0; $command=array();$command["connect"] = $connect = "'.$serveur.'"; $Pile=array(0=>array());'."\n".$code; |
|
| 636 | + $code = 'function '.$functionname.'(){'.$code.'};$res = '.$functionname.'();'; |
|
| 637 | 637 | $res = ''; |
| 638 | 638 | eval($code); |
| 639 | 639 | $res = explode(',', $res); |
@@ -735,11 +735,11 @@ discard block |
||
| 735 | 735 | $maxiter-- and $filles = sql_allfetsel( |
| 736 | 736 | 'id_rubrique', |
| 737 | 737 | 'spip_rubriques', |
| 738 | - sql_in('id_parent', $r) . ' AND ' . sql_in('id_rubrique', $r, 'NOT') |
|
| 738 | + sql_in('id_parent', $r).' AND '.sql_in('id_rubrique', $r, 'NOT') |
|
| 739 | 739 | ) |
| 740 | 740 | ) { |
| 741 | 741 | $r = join(',', array_column($filles, 'id_rubrique')); |
| 742 | - $branche .= ',' . $r; |
|
| 742 | + $branche .= ','.$r; |
|
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | # securite pour ne pas plomber la conso memoire sur les sites prolifiques |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | |
| 780 | 780 | if (isset($b[$id])) { |
| 781 | 781 | // Notre branche commence par la rubrique de depart si $tout=true |
| 782 | - return $tout ? (strlen($b[$id]) ? $b[$id] . ",$id" : $id) : $b[$id]; |
|
| 782 | + return $tout ? (strlen($b[$id]) ? $b[$id].",$id" : $id) : $b[$id]; |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | $hier = ''; |
@@ -792,11 +792,11 @@ discard block |
||
| 792 | 792 | $maxiter-- and $parents = sql_allfetsel( |
| 793 | 793 | 'id_parent', |
| 794 | 794 | 'spip_rubriques', |
| 795 | - sql_in('id_rubrique', $ids_nouveaux_parents) . ' AND ' . sql_in('id_parent', $hier, 'NOT') |
|
| 795 | + sql_in('id_rubrique', $ids_nouveaux_parents).' AND '.sql_in('id_parent', $hier, 'NOT') |
|
| 796 | 796 | ) |
| 797 | 797 | ) { |
| 798 | 798 | $ids_nouveaux_parents = join(',', array_column($parents, 'id_parent')); |
| 799 | - $hier = $ids_nouveaux_parents . (strlen($hier) ? ',' . $hier : ''); |
|
| 799 | + $hier = $ids_nouveaux_parents.(strlen($hier) ? ','.$hier : ''); |
|
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | # securite pour ne pas plomber la conso memoire sur les sites prolifiques |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | include_spip('base/abstract_sql'); |
| 829 | 829 | if ($check) { |
| 830 | 830 | $postdates = ($GLOBALS['meta']['post_dates'] == 'non') ? |
| 831 | - 'AND A.date <= ' . sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 831 | + 'AND A.date <= '.sql_quote(date('Y-m-d H:i:s')) : ''; |
|
| 832 | 832 | |
| 833 | 833 | $r = sql_select( |
| 834 | 834 | 'DISTINCT A.id_rubrique AS id', |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | $t = sql_fetsel( |
| 846 | 846 | 'date', |
| 847 | 847 | 'spip_articles', |
| 848 | - "statut='publie' AND date > " . sql_quote(date('Y-m-d H:i:s')), |
|
| 848 | + "statut='publie' AND date > ".sql_quote(date('Y-m-d H:i:s')), |
|
| 849 | 849 | '', |
| 850 | 850 | 'date', |
| 851 | 851 | '1' |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | $r = sql_getfetsel( |
| 902 | 902 | 'id_rubrique', |
| 903 | 903 | 'spip_rubriques', |
| 904 | - 'titre = ' . sql_quote($titre) . ' AND id_parent=' . intval($id_parent), |
|
| 904 | + 'titre = '.sql_quote($titre).' AND id_parent='.intval($id_parent), |
|
| 905 | 905 | $groupby = [], |
| 906 | 906 | $orderby = [], |
| 907 | 907 | $limit = '', |
@@ -937,7 +937,7 @@ discard block |
||
| 937 | 937 | sql_updateq( |
| 938 | 938 | 'spip_rubriques', |
| 939 | 939 | ['id_secteur' => $id_secteur, 'lang' => $lang], |
| 940 | - 'id_rubrique=' . intval($id_rubrique), |
|
| 940 | + 'id_rubrique='.intval($id_rubrique), |
|
| 941 | 941 | $desc = '', |
| 942 | 942 | $serveur |
| 943 | 943 | ); |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if ($query) { |
| 48 | - $url .= '?' . $query; |
|
| 48 | + $url .= '?'.$query; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - return '/' . preg_replace(',^/,S', '', $url); |
|
| 51 | + return '/'.preg_replace(',^/,S', '', $url); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | if (preg_match(';^((?:[a-z]{3,33}:)?//.*?)(/.*)?$;iS', $lien, $r)) { |
| 76 | 76 | $r = array_pad($r, 3, null); |
| 77 | 77 | |
| 78 | - return $r[1] . resolve_path($r[2]); |
|
| 78 | + return $r[1].resolve_path($r[2]); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | # L'url site spip est un lien absolu aussi |
@@ -96,13 +96,13 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | switch (substr($lien, 0, 1)) { |
| 98 | 98 | case '/': |
| 99 | - return $debut . resolve_path($lien); |
|
| 99 | + return $debut.resolve_path($lien); |
|
| 100 | 100 | case '#': |
| 101 | - return $debut . resolve_path($dir . $mot . $get . $lien); |
|
| 101 | + return $debut.resolve_path($dir.$mot.$get.$lien); |
|
| 102 | 102 | case '': |
| 103 | - return $debut . resolve_path($dir . $mot . $get . $hash); |
|
| 103 | + return $debut.resolve_path($dir.$mot.$get.$hash); |
|
| 104 | 104 | default: |
| 105 | - return $debut . resolve_path($dir . $lien); |
|
| 105 | + return $debut.resolve_path($dir.$lien); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | return ''; |
| 131 | 131 | } |
| 132 | 132 | if (!$base) { |
| 133 | - $base = url_de_base() . (_DIR_RACINE ? _DIR_RESTREINT_ABS : ''); |
|
| 133 | + $base = url_de_base().(_DIR_RACINE ? _DIR_RESTREINT_ABS : ''); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | return suivre_lien($base, $url); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | * @param array $protocoles_autorises |
| 154 | 154 | * @return bool |
| 155 | 155 | */ |
| 156 | -function protocole_verifier($url_absolue, $protocoles_autorises = ['http','https']) { |
|
| 156 | +function protocole_verifier($url_absolue, $protocoles_autorises = ['http', 'https']) { |
|
| 157 | 157 | |
| 158 | 158 | if (preg_match(';^([a-z]{3,7})://;i', $url_absolue, $m)) { |
| 159 | 159 | $protocole = $m[1]; |
@@ -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)); |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | $var_G = ($G / 255); |
| 125 | 125 | $var_B = ($B / 255); |
| 126 | 126 | |
| 127 | - $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 128 | - $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 129 | - $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 127 | + $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 128 | + $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 129 | + $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 130 | 130 | |
| 131 | 131 | $L = ($var_Max + $var_Min) / 2; |
| 132 | 132 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | function _couleur_hsl_to_rgb($H, $S, $L) { |
| 190 | 190 | // helper |
| 191 | - $hue_2_rgb = function ($v1, $v2, $vH) { |
|
| 191 | + $hue_2_rgb = function($v1, $v2, $vH) { |
|
| 192 | 192 | if ($vH < 0) { |
| 193 | 193 | $vH += 1; |
| 194 | 194 | } |
@@ -318,10 +318,10 @@ discard block |
||
| 318 | 318 | } # gerer img src="data:....base64" |
| 319 | 319 | elseif ( |
| 320 | 320 | preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs) |
| 321 | - and $extension = _image_trouver_extension_depuis_mime('image/' . $regs[1]) |
|
| 321 | + and $extension = _image_trouver_extension_depuis_mime('image/'.$regs[1]) |
|
| 322 | 322 | and in_array($extension, _image_extensions_acceptees_en_entree()) |
| 323 | 323 | ) { |
| 324 | - $local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension); |
|
| 324 | + $local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension); |
|
| 325 | 325 | if (!file_exists($local)) { |
| 326 | 326 | ecrire_fichier($local, base64_decode($regs[2])); |
| 327 | 327 | } |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | // les protocoles web prennent au moins 3 lettres |
| 336 | 336 | if (tester_url_absolue($source)) { |
| 337 | 337 | include_spip('inc/distant'); |
| 338 | - $fichier = _DIR_RACINE . copie_locale($source); |
|
| 338 | + $fichier = _DIR_RACINE.copie_locale($source); |
|
| 339 | 339 | if (!$fichier) { |
| 340 | 340 | return ''; |
| 341 | 341 | } |
@@ -427,9 +427,9 @@ discard block |
||
| 427 | 427 | // on garde la terminaison initiale car image simplement copiee |
| 428 | 428 | // et on postfixe son nom avec un md5 du path |
| 429 | 429 | $terminaison_dest = $terminaison; |
| 430 | - $fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5); |
|
| 430 | + $fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5); |
|
| 431 | 431 | } else { |
| 432 | - $fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5); |
|
| 432 | + $fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5); |
|
| 433 | 433 | } |
| 434 | 434 | $cache = sous_repertoire(_DIR_VAR, $cache); |
| 435 | 435 | $cache = sous_repertoire($cache, $effet); |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | $fichier_dest = substr($fichier_dest, 2); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | - $fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest; |
|
| 443 | + $fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest; |
|
| 444 | 444 | |
| 445 | 445 | $GLOBALS['images_calculees'][] = $fichier_dest; |
| 446 | 446 | |
@@ -478,15 +478,15 @@ discard block |
||
| 478 | 478 | |
| 479 | 479 | if ($creer) { |
| 480 | 480 | spip_log( |
| 481 | - 'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier", |
|
| 482 | - 'images' . _LOG_DEBUG |
|
| 481 | + 'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier", |
|
| 482 | + 'images'._LOG_DEBUG |
|
| 483 | 483 | ); |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | $term_fonction = _image_trouver_extension_pertinente($fichier); |
| 487 | - $ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction; |
|
| 487 | + $ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction; |
|
| 488 | 488 | $ret['fichier'] = $fichier; |
| 489 | - $ret['fonction_image'] = '_image_image' . $terminaison_dest; |
|
| 489 | + $ret['fonction_image'] = '_image_image'.$terminaison_dest; |
|
| 490 | 490 | $ret['fichier_dest'] = $fichier_dest; |
| 491 | 491 | $ret['format_source'] = _image_extension_normalisee($terminaison); |
| 492 | 492 | $ret['format_dest'] = $terminaison_dest; |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | |
| 636 | 636 | $_terminaison = _image_trouver_extension_depuis_mime($mime); |
| 637 | 637 | if ($_terminaison and $_terminaison !== $terminaison) { |
| 638 | - spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE); |
|
| 638 | + spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE); |
|
| 639 | 639 | $terminaison = $_terminaison; |
| 640 | 640 | } |
| 641 | 641 | return $terminaison; |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | if (!function_exists('imagepng')) { |
| 793 | 793 | return false; |
| 794 | 794 | } |
| 795 | - $tmp = $fichier . '.tmp'; |
|
| 795 | + $tmp = $fichier.'.tmp'; |
|
| 796 | 796 | $ret = imagepng($img, $tmp); |
| 797 | 797 | if (file_exists($tmp)) { |
| 798 | 798 | $taille_test = getimagesize($tmp); |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | if (!function_exists('imagegif')) { |
| 828 | 828 | return false; |
| 829 | 829 | } |
| 830 | - $tmp = $fichier . '.tmp'; |
|
| 830 | + $tmp = $fichier.'.tmp'; |
|
| 831 | 831 | $ret = imagegif($img, $tmp); |
| 832 | 832 | if (file_exists($tmp)) { |
| 833 | 833 | $taille_test = getimagesize($tmp); |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | if (!function_exists('imagejpeg')) { |
| 868 | 868 | return false; |
| 869 | 869 | } |
| 870 | - $tmp = $fichier . '.tmp'; |
|
| 870 | + $tmp = $fichier.'.tmp'; |
|
| 871 | 871 | |
| 872 | 872 | // Enable interlancing |
| 873 | 873 | imageinterlace($img, true); |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | if (!function_exists('imagewebp')) { |
| 929 | 929 | return false; |
| 930 | 930 | } |
| 931 | - $tmp = $fichier . '.tmp'; |
|
| 931 | + $tmp = $fichier.'.tmp'; |
|
| 932 | 932 | $ret = imagewebp($img, $tmp, $qualite); |
| 933 | 933 | if (file_exists($tmp)) { |
| 934 | 934 | $taille_test = getimagesize($tmp); |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | */ |
| 963 | 963 | function _image_imagesvg($img, $fichier) { |
| 964 | 964 | |
| 965 | - $tmp = $fichier . '.tmp'; |
|
| 965 | + $tmp = $fichier.'.tmp'; |
|
| 966 | 966 | if (strpos($img, '<') === false) { |
| 967 | 967 | $img = supprimer_timestamp($img); |
| 968 | 968 | if (!file_exists($img)) { |
@@ -1019,13 +1019,13 @@ discard block |
||
| 1019 | 1019 | */ |
| 1020 | 1020 | function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) { |
| 1021 | 1021 | if (is_null($fonction)) { |
| 1022 | - $fonction = '_image_image' . $valeurs['format_dest']; |
|
| 1022 | + $fonction = '_image_image'.$valeurs['format_dest']; |
|
| 1023 | 1023 | } |
| 1024 | 1024 | $ret = false; |
| 1025 | 1025 | #un flag pour reperer les images gravees |
| 1026 | 1026 | $lock = |
| 1027 | 1027 | !statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout |
| 1028 | - or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src')); |
|
| 1028 | + or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src')); |
|
| 1029 | 1029 | if ( |
| 1030 | 1030 | function_exists($fonction) |
| 1031 | 1031 | && ($ret = $fonction($img, $valeurs['fichier_dest'], $qualite)) # on a reussi a creer l'image |
@@ -1036,7 +1036,7 @@ discard block |
||
| 1036 | 1036 | // dans tous les cas mettre a jour la taille de l'image finale |
| 1037 | 1037 | list($valeurs['hauteur_dest'], $valeurs['largeur_dest']) = taille_image($valeurs['fichier_dest']); |
| 1038 | 1038 | $valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition |
| 1039 | - ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true); |
|
| 1039 | + ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true); |
|
| 1040 | 1040 | } |
| 1041 | 1041 | } |
| 1042 | 1042 | |
@@ -1249,7 +1249,7 @@ discard block |
||
| 1249 | 1249 | |
| 1250 | 1250 | // attributs deprecies. Transformer en CSS |
| 1251 | 1251 | if ($espace = extraire_attribut($tag, 'hspace')) { |
| 1252 | - $style = "margin:${espace}px;" . $style; |
|
| 1252 | + $style = "margin:${espace}px;".$style; |
|
| 1253 | 1253 | $tag = inserer_attribut($tag, 'hspace', ''); |
| 1254 | 1254 | } |
| 1255 | 1255 | |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | $image = $valeurs['fichier']; |
| 1375 | 1375 | $format = $valeurs['format_source']; |
| 1376 | 1376 | $destdir = dirname($valeurs['fichier_dest']); |
| 1377 | - $destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']); |
|
| 1377 | + $destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']); |
|
| 1378 | 1378 | |
| 1379 | 1379 | $format_sortie = $valeurs['format_dest']; |
| 1380 | 1380 | |
@@ -1406,14 +1406,14 @@ discard block |
||
| 1406 | 1406 | |
| 1407 | 1407 | // Si l'image est de la taille demandee (ou plus petite), simplement la retourner |
| 1408 | 1408 | if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) { |
| 1409 | - $vignette = $destination . '.' . $format; |
|
| 1409 | + $vignette = $destination.'.'.$format; |
|
| 1410 | 1410 | @copy($image, $vignette); |
| 1411 | 1411 | } |
| 1412 | 1412 | |
| 1413 | 1413 | elseif ($valeurs['format_source'] === 'svg') { |
| 1414 | 1414 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1415 | 1415 | $format_sortie = 'svg'; |
| 1416 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1416 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1417 | 1417 | $valeurs['fichier_dest'] = $vignette; |
| 1418 | 1418 | _image_gd_output($svg, $valeurs); |
| 1419 | 1419 | } |
@@ -1425,9 +1425,9 @@ discard block |
||
| 1425 | 1425 | define('_CONVERT_COMMAND', 'convert'); |
| 1426 | 1426 | } // Securite : mes_options.php peut preciser le chemin absolu |
| 1427 | 1427 | if (!defined('_RESIZE_COMMAND')) { |
| 1428 | - define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest'); |
|
| 1428 | + define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest'); |
|
| 1429 | 1429 | } |
| 1430 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1430 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1431 | 1431 | $commande = str_replace( |
| 1432 | 1432 | ['%x', '%y', '%src', '%dest'], |
| 1433 | 1433 | [ |
@@ -1443,13 +1443,13 @@ discard block |
||
| 1443 | 1443 | if (!@file_exists($vignette)) { |
| 1444 | 1444 | spip_log("echec convert sur $vignette"); |
| 1445 | 1445 | |
| 1446 | - return; // echec commande |
|
| 1446 | + return; // echec commande |
|
| 1447 | 1447 | } |
| 1448 | 1448 | } |
| 1449 | 1449 | |
| 1450 | 1450 | // php5 imagemagick |
| 1451 | 1451 | elseif ($process == 'imagick') { |
| 1452 | - $vignette = "$destination." . $format_sortie; |
|
| 1452 | + $vignette = "$destination.".$format_sortie; |
|
| 1453 | 1453 | |
| 1454 | 1454 | if (!class_exists('Imagick')) { |
| 1455 | 1455 | spip_log('Classe Imagick absente !', _LOG_ERREUR); |
@@ -1463,7 +1463,7 @@ discard block |
||
| 1463 | 1463 | $destHeight, |
| 1464 | 1464 | Imagick::FILTER_LANCZOS, |
| 1465 | 1465 | 1 |
| 1466 | - );//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1466 | + ); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1467 | 1467 | $imagick->writeImage($vignette); |
| 1468 | 1468 | |
| 1469 | 1469 | if (!@file_exists($vignette)) { |
@@ -1481,11 +1481,11 @@ discard block |
||
| 1481 | 1481 | if (_PNMSCALE_COMMAND == '') { |
| 1482 | 1482 | return; |
| 1483 | 1483 | } |
| 1484 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1484 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1485 | 1485 | $pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND); |
| 1486 | 1486 | if ($format == 'jpg') { |
| 1487 | 1487 | $jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND); |
| 1488 | - exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1488 | + exec("$jpegtopnm_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 == 'gif') { |
| 1499 | 1499 | $giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND); |
| 1500 | - exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1500 | + exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1501 | 1501 | if (!($s = @filesize($vignette))) { |
| 1502 | 1502 | spip_unlink($vignette); |
| 1503 | 1503 | } |
@@ -1509,7 +1509,7 @@ discard block |
||
| 1509 | 1509 | } else { |
| 1510 | 1510 | if ($format == 'png') { |
| 1511 | 1511 | $pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND); |
| 1512 | - exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1512 | + exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1513 | 1513 | if (!($s = @filesize($vignette))) { |
| 1514 | 1514 | spip_unlink($vignette); |
| 1515 | 1515 | } |
@@ -1531,7 +1531,7 @@ discard block |
||
| 1531 | 1531 | return; |
| 1532 | 1532 | } |
| 1533 | 1533 | if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) { |
| 1534 | - spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels'); |
|
| 1534 | + spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels'); |
|
| 1535 | 1535 | |
| 1536 | 1536 | return; |
| 1537 | 1537 | } |
@@ -1843,7 +1843,7 @@ discard block |
||
| 1843 | 1843 | // de l'image, de facon a tromper le cache du navigateur |
| 1844 | 1844 | // quand on fait supprimer/reuploader un logo |
| 1845 | 1845 | // (pas de filemtime si SAFE MODE) |
| 1846 | - $date = test_espace_prive() ? ('?' . $date) : ''; |
|
| 1846 | + $date = test_espace_prive() ? ('?'.$date) : ''; |
|
| 1847 | 1847 | |
| 1848 | 1848 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1849 | 1849 | } |
@@ -1890,7 +1890,7 @@ discard block |
||
| 1890 | 1890 | public static function LittleEndian2String($number, $minbytes = 1) { |
| 1891 | 1891 | $intstring = ''; |
| 1892 | 1892 | while ($number > 0) { |
| 1893 | - $intstring = $intstring . chr($number & 255); |
|
| 1893 | + $intstring = $intstring.chr($number & 255); |
|
| 1894 | 1894 | $number >>= 8; |
| 1895 | 1895 | } |
| 1896 | 1896 | |
@@ -1922,9 +1922,9 @@ discard block |
||
| 1922 | 1922 | $b = $argb['blue']; |
| 1923 | 1923 | |
| 1924 | 1924 | if ($bpp[$key] == 32) { |
| 1925 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a); |
|
| 1925 | + $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a); |
|
| 1926 | 1926 | } elseif ($bpp[$key] == 24) { |
| 1927 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r); |
|
| 1927 | + $icXOR[$key] .= chr($b).chr($g).chr($r); |
|
| 1928 | 1928 | } |
| 1929 | 1929 | |
| 1930 | 1930 | if ($a < 128) { |
@@ -1951,48 +1951,48 @@ discard block |
||
| 1951 | 1951 | |
| 1952 | 1952 | // BITMAPINFOHEADER - 40 bytes |
| 1953 | 1953 | $BitmapInfoHeader[$key] = ''; |
| 1954 | - $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1955 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1954 | + $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1955 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1956 | 1956 | // The biHeight member specifies the combined |
| 1957 | 1957 | // height of the XOR and AND masks. |
| 1958 | 1958 | $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG biHeight; |
| 1959 | - $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1960 | - $BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00"; // wBitCount; |
|
| 1961 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1962 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1963 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1964 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1965 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1966 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1959 | + $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1960 | + $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount; |
|
| 1961 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1962 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1963 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1964 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1965 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1966 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1967 | 1967 | } |
| 1968 | 1968 | |
| 1969 | 1969 | |
| 1970 | - $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1971 | - $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1972 | - $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1970 | + $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1971 | + $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1972 | + $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1973 | 1973 | |
| 1974 | 1974 | $dwImageOffset = 6 + (count($gd_image_array) * 16); |
| 1975 | 1975 | foreach ($gd_image_array as $key => $gd_image) { |
| 1976 | 1976 | // ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) |
| 1977 | 1977 | |
| 1978 | - $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1979 | - $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1980 | - $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1981 | - $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1978 | + $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1979 | + $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1980 | + $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1981 | + $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1982 | 1982 | |
| 1983 | - $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1984 | - $icondata .= chr($bpp[$key]) . "\x00"; // wBitCount; // Bits per pixel |
|
| 1983 | + $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1984 | + $icondata .= chr($bpp[$key])."\x00"; // wBitCount; // Bits per pixel |
|
| 1985 | 1985 | |
| 1986 | 1986 | $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]); |
| 1987 | 1987 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1988 | 1988 | $dwBytesInRes, |
| 1989 | 1989 | 4 |
| 1990 | - ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1990 | + ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1991 | 1991 | |
| 1992 | 1992 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1993 | 1993 | $dwImageOffset, |
| 1994 | 1994 | 4 |
| 1995 | - ); // dwImageOffset; // Where in the file is this image? |
|
| 1995 | + ); // dwImageOffset; // Where in the file is this image? |
|
| 1996 | 1996 | $dwImageOffset += strlen($BitmapInfoHeader[$key]); |
| 1997 | 1997 | $dwImageOffset += strlen($icXOR[$key]); |
| 1998 | 1998 | $dwImageOffset += strlen($icAND[$key]); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $rejouer = (_SESSION_REJOUER === true) ? rejouer_session() : _SESSION_REJOUER; |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - return $rejouer . (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : ''); |
|
| 191 | + return $rejouer.(defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : ''); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -234,9 +234,9 @@ discard block |
||
| 234 | 234 | // |
| 235 | 235 | if ($vcs = version_vcs_courante(_DIR_RACINE, true)) { |
| 236 | 236 | if ($vcs['vcs'] === 'GIT') { |
| 237 | - $url = 'https://git.spip.net/spip/spip/commit/' . $vcs['commit']; |
|
| 237 | + $url = 'https://git.spip.net/spip/spip/commit/'.$vcs['commit']; |
|
| 238 | 238 | } elseif ($vcs['vcs'] === 'SVN') { |
| 239 | - $url = 'https://core.spip.net/projects/spip/repository/revisions/' . $vcs['commit']; |
|
| 239 | + $url = 'https://core.spip.net/projects/spip/repository/revisions/'.$vcs['commit']; |
|
| 240 | 240 | } else { |
| 241 | 241 | $url = ''; |
| 242 | 242 | } |
@@ -246,14 +246,14 @@ discard block |
||
| 246 | 246 | $commit = "<a href=\"$url\" target=\"_blank\" rel=\"noopener noreferrer\">$commit</a>"; |
| 247 | 247 | } |
| 248 | 248 | if ($vcs['branch']) { |
| 249 | - $commit = $vcs['branch'] . ': ' . $commit; |
|
| 249 | + $commit = $vcs['branch'].': '.$commit; |
|
| 250 | 250 | } |
| 251 | 251 | $version .= " {$vcs['vcs']} [$commit]"; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | // et la version de l'ecran de securite |
| 255 | 255 | $secu = defined('_ECRAN_SECURITE') |
| 256 | - ? '<br />' . _T('ecran_securite', ['version' => _ECRAN_SECURITE]) |
|
| 256 | + ? '<br />'._T('ecran_securite', ['version' => _ECRAN_SECURITE]) |
|
| 257 | 257 | : ''; |
| 258 | 258 | |
| 259 | 259 | return _T( |
@@ -261,10 +261,10 @@ discard block |
||
| 261 | 261 | [ |
| 262 | 262 | 'spip' => "<b>SPIP $version</b> ", |
| 263 | 263 | 'lien_gpl' => |
| 264 | - "<a href='" . generer_url_ecrire( |
|
| 264 | + "<a href='".generer_url_ecrire( |
|
| 265 | 265 | 'aide', |
| 266 | - 'aide=licence&var_lang=' . $GLOBALS['spip_lang'] |
|
| 267 | - ) . "' class=\"aide popin\">" . _T('info_copyright_gpl') . '</a>' |
|
| 266 | + 'aide=licence&var_lang='.$GLOBALS['spip_lang'] |
|
| 267 | + )."' class=\"aide popin\">"._T('info_copyright_gpl').'</a>' |
|
| 268 | 268 | ] |
| 269 | 269 | ) |
| 270 | 270 | . $secu; |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | $onfocus = ''; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - $form = '<input type="text" size="10" value="' . $recherche_aff . '" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />'; |
|
| 295 | - $form .= "<input type='image' src='" . chemin_image('rechercher-20.png') . "' name='submit' class='submit' alt='" . _T('info_rechercher') . "' />"; |
|
| 294 | + $form = '<input type="text" size="10" value="'.$recherche_aff.'" name="recherche" class="recherche" accesskey="r"'.$onfocus.' />'; |
|
| 295 | + $form .= "<input type='image' src='".chemin_image('rechercher-20.png')."' name='submit' class='submit' alt='"._T('info_rechercher')."' />"; |
|
| 296 | 296 | |
| 297 | - return "<div class='spip_recherche'>" . generer_form_ecrire($page, $form . $complement, " method='get'") . '</div>'; |
|
| 297 | + return "<div class='spip_recherche'>".generer_form_ecrire($page, $form.$complement, " method='get'").'</div>'; |
|
| 298 | 298 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | lire_fichier($file, $c); |
| 75 | 75 | $css .= $c; |
| 76 | 76 | } |
| 77 | - $css = "<style type='text/css'>" . $css . '</style>'; |
|
| 77 | + $css = "<style type='text/css'>".$css.'</style>'; |
|
| 78 | 78 | } else { |
| 79 | 79 | foreach ($files as $name) { |
| 80 | 80 | $file = direction_css(find_in_theme($name)); |
@@ -87,19 +87,19 @@ discard block |
||
| 87 | 87 | define('_DOCTYPE_ECRIRE', ''); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - return _DOCTYPE_ECRIRE . |
|
| 91 | - html_lang_attributes() . |
|
| 92 | - "<head>\n" . |
|
| 93 | - '<title>' . |
|
| 94 | - textebrut($titre) . |
|
| 95 | - "</title>\n" . |
|
| 96 | - "<meta name='viewport' content='width=device-width' />\n" . |
|
| 97 | - $css . |
|
| 90 | + return _DOCTYPE_ECRIRE. |
|
| 91 | + html_lang_attributes(). |
|
| 92 | + "<head>\n". |
|
| 93 | + '<title>'. |
|
| 94 | + textebrut($titre). |
|
| 95 | + "</title>\n". |
|
| 96 | + "<meta name='viewport' content='width=device-width' />\n". |
|
| 97 | + $css. |
|
| 98 | 98 | '</head> |
| 99 | -<body' . $onLoad . " class='minipres'> |
|
| 99 | +<body' . $onLoad." class='minipres'> |
|
| 100 | 100 | <div id='minipres'> |
| 101 | 101 | <h1>" . |
| 102 | - $titre . |
|
| 102 | + $titre. |
|
| 103 | 103 | "</h1> |
| 104 | 104 | <div>\n"; |
| 105 | 105 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $titre = ($titre == 'install') |
| 184 | 184 | ? _T('avis_espace_interdit') |
| 185 | - : $titre . ' : ' . _T('info_acces_interdit'); |
|
| 185 | + : $titre.' : '._T('info_acces_interdit'); |
|
| 186 | 186 | |
| 187 | 187 | $statut = isset($GLOBALS['visiteur_session']['statut']) ? $GLOBALS['visiteur_session']['statut'] : ''; |
| 188 | 188 | $nom = isset($GLOBALS['visiteur_session']['nom']) ? $GLOBALS['visiteur_session']['nom'] : ''; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $corps = bouton_action(_T('public:accueil_site'), $GLOBALS['meta']['adresse_site']); |
| 202 | 202 | } |
| 203 | 203 | $corps = "<div class='boutons'>$corps</div>"; |
| 204 | - spip_log($nom . " $titre " . $_SERVER['REQUEST_URI']); |
|
| 204 | + spip_log($nom." $titre ".$_SERVER['REQUEST_URI']); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | if (!_AJAX) { |
@@ -219,6 +219,6 @@ discard block |
||
| 219 | 219 | foreach ($_POST as $v => $c) { |
| 220 | 220 | $url = parametre_url($url, $v, $c, '&'); |
| 221 | 221 | } |
| 222 | - ajax_retour('<div>' . $titre . redirige_formulaire($url) . '</div>', false); |
|
| 222 | + ajax_retour('<div>'.$titre.redirige_formulaire($url).'</div>', false); |
|
| 223 | 223 | } |
| 224 | 224 | } |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | && autoriser('onglet', "_$id") |
| 103 | 103 | ) { |
| 104 | 104 | $onglets[$id] = new Bouton( |
| 105 | - isset($infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 106 | - $infos['titre'], // titre |
|
| 105 | + isset($infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 106 | + $infos['titre'], // titre |
|
| 107 | 107 | (isset($infos['action']) and $infos['action']) |
| 108 | 108 | ? generer_url_ecrire( |
| 109 | 109 | $infos['action'], |
@@ -142,5 +142,5 @@ discard block |
||
| 142 | 142 | $res .= onglet(_T($onglet->libelle), $url, $exec, $ongletCourant, $onglet->icone); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - return !$res ? '' : (debut_onglet($class) . $res . fin_onglet()); |
|
| 145 | + return !$res ? '' : (debut_onglet($class).$res.fin_onglet()); |
|
| 146 | 146 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $class = ' blocreplie'; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - return '<div ' . ($id ? "id='$id' " : '') . "class='bloc_depliable$class'>"; |
|
| 58 | + return '<div '.($id ? "id='$id' " : '')."class='bloc_depliable$class'>"; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // https://code.spip.net/@fin_block |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | // $ids : id des div lies au bouton (facultatif, par defaut c'est le div.bloc_depliable qui suit) |
| 69 | 69 | // https://code.spip.net/@bouton_block_depliable |
| 70 | 70 | function bouton_block_depliable($texte, $deplie, $ids = '') { |
| 71 | - $bouton_id = 'b' . substr(md5($texte . microtime()), 0, 8); |
|
| 71 | + $bouton_id = 'b'.substr(md5($texte.microtime()), 0, 8); |
|
| 72 | 72 | |
| 73 | 73 | $class = ($deplie === true) ? ' deplie' : (($deplie == -1) ? ' impliable' : ' replie'); |
| 74 | 74 | if (strlen($ids)) { |
| 75 | 75 | $cible = explode(',', $ids); |
| 76 | - $cible = '#' . implode(',#', $cible); |
|
| 76 | + $cible = '#'.implode(',#', $cible); |
|
| 77 | 77 | } else { |
| 78 | 78 | $cible = "#$bouton_id + div.bloc_depliable"; |
| 79 | 79 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - $texte = $x . $texte; |
|
| 68 | + $texte = $x.$texte; |
|
| 69 | 69 | |
| 70 | 70 | return $texte; |
| 71 | 71 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | || ($pos = 0); |
| 180 | 180 | |
| 181 | 181 | if (false === strpos(substr($texte, 0, $pos), '<!-- insert_head -->')) { |
| 182 | - $insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n"; |
|
| 182 | + $insert = "\n".pipeline('insert_head', '<!-- f_insert_head -->')."\n"; |
|
| 183 | 183 | $texte = substr_replace($texte, $insert, $pos, 0); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | $texte = substr_replace($texte, $x, $pos, 0); |
| 213 | 213 | // pas de preview en fenetre enfant |
| 214 | - $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes($GLOBALS['meta']['adresse_site']) . "';}</script>"; |
|
| 214 | + $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes($GLOBALS['meta']['adresse_site'])."';}</script>"; |
|
| 215 | 215 | if (!$pos = stripos($texte, '<head') or !$pos = strpos($texte, '>', $pos)) { |
| 216 | 216 | $pos = -1; |
| 217 | 217 | } |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | // inserer avant le </body> fermant si on peut, a la fin de la page sinon |
| 284 | 284 | if (($p = strpos($texte, '</body>')) !== false) { |
| 285 | - $texte = substr($texte, 0, $p) . $code . substr($texte, $p); |
|
| 285 | + $texte = substr($texte, 0, $p).$code.substr($texte, $p); |
|
| 286 | 286 | } else { |
| 287 | 287 | $texte .= $code; |
| 288 | 288 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $_id_table = reset($_id_table); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - $requete['SELECT'][] = 't.' . $_id_table; |
|
| 70 | + $requete['SELECT'][] = 't.'.$_id_table; |
|
| 71 | 71 | $a = []; |
| 72 | 72 | // Recherche fulltext |
| 73 | 73 | foreach ($champs as $champ => $poids) { |
@@ -78,13 +78,13 @@ discard block |
||
| 78 | 78 | $champ = "t.$champ"; |
| 79 | 79 | } |
| 80 | 80 | $requete['SELECT'][] = $champ; |
| 81 | - $a[] = $champ . ' ' . $methode . ' ' . $q; |
|
| 81 | + $a[] = $champ.' '.$methode.' '.$q; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | if ($a) { |
| 85 | 85 | $requete['WHERE'][] = join(' OR ', $a); |
| 86 | 86 | } |
| 87 | - $requete['FROM'][] = table_objet_sql($table) . ' AS t'; |
|
| 87 | + $requete['FROM'][] = table_objet_sql($table).' AS t'; |
|
| 88 | 88 | |
| 89 | 89 | $results = []; |
| 90 | 90 | |
@@ -252,8 +252,8 @@ discard block |
||
| 252 | 252 | ); |
| 253 | 253 | } // cas table de liaison generique spip_xxx_yyy |
| 254 | 254 | elseif ( |
| 255 | - $t = $trouver_table($table_arrivee . '_' . $table_depart, $serveur) |
|
| 256 | - or $t = $trouver_table($table_depart . '_' . $table_arrivee, $serveur) |
|
| 255 | + $t = $trouver_table($table_arrivee.'_'.$table_depart, $serveur) |
|
| 256 | + or $t = $trouver_table($table_depart.'_'.$table_arrivee, $serveur) |
|
| 257 | 257 | ) { |
| 258 | 258 | $s = sql_select( |
| 259 | 259 | "$cle_depart,$cle_arrivee", |
@@ -292,12 +292,12 @@ discard block |
||
| 292 | 292 | } |
| 293 | 293 | if (isset($joint['champs']) and $joint['champs']) { |
| 294 | 294 | foreach ($joint['champs'] as $c => $val) { |
| 295 | - $results[$id]['champs'][$table_liee . '.' . $c] = $val; |
|
| 295 | + $results[$id]['champs'][$table_liee.'.'.$c] = $val; |
|
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | if (isset($joint['matches']) and $joint['matches']) { |
| 299 | 299 | foreach ($joint['matches'] as $c => $val) { |
| 300 | - $results[$id]['matches'][$table_liee . '.' . $c] = $val; |
|
| 300 | + $results[$id]['matches'][$table_liee.'.'.$c] = $val; |
|
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | 303 | } |