@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | # attention toutefois seuls '' et '=' figurent dans les modes de compatibilite |
| 24 | 24 | define('_separateur_urls_page', ''); |
| 25 | 25 | # on peut indiquer '' si on a installe le .htaccess |
| 26 | -define('_debut_urls_page', get_spip_script('./') . '?'); |
|
| 26 | +define('_debut_urls_page', get_spip_script('./').'?'); |
|
| 27 | 27 | ####### |
| 28 | 28 | |
| 29 | 29 | |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - $url = \_debut_urls_page . $objet . \_separateur_urls_page |
|
| 50 | - . $id . \_terminaison_urls_page; |
|
| 49 | + $url = \_debut_urls_page.$objet.\_separateur_urls_page |
|
| 50 | + . $id.\_terminaison_urls_page; |
|
| 51 | 51 | |
| 52 | 52 | if ($args) { |
| 53 | 53 | $args = strpos($url, '?') ? "&$args" : "?$args"; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - return _DIR_RACINE . $url . $args . ($ancre ? "#$ancre" : ''); |
|
| 56 | + return _DIR_RACINE.$url.$args.($ancre ? "#$ancre" : ''); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $result = sql_select( |
| 44 | 44 | 'id_rubrique, id_parent, titre, descriptif, lang', |
| 45 | 45 | 'spip_rubriques', |
| 46 | - 'id_parent=' . intval($collection), |
|
| 46 | + 'id_parent='.intval($collection), |
|
| 47 | 47 | '', |
| 48 | 48 | '0+titre,titre', |
| 49 | 49 | "$debut,$limite" |
@@ -74,19 +74,18 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - $lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' : |
|
| 78 | - http_img_pack( |
|
| 77 | + $lib_bouton = (!acces_restreint_rubrique($id_rubrique) ? '' : http_img_pack( |
|
| 79 | 78 | 'auteur-0minirezo-16.png', |
| 80 | 79 | '', |
| 81 | 80 | " width='16' height='16'", |
| 82 | 81 | _T('image_administrer_rubrique') |
| 83 | - )) . |
|
| 84 | - " <a class='titremlien' dir='$lang_dir'" . |
|
| 85 | - ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='" . $row['lang'] . "'" : '') . |
|
| 86 | - " href='" . |
|
| 87 | - generer_objet_url($id_rubrique, 'rubrique') . |
|
| 88 | - "'><span class='titre'>" . |
|
| 89 | - $rang . $titre |
|
| 82 | + )). |
|
| 83 | + " <a class='titremlien' dir='$lang_dir'". |
|
| 84 | + ($row['lang'] !== $GLOBALS['spip_lang'] ? " hreflang='".$row['lang']."'" : ''). |
|
| 85 | + " href='". |
|
| 86 | + generer_objet_url($id_rubrique, 'rubrique'). |
|
| 87 | + "'><span class='titre'>". |
|
| 88 | + $rang.$titre |
|
| 90 | 89 | . '</span>' |
| 91 | 90 | . (is_string($logo) ? $logo : '') |
| 92 | 91 | . '</a>'; |
@@ -96,8 +95,8 @@ discard block |
||
| 96 | 95 | ; |
| 97 | 96 | |
| 98 | 97 | $res[] = |
| 99 | - debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre) . |
|
| 100 | - $les_sous_enfants . |
|
| 98 | + debut_cadre_sous_rub(($id_parent ? 'rubrique-24.png' : 'secteur-24.png'), true, '', $titre). |
|
| 99 | + $les_sous_enfants. |
|
| 101 | 100 | fin_cadre_sous_rub(); |
| 102 | 101 | } |
| 103 | 102 | } |
@@ -116,7 +115,7 @@ discard block |
||
| 116 | 115 | * Le contenu du bloc dépliable |
| 117 | 116 | */ |
| 118 | 117 | function sous_enfant_rub($collection2) { |
| 119 | - $nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($collection2)); |
|
| 118 | + $nb = sql_countsel('spip_rubriques', 'id_parent='.intval($collection2)); |
|
| 120 | 119 | |
| 121 | 120 | $retour = ''; |
| 122 | 121 | $pagination = ''; |
@@ -128,23 +127,23 @@ discard block |
||
| 128 | 127 | * Si > 500 on affiche une pagination |
| 129 | 128 | */ |
| 130 | 129 | if ($nb > $limite) { |
| 131 | - $debut = _request('debut_rubrique' . $collection2) ?: $debut; |
|
| 130 | + $debut = _request('debut_rubrique'.$collection2) ?: $debut; |
|
| 132 | 131 | $pagination = chercher_filtre('pagination'); |
| 133 | - $pagination = '<p class="pagination">' . $pagination( |
|
| 132 | + $pagination = '<p class="pagination">'.$pagination( |
|
| 134 | 133 | $nb, |
| 135 | - '_rubrique' . $collection2, |
|
| 134 | + '_rubrique'.$collection2, |
|
| 136 | 135 | $debut, |
| 137 | 136 | $limite, |
| 138 | 137 | true, |
| 139 | 138 | 'prive' |
| 140 | - ) . '</p>'; |
|
| 139 | + ).'</p>'; |
|
| 141 | 140 | $limite = $debut + $limite; |
| 142 | 141 | } |
| 143 | 142 | |
| 144 | 143 | $result = sql_select( |
| 145 | 144 | 'id_rubrique, id_parent, titre, lang', |
| 146 | 145 | 'spip_rubriques', |
| 147 | - 'id_parent=' . intval($collection2), |
|
| 146 | + 'id_parent='.intval($collection2), |
|
| 148 | 147 | '', |
| 149 | 148 | '0+titre,titre', |
| 150 | 149 | "$debut,$limite" |
@@ -164,14 +163,14 @@ discard block |
||
| 164 | 163 | changer_typo($row['lang']); |
| 165 | 164 | $lang_dir = lang_dir($row['lang']); |
| 166 | 165 | if (autoriser('voir', 'rubrique', $id_rubrique2)) { |
| 167 | - $retour .= "\n<li class='item' dir='$lang_dir'><a href='" . generer_objet_url( |
|
| 166 | + $retour .= "\n<li class='item' dir='$lang_dir'><a href='".generer_objet_url( |
|
| 168 | 167 | $id_rubrique2, |
| 169 | 168 | 'rubrique' |
| 170 | - ) . "'>" . $rang2 . $titre2 . "</a></li>\n"; |
|
| 169 | + )."'>".$rang2.$titre2."</a></li>\n"; |
|
| 171 | 170 | } |
| 172 | 171 | } |
| 173 | 172 | |
| 174 | - $retour = $pagination . $retour . $pagination; |
|
| 173 | + $retour = $pagination.$retour.$pagination; |
|
| 175 | 174 | |
| 176 | 175 | if (!$retour) { |
| 177 | 176 | return ''; |
@@ -180,7 +179,7 @@ discard block |
||
| 180 | 179 | return debut_block_depliable($debut > 0 ? true : false, "enfants$collection2") |
| 181 | 180 | . "\n<ul class='liste-items sous-sous-rub'>\n" |
| 182 | 181 | . $retour |
| 183 | - . "</ul>\n" . fin_block() . "\n\n"; |
|
| 182 | + . "</ul>\n".fin_block()."\n\n"; |
|
| 184 | 183 | } |
| 185 | 184 | |
| 186 | 185 | /** |
@@ -199,13 +198,13 @@ discard block |
||
| 199 | 198 | $debut = 0; |
| 200 | 199 | $limite = 500; |
| 201 | 200 | |
| 202 | - $nb = sql_countsel('spip_rubriques', 'id_parent=' . intval($id_rubrique)); |
|
| 201 | + $nb = sql_countsel('spip_rubriques', 'id_parent='.intval($id_rubrique)); |
|
| 203 | 202 | |
| 204 | 203 | if ($nb > $limite) { |
| 205 | - $debut = _request('debut_rubrique' . $id_rubrique) ?: $debut; |
|
| 204 | + $debut = _request('debut_rubrique'.$id_rubrique) ?: $debut; |
|
| 206 | 205 | $pagination = chercher_filtre('pagination'); |
| 207 | - $pagination = '<br class="nettoyeur"><p class="pagination">' . |
|
| 208 | - $pagination($nb, '_rubrique' . $id_rubrique, $debut, $limite, true, 'prive') . |
|
| 206 | + $pagination = '<br class="nettoyeur"><p class="pagination">'. |
|
| 207 | + $pagination($nb, '_rubrique'.$id_rubrique, $debut, $limite, true, 'prive'). |
|
| 209 | 208 | '</p>'; |
| 210 | 209 | } |
| 211 | 210 | |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | // on renvoi un 401 qui fait echouer la requete ajax silencieusement |
| 40 | 40 | if (!autoriser('ecrire')) { |
| 41 | 41 | $retour = |
| 42 | - '<ul class="deroulant__sous-menu" data-profondeur="1">' . |
|
| 43 | - '<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">' . |
|
| 44 | - '<a class="deroulant__lien" href="' . generer_url_ecrire('accueil') . '" data-profondeur="1">' . |
|
| 45 | - '<span class="libelle">' . _T('public:lien_connecter') . '</span>' . |
|
| 46 | - '</a>' . |
|
| 47 | - '</li>' . |
|
| 42 | + '<ul class="deroulant__sous-menu" data-profondeur="1">'. |
|
| 43 | + '<li class="deroulant__item deroulant__item_plan plan_site" data-profondeur="1">'. |
|
| 44 | + '<a class="deroulant__lien" href="'.generer_url_ecrire('accueil').'" data-profondeur="1">'. |
|
| 45 | + '<span class="libelle">'._T('public:lien_connecter').'</span>'. |
|
| 46 | + '</a>'. |
|
| 47 | + '</li>'. |
|
| 48 | 48 | '</ul>'; |
| 49 | 49 | include_spip('inc/actions'); |
| 50 | 50 | ajax_retour($retour); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if ($date = intval(_request('date'))) { |
| 55 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $date) . ' GMT'); |
|
| 55 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', $date).' GMT'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $r = gen_liste_rubriques(); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | and !strstr($_SERVER['SERVER_SOFTWARE'], 'IIS/') |
| 63 | 63 | ) { |
| 64 | 64 | include_spip('inc/headers'); |
| 65 | - header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']); |
|
| 65 | + header('Content-Type: text/html; charset='.$GLOBALS['meta']['charset']); |
|
| 66 | 66 | http_response_code(304); |
| 67 | 67 | exit; |
| 68 | 68 | } else { |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | **/ |
| 86 | 86 | function menu_rubriques($complet = true) { |
| 87 | 87 | $ret = '<li class="deroulant__item deroulant__item_tout toutsite" data-profondeur="1">' |
| 88 | - . '<a class="deroulant__lien" href="' . generer_url_ecrire('plan') . '" data-profondeur="1">' |
|
| 89 | - . '<span class="libelle">' . _T('info_tout_site') . '</span>' |
|
| 88 | + . '<a class="deroulant__lien" href="'.generer_url_ecrire('plan').'" data-profondeur="1">' |
|
| 89 | + . '<span class="libelle">'._T('info_tout_site').'</span>' |
|
| 90 | 90 | . '</a>' |
| 91 | 91 | . '</li>'; |
| 92 | 92 | |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | static $zmax = 6; |
| 146 | 146 | $profondeur_next = $profondeur + 1; |
| 147 | 147 | |
| 148 | - $nav = '<a class="deroulant__lien" href="' . generer_objet_url($id_rubrique, 'rubrique', '', '', false) . "\" data-profondeur=\"$profondeur\">" |
|
| 149 | - . '<span class="libelle">' . supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)) . '</span>' |
|
| 148 | + $nav = '<a class="deroulant__lien" href="'.generer_objet_url($id_rubrique, 'rubrique', '', '', false)."\" data-profondeur=\"$profondeur\">" |
|
| 149 | + . '<span class="libelle">'.supprimer_tags(preg_replace(',[\x00-\x1f]+,', ' ', $titre_rubrique)).'</span>' |
|
| 150 | 150 | . "</a>\n"; |
| 151 | 151 | |
| 152 | 152 | // Limiter volontairement le nombre de sous-menus |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | if (strlen($dossier) and substr($dossier, -1) != '/') { |
| 54 | 54 | $dossier .= '/'; |
| 55 | 55 | } |
| 56 | - $f = str_replace('/', '_', $dossier) . $nom; |
|
| 56 | + $f = str_replace('/', '_', $dossier).$nom; |
|
| 57 | 57 | |
| 58 | 58 | if (function_exists($f)) { |
| 59 | 59 | return $f; |
| 60 | 60 | } |
| 61 | - if (function_exists($g = $f . '_dist')) { |
|
| 61 | + if (function_exists($g = $f.'_dist')) { |
|
| 62 | 62 | return $g; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // passer en minuscules (cf les balises de formulaires) |
| 80 | 80 | // et inclure le fichier |
| 81 | 81 | if ( |
| 82 | - !$inc = include_spip($dossier . ($d = strtolower($nom))) |
|
| 82 | + !$inc = include_spip($dossier.($d = strtolower($nom))) |
|
| 83 | 83 | // si le fichier truc/machin/nom.php n'existe pas, |
| 84 | 84 | // la fonction peut etre definie dans truc/machin.php qui regroupe plusieurs petites fonctions |
| 85 | 85 | and strlen(dirname($dossier)) and dirname($dossier) != '.' |
@@ -98,14 +98,14 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Echec : message d'erreur |
| 101 | - spip_log("fonction $nom ($f ou $g) indisponible" . |
|
| 101 | + spip_log("fonction $nom ($f ou $g) indisponible". |
|
| 102 | 102 | ($inc ? '' : " (fichier $d absent de $dossier)")); |
| 103 | 103 | |
| 104 | 104 | include_spip('inc/minipres'); |
| 105 | 105 | echo minipres( |
| 106 | 106 | _T('forum_titre_erreur'), |
| 107 | - _T('fichier_introuvable', ['fichier' => '<b>' . spip_htmlentities($d) . '</b>']), |
|
| 108 | - ['all_inline' => true,'status' => 404] |
|
| 107 | + _T('fichier_introuvable', ['fichier' => '<b>'.spip_htmlentities($d).'</b>']), |
|
| 108 | + ['all_inline' => true, 'status' => 404] |
|
| 109 | 109 | ); |
| 110 | 110 | exit; |
| 111 | 111 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * - string : chemin du fichier trouvé |
| 152 | 152 | **/ |
| 153 | 153 | function include_spip($f, $include = true) { |
| 154 | - return find_in_path($f . '.php', '', $include); |
|
| 154 | + return find_in_path($f.'.php', '', $include); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * - string : chemin du fichier trouvé |
| 172 | 172 | **/ |
| 173 | 173 | function require_spip($f) { |
| 174 | - return find_in_path($f . '.php', '', 'required'); |
|
| 174 | + return find_in_path($f.'.php', '', 'required'); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // donc il faut l'inclure "en globals" |
| 189 | 189 | if ($f = find_in_path('mes_fonctions.php')) { |
| 190 | 190 | global $dossier_squelettes; |
| 191 | - include_once(_ROOT_CWD . $f); |
|
| 191 | + include_once(_ROOT_CWD.$f); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | if (@is_readable(_CACHE_PLUGINS_FCT)) { |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | // appliquer notre fonction si elle existe |
| 296 | - $fonc = 'execute_pipeline_' . strtolower($action); |
|
| 296 | + $fonc = 'execute_pipeline_'.strtolower($action); |
|
| 297 | 297 | if (function_exists($fonc)) { |
| 298 | 298 | $val = $fonc($val); |
| 299 | 299 | } // plantage ? |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | function spip_log($message = null, $name = null) { |
| 359 | 359 | static $pre = []; |
| 360 | 360 | static $log; |
| 361 | - preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string)$name, $regs); |
|
| 361 | + preg_match('/^([a-z_]*)\.?(\d)?$/iS', (string) $name, $regs); |
|
| 362 | 362 | if (!isset($regs[1]) or !$logname = $regs[1]) { |
| 363 | 363 | $logname = null; |
| 364 | 364 | } |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | if (!is_string($message)) { |
| 387 | 387 | $message = print_r($message, true); |
| 388 | 388 | } |
| 389 | - $log($pre[$niveau] . ' ' . $message, $logname); |
|
| 389 | + $log($pre[$niveau].' '.$message, $logname); |
|
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | $a = './'; |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | - $regexp = ',^(' . str_replace('[]', '\[\]', $c) . '[[]?[]]?)(=.*)?$,'; |
|
| 590 | + $regexp = ',^('.str_replace('[]', '\[\]', $c).'[[]?[]]?)(=.*)?$,'; |
|
| 591 | 591 | $ajouts = array_flip(explode('|', $c)); |
| 592 | 592 | $u = is_array($v) ? $v : rawurlencode((string) $v); |
| 593 | 593 | $testv = (is_array($v) ? count($v) : strlen((string) $v)); |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | // Ajout. Pour une variable, remplacer au meme endroit, |
| 615 | 615 | // pour un tableau ce sera fait dans la prochaine boucle |
| 616 | 616 | elseif (substr($r[1], -2) != '[]') { |
| 617 | - $url[$n] = $r[1] . '=' . $u; |
|
| 617 | + $url[$n] = $r[1].'='.$u; |
|
| 618 | 618 | unset($ajouts[$r[1]]); |
| 619 | 619 | } |
| 620 | 620 | // Pour les tableaux on laisse tomber les valeurs de |
@@ -635,11 +635,11 @@ discard block |
||
| 635 | 635 | } elseif ($testv) { |
| 636 | 636 | foreach ($ajouts as $k => $n) { |
| 637 | 637 | if (!is_array($v)) { |
| 638 | - $url[] = $k . '=' . $u; |
|
| 638 | + $url[] = $k.'='.$u; |
|
| 639 | 639 | } else { |
| 640 | - $id = (substr($k, -2) == '[]') ? $k : ($k . '[]'); |
|
| 640 | + $id = (substr($k, -2) == '[]') ? $k : ($k.'[]'); |
|
| 641 | 641 | foreach ($v as $w) { |
| 642 | - $url[] = $id . '=' . (is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 642 | + $url[] = $id.'='.(is_array($w) ? 'Array' : rawurlencode($w)); |
|
| 643 | 643 | } |
| 644 | 644 | } |
| 645 | 645 | } |
@@ -650,10 +650,10 @@ discard block |
||
| 650 | 650 | |
| 651 | 651 | // recomposer l'adresse |
| 652 | 652 | if ($url) { |
| 653 | - $a .= '?' . join($sep, $url); |
|
| 653 | + $a .= '?'.join($sep, $url); |
|
| 654 | 654 | } |
| 655 | 655 | |
| 656 | - return $a . $ancre; |
|
| 656 | + return $a.$ancre; |
|
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | /** |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | translitteration($ancre) |
| 686 | 686 | ); |
| 687 | 687 | } |
| 688 | - return $url . (strlen($ancre) ? '#' . $ancre : ''); |
|
| 688 | + return $url.(strlen($ancre) ? '#'.$ancre : ''); |
|
| 689 | 689 | } |
| 690 | 690 | |
| 691 | 691 | /** |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | * @return bool |
| 802 | 802 | */ |
| 803 | 803 | function test_plugin_actif($plugin) { |
| 804 | - return ($plugin and defined('_DIR_PLUGIN_' . strtoupper($plugin))) ? true : false; |
|
| 804 | + return ($plugin and defined('_DIR_PLUGIN_'.strtoupper($plugin))) ? true : false; |
|
| 805 | 805 | } |
| 806 | 806 | |
| 807 | 807 | /** |
@@ -933,7 +933,7 @@ discard block |
||
| 933 | 933 | $value = interdire_scripts($value, -1); |
| 934 | 934 | } |
| 935 | 935 | if (!empty($options['class'])) { |
| 936 | - $value = "<span class='" . $options['class'] . "'>$value</span>"; |
|
| 936 | + $value = "<span class='".$options['class']."'>$value</span>"; |
|
| 937 | 937 | } |
| 938 | 938 | $text = str_replace("@$name@", $value, $text); |
| 939 | 939 | unset($args[$name]); |
@@ -942,7 +942,7 @@ discard block |
||
| 942 | 942 | // Si des variables n'ont pas ete inserees, le signaler |
| 943 | 943 | // (chaines de langues pas a jour) |
| 944 | 944 | if ($args) { |
| 945 | - spip_log("$f: variables inutilisees " . join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 945 | + spip_log("$f: variables inutilisees ".join(', ', array_keys($args)), _LOG_DEBUG); |
|
| 946 | 946 | } |
| 947 | 947 | } |
| 948 | 948 | |
@@ -966,7 +966,7 @@ discard block |
||
| 966 | 966 | function joli_repertoire($rep) { |
| 967 | 967 | $a = substr($rep, 0, 1); |
| 968 | 968 | if ($a <> '.' and $a <> '/') { |
| 969 | - $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS) . $rep; |
|
| 969 | + $rep = (_DIR_RESTREINT ? '' : _DIR_RESTREINT_ABS).$rep; |
|
| 970 | 970 | } |
| 971 | 971 | $rep = preg_replace(',(^\.\.\/),', '', $rep); |
| 972 | 972 | |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | $p -= ($x * 1000); |
| 1021 | 1021 | } |
| 1022 | 1022 | |
| 1023 | - return $s . sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1023 | + return $s.sprintf($s ? '%07.3f ms' : '%.3f ms', $p); |
|
| 1024 | 1024 | } |
| 1025 | 1025 | } |
| 1026 | 1026 | |
@@ -1087,7 +1087,7 @@ discard block |
||
| 1087 | 1087 | if ($taches and count($taches) and !spip_connect()) { |
| 1088 | 1088 | return false; |
| 1089 | 1089 | } |
| 1090 | - spip_log('cron !', 'jq' . _LOG_DEBUG); |
|
| 1090 | + spip_log('cron !', 'jq'._LOG_DEBUG); |
|
| 1091 | 1091 | if ($genie = charger_fonction('genie', 'inc', true)) { |
| 1092 | 1092 | return $genie($taches); |
| 1093 | 1093 | } |
@@ -1191,7 +1191,7 @@ discard block |
||
| 1191 | 1191 | |
| 1192 | 1192 | if ($queue_next_job_time == -1) { |
| 1193 | 1193 | if (!defined('_JQ_NEXT_JOB_TIME_FILENAME')) { |
| 1194 | - define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP . 'job_queue_next.txt'); |
|
| 1194 | + define('_JQ_NEXT_JOB_TIME_FILENAME', _DIR_TMP.'job_queue_next.txt'); |
|
| 1195 | 1195 | } |
| 1196 | 1196 | // utiliser un cache memoire si dispo |
| 1197 | 1197 | if (function_exists('cache_get') and defined('_MEMOIZE_MEMORY') and _MEMOIZE_MEMORY) { |
@@ -1260,8 +1260,8 @@ discard block |
||
| 1260 | 1260 | $src = ''; |
| 1261 | 1261 | } |
| 1262 | 1262 | if ($script) { |
| 1263 | - $script = ("/*<![CDATA[*/\n" . |
|
| 1264 | - preg_replace(',</([^>]*)>,', '<\/\1>', $script) . |
|
| 1263 | + $script = ("/*<![CDATA[*/\n". |
|
| 1264 | + preg_replace(',</([^>]*)>,', '<\/\1>', $script). |
|
| 1265 | 1265 | '/*]]>*/'); |
| 1266 | 1266 | } |
| 1267 | 1267 | if ($noscript) { |
@@ -1347,13 +1347,13 @@ discard block |
||
| 1347 | 1347 | if ($path_base == null) { |
| 1348 | 1348 | // Chemin standard depuis l'espace public |
| 1349 | 1349 | $path = defined('_SPIP_PATH') ? _SPIP_PATH : |
| 1350 | - _DIR_RACINE . ':' . |
|
| 1351 | - _DIR_RACINE . 'squelettes-dist/:' . |
|
| 1352 | - _DIR_RACINE . 'prive/:' . |
|
| 1350 | + _DIR_RACINE.':'. |
|
| 1351 | + _DIR_RACINE.'squelettes-dist/:'. |
|
| 1352 | + _DIR_RACINE.'prive/:'. |
|
| 1353 | 1353 | _DIR_RESTREINT; |
| 1354 | 1354 | // Ajouter squelettes/ |
| 1355 | - if (@is_dir(_DIR_RACINE . 'squelettes')) { |
|
| 1356 | - $path = _DIR_RACINE . 'squelettes/:' . $path; |
|
| 1355 | + if (@is_dir(_DIR_RACINE.'squelettes')) { |
|
| 1356 | + $path = _DIR_RACINE.'squelettes/:'.$path; |
|
| 1357 | 1357 | } |
| 1358 | 1358 | foreach (explode(':', $path) as $dir) { |
| 1359 | 1359 | if (strlen($dir) and substr($dir, -1) != '/') { |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | // Et le(s) dossier(s) des squelettes nommes |
| 1366 | 1366 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1367 | 1367 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1368 | - array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1368 | + array_unshift($path_full, ($d[0] == '/' ? '' : _DIR_RACINE).$d.'/'); |
|
| 1369 | 1369 | } |
| 1370 | 1370 | } |
| 1371 | 1371 | $GLOBALS['path_sig'] = md5(serialize($path_full)); |
@@ -1376,7 +1376,7 @@ discard block |
||
| 1376 | 1376 | |
| 1377 | 1377 | if (is_array($dir_path) or strlen($dir_path)) { |
| 1378 | 1378 | $tete = ''; |
| 1379 | - if (reset($path_base) == _DIR_RACINE . 'squelettes/') { |
|
| 1379 | + if (reset($path_base) == _DIR_RACINE.'squelettes/') { |
|
| 1380 | 1380 | $tete = array_shift($path_base); |
| 1381 | 1381 | } |
| 1382 | 1382 | $dirs = (is_array($dir_path) ? $dir_path : explode(':', $dir_path)); |
@@ -1397,7 +1397,7 @@ discard block |
||
| 1397 | 1397 | // Et le(s) dossier(s) des squelettes nommes |
| 1398 | 1398 | if (strlen($GLOBALS['dossier_squelettes'])) { |
| 1399 | 1399 | foreach (array_reverse(explode(':', $GLOBALS['dossier_squelettes'])) as $d) { |
| 1400 | - array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE) . $d . '/'); |
|
| 1400 | + array_unshift($path_full, ((isset($d[0]) and $d[0] == '/') ? '' : _DIR_RACINE).$d.'/'); |
|
| 1401 | 1401 | } |
| 1402 | 1402 | } |
| 1403 | 1403 | |
@@ -1468,14 +1468,14 @@ discard block |
||
| 1468 | 1468 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 1469 | 1469 | if ( |
| 1470 | 1470 | preg_match(',-(\d+)[.](png|gif|svg)$,', $file, $m) |
| 1471 | - and $file_svg_generique = substr($file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 1471 | + and $file_svg_generique = substr($file, 0, -strlen($m[0])).'-xx.svg' |
|
| 1472 | 1472 | and $f = find_in_theme("$file_svg_generique") |
| 1473 | 1473 | ) { |
| 1474 | - if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
|
| 1474 | + if ($fsize = substr($f, 0, -6).$m[1].'.svg' and file_exists($fsize)) { |
|
| 1475 | 1475 | return $themefiles["$subdir$file"] = $fsize; |
| 1476 | 1476 | } |
| 1477 | 1477 | else { |
| 1478 | - return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
|
| 1478 | + return $themefiles["$subdir$file"] = "$f?".$m[1].'px'; |
|
| 1479 | 1479 | } |
| 1480 | 1480 | } |
| 1481 | 1481 | |
@@ -1485,7 +1485,7 @@ discard block |
||
| 1485 | 1485 | return $themefiles["$subdir$file"] = $f; |
| 1486 | 1486 | } |
| 1487 | 1487 | } |
| 1488 | - spip_log("$file introuvable dans le theme prive " . reset($themes), 'theme'); |
|
| 1488 | + spip_log("$file introuvable dans le theme prive ".reset($themes), 'theme'); |
|
| 1489 | 1489 | |
| 1490 | 1490 | return $themefiles["$subdir$file"] = ''; |
| 1491 | 1491 | } |
@@ -1593,8 +1593,8 @@ discard block |
||
| 1593 | 1593 | return false; |
| 1594 | 1594 | } |
| 1595 | 1595 | if ($include and !isset($inc[$dirname][$file])) { |
| 1596 | - include_once _ROOT_CWD . $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1597 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1596 | + include_once _ROOT_CWD.$GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
|
| 1597 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1598 | 1598 | } |
| 1599 | 1599 | |
| 1600 | 1600 | return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file]; |
@@ -1607,14 +1607,14 @@ discard block |
||
| 1607 | 1607 | } |
| 1608 | 1608 | |
| 1609 | 1609 | foreach (creer_chemin() as $dir) { |
| 1610 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 1611 | - $dirs[$a] = (is_dir(_ROOT_CWD . $a) || !$a); |
|
| 1610 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 1611 | + $dirs[$a] = (is_dir(_ROOT_CWD.$a) || !$a); |
|
| 1612 | 1612 | } |
| 1613 | 1613 | if ($dirs[$a]) { |
| 1614 | - if (file_exists(_ROOT_CWD . ($a .= $file))) { |
|
| 1614 | + if (file_exists(_ROOT_CWD.($a .= $file))) { |
|
| 1615 | 1615 | if ($include and !isset($inc[$dirname][$file])) { |
| 1616 | - include_once _ROOT_CWD . $a; |
|
| 1617 | - $inc[$dirname][$file] = $inc[''][$dirname . $file] = true; |
|
| 1616 | + include_once _ROOT_CWD.$a; |
|
| 1617 | + $inc[$dirname][$file] = $inc[''][$dirname.$file] = true; |
|
| 1618 | 1618 | } |
| 1619 | 1619 | if (!defined('_SAUVER_CHEMIN')) { |
| 1620 | 1620 | // si le chemin n'a pas encore ete charge, ne pas lever le flag, ne pas cacher |
@@ -1624,7 +1624,7 @@ discard block |
||
| 1624 | 1624 | define('_SAUVER_CHEMIN', true); |
| 1625 | 1625 | } |
| 1626 | 1626 | |
| 1627 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = $a; |
|
| 1627 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = $a; |
|
| 1628 | 1628 | } |
| 1629 | 1629 | } |
| 1630 | 1630 | } |
@@ -1650,7 +1650,7 @@ discard block |
||
| 1650 | 1650 | define('_SAUVER_CHEMIN', true); |
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | - return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname . $file] = false; |
|
| 1653 | + return $GLOBALS['path_files'][$GLOBALS['path_sig']][$dirname][$file] = $GLOBALS['path_files'][$GLOBALS['path_sig']][''][$dirname.$file] = false; |
|
| 1654 | 1654 | } |
| 1655 | 1655 | |
| 1656 | 1656 | function clear_path_cache() { |
@@ -1720,12 +1720,12 @@ discard block |
||
| 1720 | 1720 | // cas borderline si dans mes_options on appelle redirige_par_entete qui utilise _T et charge un fichier de langue |
| 1721 | 1721 | // on a pas encore inclus flock.php |
| 1722 | 1722 | if (!function_exists('preg_files')) { |
| 1723 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 1723 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 1724 | 1724 | } |
| 1725 | 1725 | |
| 1726 | 1726 | // Parcourir le chemin |
| 1727 | 1727 | foreach (creer_chemin() as $d) { |
| 1728 | - $f = $d . $dir; |
|
| 1728 | + $f = $d.$dir; |
|
| 1729 | 1729 | if (@is_dir($f)) { |
| 1730 | 1730 | $liste = preg_files($f, $pattern, $maxfiles - count($liste_fichiers), $recurs === true ? [] : $recurs); |
| 1731 | 1731 | foreach ($liste as $chemin) { |
@@ -1774,9 +1774,9 @@ discard block |
||
| 1774 | 1774 | function charger_fonction_url(string $quoi, string $type = '') { |
| 1775 | 1775 | if ($type === 'defaut') { |
| 1776 | 1776 | $objet = objet_type($quoi); |
| 1777 | - if ($f = charger_fonction('generer_' . $objet . '_url', 'urls', true) |
|
| 1777 | + if ($f = charger_fonction('generer_'.$objet.'_url', 'urls', true) |
|
| 1778 | 1778 | // deprecated |
| 1779 | - or $f = charger_fonction('generer_url_' . $objet, 'urls', true) |
|
| 1779 | + or $f = charger_fonction('generer_url_'.$objet, 'urls', true) |
|
| 1780 | 1780 | ) { |
| 1781 | 1781 | return $f; |
| 1782 | 1782 | } |
@@ -1896,7 +1896,7 @@ discard block |
||
| 1896 | 1896 | * @deprecated 4.1 |
| 1897 | 1897 | * @see generer_objet_url |
| 1898 | 1898 | */ |
| 1899 | -function generer_url_entite($id = 0, $entite = '', $args = '', $ancre = '', $public = null, $type = null){ |
|
| 1899 | +function generer_url_entite($id = 0, $entite = '', $args = '', $ancre = '', $public = null, $type = null) { |
|
| 1900 | 1900 | if ($public and is_string($public)) { |
| 1901 | 1901 | return generer_objet_url(intval($id), $entite, $args ?: '', $ancre ?: '', true, $type ?? '', $public); |
| 1902 | 1902 | } |
@@ -1930,7 +1930,7 @@ discard block |
||
| 1930 | 1930 | * @deprecated 4.1 |
| 1931 | 1931 | * @see generer_objet_url_ecrire_edit |
| 1932 | 1932 | */ |
| 1933 | -function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = ''){ |
|
| 1933 | +function generer_url_ecrire_entite_edit($id, $entite, $args = '', $ancre = '') { |
|
| 1934 | 1934 | return generer_objet_url_ecrire_edit(intval($id), $entite, $args, $ancre); |
| 1935 | 1935 | } |
| 1936 | 1936 | |
@@ -1939,8 +1939,8 @@ discard block |
||
| 1939 | 1939 | include_spip('base/connect_sql'); |
| 1940 | 1940 | $id_type = id_table_objet($entite, $public); |
| 1941 | 1941 | |
| 1942 | - return _DIR_RACINE . get_spip_script('./') |
|
| 1943 | - . '?' . _SPIP_PAGE . "=$entite&$id_type=$i&connect=$public" |
|
| 1942 | + return _DIR_RACINE.get_spip_script('./') |
|
| 1943 | + . '?'._SPIP_PAGE."=$entite&$id_type=$i&connect=$public" |
|
| 1944 | 1944 | . (!$args ? '' : "&$args") |
| 1945 | 1945 | . (!$ancre ? '' : "#$ancre"); |
| 1946 | 1946 | } |
@@ -1993,7 +1993,7 @@ discard block |
||
| 1993 | 1993 | * @deprecated 4.1 |
| 1994 | 1994 | * @see generer_objet_url_absolue |
| 1995 | 1995 | */ |
| 1996 | -function generer_url_entite_absolue($id = 0, $entite = '', $args = '', $ancre = '', $connect = null){ |
|
| 1996 | +function generer_url_entite_absolue($id = 0, $entite = '', $args = '', $ancre = '', $connect = null) { |
|
| 1997 | 1997 | return generer_objet_url_absolue(intval($id), $entite, $args, $ancre, true, '', $connect); |
| 1998 | 1998 | } |
| 1999 | 1999 | |
@@ -2110,7 +2110,7 @@ discard block |
||
| 2110 | 2110 | !empty($_SERVER['QUERY_STRING']) |
| 2111 | 2111 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2112 | 2112 | ) { |
| 2113 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2113 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2114 | 2114 | } |
| 2115 | 2115 | } |
| 2116 | 2116 | } |
@@ -2145,9 +2145,9 @@ discard block |
||
| 2145 | 2145 | array_shift($myself); |
| 2146 | 2146 | $myself = implode('/', $myself); |
| 2147 | 2147 | } |
| 2148 | - $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)) . '/'; |
|
| 2148 | + $url = join('/', array_slice(explode('/', $myself), 0, -1 - $prof)).'/'; |
|
| 2149 | 2149 | |
| 2150 | - $url = $http . '://' . rtrim($host, '/') . '/' . ltrim($url, '/'); |
|
| 2150 | + $url = $http.'://'.rtrim($host, '/').'/'.ltrim($url, '/'); |
|
| 2151 | 2151 | |
| 2152 | 2152 | return $url; |
| 2153 | 2153 | } |
@@ -2185,16 +2185,16 @@ discard block |
||
| 2185 | 2185 | **/ |
| 2186 | 2186 | function generer_url_ecrire($script = '', $args = '', $no_entities = false, $rel = false) { |
| 2187 | 2187 | if (!$rel) { |
| 2188 | - $rel = url_de_base() . _DIR_RESTREINT_ABS . _SPIP_ECRIRE_SCRIPT; |
|
| 2188 | + $rel = url_de_base()._DIR_RESTREINT_ABS._SPIP_ECRIRE_SCRIPT; |
|
| 2189 | 2189 | } else { |
| 2190 | 2190 | if (!is_string($rel)) { |
| 2191 | - $rel = _DIR_RESTREINT ?: './' . _SPIP_ECRIRE_SCRIPT; |
|
| 2191 | + $rel = _DIR_RESTREINT ?: './'._SPIP_ECRIRE_SCRIPT; |
|
| 2192 | 2192 | } |
| 2193 | 2193 | } |
| 2194 | 2194 | |
| 2195 | 2195 | [$script, $ancre] = array_pad(explode('#', $script), 2, null); |
| 2196 | 2196 | if ($script and ($script <> 'accueil' or $rel)) { |
| 2197 | - $args = "?exec=$script" . (!$args ? '' : "&$args"); |
|
| 2197 | + $args = "?exec=$script".(!$args ? '' : "&$args"); |
|
| 2198 | 2198 | } elseif ($args) { |
| 2199 | 2199 | $args = "?$args"; |
| 2200 | 2200 | } |
@@ -2202,7 +2202,7 @@ discard block |
||
| 2202 | 2202 | $args .= "#$ancre"; |
| 2203 | 2203 | } |
| 2204 | 2204 | |
| 2205 | - return $rel . ($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2205 | + return $rel.($no_entities ? $args : str_replace('&', '&', $args)); |
|
| 2206 | 2206 | } |
| 2207 | 2207 | |
| 2208 | 2208 | // |
@@ -2284,10 +2284,10 @@ discard block |
||
| 2284 | 2284 | $action = parametre_url($action, _SPIP_PAGE, $script, '&'); |
| 2285 | 2285 | } |
| 2286 | 2286 | if ($args) { |
| 2287 | - $action .= (strpos($action, '?') !== false ? '&' : '?') . $args; |
|
| 2287 | + $action .= (strpos($action, '?') !== false ? '&' : '?').$args; |
|
| 2288 | 2288 | } |
| 2289 | 2289 | // ne pas generer une url avec /./?page= en cas d'url absolue et de _SPIP_SCRIPT vide |
| 2290 | - $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/') . preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2290 | + $url = ($rel ? _DIR_RACINE . $action : rtrim(url_de_base(), '/').preg_replace(',^/[.]/,', '/', "/$action")); |
|
| 2291 | 2291 | } |
| 2292 | 2292 | |
| 2293 | 2293 | if (!$no_entities) { |
@@ -2299,7 +2299,7 @@ discard block |
||
| 2299 | 2299 | |
| 2300 | 2300 | function generer_url_prive($script, $args = '', $no_entities = false) { |
| 2301 | 2301 | |
| 2302 | - return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS . 'prive.php'); |
|
| 2302 | + return generer_url_public($script, $args, $no_entities, false, _DIR_RESTREINT_ABS.'prive.php'); |
|
| 2303 | 2303 | } |
| 2304 | 2304 | |
| 2305 | 2305 | // Pour les formulaires en methode POST, |
@@ -2334,8 +2334,7 @@ discard block |
||
| 2334 | 2334 | . "><div>\n" |
| 2335 | 2335 | . "<input type='hidden' name='exec' value='$script1' />" |
| 2336 | 2336 | . $corps |
| 2337 | - . (!$submit ? '' : |
|
| 2338 | - ("<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><input class='fondo submit btn' type='submit' value=\"" . entites_html($submit) . '" /></div>')) |
|
| 2337 | + . (!$submit ? '' : ("<div style='text-align: ".$GLOBALS['spip_lang_right']."'><input class='fondo submit btn' type='submit' value=\"".entites_html($submit).'" /></div>')) |
|
| 2339 | 2338 | . "</div></form>\n"; |
| 2340 | 2339 | } |
| 2341 | 2340 | |
@@ -2360,14 +2359,14 @@ discard block |
||
| 2360 | 2359 | ? generer_url_ecrire(_request('exec')) |
| 2361 | 2360 | : generer_url_public(); |
| 2362 | 2361 | |
| 2363 | - return "\n<form action='" . |
|
| 2364 | - $h . |
|
| 2365 | - "'" . |
|
| 2366 | - $atts . |
|
| 2367 | - ">\n" . |
|
| 2368 | - '<div>' . |
|
| 2369 | - "\n<input type='hidden' name='action' value='$script' />" . |
|
| 2370 | - $corps . |
|
| 2362 | + return "\n<form action='". |
|
| 2363 | + $h. |
|
| 2364 | + "'". |
|
| 2365 | + $atts. |
|
| 2366 | + ">\n". |
|
| 2367 | + '<div>'. |
|
| 2368 | + "\n<input type='hidden' name='action' value='$script' />". |
|
| 2369 | + $corps. |
|
| 2371 | 2370 | '</div></form>'; |
| 2372 | 2371 | } |
| 2373 | 2372 | |
@@ -2395,7 +2394,7 @@ discard block |
||
| 2395 | 2394 | : generer_url_public('', '', false, false); |
| 2396 | 2395 | $url = parametre_url($url, 'action', $script); |
| 2397 | 2396 | if ($args) { |
| 2398 | - $url .= quote_amp('&' . $args); |
|
| 2397 | + $url .= quote_amp('&'.$args); |
|
| 2399 | 2398 | } |
| 2400 | 2399 | |
| 2401 | 2400 | if ($no_entities) { |
@@ -2445,17 +2444,17 @@ discard block |
||
| 2445 | 2444 | |
| 2446 | 2445 | // le nom du repertoire plugins/ activables/desactivables |
| 2447 | 2446 | if (!defined('_DIR_PLUGINS')) { |
| 2448 | - define('_DIR_PLUGINS', _DIR_RACINE . 'plugins/'); |
|
| 2447 | + define('_DIR_PLUGINS', _DIR_RACINE.'plugins/'); |
|
| 2449 | 2448 | } |
| 2450 | 2449 | |
| 2451 | 2450 | // le nom du repertoire des extensions/ permanentes du core, toujours actives |
| 2452 | 2451 | if (!defined('_DIR_PLUGINS_DIST')) { |
| 2453 | - define('_DIR_PLUGINS_DIST', _DIR_RACINE . 'plugins-dist/'); |
|
| 2452 | + define('_DIR_PLUGINS_DIST', _DIR_RACINE.'plugins-dist/'); |
|
| 2454 | 2453 | } |
| 2455 | 2454 | |
| 2456 | 2455 | // le nom du repertoire des librairies |
| 2457 | 2456 | if (!defined('_DIR_LIB')) { |
| 2458 | - define('_DIR_LIB', _DIR_RACINE . 'lib/'); |
|
| 2457 | + define('_DIR_LIB', _DIR_RACINE.'lib/'); |
|
| 2459 | 2458 | } |
| 2460 | 2459 | |
| 2461 | 2460 | if (!defined('_DIR_IMG')) { |
@@ -2465,29 +2464,29 @@ discard block |
||
| 2465 | 2464 | define('_DIR_LOGOS', $pa); |
| 2466 | 2465 | } |
| 2467 | 2466 | if (!defined('_DIR_IMG_ICONES')) { |
| 2468 | - define('_DIR_IMG_ICONES', _DIR_LOGOS . 'icones/'); |
|
| 2467 | + define('_DIR_IMG_ICONES', _DIR_LOGOS.'icones/'); |
|
| 2469 | 2468 | } |
| 2470 | 2469 | |
| 2471 | 2470 | if (!defined('_DIR_DUMP')) { |
| 2472 | - define('_DIR_DUMP', $ti . 'dump/'); |
|
| 2471 | + define('_DIR_DUMP', $ti.'dump/'); |
|
| 2473 | 2472 | } |
| 2474 | 2473 | if (!defined('_DIR_SESSIONS')) { |
| 2475 | - define('_DIR_SESSIONS', $ti . 'sessions/'); |
|
| 2474 | + define('_DIR_SESSIONS', $ti.'sessions/'); |
|
| 2476 | 2475 | } |
| 2477 | 2476 | if (!defined('_DIR_TRANSFERT')) { |
| 2478 | - define('_DIR_TRANSFERT', $ti . 'upload/'); |
|
| 2477 | + define('_DIR_TRANSFERT', $ti.'upload/'); |
|
| 2479 | 2478 | } |
| 2480 | 2479 | if (!defined('_DIR_CACHE')) { |
| 2481 | - define('_DIR_CACHE', $ti . 'cache/'); |
|
| 2480 | + define('_DIR_CACHE', $ti.'cache/'); |
|
| 2482 | 2481 | } |
| 2483 | 2482 | if (!defined('_DIR_CACHE_XML')) { |
| 2484 | - define('_DIR_CACHE_XML', _DIR_CACHE . 'xml/'); |
|
| 2483 | + define('_DIR_CACHE_XML', _DIR_CACHE.'xml/'); |
|
| 2485 | 2484 | } |
| 2486 | 2485 | if (!defined('_DIR_SKELS')) { |
| 2487 | - define('_DIR_SKELS', _DIR_CACHE . 'skel/'); |
|
| 2486 | + define('_DIR_SKELS', _DIR_CACHE.'skel/'); |
|
| 2488 | 2487 | } |
| 2489 | 2488 | if (!defined('_DIR_AIDE')) { |
| 2490 | - define('_DIR_AIDE', _DIR_CACHE . 'aide/'); |
|
| 2489 | + define('_DIR_AIDE', _DIR_CACHE.'aide/'); |
|
| 2491 | 2490 | } |
| 2492 | 2491 | if (!defined('_DIR_TMP')) { |
| 2493 | 2492 | define('_DIR_TMP', $ti); |
@@ -2516,27 +2515,27 @@ discard block |
||
| 2516 | 2515 | // Declaration des fichiers |
| 2517 | 2516 | |
| 2518 | 2517 | if (!defined('_CACHE_PLUGINS_PATH')) { |
| 2519 | - define('_CACHE_PLUGINS_PATH', _DIR_CACHE . 'charger_plugins_chemins.php'); |
|
| 2518 | + define('_CACHE_PLUGINS_PATH', _DIR_CACHE.'charger_plugins_chemins.php'); |
|
| 2520 | 2519 | } |
| 2521 | 2520 | if (!defined('_CACHE_PLUGINS_OPT')) { |
| 2522 | - define('_CACHE_PLUGINS_OPT', _DIR_CACHE . 'charger_plugins_options.php'); |
|
| 2521 | + define('_CACHE_PLUGINS_OPT', _DIR_CACHE.'charger_plugins_options.php'); |
|
| 2523 | 2522 | } |
| 2524 | 2523 | if (!defined('_CACHE_PLUGINS_FCT')) { |
| 2525 | - define('_CACHE_PLUGINS_FCT', _DIR_CACHE . 'charger_plugins_fonctions.php'); |
|
| 2524 | + define('_CACHE_PLUGINS_FCT', _DIR_CACHE.'charger_plugins_fonctions.php'); |
|
| 2526 | 2525 | } |
| 2527 | 2526 | if (!defined('_CACHE_PIPELINES')) { |
| 2528 | - define('_CACHE_PIPELINES', _DIR_CACHE . 'charger_pipelines.php'); |
|
| 2527 | + define('_CACHE_PIPELINES', _DIR_CACHE.'charger_pipelines.php'); |
|
| 2529 | 2528 | } |
| 2530 | 2529 | if (!defined('_CACHE_CHEMIN')) { |
| 2531 | - define('_CACHE_CHEMIN', _DIR_CACHE . 'chemin.txt'); |
|
| 2530 | + define('_CACHE_CHEMIN', _DIR_CACHE.'chemin.txt'); |
|
| 2532 | 2531 | } |
| 2533 | 2532 | |
| 2534 | 2533 | # attention .php obligatoire pour ecrire_fichier_securise |
| 2535 | 2534 | if (!defined('_FILE_META')) { |
| 2536 | - define('_FILE_META', $ti . 'meta_cache.php'); |
|
| 2535 | + define('_FILE_META', $ti.'meta_cache.php'); |
|
| 2537 | 2536 | } |
| 2538 | 2537 | if (!defined('_DIR_LOG')) { |
| 2539 | - define('_DIR_LOG', _DIR_TMP . 'log/'); |
|
| 2538 | + define('_DIR_LOG', _DIR_TMP.'log/'); |
|
| 2540 | 2539 | } |
| 2541 | 2540 | if (!defined('_FILE_LOG')) { |
| 2542 | 2541 | define('_FILE_LOG', 'spip'); |
@@ -2553,8 +2552,8 @@ discard block |
||
| 2553 | 2552 | if (!defined('_FILE_CONNECT')) { |
| 2554 | 2553 | define( |
| 2555 | 2554 | '_FILE_CONNECT', |
| 2556 | - (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f |
|
| 2557 | - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f |
|
| 2555 | + (@is_readable($f = _DIR_CONNECT._FILE_CONNECT_INS.'.php') ? $f |
|
| 2556 | + : (@is_readable($f = _DIR_RESTREINT.'inc_connect.php') ? $f |
|
| 2558 | 2557 | : false)) |
| 2559 | 2558 | ); |
| 2560 | 2559 | } |
@@ -2566,7 +2565,7 @@ discard block |
||
| 2566 | 2565 | if (!defined('_FILE_CHMOD')) { |
| 2567 | 2566 | define( |
| 2568 | 2567 | '_FILE_CHMOD', |
| 2569 | - (@is_readable($f = _DIR_CHMOD . _FILE_CHMOD_INS . '.php') ? $f |
|
| 2568 | + (@is_readable($f = _DIR_CHMOD._FILE_CHMOD_INS.'.php') ? $f |
|
| 2570 | 2569 | : false) |
| 2571 | 2570 | ); |
| 2572 | 2571 | } |
@@ -2579,10 +2578,10 @@ discard block |
||
| 2579 | 2578 | define('_FILE_TMP_SUFFIX', '.tmp.php'); |
| 2580 | 2579 | } |
| 2581 | 2580 | if (!defined('_FILE_CONNECT_TMP')) { |
| 2582 | - define('_FILE_CONNECT_TMP', _DIR_CONNECT . _FILE_CONNECT_INS . _FILE_TMP_SUFFIX); |
|
| 2581 | + define('_FILE_CONNECT_TMP', _DIR_CONNECT._FILE_CONNECT_INS._FILE_TMP_SUFFIX); |
|
| 2583 | 2582 | } |
| 2584 | 2583 | if (!defined('_FILE_CHMOD_TMP')) { |
| 2585 | - define('_FILE_CHMOD_TMP', _DIR_CHMOD . _FILE_CHMOD_INS . _FILE_TMP_SUFFIX); |
|
| 2584 | + define('_FILE_CHMOD_TMP', _DIR_CHMOD._FILE_CHMOD_INS._FILE_TMP_SUFFIX); |
|
| 2586 | 2585 | } |
| 2587 | 2586 | |
| 2588 | 2587 | // Definition des droits d'acces en ecriture |
@@ -2600,13 +2599,13 @@ discard block |
||
| 2600 | 2599 | define('_DEFAULT_CHARSET', 'utf-8'); |
| 2601 | 2600 | } |
| 2602 | 2601 | if (!defined('_ROOT_PLUGINS')) { |
| 2603 | - define('_ROOT_PLUGINS', _ROOT_RACINE . 'plugins/'); |
|
| 2602 | + define('_ROOT_PLUGINS', _ROOT_RACINE.'plugins/'); |
|
| 2604 | 2603 | } |
| 2605 | 2604 | if (!defined('_ROOT_PLUGINS_DIST')) { |
| 2606 | - define('_ROOT_PLUGINS_DIST', _ROOT_RACINE . 'plugins-dist/'); |
|
| 2605 | + define('_ROOT_PLUGINS_DIST', _ROOT_RACINE.'plugins-dist/'); |
|
| 2607 | 2606 | } |
| 2608 | 2607 | if (!defined('_ROOT_PLUGINS_SUPPL') && defined('_DIR_PLUGINS_SUPPL') && _DIR_PLUGINS_SUPPL) { |
| 2609 | - define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE . str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2608 | + define('_ROOT_PLUGINS_SUPPL', _ROOT_RACINE.str_replace(_DIR_RACINE, '', _DIR_PLUGINS_SUPPL)); |
|
| 2610 | 2609 | } |
| 2611 | 2610 | |
| 2612 | 2611 | // La taille des Log |
@@ -2643,7 +2642,7 @@ discard block |
||
| 2643 | 2642 | // (non surchargeable en l'etat ; attention si on utilise include_spip() |
| 2644 | 2643 | // pour le rendre surchargeable, on va provoquer un reecriture |
| 2645 | 2644 | // systematique du noyau ou une baisse de perfs => a etudier) |
| 2646 | - include_once _ROOT_RESTREINT . 'inc/flock.php'; |
|
| 2645 | + include_once _ROOT_RESTREINT.'inc/flock.php'; |
|
| 2647 | 2646 | |
| 2648 | 2647 | // charger tout de suite le path et son cache |
| 2649 | 2648 | load_path_cache(); |
@@ -2691,7 +2690,7 @@ discard block |
||
| 2691 | 2690 | !empty($_SERVER['QUERY_STRING']) |
| 2692 | 2691 | and !strpos($_SERVER['REQUEST_URI'], '?') |
| 2693 | 2692 | ) { |
| 2694 | - $GLOBALS['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
| 2693 | + $GLOBALS['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
| 2695 | 2694 | } |
| 2696 | 2695 | } |
| 2697 | 2696 | |
@@ -2727,7 +2726,7 @@ discard block |
||
| 2727 | 2726 | ) { |
| 2728 | 2727 | if (isset($GLOBALS['meta']['adresse_site'])) { |
| 2729 | 2728 | $uri_ref = parse_url($GLOBALS['meta']['adresse_site']); |
| 2730 | - $uri_ref = ($uri_ref['path'] ?? '') . '/'; |
|
| 2729 | + $uri_ref = ($uri_ref['path'] ?? '').'/'; |
|
| 2731 | 2730 | } else { |
| 2732 | 2731 | $uri_ref = ''; |
| 2733 | 2732 | } |
@@ -2821,7 +2820,7 @@ discard block |
||
| 2821 | 2820 | } |
| 2822 | 2821 | if (!defined('_CACHE_RUBRIQUES')) { |
| 2823 | 2822 | /** Fichier cache pour le navigateur de rubrique du bandeau */ |
| 2824 | - define('_CACHE_RUBRIQUES', _DIR_TMP . 'menu-rubriques-cache.txt'); |
|
| 2823 | + define('_CACHE_RUBRIQUES', _DIR_TMP.'menu-rubriques-cache.txt'); |
|
| 2825 | 2824 | } |
| 2826 | 2825 | if (!defined('_CACHE_RUBRIQUES_MAX')) { |
| 2827 | 2826 | /** Nombre maxi de rubriques enfants affichées pour chaque rubrique du navigateur de rubrique du bandeau */ |
@@ -2925,7 +2924,7 @@ discard block |
||
| 2925 | 2924 | $memory *= 1024; |
| 2926 | 2925 | } |
| 2927 | 2926 | if ($memory < _MEMORY_LIMIT_MIN * 1024 * 1024) { |
| 2928 | - @ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN . 'M'); |
|
| 2927 | + @ini_set('memory_limit', $m = _MEMORY_LIMIT_MIN.'M'); |
|
| 2929 | 2928 | if (trim(ini_get('memory_limit')) != $m) { |
| 2930 | 2929 | if (!defined('_INTERDIRE_COMPACTE_HEAD_ECRIRE')) { |
| 2931 | 2930 | define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true); |
@@ -3076,7 +3075,7 @@ discard block |
||
| 3076 | 3075 | } |
| 3077 | 3076 | if (isset($GLOBALS['visiteur_session']['nom'])) { |
| 3078 | 3077 | spip_log($GLOBALS['visiteur_session']['nom'] |
| 3079 | - . ' ' . _VAR_MODE); |
|
| 3078 | + . ' '._VAR_MODE); |
|
| 3080 | 3079 | } |
| 3081 | 3080 | } // pas autorise ? |
| 3082 | 3081 | else { |
@@ -3091,7 +3090,7 @@ discard block |
||
| 3091 | 3090 | if (strpos($self, 'page=login') === false) { |
| 3092 | 3091 | include_spip('inc/headers'); |
| 3093 | 3092 | $redirect = parametre_url(self('&', true), 'var_mode', $_GET['var_mode'], '&'); |
| 3094 | - redirige_par_entete(generer_url_public('login', 'url=' . rawurlencode($redirect), true)); |
|
| 3093 | + redirige_par_entete(generer_url_public('login', 'url='.rawurlencode($redirect), true)); |
|
| 3095 | 3094 | } |
| 3096 | 3095 | } |
| 3097 | 3096 | // sinon tant pis |
@@ -3133,10 +3132,10 @@ discard block |
||
| 3133 | 3132 | // mais on risque de perturber des plugins en initialisant trop tot |
| 3134 | 3133 | // certaines constantes |
| 3135 | 3134 | @spip_initialisation_core( |
| 3136 | - (_DIR_RACINE . _NOM_PERMANENTS_INACCESSIBLES), |
|
| 3137 | - (_DIR_RACINE . _NOM_PERMANENTS_ACCESSIBLES), |
|
| 3138 | - (_DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3139 | - (_DIR_RACINE . _NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3135 | + (_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES), |
|
| 3136 | + (_DIR_RACINE._NOM_PERMANENTS_ACCESSIBLES), |
|
| 3137 | + (_DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES), |
|
| 3138 | + (_DIR_RACINE._NOM_TEMPORAIRES_ACCESSIBLES) |
|
| 3140 | 3139 | ); |
| 3141 | 3140 | |
| 3142 | 3141 | // Demarrer une session NON AUTHENTIFIEE si on donne son nom |
@@ -3169,7 +3168,7 @@ discard block |
||
| 3169 | 3168 | } |
| 3170 | 3169 | |
| 3171 | 3170 | $h = (isset($_SERVER['PHP_AUTH_USER']) and !$GLOBALS['ignore_auth_http']); |
| 3172 | - if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'] . '_session'])) { |
|
| 3171 | + if ($h or isset($_COOKIE['spip_session']) or isset($_COOKIE[$GLOBALS['cookie_prefix'].'_session'])) { |
|
| 3173 | 3172 | $session = charger_fonction('session', 'inc'); |
| 3174 | 3173 | if ($session()) { |
| 3175 | 3174 | return $GLOBALS['visiteur_session']['statut']; |
@@ -3249,7 +3248,7 @@ discard block |
||
| 3249 | 3248 | 'definir_session', |
| 3250 | 3249 | $GLOBALS['visiteur_session'] |
| 3251 | 3250 | ? serialize($GLOBALS['visiteur_session']) |
| 3252 | - . '_' . @$_COOKIE['spip_session'] |
|
| 3251 | + . '_'.@$_COOKIE['spip_session'] |
|
| 3253 | 3252 | : '' |
| 3254 | 3253 | ); |
| 3255 | 3254 | $session = $s ? substr(md5($s), 0, 8) : ''; |
@@ -3405,11 +3404,11 @@ discard block |
||
| 3405 | 3404 | $GLOBALS['_INC_PUBLIC']++; |
| 3406 | 3405 | |
| 3407 | 3406 | // fix #4235 |
| 3408 | - $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3407 | + $cache_utilise_session_appelant = ($GLOBALS['cache_utilise_session'] ?? null); |
|
| 3409 | 3408 | |
| 3410 | 3409 | |
| 3411 | 3410 | foreach (is_array($fond) ? $fond : [$fond] as $f) { |
| 3412 | - unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3411 | + unset($GLOBALS['cache_utilise_session']); // fix #4235 |
|
| 3413 | 3412 | |
| 3414 | 3413 | $page = evaluer_fond($f, $contexte, $connect); |
| 3415 | 3414 | if ($page === '') { |
@@ -3494,7 +3493,7 @@ discard block |
||
| 3494 | 3493 | * @return array|string |
| 3495 | 3494 | */ |
| 3496 | 3495 | function trouver_fond($nom, $dir = '', $pathinfo = false) { |
| 3497 | - $f = find_in_path($nom . '.' . _EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/') . '/' : ''); |
|
| 3496 | + $f = find_in_path($nom.'.'._EXTENSION_SQUELETTES, $dir ? rtrim($dir, '/').'/' : ''); |
|
| 3498 | 3497 | if (!$pathinfo) { |
| 3499 | 3498 | return $f; |
| 3500 | 3499 | } |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | $link = @mysqli_connect($host, $login, $pass); |
| 59 | 59 | } |
| 60 | 60 | } catch (\mysqli_sql_exception $e) { |
| 61 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 61 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 62 | 62 | $link = false; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | if (!$link) { |
| 66 | - spip_log('Echec mysqli_connect. Erreur : ' . mysqli_connect_error(), 'mysql.' . _LOG_HS); |
|
| 66 | + spip_log('Echec mysqli_connect. Erreur : '.mysqli_connect_error(), 'mysql.'._LOG_HS); |
|
| 67 | 67 | |
| 68 | 68 | return false; |
| 69 | 69 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | spip_log( |
| 85 | - "Connexion MySQLi vers $host, base $db, prefixe $prefixe " . ($ok ? 'operationnelle' : 'impossible'), |
|
| 85 | + "Connexion MySQLi vers $host, base $db, prefixe $prefixe ".($ok ? 'operationnelle' : 'impossible'), |
|
| 86 | 86 | _LOG_DEBUG |
| 87 | 87 | ); |
| 88 | 88 | |
@@ -173,9 +173,9 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | function spip_mysql_set_charset($charset, $serveur = '', $requeter = true) { |
| 175 | 175 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 176 | - spip_log('changement de charset sql : ' . 'SET NAMES ' . _q($charset), _LOG_DEBUG); |
|
| 176 | + spip_log('changement de charset sql : '.'SET NAMES '._q($charset), _LOG_DEBUG); |
|
| 177 | 177 | |
| 178 | - return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES ' . _q($charset)); |
|
| 178 | + return mysqli_query($connexion['link'], $connexion['last'] = 'SET NAMES '._q($charset)); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | function spip_mysql_get_charset($charset = [], $serveur = '', $requeter = true) { |
| 191 | 191 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 192 | 192 | $connexion['last'] = $c = 'SHOW CHARACTER SET' |
| 193 | - . (!$charset ? '' : (' LIKE ' . _q($charset['charset']))); |
|
| 193 | + . (!$charset ? '' : (' LIKE '._q($charset['charset']))); |
|
| 194 | 194 | |
| 195 | 195 | return spip_mysql_fetch(mysqli_query($connexion['link'], $c), null, $serveur); |
| 196 | 196 | } |
@@ -234,21 +234,21 @@ discard block |
||
| 234 | 234 | $debug = ''; |
| 235 | 235 | if (defined('_DEBUG_SLOW_QUERIES') and _DEBUG_SLOW_QUERIES) { |
| 236 | 236 | if (isset($GLOBALS['debug']['aucasou'])) { |
| 237 | - [, $id, , $infos] = $GLOBALS['debug']['aucasou']; |
|
| 238 | - $debug .= "BOUCLE$id @ " . ($infos[0] ?? '') . ' | '; |
|
| 237 | + [, $id,, $infos] = $GLOBALS['debug']['aucasou']; |
|
| 238 | + $debug .= "BOUCLE$id @ ".($infos[0] ?? '').' | '; |
|
| 239 | 239 | } |
| 240 | 240 | if (isset($_SERVER['REQUEST_URI'])) { |
| 241 | 241 | $debug .= $_SERVER['REQUEST_URI']; |
| 242 | 242 | } |
| 243 | 243 | if (!empty($GLOBALS['ip'])) { |
| 244 | - $debug .= ' + ' . $GLOBALS['ip']; |
|
| 244 | + $debug .= ' + '.$GLOBALS['ip']; |
|
| 245 | 245 | } |
| 246 | - $debug = ' /* ' . mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)) . ' */'; |
|
| 246 | + $debug = ' /* '.mysqli_real_escape_string($link, str_replace('*/', '@/', $debug)).' */'; |
|
| 247 | 247 | } |
| 248 | 248 | try { |
| 249 | - $r = mysqli_query($link, $query . $debug); |
|
| 249 | + $r = mysqli_query($link, $query.$debug); |
|
| 250 | 250 | } catch (\mysqli_sql_exception $e) { |
| 251 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 251 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 252 | 252 | $r = false; |
| 253 | 253 | // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno() |
| 254 | 254 | // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report(). |
@@ -266,9 +266,9 @@ discard block |
||
| 266 | 266 | $link = $connexion['link']; |
| 267 | 267 | //On retente au cas où |
| 268 | 268 | try { |
| 269 | - $r = mysqli_query($link, $query . $debug); |
|
| 269 | + $r = mysqli_query($link, $query.$debug); |
|
| 270 | 270 | } catch (\mysqli_sql_exception $e) { |
| 271 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 271 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 272 | 272 | $r = false; |
| 273 | 273 | // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno() |
| 274 | 274 | // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report(). |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | // d'utiliser ceux-ci, copie-colle de phpmyadmin |
| 302 | 302 | $query = preg_replace(',^TABLE\s*`([^`]*)`,i', "TABLE \\1", $query); |
| 303 | 303 | |
| 304 | - return spip_mysql_query('ALTER ' . $query, $serveur, $requeter); # i.e. que PG se debrouille |
|
| 304 | + return spip_mysql_query('ALTER '.$query, $serveur, $requeter); # i.e. que PG se debrouille |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | * @return bool Toujours true |
| 315 | 315 | */ |
| 316 | 316 | function spip_mysql_optimize($table, $serveur = '', $requeter = true) { |
| 317 | - spip_mysql_query('OPTIMIZE TABLE ' . $table); |
|
| 317 | + spip_mysql_query('OPTIMIZE TABLE '.$table); |
|
| 318 | 318 | |
| 319 | 319 | return true; |
| 320 | 320 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | $link = $connexion['link']; |
| 338 | 338 | $db = $connexion['db']; |
| 339 | 339 | |
| 340 | - $query = 'EXPLAIN ' . _mysql_traite_query($query, $db, $prefixe); |
|
| 340 | + $query = 'EXPLAIN '._mysql_traite_query($query, $db, $prefixe); |
|
| 341 | 341 | $r = mysqli_query($link, $query); |
| 342 | 342 | |
| 343 | 343 | return spip_mysql_fetch($r, null, $serveur); |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | . calculer_mysql_expression('WHERE', $where) |
| 389 | 389 | . calculer_mysql_expression('GROUP BY', $groupby, ',') |
| 390 | 390 | . calculer_mysql_expression('HAVING', $having) |
| 391 | - . ($orderby ? ("\nORDER BY " . spip_mysql_order($orderby)) : '') |
|
| 391 | + . ($orderby ? ("\nORDER BY ".spip_mysql_order($orderby)) : '') |
|
| 392 | 392 | . ($limit ? "\nLIMIT $limit" : ''); |
| 393 | 393 | |
| 394 | 394 | // renvoyer la requete inerte si demandee |
@@ -478,12 +478,12 @@ discard block |
||
| 478 | 478 | $exp = "\n$expression "; |
| 479 | 479 | |
| 480 | 480 | if (!is_array($v)) { |
| 481 | - return $exp . $v; |
|
| 481 | + return $exp.$v; |
|
| 482 | 482 | } else { |
| 483 | 483 | if (strtoupper($join) === 'AND') { |
| 484 | - return $exp . join("\n\t$join ", array_map('calculer_mysql_where', $v)); |
|
| 484 | + return $exp.join("\n\t$join ", array_map('calculer_mysql_where', $v)); |
|
| 485 | 485 | } else { |
| 486 | - return $exp . join($join, $v); |
|
| 486 | + return $exp.join($join, $v); |
|
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | } |
@@ -501,17 +501,17 @@ discard block |
||
| 501 | 501 | if (substr($k, -1) == '@') { |
| 502 | 502 | // c'est une jointure qui se refere au from precedent |
| 503 | 503 | // pas de virgule |
| 504 | - $res .= ' ' . $v; |
|
| 504 | + $res .= ' '.$v; |
|
| 505 | 505 | } else { |
| 506 | 506 | if (!is_numeric($k)) { |
| 507 | 507 | $p = strpos($v, ' '); |
| 508 | 508 | if ($p) { |
| 509 | - $v = substr($v, 0, $p) . " AS `$k`" . substr($v, $p); |
|
| 509 | + $v = substr($v, 0, $p)." AS `$k`".substr($v, $p); |
|
| 510 | 510 | } else { |
| 511 | 511 | $v .= " AS `$k`"; |
| 512 | 512 | } |
| 513 | 513 | } |
| 514 | - $res .= ', ' . $v; |
|
| 514 | + $res .= ', '.$v; |
|
| 515 | 515 | } |
| 516 | 516 | } |
| 517 | 517 | |
@@ -541,13 +541,13 @@ discard block |
||
| 541 | 541 | function _mysql_traite_query($query, $db = '', $prefixe = '', $echappe_textes = true) { |
| 542 | 542 | |
| 543 | 543 | if ($GLOBALS['mysql_rappel_nom_base'] and $db) { |
| 544 | - $pref = '`' . $db . '`.'; |
|
| 544 | + $pref = '`'.$db.'`.'; |
|
| 545 | 545 | } else { |
| 546 | 546 | $pref = ''; |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | if ($prefixe) { |
| 550 | - $pref .= $prefixe . '_'; |
|
| 550 | + $pref .= $prefixe.'_'; |
|
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | if (!preg_match('/\s(SET|VALUES|WHERE|DATABASE)\s/i', $query, $regs)) { |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | $suite_echap = $suite; |
| 567 | 567 | } |
| 568 | 568 | if (preg_match('/^(.*?)([(]\s*SELECT\b.*)$/si', $suite_echap, $r)) { |
| 569 | - $suite_echap = $r[1] . _mysql_traite_query($r[2], $db, $prefixe, false); |
|
| 569 | + $suite_echap = $r[1]._mysql_traite_query($r[2], $db, $prefixe, false); |
|
| 570 | 570 | if ($echappe_textes) { |
| 571 | 571 | $suite = query_reinjecte_textes($suite_echap, $textes); |
| 572 | 572 | } |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | } |
| 578 | 578 | } |
| 579 | - $r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1' . $pref, $query) . $suite; |
|
| 579 | + $r = preg_replace(_SQL_PREFIXE_TABLE_MYSQL, '\1'.$pref, $query).$suite; |
|
| 580 | 580 | |
| 581 | 581 | // en option, remplacer les emoji (que mysql ne sait pas gérer) en 💩 |
| 582 | 582 | // remplacer les emoji (que mysql ne sait pas gérer) en 💩 |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | $link = _mysql_link($serveur); |
| 613 | 613 | $ok = mysqli_select_db($link, $db); |
| 614 | 614 | if (!$ok) { |
| 615 | - spip_log('Echec mysqli_selectdb. Erreur : ' . mysqli_error($link), 'mysql.' . _LOG_CRITIQUE); |
|
| 615 | + spip_log('Echec mysqli_selectdb. Erreur : '.mysqli_error($link), 'mysql.'._LOG_CRITIQUE); |
|
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | return $ok; |
@@ -702,10 +702,10 @@ discard block |
||
| 702 | 702 | |
| 703 | 703 | $character_set = ''; |
| 704 | 704 | if (@$GLOBALS['meta']['charset_sql_base']) { |
| 705 | - $character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base']; |
|
| 705 | + $character_set .= ' CHARACTER SET '.$GLOBALS['meta']['charset_sql_base']; |
|
| 706 | 706 | } |
| 707 | 707 | if (@$GLOBALS['meta']['charset_collation_sql_base']) { |
| 708 | - $character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base']; |
|
| 708 | + $character_set .= ' COLLATE '.$GLOBALS['meta']['charset_collation_sql_base']; |
|
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | foreach ($champs as $k => $v) { |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | preg_match(',(char|text),i', $defs[1]) |
| 716 | 716 | and !preg_match(',(binary|CHARACTER|COLLATE),i', $v) |
| 717 | 717 | ) { |
| 718 | - $v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1])); |
|
| 718 | + $v = $defs[1].$character_set.' '.substr($v, strlen($defs[1])); |
|
| 719 | 719 | } |
| 720 | 720 | } |
| 721 | 721 | |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | $s = ','; |
| 728 | 728 | } |
| 729 | 729 | $temporary = $temporary ? 'TEMPORARY' : ''; |
| 730 | - $q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query" . ($keys ? ",$keys" : '') . ')' |
|
| 730 | + $q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query".($keys ? ",$keys" : '').')' |
|
| 731 | 731 | . ' ENGINE=MyISAM' |
| 732 | 732 | . ($character_set ? " DEFAULT $character_set" : '') |
| 733 | 733 | . "\n"; |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | return false; |
| 808 | 808 | } |
| 809 | 809 | |
| 810 | - $query = "CREATE VIEW $nom AS " . $query_select; |
|
| 810 | + $query = "CREATE VIEW $nom AS ".$query_select; |
|
| 811 | 811 | |
| 812 | 812 | return spip_mysql_query($query, $serveur, $requeter); |
| 813 | 813 | } |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | * Ressource à utiliser avec sql_fetch() |
| 866 | 866 | **/ |
| 867 | 867 | function spip_mysql_showbase($match, $serveur = '', $requeter = true) { |
| 868 | - return spip_mysql_query('SHOW TABLES LIKE ' . _q($match), $serveur, $requeter); |
|
| 868 | + return spip_mysql_query('SHOW TABLES LIKE '._q($match), $serveur, $requeter); |
|
| 869 | 869 | } |
| 870 | 870 | |
| 871 | 871 | /** |
@@ -898,7 +898,7 @@ discard block |
||
| 898 | 898 | * Ressource à utiliser avec sql_fetch() |
| 899 | 899 | **/ |
| 900 | 900 | function spip_mysql_table_exists(string $table, $serveur = '', $requeter = true) { |
| 901 | - $r = spip_mysql_query('SHOW TABLES LIKE ' . _q($table), $serveur, $requeter); |
|
| 901 | + $r = spip_mysql_query('SHOW TABLES LIKE '._q($table), $serveur, $requeter); |
|
| 902 | 902 | if (!$requeter) { |
| 903 | 903 | return $r; |
| 904 | 904 | } |
@@ -980,22 +980,22 @@ discard block |
||
| 980 | 980 | } |
| 981 | 981 | if ($val['Default'] === '0' || $val['Default']) { |
| 982 | 982 | if (preg_match('/[A-Z_]/', $val['Default'])) { |
| 983 | - $nfields[$val['Field']] .= ' DEFAULT ' . $val['Default']; |
|
| 983 | + $nfields[$val['Field']] .= ' DEFAULT '.$val['Default']; |
|
| 984 | 984 | } else { |
| 985 | - $nfields[$val['Field']] .= " DEFAULT '" . $val['Default'] . "'"; |
|
| 985 | + $nfields[$val['Field']] .= " DEFAULT '".$val['Default']."'"; |
|
| 986 | 986 | } |
| 987 | 987 | } |
| 988 | 988 | if ($val['Extra']) { |
| 989 | - $nfields[$val['Field']] .= ' ' . $val['Extra']; |
|
| 989 | + $nfields[$val['Field']] .= ' '.$val['Extra']; |
|
| 990 | 990 | } |
| 991 | 991 | if ($val['Key'] == 'PRI') { |
| 992 | 992 | $nkeys['PRIMARY KEY'] = $val['Field']; |
| 993 | 993 | } else { |
| 994 | 994 | if ($val['Key'] == 'MUL') { |
| 995 | - $nkeys['KEY ' . $val['Field']] = $val['Field']; |
|
| 995 | + $nkeys['KEY '.$val['Field']] = $val['Field']; |
|
| 996 | 996 | } else { |
| 997 | 997 | if ($val['Key'] == 'UNI') { |
| 998 | - $nkeys['UNIQUE KEY ' . $val['Field']] = $val['Field']; |
|
| 998 | + $nkeys['UNIQUE KEY '.$val['Field']] = $val['Field']; |
|
| 999 | 999 | } |
| 1000 | 1000 | } |
| 1001 | 1001 | } |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | $serveur = '', |
| 1067 | 1067 | $requeter = true |
| 1068 | 1068 | ) { |
| 1069 | - $c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 1069 | + $c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 1070 | 1070 | |
| 1071 | 1071 | $r = spip_mysql_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter); |
| 1072 | 1072 | if (!$requeter) { |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | if ($s) { |
| 1107 | 1107 | $trace = debug_backtrace(); |
| 1108 | 1108 | if ($trace[0]['function'] != 'spip_mysql_error') { |
| 1109 | - spip_log("$s - $query - " . sql_error_backtrace(), 'mysql.' . _LOG_ERREUR); |
|
| 1109 | + spip_log("$s - $query - ".sql_error_backtrace(), 'mysql.'._LOG_ERREUR); |
|
| 1110 | 1110 | } |
| 1111 | 1111 | } |
| 1112 | 1112 | |
@@ -1232,7 +1232,7 @@ discard block |
||
| 1232 | 1232 | try { |
| 1233 | 1233 | $insert = mysqli_query($link, $query); |
| 1234 | 1234 | } catch (\mysqli_sql_exception $e) { |
| 1235 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 1235 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 1236 | 1236 | // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno() |
| 1237 | 1237 | // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report(). |
| 1238 | 1238 | } |
@@ -1287,8 +1287,8 @@ discard block |
||
| 1287 | 1287 | |
| 1288 | 1288 | return spip_mysql_insert( |
| 1289 | 1289 | $table, |
| 1290 | - '(' . join(',', array_keys($couples)) . ')', |
|
| 1291 | - '(' . join(',', $couples) . ')', |
|
| 1290 | + '('.join(',', array_keys($couples)).')', |
|
| 1291 | + '('.join(',', $couples).')', |
|
| 1292 | 1292 | $desc, |
| 1293 | 1293 | $serveur, |
| 1294 | 1294 | $requeter |
@@ -1325,7 +1325,7 @@ discard block |
||
| 1325 | 1325 | } |
| 1326 | 1326 | $fields = $desc['field'] ?? []; |
| 1327 | 1327 | |
| 1328 | - $cles = '(' . join(',', array_keys(reset($tab_couples))) . ')'; |
|
| 1328 | + $cles = '('.join(',', array_keys(reset($tab_couples))).')'; |
|
| 1329 | 1329 | $valeurs = []; |
| 1330 | 1330 | $r = false; |
| 1331 | 1331 | |
@@ -1334,7 +1334,7 @@ discard block |
||
| 1334 | 1334 | foreach ($couples as $champ => $val) { |
| 1335 | 1335 | $couples[$champ] = spip_mysql_cite($val, $fields[$champ]); |
| 1336 | 1336 | } |
| 1337 | - $valeurs[] = '(' . join(',', $couples) . ')'; |
|
| 1337 | + $valeurs[] = '('.join(',', $couples).')'; |
|
| 1338 | 1338 | if (count($valeurs) >= 100) { |
| 1339 | 1339 | $r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter); |
| 1340 | 1340 | $valeurs = []; |
@@ -1371,7 +1371,7 @@ discard block |
||
| 1371 | 1371 | function spip_mysql_update($table, $champs, $where = '', $desc = [], $serveur = '', $requeter = true) { |
| 1372 | 1372 | $set = []; |
| 1373 | 1373 | foreach ($champs as $champ => $val) { |
| 1374 | - $set[] = $champ . "=$val"; |
|
| 1374 | + $set[] = $champ."=$val"; |
|
| 1375 | 1375 | } |
| 1376 | 1376 | if (!empty($set)) { |
| 1377 | 1377 | return spip_mysql_query( |
@@ -1427,7 +1427,7 @@ discard block |
||
| 1427 | 1427 | } |
| 1428 | 1428 | $set = []; |
| 1429 | 1429 | foreach ($champs as $champ => $val) { |
| 1430 | - $set[] = $champ . '=' . spip_mysql_cite($val, @$fields[$champ]); |
|
| 1430 | + $set[] = $champ.'='.spip_mysql_cite($val, @$fields[$champ]); |
|
| 1431 | 1431 | } |
| 1432 | 1432 | |
| 1433 | 1433 | return spip_mysql_query( |
@@ -1496,10 +1496,10 @@ discard block |
||
| 1496 | 1496 | * - False en cas d'erreur. |
| 1497 | 1497 | **/ |
| 1498 | 1498 | function spip_mysql_replace($table, $couples, $desc = [], $serveur = '', $requeter = true) { |
| 1499 | - return spip_mysql_query("REPLACE $table (" . join(',', array_keys($couples)) . ') VALUES (' . join( |
|
| 1499 | + return spip_mysql_query("REPLACE $table (".join(',', array_keys($couples)).') VALUES ('.join( |
|
| 1500 | 1500 | ',', |
| 1501 | 1501 | array_map('_q', $couples) |
| 1502 | - ) . ')', $serveur, $requeter); |
|
| 1502 | + ).')', $serveur, $requeter); |
|
| 1503 | 1503 | } |
| 1504 | 1504 | |
| 1505 | 1505 | |
@@ -1528,10 +1528,10 @@ discard block |
||
| 1528 | 1528 | * - False en cas d'erreur. |
| 1529 | 1529 | **/ |
| 1530 | 1530 | function spip_mysql_replace_multi($table, $tab_couples, $desc = [], $serveur = '', $requeter = true) { |
| 1531 | - $cles = '(' . join(',', array_keys($tab_couples[0])) . ')'; |
|
| 1531 | + $cles = '('.join(',', array_keys($tab_couples[0])).')'; |
|
| 1532 | 1532 | $valeurs = []; |
| 1533 | 1533 | foreach ($tab_couples as $couples) { |
| 1534 | - $valeurs[] = '(' . join(',', array_map('_q', $couples)) . ')'; |
|
| 1534 | + $valeurs[] = '('.join(',', array_map('_q', $couples)).')'; |
|
| 1535 | 1535 | } |
| 1536 | 1536 | $valeurs = implode(', ', $valeurs); |
| 1537 | 1537 | |
@@ -1551,28 +1551,28 @@ discard block |
||
| 1551 | 1551 | */ |
| 1552 | 1552 | function spip_mysql_multi($objet, $lang) { |
| 1553 | 1553 | $lengthlang = strlen("[$lang]"); |
| 1554 | - $posmulti = 'INSTR(' . $objet . ", '<multi>')"; |
|
| 1555 | - $posfinmulti = 'INSTR(' . $objet . ", '</multi>')"; |
|
| 1556 | - $debutchaine = 'LEFT(' . $objet . ", $posmulti-1)"; |
|
| 1557 | - $finchaine = 'RIGHT(' . $objet . ', CHAR_LENGTH(' . $objet . ") -(7+$posfinmulti))"; |
|
| 1558 | - $chainemulti = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7, $posfinmulti -(7+$posmulti)))"; |
|
| 1559 | - $poslang = "INSTR($chainemulti,'[" . $lang . "]')"; |
|
| 1554 | + $posmulti = 'INSTR('.$objet.", '<multi>')"; |
|
| 1555 | + $posfinmulti = 'INSTR('.$objet.", '</multi>')"; |
|
| 1556 | + $debutchaine = 'LEFT('.$objet.", $posmulti-1)"; |
|
| 1557 | + $finchaine = 'RIGHT('.$objet.', CHAR_LENGTH('.$objet.") -(7+$posfinmulti))"; |
|
| 1558 | + $chainemulti = 'TRIM(SUBSTRING('.$objet.", $posmulti+7, $posfinmulti -(7+$posmulti)))"; |
|
| 1559 | + $poslang = "INSTR($chainemulti,'[".$lang."]')"; |
|
| 1560 | 1560 | $poslang = "IF($poslang=0,INSTR($chainemulti,']')+1,$poslang+$lengthlang)"; |
| 1561 | - $chainelang = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))"; |
|
| 1562 | - $posfinlang = 'INSTR(' . $chainelang . ", '[')"; |
|
| 1561 | + $chainelang = 'TRIM(SUBSTRING('.$objet.", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))"; |
|
| 1562 | + $posfinlang = 'INSTR('.$chainelang.", '[')"; |
|
| 1563 | 1563 | $chainelang = "IF($posfinlang>0,LEFT($chainelang,$posfinlang-1),$chainelang)"; |
| 1564 | 1564 | //$chainelang = "LEFT($chainelang,$posfinlang-1)"; |
| 1565 | - $retour = "(TRIM(IF($posmulti = 0 , " . |
|
| 1566 | - ' TRIM(' . $objet . '), ' . |
|
| 1567 | - ' CONCAT( ' . |
|
| 1568 | - " $debutchaine, " . |
|
| 1569 | - ' IF( ' . |
|
| 1570 | - " $poslang = 0, " . |
|
| 1571 | - " $chainemulti, " . |
|
| 1572 | - " $chainelang" . |
|
| 1573 | - ' ), ' . |
|
| 1574 | - " $finchaine" . |
|
| 1575 | - ' ) ' . |
|
| 1565 | + $retour = "(TRIM(IF($posmulti = 0 , ". |
|
| 1566 | + ' TRIM('.$objet.'), '. |
|
| 1567 | + ' CONCAT( '. |
|
| 1568 | + " $debutchaine, ". |
|
| 1569 | + ' IF( '. |
|
| 1570 | + " $poslang = 0, ". |
|
| 1571 | + " $chainemulti, ". |
|
| 1572 | + " $chainelang". |
|
| 1573 | + ' ), '. |
|
| 1574 | + " $finchaine". |
|
| 1575 | + ' ) '. |
|
| 1576 | 1576 | '))) AS multi'; |
| 1577 | 1577 | |
| 1578 | 1578 | return $retour; |
@@ -1589,7 +1589,7 @@ discard block |
||
| 1589 | 1589 | * Valeur hexadécimale pour MySQL |
| 1590 | 1590 | **/ |
| 1591 | 1591 | function spip_mysql_hex($v) { |
| 1592 | - return '0x' . $v; |
|
| 1592 | + return '0x'.$v; |
|
| 1593 | 1593 | } |
| 1594 | 1594 | |
| 1595 | 1595 | /** |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | * Expression SQL |
| 1630 | 1630 | **/ |
| 1631 | 1631 | function spip_mysql_date_proche($champ, $interval, $unite) { |
| 1632 | - $use_now = ( ($champ === 'maj' or strpos($champ, '.maj')) ? true : false ); |
|
| 1632 | + $use_now = (($champ === 'maj' or strpos($champ, '.maj')) ? true : false); |
|
| 1633 | 1633 | return '(' |
| 1634 | 1634 | . $champ |
| 1635 | 1635 | . (($interval <= 0) ? '>' : '<') |
@@ -1684,7 +1684,7 @@ discard block |
||
| 1684 | 1684 | } elseif ($v === null) { |
| 1685 | 1685 | return "''"; |
| 1686 | 1686 | } |
| 1687 | - return "'" . addslashes($v) . "'"; |
|
| 1687 | + return "'".addslashes($v)."'"; |
|
| 1688 | 1688 | } |
| 1689 | 1689 | |
| 1690 | 1690 | if ($v === null) { |
@@ -1708,7 +1708,7 @@ discard block |
||
| 1708 | 1708 | } |
| 1709 | 1709 | } |
| 1710 | 1710 | |
| 1711 | - return ("'" . addslashes($v) . "'"); |
|
| 1711 | + return ("'".addslashes($v)."'"); |
|
| 1712 | 1712 | } |
| 1713 | 1713 | |
| 1714 | 1714 | /** |
@@ -1742,7 +1742,7 @@ discard block |
||
| 1742 | 1742 | } else { |
| 1743 | 1743 | $GLOBALS['mysql_rappel_nom_base'] = false; |
| 1744 | 1744 | |
| 1745 | - return "\$GLOBALS['mysql_rappel_nom_base'] = false; " . |
|
| 1745 | + return "\$GLOBALS['mysql_rappel_nom_base'] = false; ". |
|
| 1746 | 1746 | "/* echec de test_rappel_nom_base_mysql a l'installation. */\n"; |
| 1747 | 1747 | } |
| 1748 | 1748 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $res['message_ok'] = _T('info_modification_enregistree'); |
| 101 | 101 | if ($retour) { |
| 102 | 102 | if (strncmp($retour, 'javascript:', 11) == 0) { |
| 103 | - $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>'; |
|
| 103 | + $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>'; |
|
| 104 | 104 | $res['editable'] = true; |
| 105 | 105 | } else { |
| 106 | 106 | $res['redirect'] = parametre_url($retour, $id_table_objet, $id); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | if (!isset($erreurs[$champ])) { |
| 141 | 141 | $erreurs[$champ] = ''; |
| 142 | 142 | } |
| 143 | - $erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>'; |
|
| 143 | + $erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | if ( |
| 219 | 219 | $config_fonc |
| 220 | 220 | and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
| 221 | - and $config_fonc !== $table_objet . '_edit_config' |
|
| 221 | + and $config_fonc !== $table_objet.'_edit_config' |
|
| 222 | 222 | ) { |
| 223 | 223 | if ( |
| 224 | 224 | $args = test_formulaire_inclus_par_modele() |
@@ -233,12 +233,12 @@ discard block |
||
| 233 | 233 | // Appel direct dans un squelette |
| 234 | 234 | if (!$row) { |
| 235 | 235 | if (!$new or $lier_trad) { |
| 236 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 236 | + if ($select = charger_fonction('precharger_'.$type, 'inc', true)) { |
|
| 237 | 237 | $row = $select($id, $id_parent, $lier_trad); |
| 238 | 238 | // si on a une fonction precharger, elle pu faire un reglage de langue |
| 239 | 239 | $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
| 240 | 240 | } else { |
| 241 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 241 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id)); |
|
| 242 | 242 | } |
| 243 | 243 | if (!$new) { |
| 244 | 244 | $md5 = controles_md5($row ?? []); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | if ($config_fonc) { |
| 289 | 289 | $contexte['config'] = $config = $config_fonc($contexte); |
| 290 | 290 | if (!$lang_default) { |
| 291 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 291 | + $lang_default = $config['langue'] ?? session_get('lang'); |
|
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | $config = $config + [ |
@@ -312,13 +312,12 @@ discard block |
||
| 312 | 312 | unset($contexte['lang']); |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 316 | - (!$lier_trad ? '' : |
|
| 317 | - ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 318 | - $lier_trad . |
|
| 319 | - "' />" . |
|
| 320 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 321 | - $lang_default . |
|
| 315 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n". |
|
| 316 | + (!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='". |
|
| 317 | + $lier_trad. |
|
| 318 | + "' />". |
|
| 319 | + "\n<input type='hidden' name='changer_lang' value='". |
|
| 320 | + $lang_default. |
|
| 322 | 321 | "' />")) |
| 323 | 322 | . $hidden |
| 324 | 323 | . ($md5 ?? ''); |
@@ -358,14 +357,14 @@ discard block |
||
| 358 | 357 | $aider = charger_fonction('aider', 'inc'); |
| 359 | 358 | if (strlen($texte) > 28 * 1024) { |
| 360 | 359 | $texte = str_replace("\r\n", "\n", $texte); |
| 361 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 360 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 362 | 361 | if ($pos > 0 and $pos < 32 * 1024) { |
| 363 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 362 | + $debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n"; |
|
| 364 | 363 | $suite = substr($texte, $pos + 2); |
| 365 | 364 | } else { |
| 366 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 365 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 367 | 366 | if (!($pos > 0 and $pos < 32 * 1024)) { |
| 368 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 367 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 369 | 368 | $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
| 370 | 369 | } else { |
| 371 | 370 | $decalage = 1; |
@@ -396,13 +395,13 @@ discard block |
||
| 396 | 395 | } |
| 397 | 396 | |
| 398 | 397 | include_spip('inc/barre'); |
| 399 | - $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 398 | + $textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n"; |
|
| 400 | 399 | $nombre = 0; |
| 401 | 400 | |
| 402 | 401 | while (strlen($texte) > 29 * 1024) { |
| 403 | 402 | $nombre++; |
| 404 | 403 | [$texte1, $texte] = coupe_trop_long($texte); |
| 405 | - $textes_supplement .= '<br />' . |
|
| 404 | + $textes_supplement .= '<br />'. |
|
| 406 | 405 | "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
| 407 | 406 | } |
| 408 | 407 | |
@@ -485,7 +484,7 @@ discard block |
||
| 485 | 484 | $ctr = []; |
| 486 | 485 | foreach ($data as $key => $val) { |
| 487 | 486 | $m = md5($val ?? ''); |
| 488 | - $k = $prefixe . $key; |
|
| 487 | + $k = $prefixe.$key; |
|
| 489 | 488 | |
| 490 | 489 | switch ($format) { |
| 491 | 490 | case 'html': |
@@ -498,7 +497,7 @@ discard block |
||
| 498 | 497 | } |
| 499 | 498 | |
| 500 | 499 | if ($format === 'html') { |
| 501 | - return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 500 | + return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n"; |
|
| 502 | 501 | } else { |
| 503 | 502 | return $ctr; |
| 504 | 503 | } |
@@ -650,7 +649,7 @@ discard block |
||
| 650 | 649 | // On elimine les donnees non modifiees par le formulaire (mais |
| 651 | 650 | // potentiellement modifiees entre temps par un autre utilisateur) |
| 652 | 651 | foreach ($champs as $key => $val) { |
| 653 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 652 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 654 | 653 | if (is_scalar($val) and $m == md5($val)) { |
| 655 | 654 | unset($champs[$key]); |
| 656 | 655 | } |
@@ -679,7 +678,7 @@ discard block |
||
| 679 | 678 | // de conflit. |
| 680 | 679 | $ctrh = $ctrq = $conflits = []; |
| 681 | 680 | foreach (array_keys($champs) as $key) { |
| 682 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 681 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 683 | 682 | $ctrh[$key] = $m; |
| 684 | 683 | $ctrq[] = $key; |
| 685 | 684 | } |
@@ -713,9 +712,9 @@ discard block |
||
| 713 | 712 | */ |
| 714 | 713 | function display_conflit_champ($x) { |
| 715 | 714 | if (strstr($x, "\n") or strlen($x) > 80) { |
| 716 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 715 | + return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n"; |
|
| 717 | 716 | } else { |
| 718 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 717 | + return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n"; |
|
| 719 | 718 | } |
| 720 | 719 | } |
| 721 | 720 | |
@@ -755,11 +754,11 @@ discard block |
||
| 755 | 754 | ) : $champ; |
| 756 | 755 | |
| 757 | 756 | $diffs[] = "<h2>$titre</h2>\n" |
| 758 | - . '<h3>' . _T('info_conflit_edition_differences') . "</h3>\n" |
|
| 759 | - . "<div style='max-height:8em; overflow: auto; width:99%;'>" . $d . "</div>\n" |
|
| 760 | - . '<h4>' . _T('info_conflit_edition_votre_version') . '</h4>' |
|
| 757 | + . '<h3>'._T('info_conflit_edition_differences')."</h3>\n" |
|
| 758 | + . "<div style='max-height:8em; overflow: auto; width:99%;'>".$d."</div>\n" |
|
| 759 | + . '<h4>'._T('info_conflit_edition_votre_version').'</h4>' |
|
| 761 | 760 | . display_conflit_champ($a['post']) |
| 762 | - . '<h4>' . _T('info_conflit_edition_version_enregistree') . '</h4>' |
|
| 761 | + . '<h4>'._T('info_conflit_edition_version_enregistree').'</h4>' |
|
| 763 | 762 | . display_conflit_champ($base); |
| 764 | 763 | } |
| 765 | 764 | |
@@ -767,16 +766,16 @@ discard block |
||
| 767 | 766 | $id = uniqid(random_int(0, mt_getrandmax())); |
| 768 | 767 | $redirect = "<form action='$redirect' method='get' |
| 769 | 768 | id='$id' |
| 770 | - style='float:" . $GLOBALS['spip_lang_right'] . "; margin-top:2em;'>\n" |
|
| 769 | + style='float:".$GLOBALS['spip_lang_right']."; margin-top:2em;'>\n" |
|
| 771 | 770 | . form_hidden($redirect) |
| 772 | - . "<input type='submit' value='" . _T('icone_retour') . "' /> |
|
| 771 | + . "<input type='submit' value='"._T('icone_retour')."' /> |
|
| 773 | 772 | </form>\n"; |
| 774 | 773 | |
| 775 | 774 | // pour les documents, on est probablement en ajax : il faut ajaxer |
| 776 | 775 | if (_AJAX) { |
| 777 | 776 | $redirect .= '<script type="text/javascript">' |
| 778 | - . 'setTimeout(function(){$("#' . $id . '") |
|
| 779 | - .ajaxForm({target:$("#' . $id . '").parent()}); |
|
| 777 | + . 'setTimeout(function(){$("#'.$id.'") |
|
| 778 | + .ajaxForm({target:$("#' . $id.'").parent()}); |
|
| 780 | 779 | }, 200);' |
| 781 | 780 | . "</script>\n"; |
| 782 | 781 | } |
@@ -795,9 +794,9 @@ discard block |
||
| 795 | 794 | .diff-para-deplace .diff-supprime { background: #ffb8b8; border: 1px solid #808080; } |
| 796 | 795 | .diff-para-deplace .diff-deplace { background: #b8b8ff; border: 1px solid #808080; } |
| 797 | 796 | </style>' |
| 798 | - . '<p>' . _T('info_conflit_edition_avis_non_sauvegarde') . '</p>' |
|
| 799 | - . '<p>' . _T('texte_conflit_edition_correction') . '</p>' |
|
| 800 | - . "<div style='text-align:" . $GLOBALS['spip_lang_left'] . ";'>" |
|
| 797 | + . '<p>'._T('info_conflit_edition_avis_non_sauvegarde').'</p>' |
|
| 798 | + . '<p>'._T('texte_conflit_edition_correction').'</p>' |
|
| 799 | + . "<div style='text-align:".$GLOBALS['spip_lang_left'].";'>" |
|
| 801 | 800 | . join("\n", $diffs) |
| 802 | 801 | . "</div>\n" |
| 803 | 802 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | ) { |
| 204 | 204 | $r = nettoyer_url_page($url, $contexte); |
| 205 | 205 | if ($r) { |
| 206 | - [$contexte, $type, , , $suite] = $r; |
|
| 206 | + [$contexte, $type,,, $suite] = $r; |
|
| 207 | 207 | $_id = id_table_objet($type); |
| 208 | 208 | $id_objet = $contexte[$_id]; |
| 209 | 209 | $url_propre = generer_objet_url($id_objet, $type); |
@@ -274,9 +274,9 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | function nettoyer_url_page($url, $contexte = []) { |
| 276 | 276 | $url_objets = urls_liste_objets(); |
| 277 | - $raccourci_url_page_html = ',^(?:[^?]*/)?(' . $url_objets . ')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 278 | - $raccourci_url_page_id = ',^(?:[^?]*/)?(' . $url_objets . ')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 279 | - $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?](' . $url_objets . ')([0-9]+)=?(&.*)?$,'; |
|
| 277 | + $raccourci_url_page_html = ',^(?:[^?]*/)?('.$url_objets.')([0-9]+)(?:\.html)?([?&].*)?$,'; |
|
| 278 | + $raccourci_url_page_id = ',^(?:[^?]*/)?('.$url_objets.')\.php3?[?]id_\1=([0-9]+)([?&].*)?$,'; |
|
| 279 | + $raccourci_url_page_spip = ',^(?:[^?]*/)?(?:spip[.]php)?[?]('.$url_objets.')([0-9]+)=?(&.*)?$,'; |
|
| 280 | 280 | |
| 281 | 281 | if ( |
| 282 | 282 | preg_match($raccourci_url_page_html, $url, $regs) |
@@ -314,11 +314,11 @@ discard block |
||
| 314 | 314 | $id = intval($id); |
| 315 | 315 | if (!isset($furls[$objet])) { |
| 316 | 316 | if ( |
| 317 | - function_exists($f = 'generer_' . $objet . '_url_ecrire') |
|
| 317 | + function_exists($f = 'generer_'.$objet.'_url_ecrire') |
|
| 318 | 318 | // ou definie par un plugin |
| 319 | 319 | or $f = charger_fonction($f, 'urls', true) |
| 320 | 320 | // deprecated |
| 321 | - or function_exists($f = 'generer_url_ecrire_' . $objet) or $f = charger_fonction($f, 'urls', true) |
|
| 321 | + or function_exists($f = 'generer_url_ecrire_'.$objet) or $f = charger_fonction($f, 'urls', true) |
|
| 322 | 322 | ) { |
| 323 | 323 | $furls[$objet] = $f; |
| 324 | 324 | } else { |
@@ -336,12 +336,12 @@ discard block |
||
| 336 | 336 | if ($public or $connect) { |
| 337 | 337 | return generer_objet_url_absolue($id, $objet, $args, $ancre, $public, '', $connect); |
| 338 | 338 | } |
| 339 | - $a = id_table_objet($objet) . '=' . intval($id); |
|
| 339 | + $a = id_table_objet($objet).'='.intval($id); |
|
| 340 | 340 | if (!function_exists('objet_info')) { |
| 341 | 341 | include_spip('inc/filtres'); |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | - return generer_url_ecrire(objet_info($objet, 'url_voir'), $a . ($args ? "&$args" : '')) . ($ancre ? "#$ancre" : ''); |
|
| 344 | + return generer_url_ecrire(objet_info($objet, 'url_voir'), $a.($args ? "&$args" : '')).($ancre ? "#$ancre" : ''); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | asort($liste_plugins); |
| 65 | 65 | $exposed = urldecode(_request('plugin') ?? ''); |
| 66 | 66 | |
| 67 | - $block_par_lettre = false;//count($liste_plugins)>10; |
|
| 67 | + $block_par_lettre = false; //count($liste_plugins)>10; |
|
| 68 | 68 | $fast_liste_plugins_actifs = []; |
| 69 | 69 | $fast_liste_plugins_checked = []; |
| 70 | 70 | if (is_array($liste_plugins_actifs)) { |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | $actif = isset($fast_liste_plugins_actifs[$plug]); |
| 90 | 90 | $checked = isset($fast_liste_plugins_checked[$plug]); |
| 91 | 91 | $block_actif = $block_actif | $actif; |
| 92 | - $expose = ($exposed and ($exposed == $plug or $exposed == $dir_plugins . $plug or $exposed == substr( |
|
| 92 | + $expose = ($exposed and ($exposed == $plug or $exposed == $dir_plugins.$plug or $exposed == substr( |
|
| 93 | 93 | $dir_plugins, |
| 94 | 94 | strlen(_DIR_RACINE) |
| 95 | - ) . $plug)); |
|
| 96 | - $block .= $ligne_plug($url_page, $plug, $checked, $actif, $expose, 'item', $dir_plugins) . "\n"; |
|
| 95 | + ).$plug)); |
|
| 96 | + $block .= $ligne_plug($url_page, $plug, $checked, $actif, $expose, 'item', $dir_plugins)."\n"; |
|
| 97 | 97 | } |
| 98 | 98 | $res .= $block_par_lettre ? affiche_block_initiale($initiale, $block, $block_actif) : $block; |
| 99 | 99 | $class = basename($dir_plugins); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | include_fichiers_fonctions(); |
| 99 | - foreach (['filtre_' . $fonc, 'filtre_' . $fonc . '_dist', $fonc] as $f) { |
|
| 99 | + foreach (['filtre_'.$fonc, 'filtre_'.$fonc.'_dist', $fonc] as $f) { |
|
| 100 | 100 | trouver_filtre_matrice($f); // charge des fichiers spécifiques éventuels |
| 101 | 101 | // fonction ou name\space\fonction |
| 102 | 102 | if (is_callable($f)) { |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | // affichage "GIT [master: abcdef]" |
| 224 | 224 | $commit = $desc['commit_short'] ?? $desc['commit']; |
| 225 | 225 | if ($desc['branch']) { |
| 226 | - $commit = $desc['branch'] . ': ' . $commit; |
|
| 226 | + $commit = $desc['branch'].': '.$commit; |
|
| 227 | 227 | } |
| 228 | 228 | return "{$desc['vcs']} [$commit]"; |
| 229 | 229 | } |
@@ -242,9 +242,9 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // version installee par GIT |
| 245 | - if (lire_fichier($dir . '/.git/HEAD', $c)) { |
|
| 245 | + if (lire_fichier($dir.'/.git/HEAD', $c)) { |
|
| 246 | 246 | $currentHead = trim(substr($c, 4)); |
| 247 | - if (lire_fichier($dir . '/.git/' . $currentHead, $hash)) { |
|
| 247 | + if (lire_fichier($dir.'/.git/'.$currentHead, $hash)) { |
|
| 248 | 248 | return [ |
| 249 | 249 | 'vcs' => 'GIT', |
| 250 | 250 | 'branch' => basename($currentHead), |
@@ -271,8 +271,8 @@ discard block |
||
| 271 | 271 | $dir = '.'; |
| 272 | 272 | } |
| 273 | 273 | // version installee par SVN |
| 274 | - if (file_exists($dir . '/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 275 | - $db = new SQLite3($dir . '/.svn/wc.db'); |
|
| 274 | + if (file_exists($dir.'/.svn/wc.db') && class_exists(\SQLite3::class)) { |
|
| 275 | + $db = new SQLite3($dir.'/.svn/wc.db'); |
|
| 276 | 276 | $result = $db->query('SELECT changed_revision FROM nodes WHERE local_relpath = "" LIMIT 1'); |
| 277 | 277 | if ($result) { |
| 278 | 278 | $row = $result->fetchArray(); |
@@ -290,12 +290,12 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | // La matrice est necessaire pour ne filtrer _que_ des fonctions definies dans filtres_images |
| 292 | 292 | // et laisser passer les fonctions personnelles baptisees image_... |
| 293 | -$GLOBALS['spip_matrice']['image_graver'] = true;//'inc/filtres_images_mini.php'; |
|
| 294 | -$GLOBALS['spip_matrice']['image_select'] = true;//'inc/filtres_images_mini.php'; |
|
| 295 | -$GLOBALS['spip_matrice']['image_reduire'] = true;//'inc/filtres_images_mini.php'; |
|
| 296 | -$GLOBALS['spip_matrice']['image_reduire_par'] = true;//'inc/filtres_images_mini.php'; |
|
| 297 | -$GLOBALS['spip_matrice']['image_passe_partout'] = true;//'inc/filtres_images_mini.php'; |
|
| 298 | -$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true;//'inc/filtres_images_mini.php'; |
|
| 293 | +$GLOBALS['spip_matrice']['image_graver'] = true; //'inc/filtres_images_mini.php'; |
|
| 294 | +$GLOBALS['spip_matrice']['image_select'] = true; //'inc/filtres_images_mini.php'; |
|
| 295 | +$GLOBALS['spip_matrice']['image_reduire'] = true; //'inc/filtres_images_mini.php'; |
|
| 296 | +$GLOBALS['spip_matrice']['image_reduire_par'] = true; //'inc/filtres_images_mini.php'; |
|
| 297 | +$GLOBALS['spip_matrice']['image_passe_partout'] = true; //'inc/filtres_images_mini.php'; |
|
| 298 | +$GLOBALS['spip_matrice']['image_recadre_avec_fallback'] = true; //'inc/filtres_images_mini.php'; |
|
| 299 | 299 | |
| 300 | 300 | $GLOBALS['spip_matrice']['couleur_html_to_hex'] = 'inc/filtres_images_mini.php'; |
| 301 | 301 | $GLOBALS['spip_matrice']['couleur_hex_to_hsl'] = 'inc/filtres_images_mini.php'; |
@@ -454,8 +454,8 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | function filtre_debug($val, $key = null) { |
| 456 | 456 | $debug = ( |
| 457 | - is_null($key) ? '' : (var_export($key, true) . ' = ') |
|
| 458 | - ) . var_export($val, true); |
|
| 457 | + is_null($key) ? '' : (var_export($key, true).' = ') |
|
| 458 | + ).var_export($val, true); |
|
| 459 | 459 | |
| 460 | 460 | include_spip('inc/autoriser'); |
| 461 | 461 | if (autoriser('webmestre')) { |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | $is_file = false; |
| 510 | 510 | } |
| 511 | 511 | if ($is_file) { |
| 512 | - $is_local_file = function ($path) { |
|
| 512 | + $is_local_file = function($path) { |
|
| 513 | 513 | if (strpos($path, '?') !== false) { |
| 514 | 514 | $path = supprimer_timestamp($path); |
| 515 | 515 | // remove ?24px added by find_in_theme on .svg files |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | if (preg_match(",this[.]src=['\"]([^'\"]+)['\"],ims", $mouseover, $match)) { |
| 562 | 562 | $srcover = $match[1]; |
| 563 | 563 | array_shift($args); |
| 564 | - array_unshift($args, "<img src='" . $match[1] . "' />"); |
|
| 564 | + array_unshift($args, "<img src='".$match[1]."' />"); |
|
| 565 | 565 | $srcover_filter = call_user_func_array($filtre, $args); |
| 566 | 566 | $srcover_filter = extraire_attribut($srcover_filter, 'src'); |
| 567 | 567 | $reduit = str_replace($srcover, $srcover_filter, $reduit); |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | if (!$srcHeight) { |
| 638 | 638 | $hauteur_img[$src] = $srcHeight = $imagesize[1]; |
| 639 | 639 | } |
| 640 | - if (!$srcSize){ |
|
| 640 | + if (!$srcSize) { |
|
| 641 | 641 | $poids_img[$src] = filesize($src); |
| 642 | 642 | } |
| 643 | 643 | } |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | if (!$srcHeight) { |
| 652 | 652 | $hauteur_img[$src] = $srcHeight = $height; |
| 653 | 653 | } |
| 654 | - if (!$srcSize){ |
|
| 654 | + if (!$srcSize) { |
|
| 655 | 655 | $poids_img[$src] = $srcSize = strlen($src); |
| 656 | 656 | } |
| 657 | 657 | } |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | if (!$srcHeight) { |
| 670 | 670 | $hauteur_img[$src] = $srcHeight = $valeurs['hauteur_dest']; |
| 671 | 671 | } |
| 672 | - if (!$srcSize){ |
|
| 672 | + if (!$srcSize) { |
|
| 673 | 673 | $poids_img[$src] = $srcSize = 0; |
| 674 | 674 | } |
| 675 | 675 | } |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | return $infos['poids']; |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | -function taille_image($img, $force_refresh = false){ |
|
| 698 | +function taille_image($img, $force_refresh = false) { |
|
| 699 | 699 | $infos = infos_image($img, $force_refresh); |
| 700 | 700 | return [$infos['hauteur'], $infos['largeur']]; |
| 701 | 701 | } |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | // " -> " et tout ce genre de choses |
| 965 | 965 | $u = $GLOBALS['meta']['pcre_u']; |
| 966 | 966 | $texte = str_replace(' ', ' ', $texte); |
| 967 | - $texte = preg_replace('/\s{2,}/S' . $u, ' ', $texte); |
|
| 967 | + $texte = preg_replace('/\s{2,}/S'.$u, ' ', $texte); |
|
| 968 | 968 | // ne pas echapper les sinqle quotes car certains outils de syndication gerent mal |
| 969 | 969 | $texte = entites_html($texte, false, false); |
| 970 | 970 | // mais bien echapper les double quotes ! |
@@ -1024,7 +1024,7 @@ discard block |
||
| 1024 | 1024 | **/ |
| 1025 | 1025 | function supprimer_numero($texte) { |
| 1026 | 1026 | return preg_replace( |
| 1027 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1027 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1028 | 1028 | '', |
| 1029 | 1029 | $texte |
| 1030 | 1030 | ); |
@@ -1052,7 +1052,7 @@ discard block |
||
| 1052 | 1052 | function recuperer_numero($texte) { |
| 1053 | 1053 | if ( |
| 1054 | 1054 | preg_match( |
| 1055 | - ',^[[:space:]]*([0-9]+)([.)]|' . chr(194) . '?' . chr(176) . ')[[:space:]]+,S', |
|
| 1055 | + ',^[[:space:]]*([0-9]+)([.)]|'.chr(194).'?'.chr(176).')[[:space:]]+,S', |
|
| 1056 | 1056 | $texte, |
| 1057 | 1057 | $regs |
| 1058 | 1058 | ) |
@@ -1143,8 +1143,8 @@ discard block |
||
| 1143 | 1143 | **/ |
| 1144 | 1144 | function textebrut($texte) { |
| 1145 | 1145 | $u = $GLOBALS['meta']['pcre_u']; |
| 1146 | - $texte = preg_replace('/\s+/S' . $u, ' ', $texte); |
|
| 1147 | - $texte = preg_replace('/<(p|br)( [^>]*)?' . '>/iS', "\n\n", $texte); |
|
| 1146 | + $texte = preg_replace('/\s+/S'.$u, ' ', $texte); |
|
| 1147 | + $texte = preg_replace('/<(p|br)( [^>]*)?'.'>/iS', "\n\n", $texte); |
|
| 1148 | 1148 | $texte = preg_replace("/^\n+/", '', $texte); |
| 1149 | 1149 | $texte = preg_replace("/\n+$/", '', $texte); |
| 1150 | 1150 | $texte = preg_replace("/\n +/", "\n", $texte); |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | ) |
| 1179 | 1179 | ) { |
| 1180 | 1180 | foreach ($liens[0] as $a) { |
| 1181 | - $rel = 'noopener noreferrer ' . extraire_attribut($a, 'rel'); |
|
| 1181 | + $rel = 'noopener noreferrer '.extraire_attribut($a, 'rel'); |
|
| 1182 | 1182 | $ablank = inserer_attribut($a, 'rel', $rel); |
| 1183 | 1183 | $ablank = inserer_attribut($ablank, 'target', '_blank'); |
| 1184 | 1184 | $texte = str_replace($a, $ablank, $texte); |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | foreach ($regs[0] as $a) { |
| 1204 | 1204 | $rel = extraire_attribut($a, 'rel'); |
| 1205 | 1205 | if (strpos($rel, 'nofollow') === false) { |
| 1206 | - $rel = 'nofollow' . ($rel ? " $rel" : ''); |
|
| 1206 | + $rel = 'nofollow'.($rel ? " $rel" : ''); |
|
| 1207 | 1207 | $anofollow = inserer_attribut($a, 'rel', $rel); |
| 1208 | 1208 | $texte = str_replace($a, $anofollow, $texte); |
| 1209 | 1209 | } |
@@ -1232,7 +1232,7 @@ discard block |
||
| 1232 | 1232 | $u = $GLOBALS['meta']['pcre_u']; |
| 1233 | 1233 | $texte = preg_replace('@</p>@iS', "\n", $texte); |
| 1234 | 1234 | $texte = preg_replace("@<p\b.*>@UiS", '<br />', $texte); |
| 1235 | - $texte = preg_replace('@^\s*<br />@S' . $u, '', $texte); |
|
| 1235 | + $texte = preg_replace('@^\s*<br />@S'.$u, '', $texte); |
|
| 1236 | 1236 | |
| 1237 | 1237 | return $texte; |
| 1238 | 1238 | } |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | return $texte; |
| 1264 | 1264 | } |
| 1265 | 1265 | include_spip('inc/texte'); |
| 1266 | - $tag = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $texte) ? |
|
| 1266 | + $tag = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $texte) ? |
|
| 1267 | 1267 | 'div' : 'span'; |
| 1268 | 1268 | |
| 1269 | 1269 | return "<$tag style='word-wrap:break-word;'>$texte</$tag>"; |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | } |
| 1376 | 1376 | $u = $GLOBALS['meta']['pcre_u']; |
| 1377 | 1377 | if ($textebrut) { |
| 1378 | - $texte = preg_replace([",\n,", ',\s(?=\s),msS' . $u], [' ', ''], textebrut($texte)); |
|
| 1378 | + $texte = preg_replace([",\n,", ',\s(?=\s),msS'.$u], [' ', ''], textebrut($texte)); |
|
| 1379 | 1379 | } |
| 1380 | 1380 | $texte = texte_backend($texte); |
| 1381 | 1381 | $texte = str_replace(["'", '"'], [''', '"'], $texte); |
@@ -1410,7 +1410,7 @@ discard block |
||
| 1410 | 1410 | # un message pour abs_url |
| 1411 | 1411 | $GLOBALS['mode_abs_url'] = 'url'; |
| 1412 | 1412 | $url = trim($url); |
| 1413 | - $r = ',^(?:' . _PROTOCOLES_STD . '):?/?/?$,iS'; |
|
| 1413 | + $r = ',^(?:'._PROTOCOLES_STD.'):?/?/?$,iS'; |
|
| 1414 | 1414 | |
| 1415 | 1415 | return preg_match($r, $url) ? '' : ($entites ? entites_html($url) : $url); |
| 1416 | 1416 | } |
@@ -1614,14 +1614,14 @@ discard block |
||
| 1614 | 1614 | if (strpos($texte, '<') !== false) { |
| 1615 | 1615 | include_spip('inc/lien'); |
| 1616 | 1616 | if (defined('_PREG_MODELE')) { |
| 1617 | - $preg_modeles = '@' . _PREG_MODELE . '@imsS'; |
|
| 1617 | + $preg_modeles = '@'._PREG_MODELE.'@imsS'; |
|
| 1618 | 1618 | $texte = echappe_html($texte, '', true, $preg_modeles); |
| 1619 | 1619 | } |
| 1620 | 1620 | } |
| 1621 | 1621 | |
| 1622 | 1622 | $debut = ''; |
| 1623 | 1623 | $suite = $texte; |
| 1624 | - while ($t = strpos('-' . $suite, "\n", 1)) { |
|
| 1624 | + while ($t = strpos('-'.$suite, "\n", 1)) { |
|
| 1625 | 1625 | $debut .= substr($suite, 0, $t - 1); |
| 1626 | 1626 | $suite = substr($suite, $t); |
| 1627 | 1627 | $car = substr($suite, 0, 1); |
@@ -1639,11 +1639,11 @@ discard block |
||
| 1639 | 1639 | $suite = substr($suite, strlen($regs[0])); |
| 1640 | 1640 | } |
| 1641 | 1641 | } |
| 1642 | - $texte = $debut . $suite; |
|
| 1642 | + $texte = $debut.$suite; |
|
| 1643 | 1643 | |
| 1644 | 1644 | $texte = echappe_retour($texte); |
| 1645 | 1645 | |
| 1646 | - return $texte . $fin; |
|
| 1646 | + return $texte.$fin; |
|
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | 1649 | |
@@ -1705,7 +1705,7 @@ discard block |
||
| 1705 | 1705 | } |
| 1706 | 1706 | |
| 1707 | 1707 | foreach ($regs as $reg) { |
| 1708 | - $cle = ($reg[1] ? $reg[1] . ':' : '') . $reg[2]; |
|
| 1708 | + $cle = ($reg[1] ? $reg[1].':' : '').$reg[2]; |
|
| 1709 | 1709 | $desc = $traduire($cle, $lang, true); |
| 1710 | 1710 | $l = $desc->langue; |
| 1711 | 1711 | // si pas de traduction, on laissera l'écriture de l'idiome entier dans le texte. |
@@ -1819,9 +1819,9 @@ discard block |
||
| 1819 | 1819 | // il ne faut pas echapper en div si propre produit un seul paragraphe |
| 1820 | 1820 | include_spip('inc/texte'); |
| 1821 | 1821 | $trad_propre = preg_replace(',(^<p[^>]*>|</p>$),Uims', '', propre($trad)); |
| 1822 | - $mode = preg_match(',</?(' . _BALISES_BLOCS . ')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1822 | + $mode = preg_match(',</?('._BALISES_BLOCS.')[>[:space:]],iS', $trad_propre) ? 'div' : 'span'; |
|
| 1823 | 1823 | if ($mode === 'div') { |
| 1824 | - $trad = rtrim($trad) . "\n\n"; |
|
| 1824 | + $trad = rtrim($trad)."\n\n"; |
|
| 1825 | 1825 | } |
| 1826 | 1826 | $trad = code_echappement($trad, 'multi', false, $mode); |
| 1827 | 1827 | $trad = str_replace("'", '"', inserer_attribut($trad, 'lang', $l)); |
@@ -2017,7 +2017,7 @@ discard block |
||
| 2017 | 2017 | if (is_array($balise)) { |
| 2018 | 2018 | array_walk( |
| 2019 | 2019 | $balise, |
| 2020 | - function (&$a, $key, $t) { |
|
| 2020 | + function(&$a, $key, $t) { |
|
| 2021 | 2021 | $a = extraire_attribut($a, $t); |
| 2022 | 2022 | }, |
| 2023 | 2023 | $attribut |
@@ -2114,14 +2114,14 @@ discard block |
||
| 2114 | 2114 | |
| 2115 | 2115 | if ($old !== null) { |
| 2116 | 2116 | // Remplacer l'ancien attribut du meme nom |
| 2117 | - $balise = $r[1] . $insert . $r[5]; |
|
| 2117 | + $balise = $r[1].$insert.$r[5]; |
|
| 2118 | 2118 | } else { |
| 2119 | 2119 | // preferer une balise " />" (comme <img />) |
| 2120 | 2120 | if (preg_match(',/>,', $balise)) { |
| 2121 | - $balise = preg_replace(',\s?/>,S', $insert . ' />', $balise, 1); |
|
| 2121 | + $balise = preg_replace(',\s?/>,S', $insert.' />', $balise, 1); |
|
| 2122 | 2122 | } // sinon une balise <a ...> ... </a> |
| 2123 | 2123 | else { |
| 2124 | - $balise = preg_replace(',\s?>,S', $insert . '>', $balise, 1); |
|
| 2124 | + $balise = preg_replace(',\s?>,S', $insert.'>', $balise, 1); |
|
| 2125 | 2125 | } |
| 2126 | 2126 | } |
| 2127 | 2127 | |
@@ -2176,7 +2176,7 @@ discard block |
||
| 2176 | 2176 | if ( |
| 2177 | 2177 | $class_courante |
| 2178 | 2178 | and strpos($class_courante, (string) $c) !== false |
| 2179 | - and preg_match('/(^|\s)' . preg_quote($c) . '($|\s)/', $class_courante) |
|
| 2179 | + and preg_match('/(^|\s)'.preg_quote($c).'($|\s)/', $class_courante) |
|
| 2180 | 2180 | ) { |
| 2181 | 2181 | $is_class_presente = true; |
| 2182 | 2182 | } |
@@ -2184,12 +2184,12 @@ discard block |
||
| 2184 | 2184 | in_array($operation, ['ajouter', 'commuter']) |
| 2185 | 2185 | and !$is_class_presente |
| 2186 | 2186 | ) { |
| 2187 | - $class_new = ltrim(rtrim($class_new ?? '') . ' ' . $c); |
|
| 2187 | + $class_new = ltrim(rtrim($class_new ?? '').' '.$c); |
|
| 2188 | 2188 | } elseif ( |
| 2189 | 2189 | in_array($operation, ['supprimer', 'commuter']) |
| 2190 | 2190 | and $is_class_presente |
| 2191 | 2191 | ) { |
| 2192 | - $class_new = trim(preg_replace('/(^|\s)' . preg_quote($c) . '($|\s)/', "\\1", $class_new)); |
|
| 2192 | + $class_new = trim(preg_replace('/(^|\s)'.preg_quote($c).'($|\s)/', "\\1", $class_new)); |
|
| 2193 | 2193 | } |
| 2194 | 2194 | } |
| 2195 | 2195 | |
@@ -2252,7 +2252,7 @@ discard block |
||
| 2252 | 2252 | // Quelques fonctions de calcul arithmetique |
| 2253 | 2253 | // |
| 2254 | 2254 | function floatstr($a) { |
| 2255 | - return str_replace(',', '.', (string)floatval($a)); |
|
| 2255 | + return str_replace(',', '.', (string) floatval($a)); |
|
| 2256 | 2256 | } |
| 2257 | 2257 | function strize($f, $a, $b) { |
| 2258 | 2258 | return floatstr($f(floatstr($a), floatstr($b))); |
@@ -2388,13 +2388,13 @@ discard block |
||
| 2388 | 2388 | if (!defined('_TAGS_NOM_AUTEUR')) { |
| 2389 | 2389 | define('_TAGS_NOM_AUTEUR', ''); |
| 2390 | 2390 | } |
| 2391 | - $tags_acceptes = array_unique(explode(',', 'multi,' . _TAGS_NOM_AUTEUR)); |
|
| 2391 | + $tags_acceptes = array_unique(explode(',', 'multi,'._TAGS_NOM_AUTEUR)); |
|
| 2392 | 2392 | foreach ($tags_acceptes as $tag) { |
| 2393 | 2393 | if (strlen($tag)) { |
| 2394 | - $remp1[] = '<' . trim($tag) . '>'; |
|
| 2395 | - $remp1[] = '</' . trim($tag) . '>'; |
|
| 2396 | - $remp2[] = '\x60' . trim($tag) . '\x61'; |
|
| 2397 | - $remp2[] = '\x60/' . trim($tag) . '\x61'; |
|
| 2394 | + $remp1[] = '<'.trim($tag).'>'; |
|
| 2395 | + $remp1[] = '</'.trim($tag).'>'; |
|
| 2396 | + $remp2[] = '\x60'.trim($tag).'\x61'; |
|
| 2397 | + $remp2[] = '\x60/'.trim($tag).'\x61'; |
|
| 2398 | 2398 | } |
| 2399 | 2399 | } |
| 2400 | 2400 | $v_nom = str_replace($remp2, $remp1, supprimer_tags(str_replace($remp1, $remp2, $nom))); |
@@ -2448,7 +2448,7 @@ discard block |
||
| 2448 | 2448 | . http_img_pack( |
| 2449 | 2449 | 'attachment-16.png', |
| 2450 | 2450 | $t, |
| 2451 | - 'title="' . attribut_html($t) . '"' |
|
| 2451 | + 'title="'.attribut_html($t).'"' |
|
| 2452 | 2452 | ) |
| 2453 | 2453 | . '</a>', |
| 2454 | 2454 | $tag |
@@ -2512,10 +2512,10 @@ discard block |
||
| 2512 | 2512 | $fichier = basename($url); |
| 2513 | 2513 | |
| 2514 | 2514 | return '<a rel="enclosure"' |
| 2515 | - . ($url ? ' href="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2516 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2517 | - . ($length ? ' title="' . spip_htmlspecialchars($length) . '"' : '') |
|
| 2518 | - . '>' . $fichier . '</a>'; |
|
| 2515 | + . ($url ? ' href="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2516 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2517 | + . ($length ? ' title="'.spip_htmlspecialchars($length).'"' : '') |
|
| 2518 | + . '>'.$fichier.'</a>'; |
|
| 2519 | 2519 | } |
| 2520 | 2520 | |
| 2521 | 2521 | /** |
@@ -2543,9 +2543,9 @@ discard block |
||
| 2543 | 2543 | } # vieux data |
| 2544 | 2544 | $fichier = basename($url); |
| 2545 | 2545 | $enclosures[] = '<enclosure' |
| 2546 | - . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') |
|
| 2547 | - . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') |
|
| 2548 | - . ($length ? ' length="' . $length . '"' : '') |
|
| 2546 | + . ($url ? ' url="'.spip_htmlspecialchars($url).'"' : '') |
|
| 2547 | + . ($type ? ' type="'.spip_htmlspecialchars($type).'"' : '') |
|
| 2548 | + . ($length ? ' length="'.$length.'"' : '') |
|
| 2549 | 2549 | . ' />'; |
| 2550 | 2550 | } |
| 2551 | 2551 | } |
@@ -2571,7 +2571,7 @@ discard block |
||
| 2571 | 2571 | if (extraire_attribut($e, 'rel') == 'tag') { |
| 2572 | 2572 | $subjects .= '<dc:subject>' |
| 2573 | 2573 | . texte_backend(textebrut($e)) |
| 2574 | - . '</dc:subject>' . "\n"; |
|
| 2574 | + . '</dc:subject>'."\n"; |
|
| 2575 | 2575 | } |
| 2576 | 2576 | } |
| 2577 | 2577 | |
@@ -2607,7 +2607,7 @@ discard block |
||
| 2607 | 2607 | if (is_array($texte)) { |
| 2608 | 2608 | array_walk( |
| 2609 | 2609 | $texte, |
| 2610 | - function (&$a, $key, $t) { |
|
| 2610 | + function(&$a, $key, $t) { |
|
| 2611 | 2611 | $a = extraire_balise($a, $t); |
| 2612 | 2612 | }, |
| 2613 | 2613 | $tag |
@@ -2655,7 +2655,7 @@ discard block |
||
| 2655 | 2655 | if (is_array($texte)) { |
| 2656 | 2656 | array_walk( |
| 2657 | 2657 | $texte, |
| 2658 | - function (&$a, $key, $t) { |
|
| 2658 | + function(&$a, $key, $t) { |
|
| 2659 | 2659 | $a = extraire_balises($a, $t); |
| 2660 | 2660 | }, |
| 2661 | 2661 | $tag |
@@ -2788,7 +2788,7 @@ discard block |
||
| 2788 | 2788 | if ($fond != '404') { |
| 2789 | 2789 | $contexte = array_shift($p); |
| 2790 | 2790 | $contexte['page'] = $fond; |
| 2791 | - $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2791 | + $action = preg_replace('/([?]'.preg_quote($fond).'[^&=]*[0-9]+)(&|$)/', '?&', $action); |
|
| 2792 | 2792 | } |
| 2793 | 2793 | } |
| 2794 | 2794 | // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url |
@@ -2843,9 +2843,9 @@ discard block |
||
| 2843 | 2843 | . '"' |
| 2844 | 2844 | . (is_null($val) |
| 2845 | 2845 | ? '' |
| 2846 | - : ' value="' . entites_html($val) . '"' |
|
| 2846 | + : ' value="'.entites_html($val).'"' |
|
| 2847 | 2847 | ) |
| 2848 | - . ' type="hidden"' . "\n/>"; |
|
| 2848 | + . ' type="hidden"'."\n/>"; |
|
| 2849 | 2849 | } |
| 2850 | 2850 | |
| 2851 | 2851 | return join('', $hidden); |
@@ -2955,7 +2955,7 @@ discard block |
||
| 2955 | 2955 | |
| 2956 | 2956 | return preg_replace_callback( |
| 2957 | 2957 | ",url\s*\(\s*['\"]?([^'\"/#\s][^:]*)['\"]?\s*\),Uims", |
| 2958 | - fn($x) => "url('" . suivre_lien($path, $x[1]) . "')", |
|
| 2958 | + fn($x) => "url('".suivre_lien($path, $x[1])."')", |
|
| 2959 | 2959 | $contenu |
| 2960 | 2960 | ); |
| 2961 | 2961 | } |
@@ -3016,14 +3016,14 @@ discard block |
||
| 3016 | 3016 | ) { |
| 3017 | 3017 | $distant = true; |
| 3018 | 3018 | $cssf = parse_url($css); |
| 3019 | - $cssf = $cssf['path'] . ($cssf['query'] ? '?' . $cssf['query'] : ''); |
|
| 3019 | + $cssf = $cssf['path'].($cssf['query'] ? '?'.$cssf['query'] : ''); |
|
| 3020 | 3020 | $cssf = preg_replace(',[?:&=],', '_', $cssf); |
| 3021 | 3021 | } else { |
| 3022 | 3022 | $distant = false; |
| 3023 | 3023 | $cssf = $css; |
| 3024 | 3024 | // 1. regarder d'abord si un fichier avec la bonne direction n'est pas aussi |
| 3025 | 3025 | //propose (rien a faire dans ce cas) |
| 3026 | - $f = preg_replace(',(_rtl)?\.css$,i', '_' . $ndir . '.css', $css); |
|
| 3026 | + $f = preg_replace(',(_rtl)?\.css$,i', '_'.$ndir.'.css', $css); |
|
| 3027 | 3027 | if (@file_exists($f)) { |
| 3028 | 3028 | return $f; |
| 3029 | 3029 | } |
@@ -3033,7 +3033,7 @@ discard block |
||
| 3033 | 3033 | $dir_var = sous_repertoire(_DIR_VAR, 'cache-css'); |
| 3034 | 3034 | $f = $dir_var |
| 3035 | 3035 | . preg_replace(',.*/(.*?)(_rtl)?\.css,', '\1', $cssf) |
| 3036 | - . '.' . substr(md5($cssf), 0, 4) . '_' . $ndir . '.css'; |
|
| 3036 | + . '.'.substr(md5($cssf), 0, 4).'_'.$ndir.'.css'; |
|
| 3037 | 3037 | |
| 3038 | 3038 | // la css peut etre distante (url absolue !) |
| 3039 | 3039 | if ($distant) { |
@@ -3079,8 +3079,8 @@ discard block |
||
| 3079 | 3079 | } // si la css_direction commence par $dir_var on la fait passer pour une absolue |
| 3080 | 3080 | elseif (substr($css_direction, 0, strlen($dir_var)) == $dir_var) { |
| 3081 | 3081 | $css_direction = substr($css_direction, strlen($dir_var)); |
| 3082 | - $src_faux_abs['/@@@@@@/' . $css_direction] = $css_direction; |
|
| 3083 | - $css_direction = '/@@@@@@/' . $css_direction; |
|
| 3082 | + $src_faux_abs['/@@@@@@/'.$css_direction] = $css_direction; |
|
| 3083 | + $css_direction = '/@@@@@@/'.$css_direction; |
|
| 3084 | 3084 | } |
| 3085 | 3085 | $src[] = $regs[0][$k]; |
| 3086 | 3086 | $src_direction_css[] = str_replace($import_css, $css_direction, $regs[0][$k]); |
@@ -3129,7 +3129,7 @@ discard block |
||
| 3129 | 3129 | |
| 3130 | 3130 | $f = basename($css, '.css'); |
| 3131 | 3131 | $f = sous_repertoire(_DIR_VAR, 'cache-css') |
| 3132 | - . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-" . substr(md5("$css-urlabs"), 0, 4) . "\\2", $f) |
|
| 3132 | + . preg_replace(',(.*?)(_rtl|_ltr)?$,', "\\1-urlabs-".substr(md5("$css-urlabs"), 0, 4)."\\2", $f) |
|
| 3133 | 3133 | . '.css'; |
| 3134 | 3134 | |
| 3135 | 3135 | if ((@filemtime($f) > @filemtime($css)) and (_VAR_MODE != 'recalcul')) { |
@@ -3139,7 +3139,7 @@ discard block |
||
| 3139 | 3139 | if ($url_absolue_css == $css) { |
| 3140 | 3140 | if ( |
| 3141 | 3141 | strncmp($GLOBALS['meta']['adresse_site'], $css, $l = strlen($GLOBALS['meta']['adresse_site'])) != 0 |
| 3142 | - or !lire_fichier(_DIR_RACINE . substr($css, $l), $contenu) |
|
| 3142 | + or !lire_fichier(_DIR_RACINE.substr($css, $l), $contenu) |
|
| 3143 | 3143 | ) { |
| 3144 | 3144 | include_spip('inc/distant'); |
| 3145 | 3145 | $contenu = recuperer_url($css); |
@@ -3251,7 +3251,7 @@ discard block |
||
| 3251 | 3251 | $expression = str_replace('\/', '/', $expression); |
| 3252 | 3252 | $expression = str_replace('/', '\/', $expression); |
| 3253 | 3253 | |
| 3254 | - if (preg_match('/' . $expression . '/' . $modif, $texte ?? '', $r)) { |
|
| 3254 | + if (preg_match('/'.$expression.'/'.$modif, $texte ?? '', $r)) { |
|
| 3255 | 3255 | if (isset($r[$capte])) { |
| 3256 | 3256 | return $r[$capte]; |
| 3257 | 3257 | } else { |
@@ -3289,7 +3289,7 @@ discard block |
||
| 3289 | 3289 | $expression = str_replace('\/', '/', $expression); |
| 3290 | 3290 | $expression = str_replace('/', '\/', $expression); |
| 3291 | 3291 | |
| 3292 | - return preg_replace('/' . $expression . '/' . $modif, $replace, $texte); |
|
| 3292 | + return preg_replace('/'.$expression.'/'.$modif, $replace, $texte); |
|
| 3293 | 3293 | } |
| 3294 | 3294 | |
| 3295 | 3295 | |
@@ -3308,7 +3308,7 @@ discard block |
||
| 3308 | 3308 | function traiter_doublons_documents(&$doublons, $letexte) { |
| 3309 | 3309 | |
| 3310 | 3310 | // Verifier dans le texte & les notes (pas beau, helas) |
| 3311 | - $t = $letexte . $GLOBALS['les_notes']; |
|
| 3311 | + $t = $letexte.$GLOBALS['les_notes']; |
|
| 3312 | 3312 | |
| 3313 | 3313 | if ( |
| 3314 | 3314 | strstr($t, 'spip_document_') // evite le preg_match_all si inutile |
@@ -3322,7 +3322,7 @@ discard block |
||
| 3322 | 3322 | if (!isset($doublons['documents'])) { |
| 3323 | 3323 | $doublons['documents'] = ''; |
| 3324 | 3324 | } |
| 3325 | - $doublons['documents'] .= ',' . join(',', $matches[1]); |
|
| 3325 | + $doublons['documents'] .= ','.join(',', $matches[1]); |
|
| 3326 | 3326 | } |
| 3327 | 3327 | |
| 3328 | 3328 | return $letexte; |
@@ -3379,7 +3379,7 @@ discard block |
||
| 3379 | 3379 | if ($env) { |
| 3380 | 3380 | foreach ($env as $i => $j) { |
| 3381 | 3381 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3382 | - $texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />"; |
|
| 3382 | + $texte .= "<param name='".attribut_html($i)."'\n\tvalue='".attribut_html($j)."' />"; |
|
| 3383 | 3383 | } |
| 3384 | 3384 | } |
| 3385 | 3385 | } |
@@ -3418,7 +3418,7 @@ discard block |
||
| 3418 | 3418 | if ($env) { |
| 3419 | 3419 | foreach ($env as $i => $j) { |
| 3420 | 3420 | if (is_string($j) and !in_array($i, $ignore_params)) { |
| 3421 | - $texte .= attribut_html($i) . "='" . attribut_html($j) . "' "; |
|
| 3421 | + $texte .= attribut_html($i)."='".attribut_html($j)."' "; |
|
| 3422 | 3422 | } |
| 3423 | 3423 | } |
| 3424 | 3424 | } |
@@ -3492,10 +3492,10 @@ discard block |
||
| 3492 | 3492 | // si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png |
| 3493 | 3493 | if ( |
| 3494 | 3494 | preg_match(',-(\d+)[.](png|gif|svg)$,', $img_file, $m) |
| 3495 | - and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])) . '-xx.svg' |
|
| 3495 | + and $variante_svg_generique = substr($img_file, 0, -strlen($m[0])).'-xx.svg' |
|
| 3496 | 3496 | and file_exists($variante_svg_generique) |
| 3497 | 3497 | ) { |
| 3498 | - if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
|
| 3498 | + if ($variante_svg_size = substr($variante_svg_generique, 0, -6).$m[1].'.svg' and file_exists($variante_svg_size)) { |
|
| 3499 | 3499 | $img_file = $variante_svg_size; |
| 3500 | 3500 | } |
| 3501 | 3501 | else { |
@@ -3553,7 +3553,7 @@ discard block |
||
| 3553 | 3553 | return ''; |
| 3554 | 3554 | } |
| 3555 | 3555 | } |
| 3556 | - $atts .= " width='" . $largeur . "' height='" . $hauteur . "'"; |
|
| 3556 | + $atts .= " width='".$largeur."' height='".$hauteur."'"; |
|
| 3557 | 3557 | } |
| 3558 | 3558 | |
| 3559 | 3559 | if (file_exists($img_file)) { |
@@ -3563,14 +3563,14 @@ discard block |
||
| 3563 | 3563 | $alt = ''; |
| 3564 | 3564 | } |
| 3565 | 3565 | elseif ($alt or $alt === '') { |
| 3566 | - $alt = " alt='" . attribut_html($alt) . "'"; |
|
| 3566 | + $alt = " alt='".attribut_html($alt)."'"; |
|
| 3567 | 3567 | } |
| 3568 | 3568 | else { |
| 3569 | - $alt = " alt='" . attribut_html($title) . "'"; |
|
| 3569 | + $alt = " alt='".attribut_html($title)."'"; |
|
| 3570 | 3570 | } |
| 3571 | 3571 | return "<img src='$img_file'$alt" |
| 3572 | - . ($title ? ' title="' . attribut_html($title) . '"' : '') |
|
| 3573 | - . ' ' . ltrim($atts) |
|
| 3572 | + . ($title ? ' title="'.attribut_html($title).'"' : '') |
|
| 3573 | + . ' '.ltrim($atts) |
|
| 3574 | 3574 | . ' />'; |
| 3575 | 3575 | } |
| 3576 | 3576 | |
@@ -3584,10 +3584,10 @@ discard block |
||
| 3584 | 3584 | */ |
| 3585 | 3585 | function http_style_background($img, $att = '', $size = null) { |
| 3586 | 3586 | if ($size and is_numeric($size)) { |
| 3587 | - $size = trim($size) . 'px'; |
|
| 3587 | + $size = trim($size).'px'; |
|
| 3588 | 3588 | } |
| 3589 | - return " style='background" . |
|
| 3590 | - ($att ? '' : '-image') . ': url("' . chemin_image($img) . '")' . ($att ? (' ' . $att) : '') . ';' |
|
| 3589 | + return " style='background". |
|
| 3590 | + ($att ? '' : '-image').': url("'.chemin_image($img).'")'.($att ? (' '.$att) : '').';' |
|
| 3591 | 3591 | . ($size ? "background-size:{$size};" : '') |
| 3592 | 3592 | . "'"; |
| 3593 | 3593 | } |
@@ -3702,7 +3702,7 @@ discard block |
||
| 3702 | 3702 | $img = http_img_pack( |
| 3703 | 3703 | $img, |
| 3704 | 3704 | $alt, |
| 3705 | - $class ? " class='" . attribut_html($class) . "'" : '', |
|
| 3705 | + $class ? " class='".attribut_html($class)."'" : '', |
|
| 3706 | 3706 | '', |
| 3707 | 3707 | ['chemin_image' => false, 'utiliser_suffixe_size' => false] |
| 3708 | 3708 | ); |
@@ -3787,7 +3787,7 @@ discard block |
||
| 3787 | 3787 | $balise_svg_source = $balise_svg; |
| 3788 | 3788 | |
| 3789 | 3789 | // entete XML à supprimer |
| 3790 | - $svg = preg_replace(',^\s*<\?xml[^>]*\?' . '>,', '', $svg); |
|
| 3790 | + $svg = preg_replace(',^\s*<\?xml[^>]*\?'.'>,', '', $svg); |
|
| 3791 | 3791 | |
| 3792 | 3792 | // IE est toujours mon ami |
| 3793 | 3793 | $balise_svg = inserer_attribut($balise_svg, 'focusable', 'false'); |
@@ -3805,9 +3805,9 @@ discard block |
||
| 3805 | 3805 | // regler le alt |
| 3806 | 3806 | if ($alt) { |
| 3807 | 3807 | $balise_svg = inserer_attribut($balise_svg, 'role', 'img'); |
| 3808 | - $id = 'img-svg-title-' . substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3808 | + $id = 'img-svg-title-'.substr(md5("$img_file:$svg:$alt"), 0, 4); |
|
| 3809 | 3809 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3810 | - $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
|
| 3810 | + $title = "<title id=\"$id\">".entites_html($alt)."</title>\n"; |
|
| 3811 | 3811 | $balise_svg .= $title; |
| 3812 | 3812 | } |
| 3813 | 3813 | else { |
@@ -3855,7 +3855,7 @@ discard block |
||
| 3855 | 3855 | if (is_array($tableau)) { |
| 3856 | 3856 | foreach ($tableau as $k => $v) { |
| 3857 | 3857 | $res = recuperer_fond( |
| 3858 | - 'modeles/' . $modele, |
|
| 3858 | + 'modeles/'.$modele, |
|
| 3859 | 3859 | array_merge(['cle' => $k], (is_array($v) ? $v : ['valeur' => $v])) |
| 3860 | 3860 | ); |
| 3861 | 3861 | $texte .= $res; |
@@ -4040,7 +4040,7 @@ discard block |
||
| 4040 | 4040 | } |
| 4041 | 4041 | |
| 4042 | 4042 | $c = serialize($c); |
| 4043 | - $cle = calculer_cle_action($form . $c); |
|
| 4043 | + $cle = calculer_cle_action($form.$c); |
|
| 4044 | 4044 | $c = "$cle:$c"; |
| 4045 | 4045 | |
| 4046 | 4046 | // on ne stocke pas les contextes dans des fichiers en cache |
@@ -4098,15 +4098,15 @@ discard block |
||
| 4098 | 4098 | } |
| 4099 | 4099 | // toujours encoder l'url source dans le bloc ajax |
| 4100 | 4100 | $r = self(); |
| 4101 | - $r = ' data-origin="' . $r . '"'; |
|
| 4101 | + $r = ' data-origin="'.$r.'"'; |
|
| 4102 | 4102 | $class = 'ajaxbloc'; |
| 4103 | 4103 | if ($ajaxid and is_string($ajaxid)) { |
| 4104 | 4104 | // ajaxid est normalement conforme a un nom de classe css |
| 4105 | 4105 | // on ne verifie pas la conformite, mais on passe entites_html par dessus par precaution |
| 4106 | - $class .= ' ajax-id-' . entites_html($ajaxid); |
|
| 4106 | + $class .= ' ajax-id-'.entites_html($ajaxid); |
|
| 4107 | 4107 | } |
| 4108 | 4108 | |
| 4109 | - return "<div class='$class' " . "data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4109 | + return "<div class='$class' "."data-ajax-env='$env'$r>\n$emboite</div><!--ajaxbloc-->\n"; |
|
| 4110 | 4110 | } |
| 4111 | 4111 | |
| 4112 | 4112 | /** |
@@ -4150,7 +4150,7 @@ discard block |
||
| 4150 | 4150 | $cle = substr($c, 0, $p); |
| 4151 | 4151 | $c = substr($c, $p + 1); |
| 4152 | 4152 | |
| 4153 | - if ($cle == calculer_cle_action($form . $c)) { |
|
| 4153 | + if ($cle == calculer_cle_action($form.$c)) { |
|
| 4154 | 4154 | $env = @unserialize($c); |
| 4155 | 4155 | return $env; |
| 4156 | 4156 | } |
@@ -4271,13 +4271,13 @@ discard block |
||
| 4271 | 4271 | } |
| 4272 | 4272 | } |
| 4273 | 4273 | } |
| 4274 | - $att .= 'class="' . ($class ? attribut_html($class) . ' ' : '') . (defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on') . '"'; |
|
| 4274 | + $att .= 'class="'.($class ? attribut_html($class).' ' : '').(defined('_LIEN_OU_EXPOSE_CLASS_ON') ? _LIEN_OU_EXPOSE_CLASS_ON : 'on').'"'; |
|
| 4275 | 4275 | } else { |
| 4276 | 4276 | $bal = 'a'; |
| 4277 | 4277 | $att = "href='$url'" |
| 4278 | - . ($title ? " title='" . attribut_html($title) . "'" : '') |
|
| 4279 | - . ($class ? " class='" . attribut_html($class) . "'" : '') |
|
| 4280 | - . ($rel ? " rel='" . attribut_html($rel) . "'" : '') |
|
| 4278 | + . ($title ? " title='".attribut_html($title)."'" : '') |
|
| 4279 | + . ($class ? " class='".attribut_html($class)."'" : '') |
|
| 4280 | + . ($rel ? " rel='".attribut_html($rel)."'" : '') |
|
| 4281 | 4281 | . $evt; |
| 4282 | 4282 | } |
| 4283 | 4283 | if ($libelle === null) { |
@@ -4416,7 +4416,7 @@ discard block |
||
| 4416 | 4416 | |
| 4417 | 4417 | // Icône |
| 4418 | 4418 | $icone = http_img_pack($fond, $alt, "width='$size' height='$size'"); |
| 4419 | - $icone = '<span class="icone-image' . ($fonction ? " icone-fonction icone-fonction-$fonction" : '') . "\">$icone</span>"; |
|
| 4419 | + $icone = '<span class="icone-image'.($fonction ? " icone-fonction icone-fonction-$fonction" : '')."\">$icone</span>"; |
|
| 4420 | 4420 | |
| 4421 | 4421 | // Markup final |
| 4422 | 4422 | if ($type == 'lien') { |
@@ -4693,20 +4693,20 @@ discard block |
||
| 4693 | 4693 | $class_form = 'ajax'; |
| 4694 | 4694 | $class = str_replace('ajax', '', $class); |
| 4695 | 4695 | } |
| 4696 | - $class_btn = 'submit ' . trim($class); |
|
| 4696 | + $class_btn = 'submit '.trim($class); |
|
| 4697 | 4697 | |
| 4698 | 4698 | if ($confirm) { |
| 4699 | - $confirm = 'confirm("' . attribut_html($confirm) . '")'; |
|
| 4699 | + $confirm = 'confirm("'.attribut_html($confirm).'")'; |
|
| 4700 | 4700 | if ($callback) { |
| 4701 | 4701 | $callback = "$confirm?($callback):false"; |
| 4702 | 4702 | } else { |
| 4703 | 4703 | $callback = $confirm; |
| 4704 | 4704 | } |
| 4705 | 4705 | } |
| 4706 | - $onclick = $callback ? " onclick='return " . addcslashes($callback, "'") . "'" : ''; |
|
| 4706 | + $onclick = $callback ? " onclick='return ".addcslashes($callback, "'")."'" : ''; |
|
| 4707 | 4707 | $title = $title ? " title='$title'" : ''; |
| 4708 | 4708 | |
| 4709 | - return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>" . form_hidden($url) |
|
| 4709 | + return "<form class='bouton_action_post $class_form' method='post' action='$url'><div>".form_hidden($url) |
|
| 4710 | 4710 | . "<button type='submit' class='$class_btn'$title$onclick>$libelle</button></div></form>"; |
| 4711 | 4711 | } |
| 4712 | 4712 | |
@@ -4771,14 +4771,14 @@ discard block |
||
| 4771 | 4771 | $champ_titre = ''; |
| 4772 | 4772 | if ($demande_titre) { |
| 4773 | 4773 | // si pas de titre declare mais champ titre, il sera peuple par le select * |
| 4774 | - $champ_titre = (!empty($desc['titre'])) ? ', ' . $desc['titre'] : ''; |
|
| 4774 | + $champ_titre = (!empty($desc['titre'])) ? ', '.$desc['titre'] : ''; |
|
| 4775 | 4775 | } |
| 4776 | 4776 | include_spip('base/abstract_sql'); |
| 4777 | 4777 | include_spip('base/connect_sql'); |
| 4778 | 4778 | $objets[$type_objet][$id_objet] = sql_fetsel( |
| 4779 | - '*' . $champ_titre, |
|
| 4779 | + '*'.$champ_titre, |
|
| 4780 | 4780 | $desc['table_sql'], |
| 4781 | - id_table_objet($type_objet) . ' = ' . intval($id_objet) |
|
| 4781 | + id_table_objet($type_objet).' = '.intval($id_objet) |
|
| 4782 | 4782 | ); |
| 4783 | 4783 | |
| 4784 | 4784 | // Toujours noter la longueur d'introduction, même si pas demandé cette fois-ci |
@@ -4871,8 +4871,7 @@ discard block |
||
| 4871 | 4871 | if (isset($ligne_sql['chapo'])) { |
| 4872 | 4872 | $chapo = $ligne_sql['chapo']; |
| 4873 | 4873 | $texte = strlen($descriptif) ? |
| 4874 | - '' : |
|
| 4875 | - "$chapo \n\n $texte"; |
|
| 4874 | + '' : "$chapo \n\n $texte"; |
|
| 4876 | 4875 | } |
| 4877 | 4876 | |
| 4878 | 4877 | // Longueur en paramètre, sinon celle renseignée dans la description de l'objet, sinon valeur en dur |
@@ -4947,7 +4946,7 @@ discard block |
||
| 4947 | 4946 | return $texte; |
| 4948 | 4947 | } |
| 4949 | 4948 | |
| 4950 | - $traitement = str_replace('%s', "'" . texte_script($texte) . "'", $traitement); |
|
| 4949 | + $traitement = str_replace('%s', "'".texte_script($texte)."'", $traitement); |
|
| 4951 | 4950 | |
| 4952 | 4951 | // Fournir $connect et $Pile[0] au traitement si besoin |
| 4953 | 4952 | $Pile = [0 => $env]; |
@@ -4981,7 +4980,7 @@ discard block |
||
| 4981 | 4980 | } |
| 4982 | 4981 | $url = generer_objet_url($id_objet, $objet, '', '', null, '', $connect); |
| 4983 | 4982 | |
| 4984 | - return "<a href='$url' class='$objet'>" . couper($titre, $longueur) . '</a>'; |
|
| 4983 | + return "<a href='$url' class='$objet'>".couper($titre, $longueur).'</a>'; |
|
| 4985 | 4984 | } |
| 4986 | 4985 | |
| 4987 | 4986 | /** |
@@ -5007,10 +5006,10 @@ discard block |
||
| 5007 | 5006 | function wrap($texte, $wrap) { |
| 5008 | 5007 | $balises = extraire_balises($wrap); |
| 5009 | 5008 | if (preg_match_all(",<([a-z]\w*)\b[^>]*>,UimsS", $wrap, $regs, PREG_PATTERN_ORDER)) { |
| 5010 | - $texte = $wrap . $texte; |
|
| 5009 | + $texte = $wrap.$texte; |
|
| 5011 | 5010 | $regs = array_reverse($regs[1]); |
| 5012 | - $wrap = '</' . implode('></', $regs) . '>'; |
|
| 5013 | - $texte = $texte . $wrap; |
|
| 5011 | + $wrap = '</'.implode('></', $regs).'>'; |
|
| 5012 | + $texte = $texte.$wrap; |
|
| 5014 | 5013 | } |
| 5015 | 5014 | |
| 5016 | 5015 | return $texte; |
@@ -5041,7 +5040,7 @@ discard block |
||
| 5041 | 5040 | |
| 5042 | 5041 | // caster $u en array si besoin |
| 5043 | 5042 | if (is_object($u)) { |
| 5044 | - $u = (array)$u; |
|
| 5043 | + $u = (array) $u; |
|
| 5045 | 5044 | } |
| 5046 | 5045 | |
| 5047 | 5046 | if (is_array($u)) { |
@@ -5063,7 +5062,7 @@ discard block |
||
| 5063 | 5062 | // sinon on passe a la ligne et on indente |
| 5064 | 5063 | $i_str = str_pad('', $indent, ' '); |
| 5065 | 5064 | foreach ($u as $k => $v) { |
| 5066 | - $out .= $join . $i_str . "$k: " . filtre_print_dist($v, $join, $indent + 2); |
|
| 5065 | + $out .= $join.$i_str."$k: ".filtre_print_dist($v, $join, $indent + 2); |
|
| 5067 | 5066 | } |
| 5068 | 5067 | |
| 5069 | 5068 | return $out; |
@@ -5117,7 +5116,7 @@ discard block |
||
| 5117 | 5116 | * @return string |
| 5118 | 5117 | */ |
| 5119 | 5118 | function objet_icone($objet, $taille = 24, $class = '') { |
| 5120 | - $icone = objet_info($objet, 'icone_objet') . '-' . $taille . '.png'; |
|
| 5119 | + $icone = objet_info($objet, 'icone_objet').'-'.$taille.'.png'; |
|
| 5121 | 5120 | $icone = chemin_image($icone); |
| 5122 | 5121 | $balise_img = charger_filtre('balise_img'); |
| 5123 | 5122 | |
@@ -5143,7 +5142,7 @@ discard block |
||
| 5143 | 5142 | */ |
| 5144 | 5143 | function objet_T($objet, $chaine, $args = [], $options = []) { |
| 5145 | 5144 | $chaine = explode(':', $chaine); |
| 5146 | - if ($t = _T($objet . ':' . end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5145 | + if ($t = _T($objet.':'.end($chaine), $args, array_merge($options, ['force' => false]))) { |
|
| 5147 | 5146 | return $t; |
| 5148 | 5147 | } |
| 5149 | 5148 | $chaine = implode(':', $chaine); |
@@ -5209,7 +5208,7 @@ discard block |
||
| 5209 | 5208 | $cache = recuperer_fond($fond, $contexte, $options, $connect); |
| 5210 | 5209 | |
| 5211 | 5210 | // calculer le nom de la css |
| 5212 | - $dir_var = sous_repertoire(_DIR_VAR, 'cache-' . $extension); |
|
| 5211 | + $dir_var = sous_repertoire(_DIR_VAR, 'cache-'.$extension); |
|
| 5213 | 5212 | $nom_safe = preg_replace(',\W,', '_', str_replace('.', '_', $fond)); |
| 5214 | 5213 | $contexte_implicite = calculer_contexte_implicite(); |
| 5215 | 5214 | |
@@ -5217,14 +5216,14 @@ discard block |
||
| 5217 | 5216 | // mais on peut hasher selon le contenu a la demande, si plusieurs contextes produisent un meme contenu |
| 5218 | 5217 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5219 | 5218 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5220 | - $hash = md5($contexte_implicite['host'] . '::' . $cache); |
|
| 5219 | + $hash = md5($contexte_implicite['host'].'::'.$cache); |
|
| 5221 | 5220 | } |
| 5222 | 5221 | else { |
| 5223 | 5222 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5224 | 5223 | ksort($contexte); |
| 5225 | - $hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect); |
|
| 5224 | + $hash = md5($fond.json_encode($contexte_implicite, JSON_THROW_ON_ERROR).json_encode($contexte, JSON_THROW_ON_ERROR).$connect); |
|
| 5226 | 5225 | } |
| 5227 | - $filename = $dir_var . $extension . "dyn-$nom_safe-" . substr($hash, 0, 8) . ".$extension"; |
|
| 5226 | + $filename = $dir_var.$extension."dyn-$nom_safe-".substr($hash, 0, 8).".$extension"; |
|
| 5228 | 5227 | |
| 5229 | 5228 | // mettre a jour le fichier si il n'existe pas |
| 5230 | 5229 | // ou trop ancien |
@@ -5232,8 +5231,8 @@ discard block |
||
| 5232 | 5231 | // et recopie sur le fichier cible uniquement si il change |
| 5233 | 5232 | if ( |
| 5234 | 5233 | !file_exists($filename) |
| 5235 | - or !file_exists($filename . '.last') |
|
| 5236 | - or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename . '.last') < $cache['lastmodified']) |
|
| 5234 | + or !file_exists($filename.'.last') |
|
| 5235 | + or (isset($cache['lastmodified']) and $cache['lastmodified'] and filemtime($filename.'.last') < $cache['lastmodified']) |
|
| 5237 | 5236 | or (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') |
| 5238 | 5237 | ) { |
| 5239 | 5238 | $contenu = $cache['texte']; |
@@ -5254,10 +5253,10 @@ discard block |
||
| 5254 | 5253 | } |
| 5255 | 5254 | // pas de date dans le commentaire car sinon ca invalide le md5 et force la maj |
| 5256 | 5255 | // mais on peut mettre un md5 du contenu, ce qui donne un aperu rapide si la feuille a change ou non |
| 5257 | - $comment .= "}\n md5:" . md5($contenu) . " */\n"; |
|
| 5256 | + $comment .= "}\n md5:".md5($contenu)." */\n"; |
|
| 5258 | 5257 | } |
| 5259 | 5258 | // et ecrire le fichier si il change |
| 5260 | - ecrire_fichier_calcule_si_modifie($filename, $comment . $contenu, false, true); |
|
| 5259 | + ecrire_fichier_calcule_si_modifie($filename, $comment.$contenu, false, true); |
|
| 5261 | 5260 | } |
| 5262 | 5261 | |
| 5263 | 5262 | return timestamp($filename); |
@@ -5483,7 +5482,7 @@ discard block |
||
| 5483 | 5482 | if ($e > 0 and strlen($mid) > 8) { |
| 5484 | 5483 | $mid = '***...***'; |
| 5485 | 5484 | } |
| 5486 | - return substr($passe, 0, $e) . $mid . ($e > 0 ? substr($passe, -$e) : ''); |
|
| 5485 | + return substr($passe, 0, $e).$mid.($e > 0 ? substr($passe, -$e) : ''); |
|
| 5487 | 5486 | } |
| 5488 | 5487 | |
| 5489 | 5488 | |
@@ -5545,7 +5544,7 @@ discard block |
||
| 5545 | 5544 | case 'id': |
| 5546 | 5545 | case 'anchor': |
| 5547 | 5546 | if (preg_match(',^\d,', $texte)) { |
| 5548 | - $texte = substr($type, 0, 1) . $texte; |
|
| 5547 | + $texte = substr($type, 0, 1).$texte; |
|
| 5549 | 5548 | } |
| 5550 | 5549 | } |
| 5551 | 5550 | |
@@ -5555,9 +5554,9 @@ discard block |
||
| 5555 | 5554 | |
| 5556 | 5555 | if (strlen($texte) < $longueur_mini and $longueur_mini < $longueur_maxi) { |
| 5557 | 5556 | if (preg_match(',^\d,', $texte)) { |
| 5558 | - $texte = ($type ? substr($type, 0, 1) : 's') . $texte; |
|
| 5557 | + $texte = ($type ? substr($type, 0, 1) : 's').$texte; |
|
| 5559 | 5558 | } |
| 5560 | - $texte .= $separateur . md5($original); |
|
| 5559 | + $texte .= $separateur.md5($original); |
|
| 5561 | 5560 | $texte = substr($texte, 0, $longueur_mini); |
| 5562 | 5561 | } |
| 5563 | 5562 | |