@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $rejouer = (_SESSION_REJOUER === true) ? rejouer_session() : _SESSION_REJOUER; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - return $rejouer . (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : ''); |
|
| 192 | + return $rejouer.(defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : ''); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -235,9 +235,9 @@ discard block |
||
| 235 | 235 | // |
| 236 | 236 | if ($vcs = version_vcs_courante(_DIR_RACINE, true)) { |
| 237 | 237 | if ($vcs['vcs'] === 'GIT') { |
| 238 | - $url = 'https://git.spip.net/spip/spip/commit/' . $vcs['commit']; |
|
| 238 | + $url = 'https://git.spip.net/spip/spip/commit/'.$vcs['commit']; |
|
| 239 | 239 | } elseif ($vcs['vcs'] === 'SVN') { |
| 240 | - $url = 'https://core.spip.net/projects/spip/repository/revisions/' . $vcs['commit']; |
|
| 240 | + $url = 'https://core.spip.net/projects/spip/repository/revisions/'.$vcs['commit']; |
|
| 241 | 241 | } else { |
| 242 | 242 | $url = ''; |
| 243 | 243 | } |
@@ -247,21 +247,21 @@ discard block |
||
| 247 | 247 | $commit = "<a href=\"$url\" target=\"_blank\" rel=\"noopener noreferrer\">$commit</a>"; |
| 248 | 248 | } |
| 249 | 249 | if ($vcs['branch']) { |
| 250 | - $commit = $vcs['branch'] . ': ' . $commit; |
|
| 250 | + $commit = $vcs['branch'].': '.$commit; |
|
| 251 | 251 | } |
| 252 | 252 | $version .= " {$vcs['vcs']} [$commit]"; |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | // et la version de l'ecran de securite |
| 256 | 256 | $secu = defined('_ECRAN_SECURITE') |
| 257 | - ? '<br />' . _T('ecran_securite', ['version' => _ECRAN_SECURITE]) |
|
| 257 | + ? '<br />'._T('ecran_securite', ['version' => _ECRAN_SECURITE]) |
|
| 258 | 258 | : ''; |
| 259 | 259 | |
| 260 | 260 | return _T( |
| 261 | 261 | 'info_copyright', |
| 262 | 262 | [ |
| 263 | 263 | 'spip' => "<b>SPIP $version</b> ", |
| 264 | - 'lien_gpl' => '<a href="https://www.gnu.org/licenses/gpl-3.0.html">' . _T('info_copyright_gpl') . '</a>' |
|
| 264 | + 'lien_gpl' => '<a href="https://www.gnu.org/licenses/gpl-3.0.html">'._T('info_copyright_gpl').'</a>' |
|
| 265 | 265 | ] |
| 266 | 266 | ) |
| 267 | 267 | . $secu; |
@@ -288,8 +288,8 @@ discard block |
||
| 288 | 288 | $onfocus = ''; |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - $form = '<input type="text" size="10" value="' . $recherche_aff . '" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />'; |
|
| 292 | - $form .= "<input type='image' src='" . chemin_image('rechercher-20.png') . "' name='submit' class='submit' alt='" . _T('info_rechercher') . "' />"; |
|
| 291 | + $form = '<input type="text" size="10" value="'.$recherche_aff.'" name="recherche" class="recherche" accesskey="r"'.$onfocus.' />'; |
|
| 292 | + $form .= "<input type='image' src='".chemin_image('rechercher-20.png')."' name='submit' class='submit' alt='"._T('info_rechercher')."' />"; |
|
| 293 | 293 | |
| 294 | - return "<div class='spip_recherche'>" . generer_form_ecrire($page, $form . $complement, " method='get'") . '</div>'; |
|
| 294 | + return "<div class='spip_recherche'>".generer_form_ecrire($page, $form.$complement, " method='get'").'</div>'; |
|
| 295 | 295 | } |
@@ -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 💩 |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | $ok = false; |
| 617 | 617 | } |
| 618 | 618 | if (!$ok) { |
| 619 | - spip_log('Echec mysqli_selectdb. Erreur : ' . mysqli_error($link), 'mysql.' . _LOG_CRITIQUE); |
|
| 619 | + spip_log('Echec mysqli_selectdb. Erreur : '.mysqli_error($link), 'mysql.'._LOG_CRITIQUE); |
|
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | return $ok; |
@@ -706,10 +706,10 @@ discard block |
||
| 706 | 706 | |
| 707 | 707 | $character_set = ''; |
| 708 | 708 | if (@$GLOBALS['meta']['charset_sql_base']) { |
| 709 | - $character_set .= ' CHARACTER SET ' . $GLOBALS['meta']['charset_sql_base']; |
|
| 709 | + $character_set .= ' CHARACTER SET '.$GLOBALS['meta']['charset_sql_base']; |
|
| 710 | 710 | } |
| 711 | 711 | if (@$GLOBALS['meta']['charset_collation_sql_base']) { |
| 712 | - $character_set .= ' COLLATE ' . $GLOBALS['meta']['charset_collation_sql_base']; |
|
| 712 | + $character_set .= ' COLLATE '.$GLOBALS['meta']['charset_collation_sql_base']; |
|
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | foreach ($champs as $k => $v) { |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | preg_match(',(char|text),i', $defs[1]) |
| 720 | 720 | and !preg_match(',(binary|CHARACTER|COLLATE),i', $v) |
| 721 | 721 | ) { |
| 722 | - $v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1])); |
|
| 722 | + $v = $defs[1].$character_set.' '.substr($v, strlen($defs[1])); |
|
| 723 | 723 | } |
| 724 | 724 | } |
| 725 | 725 | |
@@ -731,8 +731,8 @@ discard block |
||
| 731 | 731 | $s = ','; |
| 732 | 732 | } |
| 733 | 733 | $temporary = $temporary ? 'TEMPORARY' : ''; |
| 734 | - $q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query" . ($keys ? ",$keys" : '') . ')' |
|
| 735 | - . (defined('_MYSQL_ENGINE') ? ' ENGINE=' . _MYSQL_ENGINE : '') |
|
| 734 | + $q = "CREATE $temporary TABLE IF NOT EXISTS $nom ($query".($keys ? ",$keys" : '').')' |
|
| 735 | + . (defined('_MYSQL_ENGINE') ? ' ENGINE='._MYSQL_ENGINE : '') |
|
| 736 | 736 | . ($character_set ? " DEFAULT $character_set" : '') |
| 737 | 737 | . "\n"; |
| 738 | 738 | |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | return false; |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | - $query = "CREATE VIEW $nom AS " . $query_select; |
|
| 814 | + $query = "CREATE VIEW $nom AS ".$query_select; |
|
| 815 | 815 | |
| 816 | 816 | return spip_mysql_query($query, $serveur, $requeter); |
| 817 | 817 | } |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | * Ressource à utiliser avec sql_fetch() |
| 870 | 870 | **/ |
| 871 | 871 | function spip_mysql_showbase($match, $serveur = '', $requeter = true) { |
| 872 | - return spip_mysql_query('SHOW TABLES LIKE ' . _q($match), $serveur, $requeter); |
|
| 872 | + return spip_mysql_query('SHOW TABLES LIKE '._q($match), $serveur, $requeter); |
|
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | /** |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | * - true si la requête a réussie, false sinon |
| 886 | 886 | */ |
| 887 | 887 | function spip_mysql_repair($table, $serveur = '', $requeter = true) { |
| 888 | - $table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = ' . _q($table), $serveur, true)); |
|
| 888 | + $table_status = spip_mysql_fetch(spip_mysql_query('SHOW TABLE STATUS WHERE Name = '._q($table), $serveur, true)); |
|
| 889 | 889 | $engine = $table_status['Engine']; |
| 890 | 890 | if ($engine == 'InnoDB') { |
| 891 | 891 | if (spip_mysql_alter("TABLE $table ENGINE = InnoDB", $serveur, $requeter)) { |
@@ -894,7 +894,7 @@ discard block |
||
| 894 | 894 | } elseif ($engine == 'MyISAM') { |
| 895 | 895 | return spip_mysql_query("REPAIR TABLE `$table`", $serveur, $requeter); |
| 896 | 896 | } else { |
| 897 | - spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.' . _LOG_DEBUG); |
|
| 897 | + spip_log("spip_mysql_repair impossible pour la table $table engine $engine", 'mysql.'._LOG_DEBUG); |
|
| 898 | 898 | } |
| 899 | 899 | return false; |
| 900 | 900 | } |
@@ -914,7 +914,7 @@ discard block |
||
| 914 | 914 | * - string : requete sql, si $requeter = true |
| 915 | 915 | **/ |
| 916 | 916 | function spip_mysql_table_exists(string $table, $serveur = '', $requeter = true) { |
| 917 | - $r = spip_mysql_query('SHOW TABLES LIKE ' . _q($table), $serveur, $requeter); |
|
| 917 | + $r = spip_mysql_query('SHOW TABLES LIKE '._q($table), $serveur, $requeter); |
|
| 918 | 918 | if (!$requeter) { |
| 919 | 919 | return $r; |
| 920 | 920 | } |
@@ -996,22 +996,22 @@ discard block |
||
| 996 | 996 | } |
| 997 | 997 | if ($val['Default'] === '0' || $val['Default']) { |
| 998 | 998 | if (preg_match('/[A-Z_]/', $val['Default'])) { |
| 999 | - $nfields[$val['Field']] .= ' DEFAULT ' . $val['Default']; |
|
| 999 | + $nfields[$val['Field']] .= ' DEFAULT '.$val['Default']; |
|
| 1000 | 1000 | } else { |
| 1001 | - $nfields[$val['Field']] .= " DEFAULT '" . $val['Default'] . "'"; |
|
| 1001 | + $nfields[$val['Field']] .= " DEFAULT '".$val['Default']."'"; |
|
| 1002 | 1002 | } |
| 1003 | 1003 | } |
| 1004 | 1004 | if ($val['Extra']) { |
| 1005 | - $nfields[$val['Field']] .= ' ' . $val['Extra']; |
|
| 1005 | + $nfields[$val['Field']] .= ' '.$val['Extra']; |
|
| 1006 | 1006 | } |
| 1007 | 1007 | if ($val['Key'] == 'PRI') { |
| 1008 | 1008 | $nkeys['PRIMARY KEY'] = $val['Field']; |
| 1009 | 1009 | } else { |
| 1010 | 1010 | if ($val['Key'] == 'MUL') { |
| 1011 | - $nkeys['KEY ' . $val['Field']] = $val['Field']; |
|
| 1011 | + $nkeys['KEY '.$val['Field']] = $val['Field']; |
|
| 1012 | 1012 | } else { |
| 1013 | 1013 | if ($val['Key'] == 'UNI') { |
| 1014 | - $nkeys['UNIQUE KEY ' . $val['Field']] = $val['Field']; |
|
| 1014 | + $nkeys['UNIQUE KEY '.$val['Field']] = $val['Field']; |
|
| 1015 | 1015 | } |
| 1016 | 1016 | } |
| 1017 | 1017 | } |
@@ -1087,7 +1087,7 @@ discard block |
||
| 1087 | 1087 | $serveur = '', |
| 1088 | 1088 | $requeter = true |
| 1089 | 1089 | ) { |
| 1090 | - $c = !$groupby ? '*' : ('DISTINCT ' . (is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 1090 | + $c = !$groupby ? '*' : ('DISTINCT '.(is_string($groupby) ? $groupby : join(',', $groupby))); |
|
| 1091 | 1091 | |
| 1092 | 1092 | $r = spip_mysql_select("COUNT($c)", $from, $where, '', '', '', $having, $serveur, $requeter); |
| 1093 | 1093 | if (!$requeter) { |
@@ -1127,7 +1127,7 @@ discard block |
||
| 1127 | 1127 | if ($s) { |
| 1128 | 1128 | $trace = debug_backtrace(); |
| 1129 | 1129 | if ($trace[0]['function'] != 'spip_mysql_error') { |
| 1130 | - spip_log("$s - $query - " . sql_error_backtrace(), 'mysql.' . _LOG_ERREUR); |
|
| 1130 | + spip_log("$s - $query - ".sql_error_backtrace(), 'mysql.'._LOG_ERREUR); |
|
| 1131 | 1131 | } |
| 1132 | 1132 | } |
| 1133 | 1133 | |
@@ -1257,7 +1257,7 @@ discard block |
||
| 1257 | 1257 | try { |
| 1258 | 1258 | $insert = mysqli_query($link, $query); |
| 1259 | 1259 | } catch (\mysqli_sql_exception $e) { |
| 1260 | - spip_log('mysqli_sql_exception: ' . $e->getMessage(), 'mysql.' . _LOG_DEBUG); |
|
| 1260 | + spip_log('mysqli_sql_exception: '.$e->getMessage(), 'mysql.'._LOG_DEBUG); |
|
| 1261 | 1261 | // TODO: utiliser l’exception ensuite plutôt que les appels à spip_mysql_errno() |
| 1262 | 1262 | // mais il faut pour php < 8.1 forcer les exeptions via mysqli_report(). |
| 1263 | 1263 | } |
@@ -1312,8 +1312,8 @@ discard block |
||
| 1312 | 1312 | |
| 1313 | 1313 | return spip_mysql_insert( |
| 1314 | 1314 | $table, |
| 1315 | - '(' . join(',', array_keys($couples)) . ')', |
|
| 1316 | - '(' . join(',', $couples) . ')', |
|
| 1315 | + '('.join(',', array_keys($couples)).')', |
|
| 1316 | + '('.join(',', $couples).')', |
|
| 1317 | 1317 | $desc, |
| 1318 | 1318 | $serveur, |
| 1319 | 1319 | $requeter |
@@ -1350,7 +1350,7 @@ discard block |
||
| 1350 | 1350 | } |
| 1351 | 1351 | $fields = $desc['field'] ?? []; |
| 1352 | 1352 | |
| 1353 | - $cles = '(' . join(',', array_keys(reset($tab_couples))) . ')'; |
|
| 1353 | + $cles = '('.join(',', array_keys(reset($tab_couples))).')'; |
|
| 1354 | 1354 | $valeurs = []; |
| 1355 | 1355 | $r = false; |
| 1356 | 1356 | |
@@ -1359,7 +1359,7 @@ discard block |
||
| 1359 | 1359 | foreach ($couples as $champ => $val) { |
| 1360 | 1360 | $couples[$champ] = spip_mysql_cite($val, $fields[$champ]); |
| 1361 | 1361 | } |
| 1362 | - $valeurs[] = '(' . join(',', $couples) . ')'; |
|
| 1362 | + $valeurs[] = '('.join(',', $couples).')'; |
|
| 1363 | 1363 | if (count($valeurs) >= 100) { |
| 1364 | 1364 | $r = spip_mysql_insert($table, $cles, join(', ', $valeurs), $desc, $serveur, $requeter); |
| 1365 | 1365 | $valeurs = []; |
@@ -1396,7 +1396,7 @@ discard block |
||
| 1396 | 1396 | function spip_mysql_update($table, $champs, $where = '', $desc = [], $serveur = '', $requeter = true) { |
| 1397 | 1397 | $set = []; |
| 1398 | 1398 | foreach ($champs as $champ => $val) { |
| 1399 | - $set[] = $champ . "=$val"; |
|
| 1399 | + $set[] = $champ."=$val"; |
|
| 1400 | 1400 | } |
| 1401 | 1401 | if (!empty($set)) { |
| 1402 | 1402 | return spip_mysql_query( |
@@ -1453,7 +1453,7 @@ discard block |
||
| 1453 | 1453 | } |
| 1454 | 1454 | $set = []; |
| 1455 | 1455 | foreach ($champs as $champ => $val) { |
| 1456 | - $set[] = $champ . '=' . spip_mysql_cite($val, @$fields[$champ]); |
|
| 1456 | + $set[] = $champ.'='.spip_mysql_cite($val, @$fields[$champ]); |
|
| 1457 | 1457 | } |
| 1458 | 1458 | |
| 1459 | 1459 | return spip_mysql_query( |
@@ -1522,10 +1522,10 @@ discard block |
||
| 1522 | 1522 | * - false en cas d'erreur. |
| 1523 | 1523 | **/ |
| 1524 | 1524 | function spip_mysql_replace($table, $couples, $desc = [], $serveur = '', $requeter = true) { |
| 1525 | - return spip_mysql_query("REPLACE $table (" . join(',', array_keys($couples)) . ') VALUES (' . join( |
|
| 1525 | + return spip_mysql_query("REPLACE $table (".join(',', array_keys($couples)).') VALUES ('.join( |
|
| 1526 | 1526 | ',', |
| 1527 | 1527 | array_map('_q', $couples) |
| 1528 | - ) . ')', $serveur, $requeter); |
|
| 1528 | + ).')', $serveur, $requeter); |
|
| 1529 | 1529 | } |
| 1530 | 1530 | |
| 1531 | 1531 | |
@@ -1554,10 +1554,10 @@ discard block |
||
| 1554 | 1554 | * - false en cas d'erreur. |
| 1555 | 1555 | **/ |
| 1556 | 1556 | function spip_mysql_replace_multi($table, $tab_couples, $desc = [], $serveur = '', $requeter = true) { |
| 1557 | - $cles = '(' . join(',', array_keys($tab_couples[0])) . ')'; |
|
| 1557 | + $cles = '('.join(',', array_keys($tab_couples[0])).')'; |
|
| 1558 | 1558 | $valeurs = []; |
| 1559 | 1559 | foreach ($tab_couples as $couples) { |
| 1560 | - $valeurs[] = '(' . join(',', array_map('_q', $couples)) . ')'; |
|
| 1560 | + $valeurs[] = '('.join(',', array_map('_q', $couples)).')'; |
|
| 1561 | 1561 | } |
| 1562 | 1562 | $valeurs = implode(', ', $valeurs); |
| 1563 | 1563 | |
@@ -1577,28 +1577,28 @@ discard block |
||
| 1577 | 1577 | */ |
| 1578 | 1578 | function spip_mysql_multi($objet, $lang) { |
| 1579 | 1579 | $lengthlang = strlen("[$lang]"); |
| 1580 | - $posmulti = 'INSTR(' . $objet . ", '<multi>')"; |
|
| 1581 | - $posfinmulti = 'INSTR(' . $objet . ", '</multi>')"; |
|
| 1582 | - $debutchaine = 'LEFT(' . $objet . ", $posmulti-1)"; |
|
| 1583 | - $finchaine = 'RIGHT(' . $objet . ', CHAR_LENGTH(' . $objet . ") -(7+$posfinmulti))"; |
|
| 1584 | - $chainemulti = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7, $posfinmulti -(7+$posmulti)))"; |
|
| 1585 | - $poslang = "INSTR($chainemulti,'[" . $lang . "]')"; |
|
| 1580 | + $posmulti = 'INSTR('.$objet.", '<multi>')"; |
|
| 1581 | + $posfinmulti = 'INSTR('.$objet.", '</multi>')"; |
|
| 1582 | + $debutchaine = 'LEFT('.$objet.", $posmulti-1)"; |
|
| 1583 | + $finchaine = 'RIGHT('.$objet.', CHAR_LENGTH('.$objet.") -(7+$posfinmulti))"; |
|
| 1584 | + $chainemulti = 'TRIM(SUBSTRING('.$objet.", $posmulti+7, $posfinmulti -(7+$posmulti)))"; |
|
| 1585 | + $poslang = "INSTR($chainemulti,'[".$lang."]')"; |
|
| 1586 | 1586 | $poslang = "IF($poslang=0,INSTR($chainemulti,']')+1,$poslang+$lengthlang)"; |
| 1587 | - $chainelang = 'TRIM(SUBSTRING(' . $objet . ", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))"; |
|
| 1588 | - $posfinlang = 'INSTR(' . $chainelang . ", '[')"; |
|
| 1587 | + $chainelang = 'TRIM(SUBSTRING('.$objet.", $posmulti+7+$poslang-1,$posfinmulti -($posmulti+7+$poslang-1) ))"; |
|
| 1588 | + $posfinlang = 'INSTR('.$chainelang.", '[')"; |
|
| 1589 | 1589 | $chainelang = "IF($posfinlang>0,LEFT($chainelang,$posfinlang-1),$chainelang)"; |
| 1590 | 1590 | //$chainelang = "LEFT($chainelang,$posfinlang-1)"; |
| 1591 | - $retour = "(TRIM(IF($posmulti = 0 , " . |
|
| 1592 | - ' TRIM(' . $objet . '), ' . |
|
| 1593 | - ' CONCAT( ' . |
|
| 1594 | - " $debutchaine, " . |
|
| 1595 | - ' IF( ' . |
|
| 1596 | - " $poslang = 0, " . |
|
| 1597 | - " $chainemulti, " . |
|
| 1598 | - " $chainelang" . |
|
| 1599 | - ' ), ' . |
|
| 1600 | - " $finchaine" . |
|
| 1601 | - ' ) ' . |
|
| 1591 | + $retour = "(TRIM(IF($posmulti = 0 , ". |
|
| 1592 | + ' TRIM('.$objet.'), '. |
|
| 1593 | + ' CONCAT( '. |
|
| 1594 | + " $debutchaine, ". |
|
| 1595 | + ' IF( '. |
|
| 1596 | + " $poslang = 0, ". |
|
| 1597 | + " $chainemulti, ". |
|
| 1598 | + " $chainelang". |
|
| 1599 | + ' ), '. |
|
| 1600 | + " $finchaine". |
|
| 1601 | + ' ) '. |
|
| 1602 | 1602 | '))) AS multi'; |
| 1603 | 1603 | |
| 1604 | 1604 | return $retour; |
@@ -1615,7 +1615,7 @@ discard block |
||
| 1615 | 1615 | * Valeur hexadécimale pour MySQL |
| 1616 | 1616 | **/ |
| 1617 | 1617 | function spip_mysql_hex($v) { |
| 1618 | - return '0x' . $v; |
|
| 1618 | + return '0x'.$v; |
|
| 1619 | 1619 | } |
| 1620 | 1620 | |
| 1621 | 1621 | /** |
@@ -1655,7 +1655,7 @@ discard block |
||
| 1655 | 1655 | * Expression SQL |
| 1656 | 1656 | **/ |
| 1657 | 1657 | function spip_mysql_date_proche($champ, $interval, $unite) { |
| 1658 | - $use_now = ( ($champ === 'maj' or strpos($champ, '.maj')) ? true : false ); |
|
| 1658 | + $use_now = (($champ === 'maj' or strpos($champ, '.maj')) ? true : false); |
|
| 1659 | 1659 | return '(' |
| 1660 | 1660 | . $champ |
| 1661 | 1661 | . (($interval <= 0) ? '>' : '<') |
@@ -1710,7 +1710,7 @@ discard block |
||
| 1710 | 1710 | } elseif ($v === null) { |
| 1711 | 1711 | return "''"; |
| 1712 | 1712 | } |
| 1713 | - return "'" . addslashes($v) . "'"; |
|
| 1713 | + return "'".addslashes($v)."'"; |
|
| 1714 | 1714 | } |
| 1715 | 1715 | |
| 1716 | 1716 | if ($v === null) { |
@@ -1734,7 +1734,7 @@ discard block |
||
| 1734 | 1734 | } |
| 1735 | 1735 | } |
| 1736 | 1736 | |
| 1737 | - return ("'" . addslashes($v) . "'"); |
|
| 1737 | + return ("'".addslashes($v)."'"); |
|
| 1738 | 1738 | } |
| 1739 | 1739 | |
| 1740 | 1740 | /** |
@@ -1768,7 +1768,7 @@ discard block |
||
| 1768 | 1768 | } else { |
| 1769 | 1769 | $GLOBALS['mysql_rappel_nom_base'] = false; |
| 1770 | 1770 | |
| 1771 | - return "\$GLOBALS['mysql_rappel_nom_base'] = false; " . |
|
| 1771 | + return "\$GLOBALS['mysql_rappel_nom_base'] = false; ". |
|
| 1772 | 1772 | "/* echec de test_rappel_nom_base_mysql a l'installation. */\n"; |
| 1773 | 1773 | } |
| 1774 | 1774 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | // confirmation du deplacement |
| 118 | 118 | if ( |
| 119 | 119 | sql_table_exists('spip_breves') |
| 120 | - and ($contient_breves = sql_countsel('spip_breves', 'id_rubrique=' . intval($id_objet))) |
|
| 120 | + and ($contient_breves = sql_countsel('spip_breves', 'id_rubrique='.intval($id_objet))) |
|
| 121 | 121 | and ($contient_breves > 0) |
| 122 | 122 | ) { |
| 123 | 123 | // FIXME: utiliser singulier_ou_pluriel, migrer dans plugin Brèves |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | ); |
| 132 | 132 | $confirm .= "\n<div class='confirmer_deplacement verdana2'>" |
| 133 | 133 | . "<div class='choix'><input type='checkbox' name='confirme_deplace' value='oui' id='confirme-deplace' /><label for='confirme-deplace'>" |
| 134 | - . $scb . |
|
| 134 | + . $scb. |
|
| 135 | 135 | "</label></div></div>\n"; |
| 136 | 136 | } else { |
| 137 | 137 | $confirm .= "<input type='hidden' name='confirme_deplace' value='oui' />\n"; |
@@ -140,11 +140,11 @@ discard block |
||
| 140 | 140 | $form .= $confirm; |
| 141 | 141 | if ($actionable) { |
| 142 | 142 | if (strpos($form, '<select') !== false) { |
| 143 | - $form .= "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>" |
|
| 144 | - . '<input class="fondo submit btn" type="submit" value="' . _T('bouton_choisir') . '"/>' |
|
| 143 | + $form .= "<div style='text-align: ".$GLOBALS['spip_lang_right'].";'>" |
|
| 144 | + . '<input class="fondo submit btn" type="submit" value="'._T('bouton_choisir').'"/>' |
|
| 145 | 145 | . '</div>'; |
| 146 | 146 | } |
| 147 | - $form = "<input type='hidden' name='editer_$objet' value='oui' />\n" . $form; |
|
| 147 | + $form = "<input type='hidden' name='editer_$objet' value='oui' />\n".$form; |
|
| 148 | 148 | if ($action = charger_fonction("editer_$objet", 'action', true)) { |
| 149 | 149 | $form = generer_action_auteur( |
| 150 | 150 | "editer_$objet", |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | include_spip('inc/presentation'); |
| 172 | 172 | |
| 173 | - return debut_cadre_couleur($logo, true, '', $titre) . $form . fin_cadre_couleur(); |
|
| 173 | + return debut_cadre_couleur($logo, true, '', $titre).$form.fin_cadre_couleur(); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | if ($statut == 'nouveau') { |
| 247 | 247 | if ($attente) { |
| 248 | 248 | $statut = $attente; |
| 249 | - $plus = ' (' . _T('info_statut_auteur_a_confirmer') . ')'; |
|
| 249 | + $plus = ' ('._T('info_statut_auteur_a_confirmer').')'; |
|
| 250 | 250 | } else { |
| 251 | 251 | return _T('info_statut_auteur_a_confirmer'); |
| 252 | 252 | } |
@@ -259,16 +259,16 @@ discard block |
||
| 259 | 259 | '5poubelle' => _T('texte_statut_poubelle'), // bouh |
| 260 | 260 | ]; |
| 261 | 261 | if (isset($recom[$statut])) { |
| 262 | - return $recom[$statut] . $plus; |
|
| 262 | + return $recom[$statut].$plus; |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | // retrouver directement par le statut sinon |
| 266 | 266 | if ($t = array_search($statut, $GLOBALS['liste_des_statuts'])) { |
| 267 | 267 | if (isset($recom[$t])) { |
| 268 | - return $recom[$t] . $plus; |
|
| 268 | + return $recom[$t].$plus; |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - return _T($t) . $plus; |
|
| 271 | + return _T($t).$plus; |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | // si on a pas reussi a le traduire, retournons la chaine telle quelle |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | if (!$id_rubrique and defined('_CHOIX_RUBRIQUE_PAR_DEFAUT') and _CHOIX_RUBRIQUE_PAR_DEFAUT) { |
| 390 | 390 | $in = !(is_countable($GLOBALS['connect_id_rubrique']) ? count($GLOBALS['connect_id_rubrique']) : 0) |
| 391 | 391 | ? '' |
| 392 | - : (' AND ' . sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])); |
|
| 392 | + : (' AND '.sql_in('id_rubrique', $GLOBALS['connect_id_rubrique'])); |
|
| 393 | 393 | |
| 394 | 394 | // on tente d'abord l'ecriture a la racine dans le cas des rubriques uniquement |
| 395 | 395 | if ($objet == 'rubrique') { |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | return ''; |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | - return propre('[->' . $virtuel . ']'); |
|
| 426 | + return propre('[->'.$virtuel.']'); |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | $clic = http_img_pack('rss-16.png', 'RSS', '', $title); |
| 451 | 451 | |
| 452 | 452 | $url = generer_url_api_low_sec('transmettre', 'rss', $op, '', http_build_query($args), false, true); |
| 453 | - return "<a style='float: " . $GLOBALS['spip_lang_right'] . ";' href='$url'>$clic</a>"; |
|
| 453 | + return "<a style='float: ".$GLOBALS['spip_lang_right'].";' href='$url'>$clic</a>"; |
|
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | ); |
| 527 | 527 | |
| 528 | 528 | if ($alertes = array_filter($alertes)) { |
| 529 | - return "<div class='wrap-messages-alertes'><div class='messages-alertes'>" . |
|
| 529 | + return "<div class='wrap-messages-alertes'><div class='messages-alertes'>". |
|
| 530 | 530 | join(' | ', $alertes) |
| 531 | 531 | . '</div></div>'; |
| 532 | 532 | } |
@@ -562,13 +562,13 @@ discard block |
||
| 562 | 562 | */ |
| 563 | 563 | function afficher_plus_info($lien, $titre = '+', $titre_lien = '') { |
| 564 | 564 | $titre = attribut_html($titre); |
| 565 | - $icone = "\n<a href='$lien' title='$titre' class='plus_info'>" . |
|
| 566 | - http_img_pack('information-16.png', $titre) . '</a>'; |
|
| 565 | + $icone = "\n<a href='$lien' title='$titre' class='plus_info'>". |
|
| 566 | + http_img_pack('information-16.png', $titre).'</a>'; |
|
| 567 | 567 | |
| 568 | 568 | if (!$titre_lien) { |
| 569 | 569 | return $icone; |
| 570 | 570 | } else { |
| 571 | - return $icone . "\n<a href='$lien'>$titre_lien</a>"; |
|
| 571 | + return $icone."\n<a href='$lien'>$titre_lien</a>"; |
|
| 572 | 572 | } |
| 573 | 573 | } |
| 574 | 574 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | if (strncmp($fichier, _DIR_IMG, strlen(_DIR_IMG)) !== 0) { |
| 65 | - $fichier = _DIR_IMG . $fichier; |
|
| 65 | + $fichier = _DIR_IMG.$fichier; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // fichier normal |
@@ -158,23 +158,23 @@ discard block |
||
| 158 | 158 | or !$r = verifier_upload_autorise($dest) |
| 159 | 159 | or (!empty($r['autozip'])) |
| 160 | 160 | ) { |
| 161 | - $dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1]; |
|
| 161 | + $dest = substr($dest, 0, -strlen($m[0])).'_'.$m[1]; |
|
| 162 | 162 | break; |
| 163 | 163 | } |
| 164 | 164 | else { |
| 165 | 165 | $dest = substr($dest, 0, -strlen($m[0])); |
| 166 | - $ext = $m[1] . '.' . $ext; |
|
| 166 | + $ext = $m[1].'.'.$ext; |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // Si le document "source" est deja au bon endroit, ne rien faire |
| 171 | - if ($source == ($dir . $dest . '.' . $ext)) { |
|
| 171 | + if ($source == ($dir.$dest.'.'.$ext)) { |
|
| 172 | 172 | return $source; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | // sinon tourner jusqu'a trouver un numero correct |
| 176 | 176 | $n = 0; |
| 177 | - while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) { |
|
| 177 | + while (@file_exists($newFile = $dir.$dest.($n++ ? ('-'.$n) : '').'.'.$ext)) { |
|
| 178 | 178 | ; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | function deplacer_fichier_upload($source, $dest, $move = false) { |
| 236 | 236 | // Securite |
| 237 | 237 | if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) { |
| 238 | - $dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE))); |
|
| 238 | + $dest = _DIR_RACINE.preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE))); |
|
| 239 | 239 | } else { |
| 240 | 240 | $dest = preg_replace(',\.\.+,', '.', $dest); |
| 241 | 241 | } |
@@ -317,8 +317,8 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | default: /* autre */ |
| 319 | 319 | if (!$msg) { |
| 320 | - $msg = _T('pass_erreur') . ' ' . $error |
|
| 321 | - . '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]'); |
|
| 320 | + $msg = _T('pass_erreur').' '.$error |
|
| 321 | + . '<br />'.propre('[->http://php.net/manual/fr/features.file-upload.errors.php]'); |
|
| 322 | 322 | } |
| 323 | 323 | break; |
| 324 | 324 | } |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | include_spip('inc/minipres'); |
| 337 | 337 | echo minipres( |
| 338 | 338 | $msg, |
| 339 | - "<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>' |
|
| 339 | + "<div style='text-align: ".$GLOBALS['spip_lang_right']."'><a href='".rawurldecode($GLOBALS['redirect'])."'><button type='button'>"._T('ecrire:bouton_suivant').'</button></a></div>' |
|
| 340 | 340 | ); |
| 341 | 341 | exit; |
| 342 | 342 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | function optimiser_caches_contextes() { |
| 53 | 53 | sous_repertoire(_DIR_CACHE, 'contextes'); |
| 54 | - if (is_dir($d = _DIR_CACHE . 'contextes')) { |
|
| 54 | + if (is_dir($d = _DIR_CACHE.'contextes')) { |
|
| 55 | 55 | include_spip('inc/invalideur'); |
| 56 | 56 | purger_repertoire($d, ['mtime' => time() - 48 * 3600, 'limit' => 10000]); |
| 57 | 57 | } |
@@ -96,16 +96,16 @@ discard block |
||
| 96 | 96 | $tables[] = array_shift($row); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - spip_log('optimiser_base_une_table ' . json_encode($tables, JSON_THROW_ON_ERROR), 'genie' . _LOG_DEBUG); |
|
| 99 | + spip_log('optimiser_base_une_table '.json_encode($tables, JSON_THROW_ON_ERROR), 'genie'._LOG_DEBUG); |
|
| 100 | 100 | if ($tables) { |
| 101 | 101 | $table_op = intval(lire_config('optimiser_table', 0) + 1) % sizeof($tables); |
| 102 | 102 | ecrire_config('optimiser_table', $table_op); |
| 103 | 103 | $q = $tables[$table_op]; |
| 104 | - spip_log("optimiser_base_une_table : debut d'optimisation de la table $q", 'genie' . _LOG_DEBUG); |
|
| 104 | + spip_log("optimiser_base_une_table : debut d'optimisation de la table $q", 'genie'._LOG_DEBUG); |
|
| 105 | 105 | if (sql_optimize($q)) { |
| 106 | - spip_log("optimiser_base_une_table : fin d'optimisation de la table $q", 'genie' . _LOG_DEBUG); |
|
| 106 | + spip_log("optimiser_base_une_table : fin d'optimisation de la table $q", 'genie'._LOG_DEBUG); |
|
| 107 | 107 | } else { |
| 108 | - spip_log("optimiser_base_une_table : Pas d'optimiseur necessaire", 'genie' . _LOG_DEBUG); |
|
| 108 | + spip_log("optimiser_base_une_table : Pas d'optimiseur necessaire", 'genie'._LOG_DEBUG); |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -140,8 +140,8 @@ discard block |
||
| 140 | 140 | sql_free($sel); |
| 141 | 141 | |
| 142 | 142 | if ($in) { |
| 143 | - sql_delete($table, sql_in($id, array_keys($in)) . ($and ? " AND $and" : '')); |
|
| 144 | - spip_log("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: " . implode(', ', array_keys($in)), 'genie' . _LOG_DEBUG); |
|
| 143 | + sql_delete($table, sql_in($id, array_keys($in)).($and ? " AND $and" : '')); |
|
| 144 | + spip_log("optimiser_sansref: Numeros des entrees $id supprimees dans la table $table: ".implode(', ', array_keys($in)), 'genie'._LOG_DEBUG); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | return count($in); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | if (!defined('_AUTEURS_DELAI_REJET_NOUVEAU')) { |
| 222 | 222 | define('_AUTEURS_DELAI_REJET_NOUVEAU', 45 * 24 * 3600); |
| 223 | 223 | } |
| 224 | - sql_delete('spip_auteurs', "statut='nouveau' AND maj < " . sql_quote(date('Y-m-d', time() - intval(_AUTEURS_DELAI_REJET_NOUVEAU)))); |
|
| 224 | + sql_delete('spip_auteurs', "statut='nouveau' AND maj < ".sql_quote(date('Y-m-d', time() - intval(_AUTEURS_DELAI_REJET_NOUVEAU)))); |
|
| 225 | 225 | |
| 226 | 226 | /** |
| 227 | 227 | * Permet aux plugins de compléter l'optimisation suite aux éléments disparus |
@@ -242,5 +242,5 @@ discard block |
||
| 242 | 242 | ]); |
| 243 | 243 | |
| 244 | 244 | |
| 245 | - spip_log("optimiser_base_disparus : {$n} lien(s) mort(s)", 'genie' . _LOG_DEBUG); |
|
| 245 | + spip_log("optimiser_base_disparus : {$n} lien(s) mort(s)", 'genie'._LOG_DEBUG); |
|
| 246 | 246 | } |
@@ -76,19 +76,19 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | switch ($objet) { |
| 78 | 78 | case 'article': |
| 79 | - $libelle .= ' ' . aider('logoart'); |
|
| 79 | + $libelle .= ' '.aider('logoart'); |
|
| 80 | 80 | break; |
| 81 | 81 | case 'breve': |
| 82 | - $libelle .= ' ' . aider('breveslogo'); |
|
| 82 | + $libelle .= ' '.aider('breveslogo'); |
|
| 83 | 83 | break; |
| 84 | 84 | case 'rubrique': |
| 85 | - $libelle .= ' ' . aider('rublogo'); |
|
| 85 | + $libelle .= ' '.aider('rublogo'); |
|
| 86 | 86 | break; |
| 87 | 87 | default: |
| 88 | 88 | break; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $options['titre'] = $img . $libelle; |
|
| 91 | + $options['titre'] = $img.$libelle; |
|
| 92 | 92 | } |
| 93 | 93 | if (!isset($options['editable'])) { |
| 94 | 94 | include_spip('inc/autoriser'); |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | foreach ($etats as $etat) { |
| 114 | 114 | $logo = $chercher_logo($id_objet, $_id_objet, $etat); |
| 115 | 115 | if ($logo) { |
| 116 | - $res['logo_' . $etat] = $logo[0]; |
|
| 117 | - $res['logo_id_' . $etat] = $logo[5]['id_document'] ?? ''; |
|
| 116 | + $res['logo_'.$etat] = $logo[0]; |
|
| 117 | + $res['logo_id_'.$etat] = $logo[5]['id_document'] ?? ''; |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | // pas de logo_on -> pas de formulaire pour le survol |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $extensions_possibles |
| 181 | 181 | ) |
| 182 | 182 | ) { |
| 183 | - $erreurs['logo_' . $etat] = _L('Extension non reconnue'); |
|
| 183 | + $erreurs['logo_'.$etat] = _L('Extension non reconnue'); |
|
| 184 | 184 | } |
| 185 | 185 | } elseif ($file and $file['error'] != 0 and isset($file['msg'])) { |
| 186 | 186 | $erreurs['message_erreur'] = $file['msg']; |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | include_spip('inc/documents'); |
| 266 | 266 | $sources = []; |
| 267 | 267 | foreach (['on', 'off'] as $etat) { |
| 268 | - $logo = 'logo_' . $etat; |
|
| 268 | + $logo = 'logo_'.$etat; |
|
| 269 | 269 | if (isset($_FILES[$logo])) { |
| 270 | 270 | if ($_FILES[$logo]['error'] == 0) { |
| 271 | 271 | $sources[$etat] = $_FILES[$logo]; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | return sql_getfetsel( |
| 37 | 37 | 'virtuel', |
| 38 | 38 | 'spip_articles', |
| 39 | - ['id_article=' . intval($id_article), "statut='publie'"], |
|
| 39 | + ['id_article='.intval($id_article), "statut='publie'"], |
|
| 40 | 40 | '', |
| 41 | 41 | '', |
| 42 | 42 | '', |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $cache_quete[$connect][$table][$id] = sql_fetsel( |
| 82 | 82 | $cache_quete[$connect][$table]['_select'], |
| 83 | 83 | $table, |
| 84 | - $cache_quete[$connect][$table]['_id'] . '=' . intval($id), |
|
| 84 | + $cache_quete[$connect][$table]['_id'].'='.intval($id), |
|
| 85 | 85 | '', |
| 86 | 86 | '', |
| 87 | 87 | '', |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | return |
| 174 | 174 | (isset($GLOBALS['meta']['date_prochain_postdate']) |
| 175 | 175 | and $GLOBALS['meta']['date_prochain_postdate'] > time()) |
| 176 | - ? "$champ_date<" . sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur) |
|
| 176 | + ? "$champ_date<".sql_quote(date('Y-m-d H:i:s', $GLOBALS['meta']['date_prochain_postdate']), $serveur) |
|
| 177 | 177 | : '1=1'; |
| 178 | 178 | } |
| 179 | 179 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | and $id_table = reset($objet) |
| 233 | 233 | and $objet = objet_type($id_table) |
| 234 | 234 | ) { |
| 235 | - $w = "$mstatut<>" . sql_quote($v); |
|
| 235 | + $w = "$mstatut<>".sql_quote($v); |
|
| 236 | 236 | |
| 237 | 237 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 238 | 238 | // sinon l’auteur en session |
@@ -246,22 +246,22 @@ discard block |
||
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 249 | - if (!autoriser('previsualiser' . $v, $objet, '', $id_auteur)) { |
|
| 249 | + if (!autoriser('previsualiser'.$v, $objet, '', $id_auteur)) { |
|
| 250 | 250 | // si pas d'auteur identifie pas de sous-requete car pas d'article qui matche |
| 251 | 251 | if (!$id_auteur) { |
| 252 | 252 | $where[] = $w; |
| 253 | 253 | } else { |
| 254 | 254 | $primary = id_table_objet($objet); |
| 255 | - $where[] = "($w OR $id_table.$primary IN (" . sql_get_select( |
|
| 255 | + $where[] = "($w OR $id_table.$primary IN (".sql_get_select( |
|
| 256 | 256 | 'ssss.id_objet', |
| 257 | 257 | 'spip_auteurs_liens AS ssss', |
| 258 | - 'ssss.objet=' . sql_quote($objet) . ' AND ssss.id_auteur=' . intval($id_auteur), |
|
| 258 | + 'ssss.objet='.sql_quote($objet).' AND ssss.id_auteur='.intval($id_auteur), |
|
| 259 | 259 | '', |
| 260 | 260 | '', |
| 261 | 261 | '', |
| 262 | 262 | '', |
| 263 | 263 | $serveur |
| 264 | - ) . '))'; |
|
| 264 | + ).'))'; |
|
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | } // ignorer ce statut si on ne sait pas comment le filtrer |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | * @return array|bool|null |
| 300 | 300 | */ |
| 301 | 301 | function quete_fichier($id_document, $serveur = '') { |
| 302 | - return sql_getfetsel('fichier', 'spip_documents', ('id_document=' . intval($id_document)), '', [], '', '', $serveur); |
|
| 302 | + return sql_getfetsel('fichier', 'spip_documents', ('id_document='.intval($id_document)), '', [], '', '', $serveur); |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | /** |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | * @return array|bool |
| 311 | 311 | */ |
| 312 | 312 | function quete_document($id_document, $serveur = '') { |
| 313 | - return sql_fetsel('*', 'spip_documents', ('id_document=' . intval($id_document)), '', [], '', '', $serveur); |
|
| 313 | + return sql_fetsel('*', 'spip_documents', ('id_document='.intval($id_document)), '', [], '', '', $serveur); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | /** |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | * @return array|bool|null |
| 322 | 322 | */ |
| 323 | 323 | function quete_meta($nom, $serveur) { |
| 324 | - return sql_getfetsel('valeur', 'spip_meta', 'nom=' . sql_quote($nom), '', '', '', '', $serveur); |
|
| 324 | + return sql_getfetsel('valeur', 'spip_meta', 'nom='.sql_quote($nom), '', '', '', '', $serveur); |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | /** |
@@ -377,9 +377,9 @@ discard block |
||
| 377 | 377 | // qui permet de distinguer le changement de logo |
| 378 | 378 | // et placer un expire sur le dossier IMG/ |
| 379 | 379 | $res = [ |
| 380 | - $on['chemin'] . ($on['timestamp'] ? "?{$on['timestamp']}" : ''), |
|
| 381 | - ($off ? $off['chemin'] . ($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''), |
|
| 382 | - (!$taille ? '' : (' ' . $taille[3])) |
|
| 380 | + $on['chemin'].($on['timestamp'] ? "?{$on['timestamp']}" : ''), |
|
| 381 | + ($off ? $off['chemin'].($off['timestamp'] ? "?{$off['timestamp']}" : '') : ''), |
|
| 382 | + (!$taille ? '' : (' '.$taille[3])) |
|
| 383 | 383 | ]; |
| 384 | 384 | $res['src'] = $res[0]; |
| 385 | 385 | $res['logo_on'] = $res[0]; |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | if ( |
| 490 | 490 | strcmp($logo, _DIR_PLUGINS) == 0 |
| 491 | 491 | or strcmp($logo, _DIR_PLUGINS_DIST) == 0 |
| 492 | - or strcmp($logo, _DIR_RACINE . 'prive/') == 0 |
|
| 492 | + or strcmp($logo, _DIR_RACINE.'prive/') == 0 |
|
| 493 | 493 | ) { |
| 494 | 494 | return $logo; |
| 495 | 495 | } |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | |
| 561 | 561 | foreach (['titre', 'descriptif', 'credits', 'alt'] as $champ) { |
| 562 | 562 | if (!empty($contexte[$champ])) { |
| 563 | - $contexte[$champ] = appliquer_traitement_champ($contexte[$champ] , $champ, 'document'); |
|
| 563 | + $contexte[$champ] = appliquer_traitement_champ($contexte[$champ], $champ, 'document'); |
|
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | 566 | |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | $exposer[$m][$type][$principal] = true; |
| 668 | 668 | if ($type == 'id_mot') { |
| 669 | 669 | if (!$parent) { |
| 670 | - $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot=' . intval($principal), '', '', '', '', $connect); |
|
| 670 | + $parent = sql_getfetsel('id_groupe', 'spip_mots', 'id_mot='.intval($principal), '', '', '', '', $connect); |
|
| 671 | 671 | } |
| 672 | 672 | if ($parent) { |
| 673 | 673 | $exposer[$m]['id_groupe'][$parent] = true; |
@@ -132,5 +132,5 @@ |
||
| 132 | 132 | |
| 133 | 133 | $align = preg_replace(',\W,', '', $align); |
| 134 | 134 | |
| 135 | - return "quete_html_logo($code, '$align', " . ($_lien ?: "''") . ')'; |
|
| 135 | + return "quete_html_logo($code, '$align', ".($_lien ?: "''").')'; |
|
| 136 | 136 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if ($fichier) { |
| 111 | 111 | $code = "quete_logo_file($doc, $qconnect)"; |
| 112 | 112 | } else { |
| 113 | - $code = "quete_logo_document($doc, " . ($lien ?: "''") . ", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)"; |
|
| 113 | + $code = "quete_logo_document($doc, ".($lien ?: "''").", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)"; |
|
| 114 | 114 | } |
| 115 | 115 | // (x=non-faux ? y : '') pour affecter x en retournant y |
| 116 | 116 | if ($p->descr['documents']) { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | // demande de reduction sur logo avec ecriture spip 2.1 : #LOGO_xxx{200, 0} |
| 135 | 135 | if ($coord_x or $coord_y) { |
| 136 | - $code = "filtrer('image_graver',filtrer('image_reduire'," . $code . ", '$coord_x', '$coord_y'))"; |
|
| 136 | + $code = "filtrer('image_graver',filtrer('image_reduire',".$code.", '$coord_x', '$coord_y'))"; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | $p->code = $code; |