@@ -553,16 +553,14 @@ |
||
| 553 | 553 | if (stripos($suite, 'SELECT') !== false) { |
| 554 | 554 | if ($echappe_textes) { |
| 555 | 555 | list($suite_echap, $textes) = query_echappe_textes($suite); |
| 556 | - } |
|
| 557 | - else { |
|
| 556 | + } else { |
|
| 558 | 557 | $suite_echap = $suite; |
| 559 | 558 | } |
| 560 | 559 | if (preg_match('/^(.*?)([(]\s*SELECT\b.*)$/si', $suite_echap, $r)) { |
| 561 | 560 | $suite_echap = $r[1] . _mysql_traite_query($r[2], $db, $prefixe, false); |
| 562 | 561 | if ($echappe_textes) { |
| 563 | 562 | $suite = query_reinjecte_textes($suite_echap, $textes); |
| 564 | - } |
|
| 565 | - else { |
|
| 563 | + } else { |
|
| 566 | 564 | $suite = $suite_echap; |
| 567 | 565 | } |
| 568 | 566 | } |
@@ -257,8 +257,7 @@ discard block |
||
| 257 | 257 | if ($id === '*') { |
| 258 | 258 | unset($GLOBALS['autoriser_exception'][$faire][$type]); |
| 259 | 259 | unset($autorisation[$faire][$type]); |
| 260 | - } |
|
| 261 | - else { |
|
| 260 | + } else { |
|
| 262 | 261 | unset($GLOBALS['autoriser_exception'][$faire][$type][$id]); |
| 263 | 262 | unset($autorisation[$faire][$type][$id]); |
| 264 | 263 | } |
@@ -617,8 +616,7 @@ discard block |
||
| 617 | 616 | function autoriser_rubrique_creer_dist(string $faire, string $type, int $id, array $qui, array $opt): bool { |
| 618 | 617 | if (!empty($opt['id_parent'])) { |
| 619 | 618 | return autoriser('creerrubriquedans', 'rubrique', $opt['id_parent'], $qui); |
| 620 | - } |
|
| 621 | - else { |
|
| 619 | + } else { |
|
| 622 | 620 | return autoriser('defaut', null, null, $qui, $opt); |
| 623 | 621 | } |
| 624 | 622 | } |
@@ -767,8 +765,7 @@ discard block |
||
| 767 | 765 | if (!empty($opt['id_parent'])) { |
| 768 | 766 | // creerarticledans rappelle autoriser(creer,article) sans id, donc on verifiera condition du else aussi |
| 769 | 767 | return autoriser('creerarticledans', 'rubrique', $opt['id_parent'], $qui); |
| 770 | - } |
|
| 771 | - else { |
|
| 768 | + } else { |
|
| 772 | 769 | return (sql_countsel('spip_rubriques') > 0 and in_array($qui['statut'], ['0minirezo', '1comite'])); |
| 773 | 770 | } |
| 774 | 771 | } |
@@ -631,8 +631,7 @@ discard block |
||
| 631 | 631 | if (!$srcHeight) { |
| 632 | 632 | $hauteur_img[$src] = $srcHeight = $srcsize[1]; |
| 633 | 633 | } |
| 634 | - } |
|
| 635 | - elseif (strpos($src, '<svg') !== false) { |
|
| 634 | + } elseif (strpos($src, '<svg') !== false) { |
|
| 636 | 635 | include_spip('inc/svg'); |
| 637 | 636 | if ($attrs = svg_lire_attributs($src)) { |
| 638 | 637 | list($width, $height, $viewbox) = svg_getimagesize_from_attr($attrs); |
@@ -3454,8 +3453,7 @@ discard block |
||
| 3454 | 3453 | ) { |
| 3455 | 3454 | if ($variante_svg_size = substr($variante_svg_generique, 0, -6) . $m[1] . '.svg' and file_exists($variante_svg_size)) { |
| 3456 | 3455 | $img_file = $variante_svg_size; |
| 3457 | - } |
|
| 3458 | - else { |
|
| 3456 | + } else { |
|
| 3459 | 3457 | $img_file = $variante_svg_generique; |
| 3460 | 3458 | } |
| 3461 | 3459 | } |
@@ -3487,8 +3485,7 @@ discard block |
||
| 3487 | 3485 | } |
| 3488 | 3486 | if (!isset($options['chemin_image']) or $options['chemin_image'] == true) { |
| 3489 | 3487 | $img_file = chemin_image($img); |
| 3490 | - } |
|
| 3491 | - else { |
|
| 3488 | + } else { |
|
| 3492 | 3489 | if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true) { |
| 3493 | 3490 | $img_file = http_img_variante_svg_si_possible($img_file); |
| 3494 | 3491 | } |
@@ -3518,11 +3515,9 @@ discard block |
||
| 3518 | 3515 | } |
| 3519 | 3516 | if ($alt === false) { |
| 3520 | 3517 | $alt = ''; |
| 3521 | - } |
|
| 3522 | - elseif ($alt or $alt === '') { |
|
| 3518 | + } elseif ($alt or $alt === '') { |
|
| 3523 | 3519 | $alt = " alt='" . attribut_html($alt) . "'"; |
| 3524 | - } |
|
| 3525 | - else { |
|
| 3520 | + } else { |
|
| 3526 | 3521 | $alt = " alt='" . attribut_html($title) . "'"; |
| 3527 | 3522 | } |
| 3528 | 3523 | return "<img src='$img_file'$alt" |
@@ -3649,13 +3644,11 @@ discard block |
||
| 3649 | 3644 | if (!is_null($class)) { |
| 3650 | 3645 | if (strlen($class)) { |
| 3651 | 3646 | $img = inserer_attribut($img, 'class', $class); |
| 3652 | - } |
|
| 3653 | - else { |
|
| 3647 | + } else { |
|
| 3654 | 3648 | $img = vider_attribut($img, 'class'); |
| 3655 | 3649 | } |
| 3656 | 3650 | } |
| 3657 | - } |
|
| 3658 | - else { |
|
| 3651 | + } else { |
|
| 3659 | 3652 | $img = http_img_pack( |
| 3660 | 3653 | $img, |
| 3661 | 3654 | $alt, |
@@ -3752,8 +3745,7 @@ discard block |
||
| 3752 | 3745 | if (!is_null($class)) { |
| 3753 | 3746 | if (strlen($class)) { |
| 3754 | 3747 | $balise_svg = inserer_attribut($balise_svg, 'class', $class); |
| 3755 | - } |
|
| 3756 | - else { |
|
| 3748 | + } else { |
|
| 3757 | 3749 | $balise_svg = vider_attribut($balise_svg, 'class'); |
| 3758 | 3750 | } |
| 3759 | 3751 | } |
@@ -3765,8 +3757,7 @@ discard block |
||
| 3765 | 3757 | $balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id); |
| 3766 | 3758 | $title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n"; |
| 3767 | 3759 | $balise_svg .= $title; |
| 3768 | - } |
|
| 3769 | - else { |
|
| 3760 | + } else { |
|
| 3770 | 3761 | $balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true'); |
| 3771 | 3762 | } |
| 3772 | 3763 | |
@@ -5143,8 +5134,7 @@ discard block |
||
| 5143 | 5134 | // reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine |
| 5144 | 5135 | if (isset($options['hash_on_content']) and $options['hash_on_content']) { |
| 5145 | 5136 | $hash = md5($contexte_implicite['host'] . '::' . $cache); |
| 5146 | - } |
|
| 5147 | - else { |
|
| 5137 | + } else { |
|
| 5148 | 5138 | unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js |
| 5149 | 5139 | ksort($contexte); |
| 5150 | 5140 | $hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect); |