@@ -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 ? |
@@ -190,8 +189,7 @@ discard block |
||
| 190 | 189 | |
| 191 | 190 | if ($start === false or $start === 'end') { |
| 192 | 191 | $svg = str_replace('</svg>', $shapes . '</svg>', $svg); |
| 193 | - } |
|
| 194 | - else { |
|
| 192 | + } else { |
|
| 195 | 193 | $p = stripos($svg, '<svg'); |
| 196 | 194 | $p = strpos($svg, '>', $p); |
| 197 | 195 | $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, '#'); |
@@ -305,17 +302,14 @@ discard block |
||
| 305 | 302 | and $w = svg_dimension_to_pixels($attributs['width']) |
| 306 | 303 | ) { |
| 307 | 304 | $width = $w; |
| 308 | - } |
|
| 309 | - else { |
|
| 305 | + } else { |
|
| 310 | 306 | // si on recupere la taille de la viewbox mais si la viewbox est petite on met un multiplicateur pour la taille finale |
| 311 | 307 | $width = $viewBox[2]; |
| 312 | 308 | if ($width < 1) { |
| 313 | 309 | $coeff = max($coeff, 1000); |
| 314 | - } |
|
| 315 | - elseif ($width < 10) { |
|
| 310 | + } elseif ($width < 10) { |
|
| 316 | 311 | $coeff = max($coeff, 100); |
| 317 | - } |
|
| 318 | - elseif ($width < 100) { |
|
| 312 | + } elseif ($width < 100) { |
|
| 319 | 313 | $coeff = max($coeff, 10); |
| 320 | 314 | } |
| 321 | 315 | } |
@@ -324,16 +318,13 @@ discard block |
||
| 324 | 318 | and $h = svg_dimension_to_pixels($attributs['height']) |
| 325 | 319 | ) { |
| 326 | 320 | $height = $h; |
| 327 | - } |
|
| 328 | - else { |
|
| 321 | + } else { |
|
| 329 | 322 | $height = $viewBox[3]; |
| 330 | 323 | if ($height < 1) { |
| 331 | 324 | $coeff = max($coeff, 1000); |
| 332 | - } |
|
| 333 | - elseif ($height < 10) { |
|
| 325 | + } elseif ($height < 10) { |
|
| 334 | 326 | $coeff = max($coeff, 100); |
| 335 | - } |
|
| 336 | - elseif ($height < 100) { |
|
| 327 | + } elseif ($height < 100) { |
|
| 337 | 328 | $coeff = max($coeff, 10); |
| 338 | 329 | } |
| 339 | 330 | } |
@@ -475,8 +466,7 @@ discard block |
||
| 475 | 466 | if (isset($attributs['viewBox'])) { |
| 476 | 467 | $viewBox = explode(' ', $attributs['viewBox']); |
| 477 | 468 | $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>"; |
| 478 | - } |
|
| 479 | - else { |
|
| 469 | + } else { |
|
| 480 | 470 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 481 | 471 | } |
| 482 | 472 | $svg = svg_insert_shapes($svg, $rect); |
@@ -505,8 +495,7 @@ discard block |
||
| 505 | 495 | if (isset($attributs['viewBox'])) { |
| 506 | 496 | $viewBox = explode(' ', $attributs['viewBox']); |
| 507 | 497 | $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
| 508 | - } |
|
| 509 | - else { |
|
| 498 | + } else { |
|
| 510 | 499 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 511 | 500 | } |
| 512 | 501 | $svg = svg_insert_shapes($svg, $rect, false); |
@@ -627,8 +616,7 @@ discard block |
||
| 627 | 616 | $x = intval($viewBox[0]) + intval($viewBox[2] / 2); |
| 628 | 617 | $mx = -$x; |
| 629 | 618 | $transform = "translate($x, 0) $transform translate($mx, 0)"; |
| 630 | - } |
|
| 631 | - else { |
|
| 619 | + } else { |
|
| 632 | 620 | $transform = 'scale(1,-1)'; |
| 633 | 621 | |
| 634 | 622 | $y = intval($viewBox[1]) + intval($viewBox[3] / 2); |
@@ -689,8 +677,7 @@ discard block |
||
| 689 | 677 | $c = array_shift($colors); |
| 690 | 678 | if (strlen($c) == 4) { |
| 691 | 679 | $short[] = $c; |
| 692 | - } |
|
| 693 | - else { |
|
| 680 | + } else { |
|
| 694 | 681 | $long[] = $c; |
| 695 | 682 | } |
| 696 | 683 | } |
@@ -341,8 +341,7 @@ |
||
| 341 | 341 | ) { |
| 342 | 342 | if ($use_copy) { |
| 343 | 343 | @copy($fichier_tmp, $fichier); |
| 344 | - } |
|
| 345 | - else { |
|
| 344 | + } else { |
|
| 346 | 345 | @rename($fichier_tmp, $fichier); |
| 347 | 346 | } |
| 348 | 347 | // eviter que PHP ne reserve le vieux timestamp |
@@ -205,8 +205,7 @@ |
||
| 205 | 205 | // Marie Toto <[email protected]> => @toto.com |
| 206 | 206 | if (preg_match('/@[^\s>]+/', $from, $domain)) { |
| 207 | 207 | $domain = $domain[0]; |
| 208 | - } |
|
| 209 | - else { |
|
| 208 | + } else { |
|
| 210 | 209 | $domain = '@unknown-' . md5($from) . '.org'; |
| 211 | 210 | } |
| 212 | 211 | $uniq = rand() . '_' . md5($to . $texte) . $domain; |
@@ -335,8 +335,7 @@ |
||
| 335 | 335 | if (!autoriser('modifier', $type, intval($id))) { |
| 336 | 336 | $valeurs['editable'] = ''; |
| 337 | 337 | } |
| 338 | - } |
|
| 339 | - else { |
|
| 338 | + } else { |
|
| 340 | 339 | if (!autoriser('creer', $type, 0, null, ['id_parent' => $id_parent])) { |
| 341 | 340 | $valeurs['editable'] = ''; |
| 342 | 341 | } |
@@ -364,8 +364,7 @@ discard block |
||
| 364 | 364 | } |
| 365 | 365 | if (!isset($regs[2])) { |
| 366 | 366 | $niveau = _LOG_INFO; |
| 367 | - } |
|
| 368 | - else { |
|
| 367 | + } else { |
|
| 369 | 368 | $niveau = intval($regs[2]); |
| 370 | 369 | } |
| 371 | 370 | |
@@ -1475,8 +1474,7 @@ discard block |
||
| 1475 | 1474 | ) { |
| 1476 | 1475 | if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) { |
| 1477 | 1476 | return $themefiles["$subdir$file"] = $fsize; |
| 1478 | - } |
|
| 1479 | - else { |
|
| 1477 | + } else { |
|
| 1480 | 1478 | return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px'; |
| 1481 | 1479 | } |
| 1482 | 1480 | } |
@@ -3496,8 +3494,7 @@ discard block |
||
| 3496 | 3494 | if (!in_array('svg', $formats)) { |
| 3497 | 3495 | $formats[] = 'svg'; |
| 3498 | 3496 | } |
| 3499 | - } |
|
| 3500 | - else { |
|
| 3497 | + } else { |
|
| 3501 | 3498 | $formats = array_diff($formats, ['svg']); |
| 3502 | 3499 | } |
| 3503 | 3500 | return $formats; |
@@ -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 ( |
|
| 45 | + } elseif ( |
|
| 47 | 46 | $doc = $logo[5] |
| 48 | 47 | and isset($doc['id_document']) |
| 49 | 48 | and $id_document = $doc['id_document'] |
@@ -398,8 +398,7 @@ discard block |
||
| 398 | 398 | if (lien_triables($table_lien)) { |
| 399 | 399 | if (isset($qualif['rang_lien'])) { |
| 400 | 400 | $rang = $qualif['rang_lien']; |
| 401 | - } |
|
| 402 | - else { |
|
| 401 | + } else { |
|
| 403 | 402 | $where = lien_where($primary, $id, $objet, $id_objet); |
| 404 | 403 | // si il y a deja un lien pour ce couple (avec un autre role?) on reprend le meme rang si non nul |
| 405 | 404 | if (!$rang = intval(sql_getfetsel('rang_lien', $table_lien, $where))) { |
@@ -545,8 +544,7 @@ discard block |
||
| 545 | 544 | $desc = $trouver_table($table_lien); |
| 546 | 545 | if ($desc and isset($desc['field']['rang_lien'])) { |
| 547 | 546 | $triables[$table_lien] = true; |
| 548 | - } |
|
| 549 | - else { |
|
| 547 | + } else { |
|
| 550 | 548 | $triables[$table_lien] = false; |
| 551 | 549 | } |
| 552 | 550 | } |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | $rep = sous_repertoire(_DIR_CACHE, '', false, true); |
| 59 | 59 | $rep = sous_repertoire($rep, 'calcul/', false, true); |
| 60 | 60 | $rep = sous_repertoire($rep, $d, false, true); |
| 61 | - } |
|
| 62 | - else { |
|
| 61 | + } else { |
|
| 63 | 62 | // en lecture on essaye pas de creer les repertoires, on va au plus vite |
| 64 | 63 | $rep = _DIR_CACHE . "calcul/$d/"; |
| 65 | 64 | } |
@@ -208,8 +208,7 @@ |
||
| 208 | 208 | spip_log("signature ajax form incorrecte : $form (formulaire signe mais ne correspond pas a la session)", 'formulaires' . _LOG_ERREUR); |
| 209 | 209 | return false; |
| 210 | 210 | } |
| 211 | - } |
|
| 212 | - else { |
|
| 211 | + } else { |
|
| 213 | 212 | if (!empty($sign)) { |
| 214 | 213 | spip_log("signature ajax form incorrecte : $form (formulaire signe mais pas de session)", 'formulaires' . _LOG_ERREUR); |
| 215 | 214 | return false; |