Completed
Push — master ( 05da1d...9a9099 )
by cam
01:15
created
ecrire/inc/editer.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -329,8 +329,7 @@
 block discarded – undo
329 329
 		if (!autoriser('modifier', $type, intval($id))){
330 330
 			$valeurs['editable'] = '';
331 331
 		}
332
-	}
333
-	else {
332
+	} else {
334 333
 		if (!autoriser('creer', $type, 0, null, ['id_parent' => $id_parent])) {
335 334
 			$valeurs['editable'] = '';
336 335
 		}
Please login to merge, or discard this patch.
ecrire/inc/autoriser.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -237,8 +237,7 @@  discard block
 block discarded – undo
237 237
 		if ($id === '*') {
238 238
 			unset($GLOBALS['autoriser_exception'][$faire][$type]);
239 239
 			unset($autorisation[$faire][$type]);
240
-		}
241
-		else {
240
+		} else {
242 241
 			unset($GLOBALS['autoriser_exception'][$faire][$type][$id]);
243 242
 			unset($autorisation[$faire][$type][$id]);
244 243
 		}
@@ -592,8 +591,7 @@  discard block
 block discarded – undo
592 591
 function autoriser_rubrique_creer_dist($faire, $type, $id, $qui, $opt) {
593 592
 	if (!empty($opt['id_parent'])) {
594 593
 		return autoriser('creerrubriquedans', 'rubrique', $opt['id_parent'], $qui);
595
-	}
596
-	else {
594
+	} else {
597 595
 		return autoriser('defaut', null, null, $qui, $opt);
598 596
 	}
599 597
 }
@@ -739,8 +737,7 @@  discard block
 block discarded – undo
739 737
 	if (!empty($opt['id_parent'])) {
740 738
 		// creerarticledans rappelle autoriser(creer,article) sans id, donc on verifiera condition du else aussi
741 739
 		return autoriser('creerarticledans', 'rubrique', $opt['id_parent'], $qui);
742
-	}
743
-	else {
740
+	} else {
744 741
 		return (sql_countsel('spip_rubriques') > 0 and in_array($qui['statut'], array('0minirezo', '1comite')));
745 742
 	}
746 743
 }
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Braces   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -606,8 +606,7 @@  discard block
 block discarded – undo
606 606
 			if (!$srcHeight) {
607 607
 				$hauteur_img[$src] = $srcHeight = $srcsize[1];
608 608
 			}
