@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | * @return void |
| 44 | 44 | **/ |
| 45 | 45 | function install_fichier_connexion($nom, $texte) { |
| 46 | - $texte = "<" . "?php\n" |
|
| 46 | + $texte = "<"."?php\n" |
|
| 47 | 47 | . "if (!defined(\"_ECRIRE_INC_VERSION\")) return;\n" |
| 48 | 48 | . $texte |
| 49 | - . "?" . ">"; |
|
| 49 | + . "?".">"; |
|
| 50 | 50 | |
| 51 | 51 | ecrire_fichier($nom, $texte); |
| 52 | 52 | } |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | return $regs; |
| 114 | 114 | } else { |
| 115 | 115 | $ar = '\s*\'([^\']*)\''; |
| 116 | - $r = '\s*,' . $ar; |
|
| 116 | + $r = '\s*,'.$ar; |
|
| 117 | 117 | $r = "#spip_connect_db[(]$ar$r$r$r$r(?:$r(?:$r(?:$r(?:$r)?)?)?)?#"; |
| 118 | 118 | if (preg_match($r, $s, $regs)) { |
| 119 | - $regs[2] = $regs[1] . (!$regs[2] ? '' : ":" . $regs[2] . ";"); |
|
| 119 | + $regs[2] = $regs[1].(!$regs[2] ? '' : ":".$regs[2].";"); |
|
| 120 | 120 | array_shift($regs); |
| 121 | 121 | array_shift($regs); |
| 122 | 122 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | // Si on n'a pas la bonne version de PHP, c'est la fin |
| 175 | 175 | if ($err) { |
| 176 | 176 | die("<div class='error'>" |
| 177 | - . "<h3>" . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>" |
|
| 177 | + . "<h3>"._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>" |
|
| 178 | 178 | . "<li><strong>{$err[0]}</strong></li>\n</ul></div>"); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | if ($err) { |
| 203 | 203 | echo "<div class='error'>" |
| 204 | - . "<h3>" . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>"; |
|
| 204 | + . "<h3>"._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>"; |
|
| 205 | 205 | foreach ($err as $e) { |
| 206 | 206 | echo "<li><strong>$e</strong></li>\n"; |
| 207 | 207 | } |
@@ -235,8 +235,8 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | // https://code.spip.net/@info_etape |
| 237 | 237 | function info_etape($titre, $complement = '') { |
| 238 | - return "<h2>" . $titre . "</h2>\n" . |
|
| 239 | - ($complement ? "" . $complement . "\n" : ''); |
|
| 238 | + return "<h2>".$titre."</h2>\n". |
|
| 239 | + ($complement ? "".$complement."\n" : ''); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /** |
@@ -250,18 +250,18 @@ discard block |
||
| 250 | 250 | $code = _T('bouton_suivant'); |
| 251 | 251 | } |
| 252 | 252 | static $suivant = 0; |
| 253 | - $id = 'suivant' . (($suivant > 0) ? strval($suivant) : ''); |
|
| 253 | + $id = 'suivant'.(($suivant > 0) ? strval($suivant) : ''); |
|
| 254 | 254 | $suivant += 1; |
| 255 | 255 | |
| 256 | - return "\n<p class='boutons suivant'><input id='" . $id . "' type='submit'\nvalue=\"" . |
|
| 257 | - $code . |
|
| 256 | + return "\n<p class='boutons suivant'><input id='".$id."' type='submit'\nvalue=\"". |
|
| 257 | + $code. |
|
| 258 | 258 | " >>\" /></p>\n"; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | // https://code.spip.net/@info_progression_etape |
| 262 | 262 | function info_progression_etape($en_cours, $phase, $dir, $erreur = false) { |
| 263 | 263 | //$en_cours = _request('etape')?_request('etape'):""; |
| 264 | - $liste = find_all_in_path($dir, $phase . '(([0-9])+|fin)[.]php$'); |
|
| 264 | + $liste = find_all_in_path($dir, $phase.'(([0-9])+|fin)[.]php$'); |
|
| 265 | 265 | $debut = 1; |
| 266 | 266 | $etat = "ok"; |
| 267 | 267 | $last = count($liste); |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | $aff_etapes .= "<li class='$class'><div class='fond'>"; |
| 302 | 302 | $aff_etapes .= ($debut == $en_cours) ? "<strong>" : ''; |
| 303 | - $aff_etapes .= "<em>" . _T('etape') . " </em><span class='numero_etape'>$debut</span><em> : </em>"; |
|
| 303 | + $aff_etapes .= "<em>"._T('etape')." </em><span class='numero_etape'>$debut</span><em> : </em>"; |
|
| 304 | 304 | $aff_etapes .= $intitule_etat["$phase"][$debut]; |
| 305 | 305 | $aff_etapes .= ($debut == $en_cours) ? "</strong>" : ''; |
| 306 | 306 | $aff_etapes .= "</div></li>"; |
@@ -316,11 +316,11 @@ discard block |
||
| 316 | 316 | |
| 317 | 317 | // https://code.spip.net/@fieldset |
| 318 | 318 | function fieldset($legend, $champs = array(), $apres = '', $avant = '') { |
| 319 | - return "<fieldset>\n" . |
|
| 320 | - $avant . |
|
| 321 | - ($legend ? "<legend>" . $legend . "</legend>\n" : '') . |
|
| 322 | - fieldset_champs($champs) . |
|
| 323 | - $apres . |
|
| 319 | + return "<fieldset>\n". |
|
| 320 | + $avant. |
|
| 321 | + ($legend ? "<legend>".$legend."</legend>\n" : ''). |
|
| 322 | + fieldset_champs($champs). |
|
| 323 | + $apres. |
|
| 324 | 324 | "</fieldset>\n"; |
| 325 | 325 | } |
| 326 | 326 | |
@@ -330,18 +330,18 @@ discard block |
||
| 330 | 330 | $type = isset($contenu['hidden']) ? 'hidden' : (preg_match(',^pass,', $nom) ? 'password' : 'text'); |
| 331 | 331 | $class = isset($contenu['hidden']) ? '' : "class='formo' size='40' "; |
| 332 | 332 | if (isset($contenu['alternatives'])) { |
| 333 | - $fieldset .= $contenu['label'] . "\n"; |
|
| 333 | + $fieldset .= $contenu['label']."\n"; |
|
| 334 | 334 | foreach ($contenu['alternatives'] as $valeur => $label) { |
| 335 | - $fieldset .= "<input type='radio' name='" . $nom . |
|
| 335 | + $fieldset .= "<input type='radio' name='".$nom. |
|
| 336 | 336 | "' id='$nom-$valeur' value='$valeur'" |
| 337 | 337 | . (($valeur == $contenu['valeur']) ? "\nchecked='checked'" : '') |
| 338 | 338 | . "/>\n"; |
| 339 | - $fieldset .= "<label for='$nom-$valeur'>" . $label . "</label>\n"; |
|
| 339 | + $fieldset .= "<label for='$nom-$valeur'>".$label."</label>\n"; |
|
| 340 | 340 | } |
| 341 | 341 | $fieldset .= "<br />\n"; |
| 342 | 342 | } else { |
| 343 | - $fieldset .= "<label for='" . $nom . "'>" . $contenu['label'] . "</label>\n"; |
|
| 344 | - $fieldset .= "<input " . $class . "type='" . $type . "' id='" . $nom . "' name='" . $nom . "'\nvalue='" . $contenu['valeur'] . "'" |
|
| 343 | + $fieldset .= "<label for='".$nom."'>".$contenu['label']."</label>\n"; |
|
| 344 | + $fieldset .= "<input ".$class."type='".$type."' id='".$nom."' name='".$nom."'\nvalue='".$contenu['valeur']."'" |
|
| 345 | 345 | . (preg_match(',^(pass|login),', $nom) ? " autocomplete='off'" : '') |
| 346 | 346 | . ((isset($contenu['required']) and $contenu['required']) ? " required='required'" : "") |
| 347 | 347 | . " />\n"; |
@@ -353,24 +353,24 @@ discard block |
||
| 353 | 353 | |
| 354 | 354 | function install_select_serveur() { |
| 355 | 355 | $options = array(); |
| 356 | - $dir = _DIR_RESTREINT . 'req/'; |
|
| 356 | + $dir = _DIR_RESTREINT.'req/'; |
|
| 357 | 357 | $d = opendir($dir); |
| 358 | 358 | if (!$d) { |
| 359 | 359 | return array(); |
| 360 | 360 | } |
| 361 | 361 | while (($f = readdir($d)) !== false) { |
| 362 | 362 | if ((preg_match('/^(.*)[.]php$/', $f, $s)) |
| 363 | - and is_readable($f = $dir . $f) |
|
| 363 | + and is_readable($f = $dir.$f) |
|
| 364 | 364 | ) { |
| 365 | 365 | require_once($f); |
| 366 | 366 | $s = $s[1]; |
| 367 | - $v = 'spip_versions_' . $s; |
|
| 367 | + $v = 'spip_versions_'.$s; |
|
| 368 | 368 | if (function_exists($v) and $v()) { |
| 369 | 369 | $titre = _T("install_select_type_$s"); |
| 370 | 370 | // proposer mysql par defaut si dispo |
| 371 | 371 | $checked = ($s == 'mysql' ? " checked='checked'" : ""); |
| 372 | 372 | $options[$s] = "<li><input type='radio' id='$s' value='$s' name='server_db'$checked>" |
| 373 | - . "<label for='$s'>" . ($titre ? $titre : $s) . "</label></li>"; |
|
| 373 | + . "<label for='$s'>".($titre ? $titre : $s)."</label></li>"; |
|
| 374 | 374 | } else { |
| 375 | 375 | spip_log("$s: portage indisponible"); |
| 376 | 376 | } |
@@ -389,8 +389,8 @@ discard block |
||
| 389 | 389 | "\n<input type='hidden' name='etape' value='$etape' />" |
| 390 | 390 | . $hidden |
| 391 | 391 | . (_request('echec') ? |
| 392 | - ("<p><b>" . _T('avis_connexion_echec_1') . |
|
| 393 | - "</b></p><p>" . _T('avis_connexion_echec_2') . "</p><p style='font-size: small;'>" . _T('avis_connexion_echec_3') . "</p>") |
|
| 392 | + ("<p><b>"._T('avis_connexion_echec_1'). |
|
| 393 | + "</b></p><p>"._T('avis_connexion_echec_2')."</p><p style='font-size: small;'>"._T('avis_connexion_echec_3')."</p>") |
|
| 394 | 394 | : "") |
| 395 | 395 | |
| 396 | 396 | . ($jquery ? http_script('', 'jquery.js') : '') |
@@ -428,9 +428,9 @@ discard block |
||
| 428 | 428 | });') |
| 429 | 429 | |
| 430 | 430 | . ($server_db |
| 431 | - ? '<input type="hidden" name="server_db" value="' . $server_db . '" />' |
|
| 431 | + ? '<input type="hidden" name="server_db" value="'.$server_db.'" />' |
|
| 432 | 432 | . (($predef[0]) |
| 433 | - ? ('<h3>' . _T('install_serveur_hebergeur') . '</h3>') |
|
| 433 | + ? ('<h3>'._T('install_serveur_hebergeur').'</h3>') |
|
| 434 | 434 | : '') |
| 435 | 435 | : ('<fieldset><legend>' |
| 436 | 436 | . _T('install_select_type_db') |
@@ -445,9 +445,9 @@ discard block |
||
| 445 | 445 | . "\n</ul>\n</div></fieldset>") |
| 446 | 446 | ) |
| 447 | 447 | . '<div id="install_adresse_base_hebergeur">' |
| 448 | - . '<p>' . _T('texte_connexion_mysql') . '</p>' |
|
| 448 | + . '<p>'._T('texte_connexion_mysql').'</p>' |
|
| 449 | 449 | . ($predef[1] |
| 450 | - ? '<h3>' . _T('install_adresse_base_hebergeur') . '</h3>' |
|
| 450 | + ? '<h3>'._T('install_adresse_base_hebergeur').'</h3>' |
|
| 451 | 451 | : fieldset(_T('entree_base_donnee_1'), |
| 452 | 452 | array( |
| 453 | 453 | 'adresse_db' => array( |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | |
| 462 | 462 | . '<div id="install_login_base_hebergeur">' |
| 463 | 463 | . ($predef[2] |
| 464 | - ? '<h3>' . _T('install_login_base_hebergeur') . '</h3>' |
|
| 464 | + ? '<h3>'._T('install_login_base_hebergeur').'</h3>' |
|
| 465 | 465 | : fieldset(_T('entree_login_connexion_1'), |
| 466 | 466 | array( |
| 467 | 467 | 'login_db' => array( |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | |
| 476 | 476 | . '<div id="install_pass_base_hebergeur">' |
| 477 | 477 | . ($predef[3] |
| 478 | - ? '<h3>' . _T('install_pass_base_hebergeur') . '</h3>' |
|
| 478 | + ? '<h3>'._T('install_pass_base_hebergeur').'</h3>' |
|
| 479 | 479 | : fieldset(_T('entree_mot_passe_1'), |
| 480 | 480 | array( |
| 481 | 481 | 'pass_db' => array( |
@@ -498,20 +498,20 @@ discard block |
||
| 498 | 498 | function predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db) { |
| 499 | 499 | return ((defined('_INSTALL_HOST_DB')) |
| 500 | 500 | ? '' |
| 501 | - : "\n<input type='hidden' name='adresse_db' value=\"" . spip_htmlspecialchars($adresse_db) . "\" />" |
|
| 501 | + : "\n<input type='hidden' name='adresse_db' value=\"".spip_htmlspecialchars($adresse_db)."\" />" |
|
| 502 | 502 | ) |
| 503 | 503 | . ((defined('_INSTALL_USER_DB')) |
| 504 | 504 | ? '' |
| 505 | - : "\n<input type='hidden' name='login_db' value=\"" . spip_htmlspecialchars($login_db) . "\" />" |
|
| 505 | + : "\n<input type='hidden' name='login_db' value=\"".spip_htmlspecialchars($login_db)."\" />" |
|
| 506 | 506 | ) |
| 507 | 507 | . ((defined('_INSTALL_PASS_DB')) |
| 508 | 508 | ? '' |
| 509 | - : "\n<input type='hidden' name='pass_db' value=\"" . spip_htmlspecialchars($pass_db) . "\" />" |
|
| 509 | + : "\n<input type='hidden' name='pass_db' value=\"".spip_htmlspecialchars($pass_db)."\" />" |
|
| 510 | 510 | ) |
| 511 | 511 | |
| 512 | 512 | . ((defined('_INSTALL_SERVER_DB')) |
| 513 | 513 | ? '' |
| 514 | - : "\n<input type='hidden' name='server_db' value=\"" . spip_htmlspecialchars($server_db) . "\" />" |
|
| 514 | + : "\n<input type='hidden' name='server_db' value=\"".spip_htmlspecialchars($server_db)."\" />" |
|
| 515 | 515 | ); |
| 516 | 516 | } |
| 517 | 517 | |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | ); |
| 44 | 44 | $style_titre_mapping = array('couleur' => 'topper', 'trait-couleur' => 'section'); |
| 45 | 45 | $c = isset($style_mapping[$style]) ? $style_mapping[$style] : 'simple'; |
| 46 | - $class = $c . ($class ? " $class" : ""); |
|
| 46 | + $class = $c.($class ? " $class" : ""); |
|
| 47 | 47 | if (!$padding) { |
| 48 | - $class .= ($class ? " " : "") . "no-padding"; |
|
| 48 | + $class .= ($class ? " " : "")."no-padding"; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | //($id?"id='$id' ":"") |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | if ($fonction) { |
| 61 | 61 | // 2 images pour composer l'icone : le fond (article) en background, |
| 62 | 62 | // la fonction (new) en image |
| 63 | - $icone = http_img_pack($fonction, "", "class='cadre-icone' width='$size' height='$size'\n" . |
|
| 63 | + $icone = http_img_pack($fonction, "", "class='cadre-icone' width='$size' height='$size'\n". |
|
| 64 | 64 | http_style_background($fond, "no-repeat center center", $size)); |
| 65 | 65 | } else { |
| 66 | 66 | $icone = http_img_pack($fond, "", "class='cadre-icone' width='$size' height='$size'"); |
| 67 | 67 | } |
| 68 | - $titre = $icone . $titre; |
|
| 68 | + $titre = $icone.$titre; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | return boite_ouvrir($titre, $class, isset($style_titre_mapping[$style]) ? $style_titre_mapping[$style] : '', $id); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $titre, |
| 160 | 160 | $ze_logo = '' |
| 161 | 161 | ) { |
| 162 | - return "<h1 class = 'grostitre'>" . $ze_logo . ' ' . typo($titre) . "</h1>\n"; |
|
| 162 | + return "<h1 class = 'grostitre'>".$ze_logo.' '.typo($titre)."</h1>\n"; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | // La boite des raccourcis |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | // https://code.spip.net/@bloc_des_raccourcis |
| 168 | 168 | function bloc_des_raccourcis($bloc) { |
| 169 | 169 | return creer_colonne_droite() |
| 170 | - . boite_ouvrir(_T('titre_cadre_raccourcis'), 'raccourcis') . $bloc . boite_fermer(); |
|
| 170 | + . boite_ouvrir(_T('titre_cadre_raccourcis'), 'raccourcis').$bloc.boite_fermer(); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | // |
@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | $class_li .= " error"; |
| 57 | 57 | $erreur = http_img_pack("plugin-err-32.png", _T('plugin_info_erreur_xml'), " class='picto_err'", |
| 58 | 58 | _T('plugin_info_erreur_xml')) |
| 59 | - . "<div class='erreur'>" . join('<br >', $info['erreur']) . "</div>"; |
|
| 59 | + . "<div class='erreur'>".join('<br >', $info['erreur'])."</div>"; |
|
| 60 | 60 | $checkable = false; |
| 61 | - } elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) { |
|
| 61 | + } elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])) { |
|
| 62 | 62 | $class_li .= " error"; |
| 63 | 63 | $erreur = http_img_pack("plugin-err-32.png", _T('plugin_impossible_activer', array('plugin' => $nom)), |
| 64 | 64 | " class='picto_err'", _T('plugin_impossible_activer', array('plugin' => $nom))) |
| 65 | - . "<div class='erreur'>" . implode("<br />", |
|
| 66 | - $GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file]) . "</div>"; |
|
| 65 | + . "<div class='erreur'>".implode("<br />", |
|
| 66 | + $GLOBALS['erreurs_activation_raw'][$dir_plugins.$plug_file])."</div>"; |
|
| 67 | 67 | } else { |
| 68 | 68 | $cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : ""; |
| 69 | 69 | } |
@@ -71,11 +71,11 @@ discard block |
||
| 71 | 71 | // numerotons les occurrences d'un meme prefix |
| 72 | 72 | $versions[$prefix] = $id = isset($versions[$prefix]) ? intval($versions[$prefix]) + 1 : ''; |
| 73 | 73 | |
| 74 | - $class_li .= ($actif ? " actif" : "") . ($expose ? " on" : ""); |
|
| 74 | + $class_li .= ($actif ? " actif" : "").($expose ? " on" : ""); |
|
| 75 | 75 | |
| 76 | 76 | return "<li id='$prefix$id' class='$class_li'>" |
| 77 | 77 | . ((!$checkable and !$checked) |
| 78 | - ? '' : plugin_checkbox(++$id_input, $dir_plugins . $plug_file, $checked)) |
|
| 78 | + ? '' : plugin_checkbox(++$id_input, $dir_plugins.$plug_file, $checked)) |
|
| 79 | 79 | . plugin_resume($info, $dir_plugins, $plug_file, $url_page) |
| 80 | 80 | . $cfg |
| 81 | 81 | . $erreur |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | $prefix = strtolower($infos['prefix']); |
| 94 | 94 | // si paquet.xml fournit un squelette, le prendre |
| 95 | 95 | if (isset($infos['config']) and $infos['config']) { |
| 96 | - return recuperer_fond("$dir$nom/" . $infos['config'], |
|
| 96 | + return recuperer_fond("$dir$nom/".$infos['config'], |
|
| 97 | 97 | array( |
| 98 | - 'script' => 'configurer_' . $prefix, |
|
| 98 | + 'script' => 'configurer_'.$prefix, |
|
| 99 | 99 | 'nom' => $nom |
| 100 | 100 | )); |
| 101 | 101 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | // sinon prendre le squelette std sur le nom std |
| 114 | 114 | return recuperer_fond("prive/squelettes/inclure/cfg", |
| 115 | 115 | array( |
| 116 | - 'script' => 'configurer_' . $prefix, |
|
| 116 | + 'script' => 'configurer_'.$prefix, |
|
| 117 | 117 | 'nom' => $nom |
| 118 | 118 | )); |
| 119 | 119 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | . "<input type='checkbox' name='s$name' id='label_$id_input'" |
| 129 | 129 | . ($actif ? " checked='checked'" : "") |
| 130 | 130 | . " class='checkbox' value='O' />" |
| 131 | - . "\n<label for='label_$id_input'>" . _T('activer_plugin') . "</label>" |
|
| 131 | + . "\n<label for='label_$id_input'>"._T('activer_plugin')."</label>" |
|
| 132 | 132 | . "</div>"; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -176,11 +176,11 @@ discard block |
||
| 176 | 176 | . "<h3><a href='$url' rel='info'>" |
| 177 | 177 | . $nom |
| 178 | 178 | . "</a></h3>" |
| 179 | - . " <span class='version'>" . $info['version'] . "</span>" |
|
| 179 | + . " <span class='version'>".$info['version']."</span>" |
|
| 180 | 180 | . " <span class='etat'> - " |
| 181 | 181 | . plugin_etat_en_clair($info['etat']) |
| 182 | 182 | . "</span>" |
| 183 | - . "<div class='short'>" . $slogan . "</div>" |
|
| 183 | + . "<div class='short'>".$slogan."</div>" |
|
| 184 | 184 | . $i |
| 185 | 185 | . "</div>"; |
| 186 | 186 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $text2 = _T('info_desinstaller_plugin'); |
| 196 | 196 | $file = basename($plug_file); |
| 197 | 197 | |
| 198 | - return "<div class='actions'>[" . |
|
| 198 | + return "<div class='actions'>[". |
|
| 199 | 199 | "<a href='$action' |
| 200 | 200 | onclick='return confirm(\"$text $nom ?\\n$text2\")'>" |
| 201 | 201 | . $text |
@@ -217,17 +217,17 @@ discard block |
||
| 217 | 217 | $etat = 'developpement'; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - return _T('plugin_etat_' . $etat); |
|
| 220 | + return _T('plugin_etat_'.$etat); |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | // https://code.spip.net/@plugin_propre |
| 224 | -function plugin_propre($texte, $module = '',$propre='propre') { |
|
| 224 | +function plugin_propre($texte, $module = '', $propre = 'propre') { |
|
| 225 | 225 | // retirer le retour a la racine du module, car le find_in_path se fait depuis la racine |
| 226 | 226 | if (_DIR_RACINE and strncmp($module, _DIR_RACINE, strlen(_DIR_RACINE)) == 0) { |
| 227 | 227 | $module = substr($module, strlen(_DIR_RACINE)); |
| 228 | 228 | } |
| 229 | 229 | if (preg_match("|^\w+_[\w_]+$|", $texte)) { |
| 230 | - $texte = _T(($module ? "$module:" : '') . $texte, array(), array('force' => false)); |
|
| 230 | + $texte = _T(($module ? "$module:" : '').$texte, array(), array('force' => false)); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | return $propre($texte); |
@@ -259,9 +259,9 @@ discard block |
||
| 259 | 259 | if (isset($info['documentation']) |
| 260 | 260 | and $lien = $info['documentation'] |
| 261 | 261 | ) { |
| 262 | - $description .= "<p><em class='site'><a href='$lien' class='spip_out'>" . _T('en_savoir_plus') . '</a></em></p>'; |
|
| 262 | + $description .= "<p><em class='site'><a href='$lien' class='spip_out'>"._T('en_savoir_plus').'</a></em></p>'; |
|
| 263 | 263 | } |
| 264 | - $s .= "<dd class='desc'>" . $description . "</dd>\n"; |
|
| 264 | + $s .= "<dd class='desc'>".$description."</dd>\n"; |
|
| 265 | 265 | |
| 266 | 266 | if (isset($info['auteur'])) { |
| 267 | 267 | if (is_array($info['auteur'])) { |
@@ -271,15 +271,15 @@ discard block |
||
| 271 | 271 | $a = trim($info['auteur']); |
| 272 | 272 | } |
| 273 | 273 | if ($a) { |
| 274 | - $s .= "<dt class='auteurs'>" . _T('public:par_auteur') . "</dt><dd class='auteurs'>" . PtoBR(propre($a, |
|
| 275 | - $dir)) . "</dd>\n"; |
|
| 274 | + $s .= "<dt class='auteurs'>"._T('public:par_auteur')."</dt><dd class='auteurs'>".PtoBR(propre($a, |
|
| 275 | + $dir))."</dd>\n"; |
|
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | if (isset($info['credit'])) { |
| 280 | 280 | if ($a = formater_credits($info['credit'], ', ')) { |
| 281 | - $s .= "<dt class='credits'>" . _T('plugin_info_credit') . "</dt><dd class='credits'>" . PtoBR(propre($a, |
|
| 282 | - $dir)) . "</dd>\n"; |
|
| 281 | + $s .= "<dt class='credits'>"._T('plugin_info_credit')."</dt><dd class='credits'>".PtoBR(propre($a, |
|
| 282 | + $dir))."</dd>\n"; |
|
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | $a = trim($info['licence']); |
| 292 | 292 | } |
| 293 | 293 | if ($a) { |
| 294 | - $s .= "<dt class='licence'>" . _T('intitule_licence') . "</dt><dd class='licence'>" . PtoBR(propre($a, |
|
| 295 | - $dir)) . "</dd>\n"; |
|
| 294 | + $s .= "<dt class='licence'>"._T('intitule_licence')."</dt><dd class='licence'>".PtoBR(propre($a, |
|
| 295 | + $dir))."</dd>\n"; |
|
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | |
@@ -303,23 +303,22 @@ discard block |
||
| 303 | 303 | // |
| 304 | 304 | $infotech = array(); |
| 305 | 305 | |
| 306 | - $version = "<dt>" . _T('version') . "</dt><dd>" . $info['version']; |
|
| 306 | + $version = "<dt>"._T('version')."</dt><dd>".$info['version']; |
|
| 307 | 307 | // Version VCS |
| 308 | - if ($vcs = version_vcs_courante($dir_plugins . $plug_file)) { |
|
| 309 | - $version .= ' ' . $vcs; |
|
| 308 | + if ($vcs = version_vcs_courante($dir_plugins.$plug_file)) { |
|
| 309 | + $version .= ' '.$vcs; |
|
| 310 | 310 | } |
| 311 | 311 | $version .= "</dd>"; |
| 312 | 312 | $infotech[] = $version; |
| 313 | - $infotech[] = "<dt>" . _T('repertoire_plugins') . "</dt><dd>" . joli_repertoire("$dir_plugins$plug_file") . "</dd>"; |
|
| 313 | + $infotech[] = "<dt>"._T('repertoire_plugins')."</dt><dd>".joli_repertoire("$dir_plugins$plug_file")."</dd>"; |
|
| 314 | 314 | // source zip le cas echeant |
| 315 | - $infotech[] = (lire_fichier($dir_plugins . $plug_file . '/install.log', $log) |
|
| 315 | + $infotech[] = (lire_fichier($dir_plugins.$plug_file.'/install.log', $log) |
|
| 316 | 316 | and preg_match(',^source:(.*)$,m', $log, $r)) |
| 317 | - ? '<dt>' . _T('plugin_source') . '</dt><dd>' . trim($r[1]) . "</dd>" |
|
| 317 | + ? '<dt>'._T('plugin_source').'</dt><dd>'.trim($r[1])."</dd>" |
|
| 318 | 318 | : ''; |
| 319 | 319 | |
| 320 | - $infotech[] = !$info['necessite'] ? '' : |
|
| 321 | - ('<dt>' . _T('plugin_info_necessite') . '</dt><dd>' . join(' ', |
|
| 322 | - array_map('array_shift', $info['necessite'])) . '</dd>'); |
|
| 320 | + $infotech[] = !$info['necessite'] ? '' : ('<dt>'._T('plugin_info_necessite').'</dt><dd>'.join(' ', |
|
| 321 | + array_map('array_shift', $info['necessite'])).'</dd>'); |
|
| 323 | 322 | |
| 324 | 323 | $s .= "<dl class='tech'>" |
| 325 | 324 | . join('', $infotech) |
@@ -340,8 +339,8 @@ discard block |
||
| 340 | 339 | $texte .= |
| 341 | 340 | (!is_array($_credit)) |
| 342 | 341 | ? PtoBR(propre($_credit)) |
| 343 | - : ($_credit['url'] ? '<a href="' . $_credit['url'] . '">' : '') . |
|
| 344 | - $_credit['nom'] . |
|
| 342 | + : ($_credit['url'] ? '<a href="'.$_credit['url'].'">' : ''). |
|
| 343 | + $_credit['nom']. |
|
| 345 | 344 | ($_credit['url'] ? '</a>' : ''); |
| 346 | 345 | } |
| 347 | 346 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | = spip_connect_db($adresse_db, $port, $login_db, $pass_db, '', $server_db); |
| 46 | 46 | |
| 47 | 47 | $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']] |
| 48 | - = $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']]; |
|
| 48 | + = $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']]; |
|
| 49 | 49 | |
| 50 | 50 | $fquery = sql_serveur('query', $server_db); |
| 51 | 51 | if ($choix_db == 'new_spip') { |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | if (!$ok) { |
| 56 | 56 | $re = "Impossible de creer la base $re"; |
| 57 | 57 | spip_log($re); |
| 58 | - return '<p>' . _T('avis_connexion_erreur_creer_base') . "</p><!--\n$re\n-->"; |
|
| 58 | + return '<p>'._T('avis_connexion_erreur_creer_base')."</p><!--\n$re\n-->"; |
|
| 59 | 59 | } |
| 60 | 60 | } else { |
| 61 | 61 | $re = "Le nom de la base doit correspondre a $re"; |
| 62 | 62 | spip_log($re); |
| 63 | 63 | |
| 64 | - return '<p>' . _T('avis_connexion_erreur_nom_base') . "</p><!--\n$re\n-->"; |
|
| 64 | + return '<p>'._T('avis_connexion_erreur_nom_base')."</p><!--\n$re\n-->"; |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
@@ -72,14 +72,14 @@ discard block |
||
| 72 | 72 | = spip_connect_db($adresse_db, $port, $login_db, $pass_db, $sel_db, $server_db); |
| 73 | 73 | |
| 74 | 74 | $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']] |
| 75 | - = $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']]; |
|
| 75 | + = $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']]; |
|
| 76 | 76 | |
| 77 | 77 | // Completer le tableau decrivant la connexion |
| 78 | 78 | |
| 79 | 79 | $GLOBALS['connexions'][$server_db]['prefixe'] = $table_prefix; |
| 80 | 80 | $GLOBALS['connexions'][$server_db]['db'] = $sel_db; |
| 81 | 81 | |
| 82 | - $old = sql_showbase($table_prefix . '_meta', $server_db); |
|
| 82 | + $old = sql_showbase($table_prefix.'_meta', $server_db); |
|
| 83 | 83 | if ($old) { |
| 84 | 84 | $old = sql_fetch($old, $server_db); |
| 85 | 85 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $charset['charset']; |
| 99 | 99 | $charsetbase = $charset['charset']; |
| 100 | 100 | } else { |
| 101 | - spip_log(_DEFAULT_CHARSET . ' inconnu du serveur SQL'); |
|
| 101 | + spip_log(_DEFAULT_CHARSET.' inconnu du serveur SQL'); |
|
| 102 | 102 | $charsetbase = 'standard'; |
| 103 | 103 | } |
| 104 | 104 | spip_log("Creation des tables. Codage $charsetbase"); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if ($r) { |
| 149 | 149 | $r = sql_fetch($r, $server_db); |
| 150 | 150 | } |
| 151 | - $version_installee = !$r ? 0 : (double)$r['valeur']; |
|
| 151 | + $version_installee = !$r ? 0 : (double) $r['valeur']; |
|
| 152 | 152 | if (!$version_installee or ($GLOBALS['spip_version_base'] < $version_installee)) { |
| 153 | 153 | $fupdateq( |
| 154 | 154 | 'spip_meta', |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | '', |
| 158 | 158 | $server_db |
| 159 | 159 | ); |
| 160 | - spip_log('nouvelle version installee: ' . $GLOBALS['spip_version_base']); |
|
| 160 | + spip_log('nouvelle version installee: '.$GLOBALS['spip_version_base']); |
|
| 161 | 161 | } |
| 162 | 162 | // eliminer la derniere operation d'admin mal terminee |
| 163 | 163 | // notamment la mise a jour |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | if ($chmod_db) { |
| 185 | 185 | install_fichier_connexion( |
| 186 | 186 | _FILE_CHMOD_TMP, |
| 187 | - "if (!defined('_SPIP_CHMOD')) define('_SPIP_CHMOD', " . sprintf('0%3o', $chmod_db) . ");\n" |
|
| 187 | + "if (!defined('_SPIP_CHMOD')) define('_SPIP_CHMOD', ".sprintf('0%3o', $chmod_db).");\n" |
|
| 188 | 188 | ); |
| 189 | 189 | } |
| 190 | 190 | |
@@ -249,16 +249,16 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | // https://code.spip.net/@install_premier_auteur |
| 251 | 251 | function install_premier_auteur($email, $login, $nom, $pass, $hidden, $auteur_obligatoire) { |
| 252 | - return info_progression_etape(3, 'etape_', 'install/') . |
|
| 252 | + return info_progression_etape(3, 'etape_', 'install/'). |
|
| 253 | 253 | info_etape( |
| 254 | 254 | _T('info_informations_personnelles'), |
| 255 | - '<b>' . _T('texte_informations_personnelles_1') . '</b>' . |
|
| 256 | - aider('install5', true) . |
|
| 257 | - '<p>' . |
|
| 255 | + '<b>'._T('texte_informations_personnelles_1').'</b>'. |
|
| 256 | + aider('install5', true). |
|
| 257 | + '<p>'. |
|
| 258 | 258 | ($auteur_obligatoire ? |
| 259 | 259 | '' |
| 260 | 260 | : |
| 261 | - _T('texte_informations_personnelles_2') . ' ' . _T('info_laisser_champs_vides') |
|
| 261 | + _T('texte_informations_personnelles_2').' '._T('info_laisser_champs_vides') |
|
| 262 | 262 | ) |
| 263 | 263 | ) |
| 264 | 264 | . generer_form_ecrire('install', ( |
@@ -268,12 +268,12 @@ discard block |
||
| 268 | 268 | _T('info_identification_publique'), |
| 269 | 269 | array( |
| 270 | 270 | 'nom' => array( |
| 271 | - 'label' => '<b>' . _T('entree_signature') . "</b><br />\n" . _T('entree_nom_pseudo_1') . "\n", |
|
| 271 | + 'label' => '<b>'._T('entree_signature')."</b><br />\n"._T('entree_nom_pseudo_1')."\n", |
|
| 272 | 272 | 'valeur' => $nom, |
| 273 | 273 | 'required' => $auteur_obligatoire, |
| 274 | 274 | ), |
| 275 | 275 | 'email' => array( |
| 276 | - 'label' => '<b>' . _T('entree_adresse_email') . "</b>\n", |
|
| 276 | + 'label' => '<b>'._T('entree_adresse_email')."</b>\n", |
|
| 277 | 277 | 'valeur' => $email, |
| 278 | 278 | ) |
| 279 | 279 | ) |
@@ -283,23 +283,23 @@ discard block |
||
| 283 | 283 | _T('entree_identifiants_connexion'), |
| 284 | 284 | array( |
| 285 | 285 | 'login' => array( |
| 286 | - 'label' => '<b>' . _T('entree_login') . "</b><br />\n" . _T( |
|
| 286 | + 'label' => '<b>'._T('entree_login')."</b><br />\n"._T( |
|
| 287 | 287 | 'info_login_trop_court_car_pluriel', |
| 288 | 288 | array('nb' => _LOGIN_TROP_COURT) |
| 289 | - ) . "\n", |
|
| 289 | + )."\n", |
|
| 290 | 290 | 'valeur' => $login, |
| 291 | 291 | 'required' => $auteur_obligatoire, |
| 292 | 292 | ), |
| 293 | 293 | 'pass' => array( |
| 294 | - 'label' => '<b>' . _T('entree_mot_passe') . "</b><br />\n" . _T( |
|
| 294 | + 'label' => '<b>'._T('entree_mot_passe')."</b><br />\n"._T( |
|
| 295 | 295 | 'info_passe_trop_court_car_pluriel', |
| 296 | 296 | array('nb' => _PASS_LONGUEUR_MINI) |
| 297 | - ) . "\n", |
|
| 297 | + )."\n", |
|
| 298 | 298 | 'valeur' => $pass, |
| 299 | 299 | 'required' => $auteur_obligatoire, |
| 300 | 300 | ), |
| 301 | 301 | 'pass_verif' => array( |
| 302 | - 'label' => '<b>' . _T('info_confirmer_passe') . "</b><br />\n", |
|
| 302 | + 'label' => '<b>'._T('info_confirmer_passe')."</b><br />\n", |
|
| 303 | 303 | 'valeur' => $pass, |
| 304 | 304 | 'required' => $auteur_obligatoire, |
| 305 | 305 | ) |
@@ -344,9 +344,9 @@ discard block |
||
| 344 | 344 | |
| 345 | 345 | if ($res) { |
| 346 | 346 | $res = info_progression_etape(2, 'etape_', 'install/', true) |
| 347 | - . "<div class='error'><h3>" . _T('avis_operation_echec') . '</h3>' |
|
| 347 | + . "<div class='error'><h3>"._T('avis_operation_echec').'</h3>' |
|
| 348 | 348 | . $res |
| 349 | - . '<p>' . _T('texte_operation_echec') . '</p>' |
|
| 349 | + . '<p>'._T('texte_operation_echec').'</p>' |
|
| 350 | 350 | . '</div>'; |
| 351 | 351 | } |
| 352 | 352 | } else { |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | if ($fail) { |
| 41 | 41 | echo info_etape(_T('info_chemin_acces_annuaire')), |
| 42 | 42 | info_progression_etape(3, 'etape_ldap', 'install/', true), |
| 43 | - "<div class='error'><p><b>" . _T('avis_operation_echec') . '</b></p><p>' . _T('avis_chemin_invalide_1'), |
|
| 44 | - ' (<tt>' . spip_htmlspecialchars($base_ldap) . '</tt>) ' . _T('avis_chemin_invalide_2') . '</p></div>'; |
|
| 43 | + "<div class='error'><p><b>"._T('avis_operation_echec').'</b></p><p>'._T('avis_chemin_invalide_1'), |
|
| 44 | + ' (<tt>'.spip_htmlspecialchars($base_ldap).'</tt>) '._T('avis_chemin_invalide_2').'</p></div>'; |
|
| 45 | 45 | } else { |
| 46 | 46 | info_etape(_T('info_reglage_ldap')); |
| 47 | 47 | echo info_progression_etape(4, 'etape_ldap', 'install/'); |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $res = install_propager(array('adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap')) |
| 56 | 56 | . "<input type='hidden' name='etape' value='ldap5' />" |
| 57 | - . "<input type='hidden' name='base_ldap' value='" . spip_htmlentities($base_ldap) . "' />" |
|
| 57 | + . "<input type='hidden' name='base_ldap' value='".spip_htmlentities($base_ldap)."' />" |
|
| 58 | 58 | . fieldset( |
| 59 | 59 | _T('info_statut_utilisateurs_1'), |
| 60 | 60 | array( |
| 61 | 61 | 'statut_ldap' => array( |
| 62 | - 'label' => _T('info_statut_utilisateurs_2') . '<br />', |
|
| 62 | + 'label' => _T('info_statut_utilisateurs_2').'<br />', |
|
| 63 | 63 | 'valeur' => $statut_ldap, |
| 64 | 64 | 'alternatives' => $statuts |
| 65 | 65 | ) |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | // https://code.spip.net/@liste_statuts_ldap |
| 78 | 78 | function liste_statuts_ldap() { |
| 79 | 79 | $recom = array( |
| 80 | - 'info_administrateurs' => ('<b>' . _T('info_administrateur_1') . '</b> ' . _T('info_administrateur_2') . '<br />'), |
|
| 81 | - 'info_redacteurs' => ('<b>' . _T('info_redacteur_1') . '</b> ' . _T('info_redacteur_2') . '<br />'), |
|
| 82 | - 'info_visiteurs' => ('<b>' . _T('info_visiteur_1') . '</b> ' . _T('info_visiteur_2') . '<br />') |
|
| 80 | + 'info_administrateurs' => ('<b>'._T('info_administrateur_1').'</b> '._T('info_administrateur_2').'<br />'), |
|
| 81 | + 'info_redacteurs' => ('<b>'._T('info_redacteur_1').'</b> '._T('info_redacteur_2').'<br />'), |
|
| 82 | + 'info_visiteurs' => ('<b>'._T('info_visiteur_1').'</b> '._T('info_visiteur_2').'<br />') |
|
| 83 | 83 | ); |
| 84 | 84 | |
| 85 | 85 | $res = array(); |
@@ -95,14 +95,14 @@ discard block |
||
| 95 | 95 | function install_ldap_correspondances() { |
| 96 | 96 | $champs = array(); |
| 97 | 97 | foreach (is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : array() as $champ => $v) { |
| 98 | - $nom = 'ldap_' . $champ; |
|
| 98 | + $nom = 'ldap_'.$champ; |
|
| 99 | 99 | $val = is_array($v) ? join(',', $v) : strval($v); |
| 100 | 100 | $champs[$nom] = array( |
| 101 | - 'label' => _T('ldap_correspondance', array('champ' => "<tt>$champ</tt>")) . '<br />', |
|
| 101 | + 'label' => _T('ldap_correspondance', array('champ' => "<tt>$champ</tt>")).'<br />', |
|
| 102 | 102 | 'valeur' => $val |
| 103 | 103 | ); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | return !$champs ? |
| 107 | - '' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2') . '<br /><br />'); |
|
| 107 | + '' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2').'<br /><br />'); |
|
| 108 | 108 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | #if (!$sql_desc) $sql_desc = false; |
| 86 | 86 | #spip_log("Resultat table=$table sql_desc:$sql_desc","dbinstall"._LOG_INFO_IMPORTANTE); |
| 87 | 87 | if (!$sql_desc) { |
| 88 | - spip_log("Echec creation table $table", "maj" . _LOG_CRITIQUE); |
|
| 88 | + spip_log("Echec creation table $table", "maj"._LOG_CRITIQUE); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | } else { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | if (isset($desc['field'])) { |
| 98 | 98 | foreach ($desc['field'] as $field => $type) { |
| 99 | 99 | if (!isset($sql_desc['field'][$field])) { |
| 100 | - sql_alter("TABLE $table ADD $field $type" . ($last ? " AFTER $last" : ""), $serveur); |
|
| 100 | + sql_alter("TABLE $table ADD $field $type".($last ? " AFTER $last" : ""), $serveur); |
|
| 101 | 101 | } |
| 102 | 102 | $last = $field; |
| 103 | 103 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | // Si a ce stade on n'a pas de table, il y a un bug |
| 232 | 232 | if (!is_array($this->tableau)) { |
| 233 | 233 | $this->err = true; |
| 234 | - spip_log("erreur datasource " . var_export($command, true)); |
|
| 234 | + spip_log("erreur datasource ".var_export($command, true)); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | // {datapath query.results} |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | if (isset($this->command['sourcemode']) |
| 272 | 272 | and !in_array($this->command['sourcemode'], array('table', 'array', 'tableau')) |
| 273 | 273 | ) { |
| 274 | - charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true); |
|
| 274 | + charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | # le premier argument peut etre un array, une URL etc. |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | # avons-nous un cache dispo ? |
| 281 | 281 | $cle = null; |
| 282 | 282 | if (is_string($src)) { |
| 283 | - $cle = 'datasource_' . md5($this->command['sourcemode'] . ':' . var_export($this->command['source'], true)); |
|
| 283 | + $cle = 'datasource_'.md5($this->command['sourcemode'].':'.var_export($this->command['source'], true)); |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | $cache = $this->cache_get($cle); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | if (!$this->err |
| 335 | - and $data_to_array = charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true) |
|
| 335 | + and $data_to_array = charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true) |
|
| 336 | 336 | ) { |
| 337 | 337 | $args = $this->command['source']; |
| 338 | 338 | $args[0] = $data; |
@@ -467,13 +467,13 @@ discard block |
||
| 467 | 467 | $tv = '%s'; |
| 468 | 468 | } # {par valeur/xx/yy} ?? |
| 469 | 469 | else { |
| 470 | - $tv = 'table_valeur(%s, ' . var_export($r[1], true) . ')'; |
|
| 470 | + $tv = 'table_valeur(%s, '.var_export($r[1], true).')'; |
|
| 471 | 471 | } |
| 472 | 472 | $sortfunc .= ' |
| 473 | - $a = ' . sprintf($tv, '$aa') . '; |
|
| 474 | - $b = ' . sprintf($tv, '$bb') . '; |
|
| 473 | + $a = ' . sprintf($tv, '$aa').'; |
|
| 474 | + $b = ' . sprintf($tv, '$bb').'; |
|
| 475 | 475 | if ($a <> $b) |
| 476 | - return ($a ' . (!empty($r[2]) ? '>' : '<') . ' $b) ? -1 : 1;'; |
|
| 476 | + return ($a ' . (!empty($r[2]) ? '>' : '<').' $b) ? -1 : 1;'; |
|
| 477 | 477 | } |
| 478 | 478 | } |
| 479 | 479 | } |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | function inc_sql_to_array_dist($data) { |
| 627 | 627 | # sortir le connecteur de $data |
| 628 | 628 | preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v); |
| 629 | - $serveur = (string)$v[1]; |
|
| 629 | + $serveur = (string) $v[1]; |
|
| 630 | 630 | $req = trim($v[2]); |
| 631 | 631 | if ($s = sql_query($req, $serveur)) { |
| 632 | 632 | $r = array(); |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | */ |
| 649 | 649 | function inc_json_to_array_dist($data) { |
| 650 | 650 | if (is_array($json = json_decode($data, true))) { |
| 651 | - return (array)$json; |
|
| 651 | + return (array) $json; |
|
| 652 | 652 | } |
| 653 | 653 | } |
| 654 | 654 | |
@@ -667,13 +667,13 @@ discard block |
||
| 667 | 667 | $i = 1; |
| 668 | 668 | foreach ($entete as $k => $v) { |
| 669 | 669 | if (trim($v) == "") { |
| 670 | - $v = "col" . $i; |
|
| 670 | + $v = "col".$i; |
|
| 671 | 671 | } // reperer des eventuelles cases vides |
| 672 | 672 | if (is_numeric($v) and $v < 0) { |
| 673 | - $v = "__" . $v; |
|
| 673 | + $v = "__".$v; |
|
| 674 | 674 | } // ne pas risquer d'ecraser une cle numerique |
| 675 | 675 | if (is_numeric($v)) { |
| 676 | - $v = "_" . $v; |
|
| 676 | + $v = "_".$v; |
|
| 677 | 677 | } // ne pas risquer d'ecraser une cle numerique |
| 678 | 678 | $v = strtolower(preg_replace(',\W+,', '_', translitteration($v))); |
| 679 | 679 | foreach ($csv as &$item) { |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | * @return array|bool |
| 758 | 758 | */ |
| 759 | 759 | function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) { |
| 760 | - return (array)preg_files($dir, $regexp, $limit); |
|
| 760 | + return (array) preg_files($dir, $regexp, $limit); |
|
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | /** |
@@ -772,13 +772,13 @@ discard block |
||
| 772 | 772 | $glob_to_array = charger_fonction('glob_to_array', 'inc'); |
| 773 | 773 | $a = $glob_to_array($data); |
| 774 | 774 | foreach ($a as &$v) { |
| 775 | - $b = (array)@stat($v); |
|
| 775 | + $b = (array) @stat($v); |
|
| 776 | 776 | foreach ($b as $k => $ignore) { |
| 777 | 777 | if (is_numeric($k)) { |
| 778 | 778 | unset($b[$k]); |
| 779 | 779 | } |
| 780 | 780 | } |
| 781 | - $b['file'] = preg_replace('`/$`','',$v) ; |
|
| 781 | + $b['file'] = preg_replace('`/$`', '', $v); |
|
| 782 | 782 | $v = array_merge( |
| 783 | 783 | pathinfo($v), |
| 784 | 784 | $b |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | $xml_array = array(); |
| 799 | 799 | for ($object->rewind(); $object->valid(); $object->next()) { |
| 800 | 800 | if (array_key_exists($key = $object->key(), $xml_array)) { |
| 801 | - $key .= '-' . uniqid(); |
|
| 801 | + $key .= '-'.uniqid(); |
|
| 802 | 802 | } |
| 803 | 803 | $vars = get_object_vars($object->current()); |
| 804 | 804 | if (isset($vars['@attributes'])) { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } else { |
| 44 | 44 | # Attention GD sait lire le gif mais pas forcement l'ecrire |
| 45 | 45 | if (function_exists('ImageCreateFromGIF')) { |
| 46 | - $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK . "test.gif"); |
|
| 46 | + $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK."test.gif"); |
|
| 47 | 47 | if ($srcImage) { |
| 48 | 48 | $gd_formats_read_gif = ",gif"; |
| 49 | 49 | ImageDestroy($srcImage); |
@@ -67,28 +67,28 @@ discard block |
||
| 67 | 67 | # les formats disponibles en ecriture... (cf. inc_logos) |
| 68 | 68 | |
| 69 | 69 | if (function_exists('ImageCreateFromJPEG')) { |
| 70 | - $srcImage = @ImageCreateFromJPEG(_ROOT_IMG_PACK . "test.jpg"); |
|
| 70 | + $srcImage = @ImageCreateFromJPEG(_ROOT_IMG_PACK."test.jpg"); |
|
| 71 | 71 | if ($srcImage) { |
| 72 | 72 | $gd_formats[] = "jpg"; |
| 73 | 73 | ImageDestroy($srcImage); |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | if (function_exists('ImageCreateFromGIF')) { |
| 77 | - $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK . "test.gif"); |
|
| 77 | + $srcImage = @ImageCreateFromGIF(_ROOT_IMG_PACK."test.gif"); |
|
| 78 | 78 | if ($srcImage) { |
| 79 | 79 | $gd_formats[] = "gif"; |
| 80 | 80 | ImageDestroy($srcImage); |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | if (function_exists('ImageCreateFromPNG')) { |
| 84 | - $srcImage = @ImageCreateFromPNG(_ROOT_IMG_PACK . "test.png"); |
|
| 84 | + $srcImage = @ImageCreateFromPNG(_ROOT_IMG_PACK."test.png"); |
|
| 85 | 85 | if ($srcImage) { |
| 86 | 86 | $gd_formats[] = "png"; |
| 87 | 87 | ImageDestroy($srcImage); |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | if (function_exists('ImageCreateFromWEBP')) { |
| 91 | - $srcImage = @ImageCreateFromWEBP(_ROOT_IMG_PACK . "test.webp"); |
|
| 91 | + $srcImage = @ImageCreateFromWEBP(_ROOT_IMG_PACK."test.webp"); |
|
| 92 | 92 | if ($srcImage) { |
| 93 | 93 | $gd_formats[] = "webp"; |
| 94 | 94 | ImageDestroy($srcImage); |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (! empty($gd_formats)) { |
|
| 99 | + if (!empty($gd_formats)) { |
|
| 100 | 100 | $gd_formats = join(",", $gd_formats); |
| 101 | 101 | } |
| 102 | - ecrire_meta("gd_formats_read", $gd_formats . $gd_formats_read_gif); |
|
| 102 | + ecrire_meta("gd_formats_read", $gd_formats.$gd_formats_read_gif); |
|
| 103 | 103 | ecrire_meta("gd_formats", $gd_formats); |
| 104 | 104 | } // verifier les formats netpbm |
| 105 | 105 | else { |
@@ -117,9 +117,9 @@ discard block |
||
| 117 | 117 | $pnmtojpeg_command = str_replace("pnmscale", |
| 118 | 118 | "pnmtojpeg", _PNMSCALE_COMMAND); |
| 119 | 119 | |
| 120 | - $vignette = _ROOT_IMG_PACK . "test.jpg"; |
|
| 121 | - $dest = _DIR_VAR . "test-jpg.jpg"; |
|
| 122 | - $commande = "$jpegtopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest"; |
|
| 120 | + $vignette = _ROOT_IMG_PACK."test.jpg"; |
|
| 121 | + $dest = _DIR_VAR."test-jpg.jpg"; |
|
| 122 | + $commande = "$jpegtopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
|
| 123 | 123 | spip_log($commande); |
| 124 | 124 | exec($commande); |
| 125 | 125 | if ($taille = @getimagesize($dest)) { |
@@ -129,9 +129,9 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | $giftopnm_command = str_replace("pnmscale", "giftopnm", _PNMSCALE_COMMAND); |
| 131 | 131 | $pnmtojpeg_command = str_replace("pnmscale", "pnmtojpeg", _PNMSCALE_COMMAND); |
| 132 | - $vignette = _ROOT_IMG_PACK . "test.gif"; |
|
| 133 | - $dest = _DIR_VAR . "test-gif.jpg"; |
|
| 134 | - $commande = "$giftopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest"; |
|
| 132 | + $vignette = _ROOT_IMG_PACK."test.gif"; |
|
| 133 | + $dest = _DIR_VAR."test-gif.jpg"; |
|
| 134 | + $commande = "$giftopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
|
| 135 | 135 | spip_log($commande); |
| 136 | 136 | exec($commande); |
| 137 | 137 | if ($taille = @getimagesize($dest)) { |
@@ -141,9 +141,9 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $pngtopnm_command = str_replace("pnmscale", "pngtopnm", _PNMSCALE_COMMAND); |
| 144 | - $vignette = _ROOT_IMG_PACK . "test.png"; |
|
| 145 | - $dest = _DIR_VAR . "test-gif.jpg"; |
|
| 146 | - $commande = "$pngtopnm_command $vignette | " . _PNMSCALE_COMMAND . " -width 10 | $pnmtojpeg_command > $dest"; |
|
| 144 | + $vignette = _ROOT_IMG_PACK."test.png"; |
|
| 145 | + $dest = _DIR_VAR."test-gif.jpg"; |
|
| 146 | + $commande = "$pngtopnm_command $vignette | "._PNMSCALE_COMMAND." -width 10 | $pnmtojpeg_command > $dest"; |
|
| 147 | 147 | spip_log($commande); |
| 148 | 148 | exec($commande); |
| 149 | 149 | if ($taille = @getimagesize($dest)) { |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | include_spip('inc/filtres'); |
| 168 | 168 | include_spip('inc/filtres_images_mini'); |
| 169 | 169 | $taille_preview = 150; |
| 170 | - $image = _image_valeurs_trans(_DIR_IMG_PACK . 'test_image.jpg', "reduire-$taille_preview-$taille_preview", 'jpg'); |
|
| 170 | + $image = _image_valeurs_trans(_DIR_IMG_PACK.'test_image.jpg', "reduire-$taille_preview-$taille_preview", 'jpg'); |
|
| 171 | 171 | |
| 172 | - $image['fichier_dest'] = _DIR_VAR . "test_$arg"; |
|
| 172 | + $image['fichier_dest'] = _DIR_VAR."test_$arg"; |
|
| 173 | 173 | |
| 174 | 174 | if ($preview = _image_creer_vignette($image, $taille_preview, $taille_preview, $arg, true) |
| 175 | 175 | and ($preview['width'] * $preview['height'] > 0) |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | define('_INC_DISTANT_CONTENT_ENCODING', 'gzip'); |
| 27 | 27 | } |
| 28 | 28 | if (!defined('_INC_DISTANT_USER_AGENT')) { |
| 29 | - define('_INC_DISTANT_USER_AGENT', 'SPIP-' . $GLOBALS['spip_version_affichee'] . ' (' . $GLOBALS['home_server'] . ')'); |
|
| 29 | + define('_INC_DISTANT_USER_AGENT', 'SPIP-'.$GLOBALS['spip_version_affichee'].' ('.$GLOBALS['home_server'].')'); |
|
| 30 | 30 | } |
| 31 | 31 | if (!defined('_INC_DISTANT_MAX_SIZE')) { |
| 32 | 32 | define('_INC_DISTANT_MAX_SIZE', 2097152); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | define('_INC_DISTANT_CONNECT_TIMEOUT', 10); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -define('_REGEXP_COPIE_LOCALE', ',' . |
|
| 38 | +define('_REGEXP_COPIE_LOCALE', ','. |
|
| 39 | 39 | preg_replace( |
| 40 | 40 | '@^https?:@', |
| 41 | 41 | 'https?:', |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // si c'est la protection de soi-meme, retourner le path |
| 72 | 72 | if ($mode !== 'force' and preg_match(_REGEXP_COPIE_LOCALE, $source, $match)) { |
| 73 | - $source = substr(_DIR_IMG, strlen(_DIR_RACINE)) . urldecode($match[1]); |
|
| 73 | + $source = substr(_DIR_IMG, strlen(_DIR_RACINE)).urldecode($match[1]); |
|
| 74 | 74 | |
| 75 | 75 | return @file_exists($source) ? $source : false; |
| 76 | 76 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return false; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $localrac = _DIR_RACINE . $local; |
|
| 93 | + $localrac = _DIR_RACINE.$local; |
|
| 94 | 94 | $t = ($mode == 'force') ? false : @file_exists($localrac); |
| 95 | 95 | |
| 96 | 96 | // test d'existence du fichier |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | array('file' => $localrac, 'taille_max' => $taille_max, 'if_modified_since' => $t ? filemtime($localrac) : '') |
| 116 | 116 | ); |
| 117 | 117 | if (!$res or (!$res['length'] and $res['status'] != 304)) { |
| 118 | - spip_log("copie_locale : Echec recuperation $source sur $localrac status : " . $res['status'], 'distant' . _LOG_INFO_IMPORTANTE); |
|
| 118 | + spip_log("copie_locale : Echec recuperation $source sur $localrac status : ".$res['status'], 'distant'._LOG_INFO_IMPORTANTE); |
|
| 119 | 119 | } |
| 120 | 120 | if (!$res['length']) { |
| 121 | 121 | // si $t c'est sans doute juste un not-modified-since |
| 122 | 122 | return $t ? $local : false; |
| 123 | 123 | } |
| 124 | - spip_log("copie_locale : recuperation $source sur $localrac taille " . $res['length'] . ' OK', 'distant'); |
|
| 124 | + spip_log("copie_locale : recuperation $source sur $localrac taille ".$res['length'].' OK', 'distant'); |
|
| 125 | 125 | |
| 126 | 126 | // pour une eventuelle indexation |
| 127 | 127 | pipeline( |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | * url ou false en cas d'echec |
| 154 | 154 | */ |
| 155 | 155 | function valider_url_distante($url, $known_hosts = array()) { |
| 156 | - if (!function_exists('protocole_verifier')){ |
|
| 156 | + if (!function_exists('protocole_verifier')) { |
|
| 157 | 157 | include_spip('inc/filtres_mini'); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | $parsed_url = parse_url($url); |
| 165 | - if (!$parsed_url or empty($parsed_url['host']) ) { |
|
| 165 | + if (!$parsed_url or empty($parsed_url['host'])) { |
|
| 166 | 166 | return false; |
| 167 | 167 | } |
| 168 | 168 | |
@@ -203,10 +203,10 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | if ($ip) { |
| 206 | - $parts = array_map('intval', explode( '.', $ip )); |
|
| 206 | + $parts = array_map('intval', explode('.', $ip)); |
|
| 207 | 207 | if (127 === $parts[0] or 10 === $parts[0] or 0 === $parts[0] |
| 208 | - or ( 172 === $parts[0] and 16 <= $parts[1] and 31 >= $parts[1] ) |
|
| 209 | - or ( 192 === $parts[0] && 168 === $parts[1] ) |
|
| 208 | + or (172 === $parts[0] and 16 <= $parts[1] and 31 >= $parts[1]) |
|
| 209 | + or (192 === $parts[0] && 168 === $parts[1]) |
|
| 210 | 210 | ) { |
| 211 | 211 | return false; |
| 212 | 212 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | $port = $parsed_url['port']; |
| 221 | - if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 221 | + if ($port === 80 or $port === 443 or $port === 8080) { |
|
| 222 | 222 | return $url; |
| 223 | 223 | } |
| 224 | 224 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | if ($taille > 500) { |
| 288 | - $boundary = substr(md5(rand() . 'spip'), 0, 8); |
|
| 288 | + $boundary = substr(md5(rand().'spip'), 0, 8); |
|
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | |
@@ -313,16 +313,16 @@ discard block |
||
| 313 | 313 | } |
| 314 | 314 | } else { |
| 315 | 315 | // fabrique une chaine HTTP simple pour un POST |
| 316 | - $entete = 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; |
|
| 316 | + $entete = 'Content-Type: application/x-www-form-urlencoded'."\r\n"; |
|
| 317 | 317 | $chaine = array(); |
| 318 | 318 | if (is_array($donnees)) { |
| 319 | 319 | foreach ($donnees as $cle => $valeur) { |
| 320 | 320 | if (is_array($valeur)) { |
| 321 | 321 | foreach ($valeur as $val2) { |
| 322 | - $chaine[] = rawurlencode($cle) . '[]=' . rawurlencode($val2); |
|
| 322 | + $chaine[] = rawurlencode($cle).'[]='.rawurlencode($val2); |
|
| 323 | 323 | } |
| 324 | 324 | } else { |
| 325 | - $chaine[] = rawurlencode($cle) . '=' . rawurlencode($valeur); |
|
| 325 | + $chaine[] = rawurlencode($cle).'='.rawurlencode($valeur); |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | $chaine = implode('&', $chaine); |
@@ -423,9 +423,9 @@ discard block |
||
| 423 | 423 | if (!empty($options['datas'])) { |
| 424 | 424 | list($head, $postdata) = prepare_donnees_post($options['datas'], $options['boundary']); |
| 425 | 425 | if (stripos($head, 'Content-Length:') === false) { |
| 426 | - $head .= 'Content-Length: ' . strlen($postdata); |
|
| 426 | + $head .= 'Content-Length: '.strlen($postdata); |
|
| 427 | 427 | } |
| 428 | - $options['datas'] = $head . "\r\n\r\n" . $postdata; |
|
| 428 | + $options['datas'] = $head."\r\n\r\n".$postdata; |
|
| 429 | 429 | if (strlen($postdata)) { |
| 430 | 430 | $options['methode'] = 'POST'; |
| 431 | 431 | } |
@@ -434,9 +434,9 @@ discard block |
||
| 434 | 434 | // Accepter les URLs au format feed:// ou qui ont oublie le http:// ou les urls relatives au protocole |
| 435 | 435 | $url = preg_replace(',^feed://,i', 'http://', $url); |
| 436 | 436 | if (!tester_url_absolue($url)) { |
| 437 | - $url = 'http://' . $url; |
|
| 437 | + $url = 'http://'.$url; |
|
| 438 | 438 | } elseif (strncmp($url, '//', 2) == 0) { |
| 439 | - $url = 'http:' . $url; |
|
| 439 | + $url = 'http:'.$url; |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | $url = url_to_ascii($url); |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | $options['if_modified_since'] |
| 466 | 466 | ); |
| 467 | 467 | if (!$handle) { |
| 468 | - spip_log("ECHEC init_http $url", 'distant' . _LOG_ERREUR); |
|
| 468 | + spip_log("ECHEC init_http $url", 'distant'._LOG_ERREUR); |
|
| 469 | 469 | |
| 470 | 470 | return false; |
| 471 | 471 | } |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | 'status' => 200, |
| 495 | 495 | ); |
| 496 | 496 | } else { |
| 497 | - spip_log("ECHEC chinoiserie $url", 'distant' . _LOG_ERREUR); |
|
| 497 | + spip_log("ECHEC chinoiserie $url", 'distant'._LOG_ERREUR); |
|
| 498 | 498 | return false; |
| 499 | 499 | } |
| 500 | 500 | } elseif ($res['location'] and $options['follow_location']) { |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | |
| 507 | 507 | return recuperer_url($url, $options); |
| 508 | 508 | } elseif ($res['status'] !== 200) { |
| 509 | - spip_log('HTTP status ' . $res['status'] . " pour $url", 'distant'); |
|
| 509 | + spip_log('HTTP status '.$res['status']." pour $url", 'distant'); |
|
| 510 | 510 | } |
| 511 | 511 | $result['status'] = $res['status']; |
| 512 | 512 | if (isset($res['headers'])) { |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | |
| 532 | 532 | $gz = false; |
| 533 | 533 | if (preg_match(",\bContent-Encoding: .*gzip,is", $result['headers'])) { |
| 534 | - $gz = (_DIR_TMP . md5(uniqid(mt_rand())) . '.tmp.gz'); |
|
| 534 | + $gz = (_DIR_TMP.md5(uniqid(mt_rand())).'.tmp.gz'); |
|
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | // si on a pas deja recuperer le contenu par une methode detournee |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $sig['url'] = $url; |
| 618 | 618 | |
| 619 | 619 | $dir = sous_repertoire(_DIR_CACHE, 'curl'); |
| 620 | - $cache = md5(serialize($sig)) . '-' . substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 620 | + $cache = md5(serialize($sig)).'-'.substr(preg_replace(',\W+,', '_', $url), 0, 80); |
|
| 621 | 621 | $sub = sous_repertoire($dir, substr($cache, 0, 2)); |
| 622 | 622 | $cache = "$sub$cache"; |
| 623 | 623 | |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | return false; |
| 727 | 727 | } |
| 728 | 728 | if ($get_headers) { |
| 729 | - return $res['headers'] . "\n" . $res['page']; |
|
| 729 | + return $res['headers']."\n".$res['page']; |
|
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | return $res['page']; |
@@ -830,7 +830,7 @@ discard block |
||
| 830 | 830 | $fp = false; |
| 831 | 831 | if ($fichier) { |
| 832 | 832 | include_spip('inc/acces'); |
| 833 | - $tmpfile = "$fichier." . creer_uniqid() . '.tmp'; |
|
| 833 | + $tmpfile = "$fichier.".creer_uniqid().'.tmp'; |
|
| 834 | 834 | $fp = spip_fopen_lock($tmpfile, 'w', LOCK_EX); |
| 835 | 835 | if (!$fp and file_exists($fichier)) { |
| 836 | 836 | return filesize($fichier); |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | } |
| 890 | 890 | $result['status'] = intval($r[1]); |
| 891 | 891 | while ($s = trim(fgets($handle, 16384))) { |
| 892 | - $result['headers'][] = $s . "\n"; |
|
| 892 | + $result['headers'][] = $s."\n"; |
|
| 893 | 893 | preg_match(',^([^:]*): *(.*)$,i', $s, $r); |
| 894 | 894 | list(, $d, $v) = $r; |
| 895 | 895 | if (strtolower(trim($d)) == 'location' and $result['status'] >= 300 and $result['status'] < 400) { |
@@ -972,13 +972,13 @@ discard block |
||
| 972 | 972 | |
| 973 | 973 | // on se place tout le temps comme si on etait a la racine |
| 974 | 974 | if (_DIR_RACINE) { |
| 975 | - $d = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $d); |
|
| 975 | + $d = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $d); |
|
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | $m = md5($source); |
| 979 | 979 | |
| 980 | 980 | return $d |
| 981 | - . substr(preg_replace(',[^\w-],', '', basename($source)) . '-' . $m, 0, 12) |
|
| 981 | + . substr(preg_replace(',[^\w-],', '', basename($source)).'-'.$m, 0, 12) |
|
| 982 | 982 | . substr($m, 0, 4) |
| 983 | 983 | . ".$extension"; |
| 984 | 984 | } |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | // Si c'est deja local pas de souci |
| 1002 | 1002 | if (!tester_url_absolue($source)) { |
| 1003 | 1003 | if (_DIR_RACINE) { |
| 1004 | - $source = preg_replace(',^' . preg_quote(_DIR_RACINE) . ',', '', $source); |
|
| 1004 | + $source = preg_replace(',^'.preg_quote(_DIR_RACINE).',', '', $source); |
|
| 1005 | 1005 | } |
| 1006 | 1006 | |
| 1007 | 1007 | return $source; |
@@ -1018,7 +1018,7 @@ discard block |
||
| 1018 | 1018 | if ($ext |
| 1019 | 1019 | and preg_match(',^\w+$,', $ext) // pas de php?truc=1&... |
| 1020 | 1020 | and $f = nom_fichier_copie_locale($source, $ext) |
| 1021 | - and file_exists(_DIR_RACINE . $f) |
|
| 1021 | + and file_exists(_DIR_RACINE.$f) |
|
| 1022 | 1022 | ) { |
| 1023 | 1023 | return $f; |
| 1024 | 1024 | } |
@@ -1026,7 +1026,7 @@ discard block |
||
| 1026 | 1026 | |
| 1027 | 1027 | // Si c'est deja dans la table des documents, |
| 1028 | 1028 | // ramener le nom de sa copie potentielle |
| 1029 | - $ext = sql_getfetsel('extension', 'spip_documents', 'fichier=' . sql_quote($source) . " AND distant='oui' AND extension <> ''"); |
|
| 1029 | + $ext = sql_getfetsel('extension', 'spip_documents', 'fichier='.sql_quote($source)." AND distant='oui' AND extension <> ''"); |
|
| 1030 | 1030 | |
| 1031 | 1031 | if ($ext) { |
| 1032 | 1032 | return nom_fichier_copie_locale($source, $ext); |
@@ -1037,9 +1037,9 @@ discard block |
||
| 1037 | 1037 | |
| 1038 | 1038 | $ext = $path_parts ? $path_parts['extension'] : ''; |
| 1039 | 1039 | |
| 1040 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 1040 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 1041 | 1041 | $f = nom_fichier_copie_locale($source, $ext); |
| 1042 | - if (file_exists(_DIR_RACINE . $f)) { |
|
| 1042 | + if (file_exists(_DIR_RACINE.$f)) { |
|
| 1043 | 1043 | return $f; |
| 1044 | 1044 | } |
| 1045 | 1045 | } |
@@ -1047,7 +1047,7 @@ discard block |
||
| 1047 | 1047 | // Ping pour voir si son extension est connue et autorisee |
| 1048 | 1048 | // avec mise en cache du resultat du ping |
| 1049 | 1049 | |
| 1050 | - $cache = sous_repertoire(_DIR_CACHE, 'rid') . md5($source); |
|
| 1050 | + $cache = sous_repertoire(_DIR_CACHE, 'rid').md5($source); |
|
| 1051 | 1051 | if (!@file_exists($cache) |
| 1052 | 1052 | or !$path_parts = @unserialize(spip_file_get_contents($cache)) |
| 1053 | 1053 | or _request('var_mode') == 'recalcul' |
@@ -1056,10 +1056,10 @@ discard block |
||
| 1056 | 1056 | ecrire_fichier($cache, serialize($path_parts)); |
| 1057 | 1057 | } |
| 1058 | 1058 | $ext = !empty($path_parts['extension']) ? $path_parts['extension'] : ''; |
| 1059 | - if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($ext))) { |
|
| 1059 | + if ($ext and sql_getfetsel('extension', 'spip_types_documents', 'extension='.sql_quote($ext))) { |
|
| 1060 | 1060 | return nom_fichier_copie_locale($source, $ext); |
| 1061 | 1061 | } |
| 1062 | - spip_log("pas de copie locale pour $source", 'distant' . _LOG_ERREUR); |
|
| 1062 | + spip_log("pas de copie locale pour $source", 'distant'._LOG_ERREUR); |
|
| 1063 | 1063 | } |
| 1064 | 1064 | |
| 1065 | 1065 | |
@@ -1124,19 +1124,19 @@ discard block |
||
| 1124 | 1124 | if (!$t |
| 1125 | 1125 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1126 | 1126 | ) { |
| 1127 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
|
| 1127 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote($rext[1], '', 'text')); |
|
| 1128 | 1128 | } |
| 1129 | 1129 | if (!$t |
| 1130 | 1130 | and preg_match(',^Content-Disposition:\s*attachment;\s*filename=(.*)$,Uims', $headers, $m) |
| 1131 | 1131 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $m[1], $rext) |
| 1132 | 1132 | ) { |
| 1133 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
|
| 1133 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote($rext[1], '', 'text')); |
|
| 1134 | 1134 | } |
| 1135 | 1135 | } |
| 1136 | 1136 | |
| 1137 | 1137 | // Autre mime/type (ou text/plain avec fichier d'extension inconnue) |
| 1138 | 1138 | if (!$t) { |
| 1139 | - $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type=' . sql_quote($mime_type)); |
|
| 1139 | + $t = sql_fetsel('extension', 'spip_types_documents', 'mime_type='.sql_quote($mime_type)); |
|
| 1140 | 1140 | } |
| 1141 | 1141 | |
| 1142 | 1142 | // Toujours rien ? (ex: audio/x-ogg au lieu de application/ogg) |
@@ -1146,11 +1146,11 @@ discard block |
||
| 1146 | 1146 | and preg_match(',\.([a-z0-9]+)(\?.*)?$,i', $source, $rext) |
| 1147 | 1147 | ) { |
| 1148 | 1148 | # eviter xxx.3 => 3gp (> SPIP 3) |
| 1149 | - $t = sql_fetsel('extension', 'spip_types_documents', 'extension=' . sql_quote($rext[1], '', 'text')); |
|
| 1149 | + $t = sql_fetsel('extension', 'spip_types_documents', 'extension='.sql_quote($rext[1], '', 'text')); |
|
| 1150 | 1150 | } |
| 1151 | 1151 | |
| 1152 | 1152 | if ($t) { |
| 1153 | - spip_log("mime-type $mime_type ok, extension " . $t['extension'], 'distant'); |
|
| 1153 | + spip_log("mime-type $mime_type ok, extension ".$t['extension'], 'distant'); |
|
| 1154 | 1154 | $a['extension'] = $t['extension']; |
| 1155 | 1155 | } else { |
| 1156 | 1156 | # par defaut on retombe sur '.bin' si c'est autorise |
@@ -1192,7 +1192,7 @@ discard block |
||
| 1192 | 1192 | } else { |
| 1193 | 1193 | if ($a['body']) { |
| 1194 | 1194 | $a['extension'] = $extension; |
| 1195 | - $a['fichier'] = _DIR_RACINE . nom_fichier_copie_locale($source, $extension); |
|
| 1195 | + $a['fichier'] = _DIR_RACINE.nom_fichier_copie_locale($source, $extension); |
|
| 1196 | 1196 | ecrire_fichier($a['fichier'], $a['body']); |
| 1197 | 1197 | $size_image = @spip_getimagesize($a['fichier']); |
| 1198 | 1198 | $a['largeur'] = intval($size_image[0]); |
@@ -1317,7 +1317,7 @@ discard block |
||
| 1317 | 1317 | } |
| 1318 | 1318 | } else { |
| 1319 | 1319 | $scheme = $t['scheme']; |
| 1320 | - $noproxy = $scheme . '://'; |
|
| 1320 | + $noproxy = $scheme.'://'; |
|
| 1321 | 1321 | } |
| 1322 | 1322 | if (isset($t['user'])) { |
| 1323 | 1323 | $user = array($t['user'], $t['pass']); |
@@ -1331,7 +1331,7 @@ discard block |
||
| 1331 | 1331 | } |
| 1332 | 1332 | |
| 1333 | 1333 | if (!empty($t['query'])) { |
| 1334 | - $path .= '?' . $t['query']; |
|
| 1334 | + $path .= '?'.$t['query']; |
|
| 1335 | 1335 | } |
| 1336 | 1336 | |
| 1337 | 1337 | $f = lance_requete($method, $scheme, $user, $host, $path, $port, $noproxy, $refuse_gz, $referer, $datas, $vers, $date); |
@@ -1404,20 +1404,20 @@ discard block |
||
| 1404 | 1404 | $proxy_user = ''; |
| 1405 | 1405 | $http_proxy = need_proxy($host); |
| 1406 | 1406 | if ($user) { |
| 1407 | - $user = urlencode($user[0]) . ':' . urlencode($user[1]); |
|
| 1407 | + $user = urlencode($user[0]).':'.urlencode($user[1]); |
|
| 1408 | 1408 | } |
| 1409 | 1409 | |
| 1410 | 1410 | $connect = ''; |
| 1411 | 1411 | if ($http_proxy) { |
| 1412 | - if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme , array('tls','ssl'))) { |
|
| 1413 | - $path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : ''); |
|
| 1414 | - $connect = 'CONNECT ' . $path_host . " $vers\r\n" |
|
| 1412 | + if (!defined('_PROXY_HTTPS_NOT_VIA_CONNECT') and in_array($scheme, array('tls', 'ssl'))) { |
|
| 1413 | + $path_host = (!$user ? '' : "$user@").$host.(($port != 80) ? ":$port" : ''); |
|
| 1414 | + $connect = 'CONNECT '.$path_host." $vers\r\n" |
|
| 1415 | 1415 | . "Host: $path_host\r\n" |
| 1416 | 1416 | . "Proxy-Connection: Keep-Alive\r\n"; |
| 1417 | 1417 | } else { |
| 1418 | - $path = (in_array($scheme , array('tls','ssl')) ? 'https://' : "$scheme://") |
|
| 1418 | + $path = (in_array($scheme, array('tls', 'ssl')) ? 'https://' : "$scheme://") |
|
| 1419 | 1419 | . (!$user ? '' : "$user@") |
| 1420 | - . "$host" . (($port != 80) ? ":$port" : '') . $path; |
|
| 1420 | + . "$host".(($port != 80) ? ":$port" : '').$path; |
|
| 1421 | 1421 | } |
| 1422 | 1422 | $t2 = @parse_url($http_proxy); |
| 1423 | 1423 | $first_host = $t2['host']; |
@@ -1425,10 +1425,10 @@ discard block |
||
| 1425 | 1425 | $port = 80; |
| 1426 | 1426 | } |
| 1427 | 1427 | if ($t2['user']) { |
| 1428 | - $proxy_user = base64_encode($t2['user'] . ':' . $t2['pass']); |
|
| 1428 | + $proxy_user = base64_encode($t2['user'].':'.$t2['pass']); |
|
| 1429 | 1429 | } |
| 1430 | 1430 | } else { |
| 1431 | - $first_host = $noproxy . $host; |
|
| 1431 | + $first_host = $noproxy.$host; |
|
| 1432 | 1432 | } |
| 1433 | 1433 | |
| 1434 | 1434 | if ($connect) { |
@@ -1453,7 +1453,7 @@ discard block |
||
| 1453 | 1453 | ); |
| 1454 | 1454 | spip_log("Recuperer $path sur $first_host:$port par $f (via CONNECT)", 'connect'); |
| 1455 | 1455 | if (!$f) { |
| 1456 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1456 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1457 | 1457 | return $errno; |
| 1458 | 1458 | } |
| 1459 | 1459 | stream_set_timeout($f, _INC_DISTANT_CONNECT_TIMEOUT); |
@@ -1465,7 +1465,7 @@ discard block |
||
| 1465 | 1465 | or !count($res = explode(' ', $res)) |
| 1466 | 1466 | or $res[1] !== '200' |
| 1467 | 1467 | ) { |
| 1468 | - spip_log("Echec CONNECT sur $first_host:$port", 'connect' . _LOG_INFO_IMPORTANTE); |
|
| 1468 | + spip_log("Echec CONNECT sur $first_host:$port", 'connect'._LOG_INFO_IMPORTANTE); |
|
| 1469 | 1469 | fclose($f); |
| 1470 | 1470 | |
| 1471 | 1471 | return false; |
@@ -1482,7 +1482,7 @@ discard block |
||
| 1482 | 1482 | } while (!$f and $ntry-- and $errno !== 110 and sleep(1)); |
| 1483 | 1483 | spip_log("Recuperer $path sur $first_host:$port par $f"); |
| 1484 | 1484 | if (!$f) { |
| 1485 | - spip_log("Erreur connexion $errno $errstr", 'distant' . _LOG_ERREUR); |
|
| 1485 | + spip_log("Erreur connexion $errno $errstr", 'distant'._LOG_ERREUR); |
|
| 1486 | 1486 | |
| 1487 | 1487 | return $errno; |
| 1488 | 1488 | } |
@@ -1492,16 +1492,16 @@ discard block |
||
| 1492 | 1492 | $site = isset($GLOBALS['meta']['adresse_site']) ? $GLOBALS['meta']['adresse_site'] : ''; |
| 1493 | 1493 | |
| 1494 | 1494 | $host_port = $host; |
| 1495 | - if ($port != (in_array($scheme , array('tls','ssl')) ? 443 : 80)) { |
|
| 1495 | + if ($port != (in_array($scheme, array('tls', 'ssl')) ? 443 : 80)) { |
|
| 1496 | 1496 | $host_port .= ":$port"; |
| 1497 | 1497 | } |
| 1498 | 1498 | $req = "$method $path $vers\r\n" |
| 1499 | 1499 | . "Host: $host_port\r\n" |
| 1500 | - . 'User-Agent: ' . _INC_DISTANT_USER_AGENT . "\r\n" |
|
| 1501 | - . ($refuse_gz ? '' : ('Accept-Encoding: ' . _INC_DISTANT_CONTENT_ENCODING . "\r\n")) |
|
| 1500 | + . 'User-Agent: '._INC_DISTANT_USER_AGENT."\r\n" |
|
| 1501 | + . ($refuse_gz ? '' : ('Accept-Encoding: '._INC_DISTANT_CONTENT_ENCODING."\r\n")) |
|
| 1502 | 1502 | . (!$site ? '' : "Referer: $site/$referer\r\n") |
| 1503 | - . (!$date ? '' : 'If-Modified-Since: ' . (gmdate('D, d M Y H:i:s', $date) . " GMT\r\n")) |
|
| 1504 | - . (!$user ? '' : ('Authorization: Basic ' . base64_encode($user) . "\r\n")) |
|
| 1503 | + . (!$date ? '' : 'If-Modified-Since: '.(gmdate('D, d M Y H:i:s', $date)." GMT\r\n")) |
|
| 1504 | + . (!$user ? '' : ('Authorization: Basic '.base64_encode($user)."\r\n")) |
|
| 1505 | 1505 | . (!$proxy_user ? '' : "Proxy-Authorization: Basic $proxy_user\r\n") |
| 1506 | 1506 | . (!strpos($vers, '1.1') ? '' : "Keep-Alive: 300\r\nConnection: keep-alive\r\n"); |
| 1507 | 1507 | |