@@ -384,10 +384,12 @@ |
||
| 384 | 384 | $texte = $court; |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | - if (strpos($texte, "\n")) // la fin est encore la : c'est qu'on n'a pas de texte de suite |
|
| 387 | + if (strpos($texte, "\n")) { |
|
| 388 | + // la fin est encore la : c'est qu'on n'a pas de texte de suite |
|
| 388 | 389 | { |
| 389 | 390 | $points = ''; |
| 390 | 391 | } |
| 392 | + } |
|
| 391 | 393 | |
| 392 | 394 | // remettre les paragraphes |
| 393 | 395 | $texte = preg_replace("/\r+/", "\n\n", $texte); |
@@ -326,14 +326,15 @@ |
||
| 326 | 326 | $connecte = false; |
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | - if ($connecte) |
|
| 330 | - # on ajoute les liaisons en premier |
|
| 329 | + if ($connecte) { |
|
| 330 | + # on ajoute les liaisons en premier |
|
| 331 | 331 | # si une restauration est interrompue, |
| 332 | 332 | # cela se verra mieux si il manque des objets |
| 333 | 333 | # que des liens |
| 334 | 334 | { |
| 335 | 335 | array_unshift($tables_for_dump, $link_table); |
| 336 | 336 | } |
| 337 | + } |
|
| 337 | 338 | } |
| 338 | 339 | |
| 339 | 340 | return array($tables_for_dump, $tables_for_link); |
@@ -616,10 +616,12 @@ |
||
| 616 | 616 | function spip_pg_groupby($groupby, $from, $select) { |
| 617 | 617 | $join = strpos($from, ","); |
| 618 | 618 | // ismplifier avant de decouper |
| 619 | - if (is_string($select)) // fct SQL sur colonne et constante apostrophee ==> la colonne |
|
| 619 | + if (is_string($select)) { |
|
| 620 | + // fct SQL sur colonne et constante apostrophee ==> la colonne |
|
| 620 | 621 | { |
| 621 | 622 | $select = preg_replace('/\w+\(\s*([^(),\']*),\s*\'[^\']*\'[^)]*\)/', '\\1', $select); |
| 622 | 623 | } |
| 624 | + } |
|
| 623 | 625 | |
| 624 | 626 | if ($join or $groupby) { |
| 625 | 627 | $join = is_array($select) ? $select : explode(", ", $select); |
@@ -1256,8 +1256,9 @@ |
||
| 1256 | 1256 | $http_noproxy = " $http_noproxy "; |
| 1257 | 1257 | $domain = $host; |
| 1258 | 1258 | // si le domaine exact www.example.org est dans les exceptions |
| 1259 | - if (strpos($http_noproxy, " $domain ") !== false) |
|
| 1260 | - return ''; |
|
| 1259 | + if (strpos($http_noproxy, " $domain ") !== false) { |
|
| 1260 | + return ''; |
|
| 1261 | + } |
|
| 1261 | 1262 | |
| 1262 | 1263 | while (strpos($domain, '.') !== false) { |
| 1263 | 1264 | $domain = explode('.', $domain); |
@@ -351,11 +351,15 @@ discard block |
||
| 351 | 351 | $erreurs = array(); |
| 352 | 352 | $erreurs = auteur_reset_password($res['id_auteur'], $erreurs); |
| 353 | 353 | if (isset($erreurs['message_ok'])) { |
| 354 | - if (!isset($res['message_ok'])) $res['message_ok'] = ''; |
|
| 354 | + if (!isset($res['message_ok'])) { |
|
| 355 | + $res['message_ok'] = ''; |
|
| 356 | + } |
|
| 355 | 357 | $res['message_ok'] = trim($res['message_ok'] . ' ' . $erreurs['message_ok']); |
| 356 | 358 | } |
| 357 | 359 | if (isset($erreurs['message_erreur']) and $erreurs['message_erreur']) { |
| 358 | - if (!isset($res['message_erreur'])) $res['message_erreur'] = ''; |
|
| 360 | + if (!isset($res['message_erreur'])) { |
|
| 361 | + $res['message_erreur'] = ''; |
|
| 362 | + } |
|
| 359 | 363 | $res['message_erreur'] = trim($res['message_erreur'] . ' ' . $erreurs['message_erreur']); |
| 360 | 364 | } |
| 361 | 365 | } |
@@ -439,8 +443,7 @@ discard block |
||
| 439 | 443 | if (!isset($contexte['lang']) or !$contexte['lang']) { |
| 440 | 444 | if (isset($row['lang']) and $row['lang']) { |
| 441 | 445 | $contexte['lang'] = $row['lang']; |
| 442 | - } |
|
| 443 | - else { |
|
| 446 | + } else { |
|
| 444 | 447 | $contexte['lang'] = $GLOBALS['meta']['langue_site']; |
| 445 | 448 | } |
| 446 | 449 | } |
@@ -512,8 +512,7 @@ |
||
| 512 | 512 | $desc = $trouver_table($table_lien); |
| 513 | 513 | if ($desc and isset($desc['field']['rang_lien'])) { |
| 514 | 514 | $triables[$table_lien] = true; |
| 515 | - } |
|
| 516 | - else { |
|
| 515 | + } else { |
|
| 517 | 516 | $triables[$table_lien] = false; |
| 518 | 517 | } |
| 519 | 518 | } |
@@ -42,8 +42,7 @@ |
||
| 42 | 42 | if (count($logo) < 6) { |
| 43 | 43 | spip_log("Supprimer ancien logo $logo", 'logo'); |
| 44 | 44 | spip_unlink($logo[0]); |
| 45 | - } |
|
| 46 | - elseif ($doc = $logo[5] |
|
| 45 | + } elseif ($doc = $logo[5] |
|
| 47 | 46 | and isset($doc['id_document']) |
| 48 | 47 | and $id_document = $doc['id_document']) { |
| 49 | 48 | |
@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | if (is_null($maxlen)) { |
| 65 | 65 | $image = file_get_contents($fichier); |
| 66 | - } |
|
| 67 | - else { |
|
| 66 | + } else { |
|
| 68 | 67 | $image = file_get_contents($fichier, false,null,0, $maxlen); |
| 69 | 68 | } |
| 70 | 69 | // est-ce bien une image svg ? |
@@ -191,8 +190,7 @@ discard block |
||
| 191 | 190 | |
| 192 | 191 | if ($start === false or $start === 'end') { |
| 193 | 192 | $svg = str_replace("</svg>", $shapes . "</svg>", $svg); |
| 194 | - } |
|
| 195 | - else { |
|
| 193 | + } else { |
|
| 196 | 194 | $p = stripos($svg, "<svg"); |
| 197 | 195 | $p = strpos($svg, ">", $p); |
| 198 | 196 | $svg = substr_replace($svg, $shapes, $p+1, 0); |
@@ -253,8 +251,7 @@ discard block |
||
| 253 | 251 | if (strpos($couleur, "rgb(")===0) { |
| 254 | 252 | $c = explode(',', substr($couleur, 4)); |
| 255 | 253 | $couleur = _couleur_dec_to_hex(intval($c[0]), intval($c[1]), intval($c[2])); |
| 256 | - } |
|
| 257 | - else { |
|
| 254 | + } else { |
|
| 258 | 255 | $couleur = couleur_html_to_hex($couleur); |
| 259 | 256 | } |
| 260 | 257 | $couleur = '#'.ltrim($couleur,'#'); |
@@ -303,33 +300,27 @@ discard block |
||
| 303 | 300 | if (isset($attributs['width']) |
| 304 | 301 | and $w = svg_dimension_to_pixels($attributs['width'])) { |
| 305 | 302 | $width = $w; |
| 306 | - } |
|
| 307 | - else { |
|
| 303 | + } else { |
|
| 308 | 304 | // si on recupere la taille de la viewbox mais si la viewbox est petite on met un multiplicateur pour la taille finale |
| 309 | 305 | $width = $viewBox[2]; |
| 310 | 306 | if ($width < 1) { |
| 311 | 307 | $coeff = max($coeff, 1000); |
| 312 | - } |
|
| 313 | - elseif ($width < 10) { |
|
| 308 | + } elseif ($width < 10) { |
|
| 314 | 309 | $coeff = max($coeff, 100); |
| 315 | - } |
|
| 316 | - elseif ($width < 100) { |
|
| 310 | + } elseif ($width < 100) { |
|
| 317 | 311 | $coeff = max($coeff, 10); |
| 318 | 312 | } |
| 319 | 313 | } |
| 320 | 314 | if (isset($attributs['height']) |
| 321 | 315 | and $h = svg_dimension_to_pixels($attributs['height'])) { |
| 322 | 316 | $height = $h; |
| 323 | - } |
|
| 324 | - else { |
|
| 317 | + } else { |
|
| 325 | 318 | $height = $viewBox[3]; |
| 326 | 319 | if ($height < 1) { |
| 327 | 320 | $coeff = max($coeff, 1000); |
| 328 | - } |
|
| 329 | - elseif ($height < 10) { |
|
| 321 | + } elseif ($height < 10) { |
|
| 330 | 322 | $coeff = max($coeff, 100); |
| 331 | - } |
|
| 332 | - elseif ($height < 100) { |
|
| 323 | + } elseif ($height < 100) { |
|
| 333 | 324 | $coeff = max($coeff, 10); |
| 334 | 325 | } |
| 335 | 326 | } |
@@ -467,8 +458,7 @@ discard block |
||
| 467 | 458 | if (isset($attributs['viewBox'])) { |
| 468 | 459 | $viewBox = explode(' ', $attributs['viewBox']); |
| 469 | 460 | $rect = "<rect x=\"".$viewBox[0]."\" y=\"".$viewBox[1]."\" width=\"".$viewBox[2]."\" height=\"".$viewBox[3]."\" fill=\"$background_color\"/>"; |
| 470 | - } |
|
| 471 | - else { |
|
| 461 | + } else { |
|
| 472 | 462 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 473 | 463 | } |
| 474 | 464 | $svg = svg_insert_shapes($svg, $rect); |
@@ -496,8 +486,7 @@ discard block |
||
| 496 | 486 | if (isset($attributs['viewBox'])) { |
| 497 | 487 | $viewBox = explode(' ', $attributs['viewBox']); |
| 498 | 488 | $rect = "<rect x=\"".$viewBox[0]."\" y=\"".$viewBox[1]."\" width=\"".$viewBox[2]."\" height=\"".$viewBox[3]."\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
| 499 | - } |
|
| 500 | - else { |
|
| 489 | + } else { |
|
| 501 | 490 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 502 | 491 | } |
| 503 | 492 | $svg = svg_insert_shapes($svg, $rect, false); |
@@ -615,8 +604,7 @@ discard block |
||
| 615 | 604 | $x = intval($viewBox[0]) + intval($viewBox[2]/2); |
| 616 | 605 | $mx = -$x; |
| 617 | 606 | $transform = "translate($x, 0) $transform translate($mx, 0)"; |
| 618 | - } |
|
| 619 | - else { |
|
| 607 | + } else { |
|
| 620 | 608 | $transform = "scale(1,-1)"; |
| 621 | 609 | |
| 622 | 610 | $y = intval($viewBox[1]) + intval($viewBox[3]/2); |
@@ -675,8 +663,7 @@ discard block |
||
| 675 | 663 | $c = array_shift($colors); |
| 676 | 664 | if (strlen($c) == 4) { |
| 677 | 665 | $short[] = $c; |
| 678 | - } |
|
| 679 | - else { |
|
| 666 | + } else { |
|
| 680 | 667 | $long[] = $c; |
| 681 | 668 | } |
| 682 | 669 | } |
@@ -890,8 +890,7 @@ |
||
| 890 | 890 | if (isset($boucles[$idb]->descr['sourcefile'])) { |
| 891 | 891 | $descr['sourcefile'] = $boucles[$idb]->descr['sourcefile']; |
| 892 | 892 | } |
| 893 | - } |
|
| 894 | - else { |
|
| 893 | + } else { |
|
| 895 | 894 | $descr = array(); |
| 896 | 895 | } |
| 897 | 896 | } |