609
-		}
610
-		elseif(strpos($src, "<svg") !== false) {
609
+		} elseif(strpos($src, "<svg") !== false) {
611 610
 			include_spip('inc/svg');
612 611
 			if ($attrs = svg_lire_attributs($src)){
613 612
 				list($width, $height, $viewbox) = svg_getimagesize_from_attr($attrs);
@@ -2072,8 +2071,7 @@  discard block
 block discarded – undo
2072 2071
 				if (in_array($operation, ['ajouter', 'commuter'])
2073 2072
 					and !$is_class_presente) {
2074 2073
 					$class_new = rtrim($class_new) . " " . $c;
2075
-				}
2076
-				elseif (in_array($operation, ['supprimer', 'commuter'])
2074
+				} elseif (in_array($operation, ['supprimer', 'commuter'])
2077 2075
 					and $is_class_presente) {
2078 2076
 					$class_new = trim(preg_replace("/(^|\s)".preg_quote($c)."($|\s)/", "\\1", $class_new));
2079 2077
 				}
@@ -2083,8 +2081,7 @@  discard block
 block discarded – undo
2083 2081
 		if ($class_new !== $class_courante) {
2084 2082
 			if (strlen($class_new)) {
2085 2083
 				$balise = inserer_attribut($balise, 'class', $class_new);
2086
-			}
2087
-			elseif ($class_courante) {
2084
+			} elseif ($class_courante) {
2088 2085
 				$balise = vider_attribut($balise, 'class');
2089 2086
 			}
2090 2087
 		}
@@ -3383,8 +3380,7 @@  discard block
 block discarded – undo
3383 3380
 	}
3384 3381
 	if (!isset($options['chemin_image']) or $options['chemin_image'] == true) {
3385 3382
 		$img_file = chemin_image($img);
3386
-	}
3387
-	else {
3383
+	} else {
3388 3384
 		if (!isset($options['variante_svg_si_possible']) or $options['variante_svg_si_possible'] == true){
3389 3385
 			// on peut fournir une icone generique -xx.svg qui fera le job dans toutes les tailles, et qui est prioritaire sur le png
3390 3386
 			// si il y a un .svg a la bonne taille (-16.svg) a cote, on l'utilise en remplacement du -16.png
@@ -3393,8 +3389,7 @@  discard block
 block discarded – undo
3393 3389
 			  and file_exists($variante_svg_generique)) {
3394 3390
 				if ($variante_svg_size = substr($variante_svg_generique,0,-6) . $m[1] . ".svg" and file_exists($variante_svg_size)) {
3395 3391
 					$img_file = $variante_svg_size;
3396
-				}
3397
-				else {
3392
+				} else {
3398 3393
 					$img_file = $variante_svg_generique;
3399 3394
 				}
3400 3395
 			}
@@ -3424,11 +3419,9 @@  discard block
 block discarded – undo
3424 3419
 	}
3425 3420
 	if ($alt === false) {
3426 3421
 		$alt = '';
3427
-	}
3428
-	elseif($alt or $alt==='') {
3422
+	} elseif($alt or $alt==='') {
3429 3423
 		$alt = " alt='".attribut_html($alt)."'";
3430
-	}
3431
-	else {
3424
+	} else {
3432 3425
 		$alt = " alt='".attribut_html($title)."'";
3433 3426
 	}
3434 3427
 	return "<img src='$img_file'$alt"
@@ -3553,13 +3546,11 @@  discard block
 block discarded – undo
3553 3546
 		if (!is_null($class)) {
3554 3547
 			if (strlen($class)) {
3555 3548
 				$img = inserer_attribut($img, 'class', $class);
3556
-			}
3557
-			else {
3549
+			} else {
3558 3550
 				$img = vider_attribut($img, 'class');
3559 3551
 			}
3560 3552
 		}
3561
-	}
3562
-	else {
3553
+	} else {
3563 3554
 		$img = http_img_pack($img, $alt, $class ? " class='" . attribut_html($class) . "'" : '', '',
3564 3555
 				array('chemin_image' => false, 'utiliser_suffixe_size' => false));
3565 3556
 		if (is_null($alt)) {
@@ -3639,8 +3630,7 @@  discard block
 block discarded – undo
3639 3630
 	if (!is_null($class)) {
3640 3631
 		if (strlen($class)) {
3641 3632
 			$balise_svg = inserer_attribut($balise_svg, 'class', $class);
3642
-		}
3643
-		else {
3633
+		} else {
3644 3634
 			$balise_svg = vider_attribut($balise_svg, 'class');
3645 3635
 		}
3646 3636
 	}
@@ -3652,8 +3642,7 @@  discard block
 block discarded – undo
3652 3642
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3653 3643
 		$title = "<title id=\"$id\">" . entites_html($alt)."</title>\n";
3654 3644
 		$balise_svg .= $title;
3655
-	}
3656
-	else {
3645
+	} else {
3657 3646
 		$balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true');
3658 3647
 	}
3659 3648
 
@@ -4895,8 +4884,7 @@  discard block
 block discarded – undo
4895 4884
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
4896 4885
 	if (isset($options['hash_on_content']) and $options['hash_on_content']) {
4897 4886
 		$hash = md5($contexte_implicite['host'] . '::'. $cache);
4898
-	}
4899
-	else {
4887
+	} else {
4900 4888
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
4901 4889
 		ksort($contexte);
4902 4890
 		$hash = md5($fond . json_encode($contexte_implicite) . json_encode($contexte) . $connect);
Please login to merge, or discard this patch.
ecrire/inc/minipres.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -192,11 +192,9 @@
 block discarded – undo
192 192
 
193 193
 		if ($statut AND test_espace_prive()) {
194 194
 			$corps = bouton_action(_T('public:accueil_site'),generer_url_ecrire('accueil'));
195
-		}
196
-		elseif (!empty($_COOKIE['spip_admin'])) {
195
+		} elseif (!empty($_COOKIE['spip_admin'])) {
197 196
 			$corps = bouton_action(_T('public:lien_connecter'),generer_url_public('login'));
198
-		}
199
-		else {
197
+		} else {
200 198
 			$corps = bouton_action(_T('public:accueil_site'),$GLOBALS['meta']['adresse_site']);
201 199
 		}
202 200
 		$corps = "<div class='boutons'>$corps</div>";
Please login to merge, or discard this patch.
ecrire/inc/securiser_action.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@
 block discarded – undo
85 85
 		$url_action = self();
86 86
 		$action = _request('action');
87 87
 		$url_action = parametre_url($url_action, 'action', $action, '&');
88
-	}
89
-	else {
88
+	} else {
90 89
 		$action = parametre_url($url_action, 'action');
91 90
 	}
92 91
 
Please login to merge, or discard this patch.
ecrire/inc/plugin.php 1 patch
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -555,11 +555,9 @@  discard block
 block discarded – undo
555 555
 		if (!isset($msg[$p])) {
556 556
 			if (isset($resume['erreur']) and $resume['erreur']) {
557 557
 				$msg[$p] = array($resume['erreur']);
558
-			}
559
-			elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
558
+			} elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
560 559
 				$msg[$p] = array(plugin_message_incompatibilite($k['compatibilite'], $GLOBALS['spip_version_branche'], 'SPIP', 'necessite'));
561
-			}
562
-			elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
560
+			} elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
563 561
 				$msg[$p] = plugin_necessite($k['utilise'], $liste, 'utilise');
564 562
 			}
565 563
 		} else {
@@ -942,8 +940,7 @@  discard block
 block discarded – undo
942 940
 					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
943 941
 						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
944 942
 					}
945
-				}
946
-				else{
943
+				} else{
947 944
 					foreach ($info['chemin'] as $chemin) {
948 945
 						if (!isset($chemin['version']) or plugin_version_compatible($chemin['version'],
949 946
 								$GLOBALS['spip_version_branche'], 'spip')
@@ -1166,10 +1163,12 @@  discard block
 block discarded – undo
1166 1163
 					}
1167 1164
 					$nom = $nomlower;
1168 1165
 					// une action vide est une declaration qui ne doit pas etre compilee !
1169
-					if (!isset($GLOBALS['spip_pipeline'][$nom])) // creer le pipeline eventuel
1166
+					if (!isset($GLOBALS['spip_pipeline'][$nom])) {
1167
+					    // creer le pipeline eventuel
1170 1168
 					{
1171 1169
 						$GLOBALS['spip_pipeline'][$nom] = "";
1172 1170
 					}
1171
+					}
1173 1172
 					if ($action) {
1174 1173
 						if (strpos($GLOBALS['spip_pipeline'][$nom], "|$prefix$action") === false) {
1175 1174
 							$GLOBALS['spip_pipeline'][$nom] = preg_replace(",(\|\||$),", "|$prefix$action\\1",
@@ -1430,8 +1429,7 @@  discard block
 block discarded – undo
1430 1429
 	if (file_exists($nom)) {
1431 1430
 		if (substr($nom, -4) == '.php') {
1432 1431
 			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1433
-		}
1434
-		else {
1432
+		} else {
1435 1433
 			$fichier_tmp = $nom . '.tmp';
1436 1434
 		}
1437 1435
 		file_put_contents($fichier_tmp, $contenu);
Please login to merge, or discard this patch.
ecrire/inc/envoyer_mail.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -205,8 +205,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
ecrire/inc/acces.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -359,8 +359,7 @@
 block discarded – undo
359 359
 function generer_htpass($pass) {
360 360
 	if ($generer_htpass = charger_fonction('generer_htpass', 'inc', true)) {
361 361
 		return $generer_htpass($pass);
362
-	}
363
-	elseif (function_exists('crypt')) {
362
+	} elseif (function_exists('crypt')) {
364 363
 		return crypt($pass, initialiser_sel());
365 364
 	}
366 365
 	return '';
Please login to merge, or discard this patch.
ecrire/inc/rubriques.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,8 +77,7 @@  discard block
 block discarded – undo
77 77
 				break; // stop on a trouvé le bon champ
78 78
 			}
79 79
 		}
80
-	}
81
-	else {
80
+	} else {
82 81
 		$statuts_publies = array('publie');
83 82
 	}
84 83
 	
@@ -105,10 +104,12 @@  discard block
 block discarded – undo
105 104
 		}
106 105
 	}
107 106
 
108
-	if ($neuf) // Sauver la date de la derniere mise a jour (pour menu_rubriques)
107
+	if ($neuf) {
108
+	    // Sauver la date de la derniere mise a jour (pour menu_rubriques)
109 109
 	{
110 110
 		ecrire_meta("date_calcul_rubriques", date("U"));
111 111
 	}
112
+	}
112 113
 
113 114
 	$langues = calculer_langues_utilisees();
114 115
 	ecrire_meta('langues_utilisees', $langues);
Please login to merge, or discard this patch.