Completed
Push — master ( afb18e...7b1735 )
by cam
01:21
created
ecrire/action/tester_taille.php 2 patches
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 if (!defined('_ECRIRE_INC_VERSION')) {
21
-	return;
21
+    return;
22 22
 }
23 23
 include_spip('inc/headers');
24 24
 
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
  *     Sortie du buffer
36 36
  **/
37 37
 function action_tester_taille_error_handler($output) {
38
-	// on est ici, donc echec lors de la creation de l'image
39
-	if (!empty($GLOBALS['redirect'])) {
40
-		return redirige_formulaire($GLOBALS['redirect']);
41
-	}
38
+    // on est ici, donc echec lors de la creation de l'image
39
+    if (!empty($GLOBALS['redirect'])) {
40
+        return redirige_formulaire($GLOBALS['redirect']);
41
+    }
42 42
 
43
-	return $output;
43
+    return $output;
44 44
 }
45 45
 
46 46
 
@@ -58,77 +58,77 @@  discard block
 block discarded – undo
58 58
  **/
59 59
 function action_tester_taille_dist() {
60 60
 
61
-	if (!autoriser('configurer')) {
62
-		return;
63
-	}
64
-
65
-	$taille = _request('arg');
66
-	$taille = explode('-', $taille);
67
-
68
-	$GLOBALS['taille_max'] = end($taille);
69
-	$GLOBALS['taille_min'] = 0;
70
-	if (count($taille) > 1) {
71
-		$GLOBALS['taille_min'] = reset($taille);
72
-	}
73
-
74
-	// si l'intervalle est assez petit, on garde la valeur min
75
-	if ($GLOBALS['taille_max'] * $GLOBALS['taille_max'] - $GLOBALS['taille_min'] * $GLOBALS['taille_min'] < 50000) {
76
-		$t = ($GLOBALS['taille_min'] * $GLOBALS['taille_min']);
77
-		if ($GLOBALS['taille_min'] !== $GLOBALS['taille_max']) {
78
-			$t = $t * 0.9; // marge de securite
79
-			echo round($t / 1_000_000, 3) . ' Mpx';
80
-		} else {
81
-			// c'est un cas "on a reussi la borne max initiale, donc on a pas de limite connue"
82
-			$t = 0;
83
-			echo '&infin;';
84
-		}
85
-		ecrire_meta('max_taille_vignettes', $t, 'non');
86
-		die();
87
-	}
88
-
89
-	$taille = $GLOBALS['taille_test'] = round(($GLOBALS['taille_max'] + $GLOBALS['taille_min']) / 2);
90
-
91
-	include_spip('inc/filtres');
92
-	// des inclusions representatives d'un hit prive et/ou public pour la conso memoire
93
-	include_spip('public/assembler');
94
-	include_spip('public/balises');
95
-	include_spip('public/boucles');
96
-	include_spip('public/cacher');
97
-	include_spip('public/compiler');
98
-	include_spip('public/composer');
99
-	include_spip('public/criteres');
100
-	include_spip('public/interfaces');
101
-	include_spip('public/parametrer');
102
-	include_spip('public/phraser_html');
103
-	include_spip('public/references');
104
-
105
-	include_spip('inc/presentation');
106
-	include_spip('inc/charsets');
107
-	include_spip('inc/documents');
108
-	include_spip('inc/header');
109
-	propre('<doc1>'); // charger propre avec le trairement d'un modele
110
-
111
-	$i = _request('i') + 1;
112
-	$image_source = chemin_image('test.png');
113
-	$GLOBALS['redirect'] = generer_url_action(
114
-		'tester_taille',
115
-		"i=$i&arg=" . $GLOBALS['taille_min'] . '-' . $GLOBALS['taille_test']
116
-	);
117
-
118
-	ob_start('action_tester_taille_error_handler');
119
-	filtrer('image_recadre', $image_source, $taille, $taille);
120
-	$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']);
121
-
122
-	// si la valeur intermediaire a reussi, on teste la valeur maxi qui est peut etre sous estimee
123
-	// si $GLOBALS['taille_min']==0 (car on est au premier coup)
124
-	if ($GLOBALS['taille_min'] == 0) {
125
-		$taille = $GLOBALS['taille_max'];
126
-		filtrer('image_recadre', $image_source, $taille, $taille);
127
-		$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']);
128
-	}
129
-	ob_end_clean();
130
-
131
-
132
-	// on est ici, donc pas de plantage
133
-	echo redirige_formulaire($GLOBALS['redirect']);
61
+    if (!autoriser('configurer')) {
62
+        return;
63
+    }
64
+
65
+    $taille = _request('arg');
66
+    $taille = explode('-', $taille);
67
+
68
+    $GLOBALS['taille_max'] = end($taille);
69
+    $GLOBALS['taille_min'] = 0;
70
+    if (count($taille) > 1) {
71
+        $GLOBALS['taille_min'] = reset($taille);
72
+    }
73
+
74
+    // si l'intervalle est assez petit, on garde la valeur min
75
+    if ($GLOBALS['taille_max'] * $GLOBALS['taille_max'] - $GLOBALS['taille_min'] * $GLOBALS['taille_min'] < 50000) {
76
+        $t = ($GLOBALS['taille_min'] * $GLOBALS['taille_min']);
77
+        if ($GLOBALS['taille_min'] !== $GLOBALS['taille_max']) {
78
+            $t = $t * 0.9; // marge de securite
79
+            echo round($t / 1_000_000, 3) . ' Mpx';
80
+        } else {
81
+            // c'est un cas "on a reussi la borne max initiale, donc on a pas de limite connue"
82
+            $t = 0;
83
+            echo '&infin;';
84
+        }
85
+        ecrire_meta('max_taille_vignettes', $t, 'non');
86
+        die();
87
+    }
88
+
89
+    $taille = $GLOBALS['taille_test'] = round(($GLOBALS['taille_max'] + $GLOBALS['taille_min']) / 2);
90
+
91
+    include_spip('inc/filtres');
92
+    // des inclusions representatives d'un hit prive et/ou public pour la conso memoire
93
+    include_spip('public/assembler');
94
+    include_spip('public/balises');
95
+    include_spip('public/boucles');
96
+    include_spip('public/cacher');
97
+    include_spip('public/compiler');
98
+    include_spip('public/composer');
99
+    include_spip('public/criteres');
100
+    include_spip('public/interfaces');
101
+    include_spip('public/parametrer');
102
+    include_spip('public/phraser_html');
103
+    include_spip('public/references');
104
+
105
+    include_spip('inc/presentation');
106
+    include_spip('inc/charsets');
107
+    include_spip('inc/documents');
108
+    include_spip('inc/header');
109
+    propre('<doc1>'); // charger propre avec le trairement d'un modele
110
+
111
+    $i = _request('i') + 1;
112
+    $image_source = chemin_image('test.png');
113
+    $GLOBALS['redirect'] = generer_url_action(
114
+        'tester_taille',
115
+        "i=$i&arg=" . $GLOBALS['taille_min'] . '-' . $GLOBALS['taille_test']
116
+    );
117
+
118
+    ob_start('action_tester_taille_error_handler');
119
+    filtrer('image_recadre', $image_source, $taille, $taille);
120
+    $GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']);
121
+
122
+    // si la valeur intermediaire a reussi, on teste la valeur maxi qui est peut etre sous estimee
123
+    // si $GLOBALS['taille_min']==0 (car on est au premier coup)
124
+    if ($GLOBALS['taille_min'] == 0) {
125
+        $taille = $GLOBALS['taille_max'];
126
+        filtrer('image_recadre', $image_source, $taille, $taille);
127
+        $GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']);
128
+    }
129
+    ob_end_clean();
130
+
131
+
132
+    // on est ici, donc pas de plantage
133
+    echo redirige_formulaire($GLOBALS['redirect']);
134 134
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		$t = ($GLOBALS['taille_min'] * $GLOBALS['taille_min']);
77 77
 		if ($GLOBALS['taille_min'] !== $GLOBALS['taille_max']) {
78 78
 			$t = $t * 0.9; // marge de securite
79
-			echo round($t / 1_000_000, 3) . ' Mpx';
79
+			echo round($t / 1_000_000, 3).' Mpx';
80 80
 		} else {
81 81
 			// c'est un cas "on a reussi la borne max initiale, donc on a pas de limite connue"
82 82
 			$t = 0;
@@ -112,19 +112,19 @@  discard block
 block discarded – undo
112 112
 	$image_source = chemin_image('test.png');
113 113
 	$GLOBALS['redirect'] = generer_url_action(
114 114
 		'tester_taille',
115
-		"i=$i&arg=" . $GLOBALS['taille_min'] . '-' . $GLOBALS['taille_test']
115
+		"i=$i&arg=".$GLOBALS['taille_min'].'-'.$GLOBALS['taille_test']
116 116
 	);
117 117
 
118 118
 	ob_start('action_tester_taille_error_handler');
119 119
 	filtrer('image_recadre', $image_source, $taille, $taille);
120
-	$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']);
120
+	$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-".$GLOBALS['taille_max']);
121 121
 
122 122
 	// si la valeur intermediaire a reussi, on teste la valeur maxi qui est peut etre sous estimee
123 123
 	// si $GLOBALS['taille_min']==0 (car on est au premier coup)
124 124
 	if ($GLOBALS['taille_min'] == 0) {
125 125
 		$taille = $GLOBALS['taille_max'];
126 126
 		filtrer('image_recadre', $image_source, $taille, $taille);
127
-		$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-" . $GLOBALS['taille_max']);
127
+		$GLOBALS['redirect'] = generer_url_action('tester_taille', "i=$i&arg=$taille-".$GLOBALS['taille_max']);
128 128
 	}
129 129
 	ob_end_clean();
130 130
 
Please login to merge, or discard this patch.
ecrire/action/ajouter_lien.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
  * @return void
35 35
  */
36 36
 function action_ajouter_lien_dist($arg = null) {
37
-	if (is_null($arg)) {
38
-		$securiser_action = charger_fonction('securiser_action', 'inc');
39
-		$arg = $securiser_action();
40
-	}
37
+    if (is_null($arg)) {
38
+        $securiser_action = charger_fonction('securiser_action', 'inc');
39
+        $arg = $securiser_action();
40
+    }
41 41
 
42
-	$arg = explode('-', $arg);
43
-	[$objet_source, $ids, $objet_lie, $idl] = $arg;
42
+    $arg = explode('-', $arg);
43
+    [$objet_source, $ids, $objet_lie, $idl] = $arg;
44 44
 
45
-	include_spip('action/editer_liens');
46
-	objet_associer([$objet_source => $ids], [$objet_lie => $idl]);
45
+    include_spip('action/editer_liens');
46
+    objet_associer([$objet_source => $ids], [$objet_lie => $idl]);
47 47
 }
Please login to merge, or discard this patch.
ecrire/action/debloquer_edition.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -31,17 +31,17 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function action_debloquer_edition_dist() {
33 33
 
34
-	$securiser_action = charger_fonction('securiser_action', 'inc');
35
-	$arg = $securiser_action();
34
+    $securiser_action = charger_fonction('securiser_action', 'inc');
35
+    $arg = $securiser_action();
36 36
 
37
-	if ($arg) {
38
-		include_spip('inc/drapeau_edition');
39
-		if ($arg == 'tous') {
40
-			debloquer_tous($GLOBALS['visiteur_session']['id_auteur']);
41
-		} else {
42
-			$arg = explode('-', $arg);
43
-			[$objet, $id_objet] = $arg;
44
-			debloquer_edition($GLOBALS['visiteur_session']['id_auteur'], $id_objet, $objet);
45
-		}
46
-	}
37
+    if ($arg) {
38
+        include_spip('inc/drapeau_edition');
39
+        if ($arg == 'tous') {
40
+            debloquer_tous($GLOBALS['visiteur_session']['id_auteur']);
41
+        } else {
42
+            $arg = explode('-', $arg);
43
+            [$objet, $id_objet] = $arg;
44
+            debloquer_edition($GLOBALS['visiteur_session']['id_auteur'], $id_objet, $objet);
45
+        }
46
+    }
47 47
 }
Please login to merge, or discard this patch.
ecrire/action/cookie.php 2 patches
Indentation   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 include_spip('inc/actions');
@@ -33,93 +33,93 @@  discard block
 block discarded – undo
33 33
  * @return void
34 34
  */
35 35
 function action_cookie_dist($set_cookie_admin = null, $change_session = null) {
36
-	$redirect_echec = $redirect = null;
37
-	$test_echec_cookie = null;
38
-	$url = '';
39
-	if (is_null($set_cookie_admin)) {
40
-		$set_cookie_admin = _request('cookie_admin');
41
-		$change_session = _request('change_session');
42
-		$test_echec_cookie = _request('test_echec_cookie');
36
+    $redirect_echec = $redirect = null;
37
+    $test_echec_cookie = null;
38
+    $url = '';
39
+    if (is_null($set_cookie_admin)) {
40
+        $set_cookie_admin = _request('cookie_admin');
41
+        $change_session = _request('change_session');
42
+        $test_echec_cookie = _request('test_echec_cookie');
43 43
 
44
-		// La cible de notre operation de connexion
45
-		$url = securiser_redirect_action(_request('url'));
46
-		$redirect = $url ?: generer_url_ecrire('accueil');
47
-		$redirect_echec = _request('url_echec');
48
-		if (!isset($redirect_echec)) {
49
-			if (strpos($redirect, (string) _DIR_RESTREINT_ABS) !== false) {
50
-				$redirect_echec = generer_url_public('login', '', true);
51
-			} else {
52
-				$redirect_echec = $redirect;
53
-			}
54
-		}
55
-	}
44
+        // La cible de notre operation de connexion
45
+        $url = securiser_redirect_action(_request('url'));
46
+        $redirect = $url ?: generer_url_ecrire('accueil');
47
+        $redirect_echec = _request('url_echec');
48
+        if (!isset($redirect_echec)) {
49
+            if (strpos($redirect, (string) _DIR_RESTREINT_ABS) !== false) {
50
+                $redirect_echec = generer_url_public('login', '', true);
51
+            } else {
52
+                $redirect_echec = $redirect;
53
+            }
54
+        }
55
+    }
56 56
 
57 57
 
58
-	// rejoue le cookie pour renouveler spip_session
59
-	if ($change_session == 'oui') {
60
-		$session = charger_fonction('session', 'inc');
61
-		$session(true);
62
-		spip_log('statut 204 pour ' . $_SERVER['REQUEST_URI']);
63
-		http_response_code(204); // No Content
64
-		return;
65
-	}
58
+    // rejoue le cookie pour renouveler spip_session
59
+    if ($change_session == 'oui') {
60
+        $session = charger_fonction('session', 'inc');
61
+        $session(true);
62
+        spip_log('statut 204 pour ' . $_SERVER['REQUEST_URI']);
63
+        http_response_code(204); // No Content
64
+        return;
65
+    }
66 66
 
67
-	// tentative de connexion en auth_http
68
-	if (_request('essai_auth_http') and !$GLOBALS['ignore_auth_http']) {
69
-		include_spip('inc/auth');
70
-		if (
71
-			@$_SERVER['PHP_AUTH_USER']
72
-			and @$_SERVER['PHP_AUTH_PW']
73
-			and $auteur = lire_php_auth($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])
74
-		) {
75
-			auth_loger($auteur);
76
-			redirige_par_entete(parametre_url($redirect, 't', time(), '&'));
77
-		} else {
78
-			ask_php_auth(
79
-				_T('info_connexion_refusee'),
80
-				_T('login_login_pass_incorrect'),
81
-				_T('login_retour_site'),
82
-				'url=' . rawurlencode($redirect),
83
-				_T('login_nouvelle_tentative'),
84
-				(strpos($url, (string) _DIR_RESTREINT_ABS) !== false)
85
-			);
86
-		}
87
-	} else {
88
-		// en cas de login sur bonjour=oui, on tente de poser un cookie
89
-		// puis de passer au login qui diagnostiquera l'echec de cookie
90
-		// le cas echeant.
91
-		if ($test_echec_cookie == 'oui') {
92
-			spip_setcookie('spip_session', 'test_echec_cookie');
93
-			if ($redirect) {
94
-				$redirect = parametre_url(
95
-					parametre_url($redirect_echec, 'var_echec_cookie', 'oui', '&'),
96
-					'url',
97
-					rawurlencode($redirect),
98
-					'&'
99
-				);
100
-			}
101
-		} else {
102
-			$cook = $_COOKIE['spip_admin'] ?? '';
103
-			// Suppression cookie d'admin ?
104
-			if ($set_cookie_admin == 'non') {
105
-				if ($cook) {
106
-					spip_setcookie('spip_admin', $cook, [
107
-						'expires' => time() - 3600 * 24
108
-					]);
109
-				}
110
-			} // Ajout de cookie d'admin
111
-			else {
112
-				if ($set_cookie_admin and _DUREE_COOKIE_ADMIN) {
113
-					spip_setcookie('spip_admin', $set_cookie_admin, [
114
-						'expires' => time() + max(_DUREE_COOKIE_ADMIN, 2 * _RENOUVELLE_ALEA)
115
-					]);
116
-				}
117
-			}
118
-		}
119
-	}
67
+    // tentative de connexion en auth_http
68
+    if (_request('essai_auth_http') and !$GLOBALS['ignore_auth_http']) {
69
+        include_spip('inc/auth');
70
+        if (
71
+            @$_SERVER['PHP_AUTH_USER']
72
+            and @$_SERVER['PHP_AUTH_PW']
73
+            and $auteur = lire_php_auth($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])
74
+        ) {
75
+            auth_loger($auteur);
76
+            redirige_par_entete(parametre_url($redirect, 't', time(), '&'));
77
+        } else {
78
+            ask_php_auth(
79
+                _T('info_connexion_refusee'),
80
+                _T('login_login_pass_incorrect'),
81
+                _T('login_retour_site'),
82
+                'url=' . rawurlencode($redirect),
83
+                _T('login_nouvelle_tentative'),
84
+                (strpos($url, (string) _DIR_RESTREINT_ABS) !== false)
85
+            );
86
+        }
87
+    } else {
88
+        // en cas de login sur bonjour=oui, on tente de poser un cookie
89
+        // puis de passer au login qui diagnostiquera l'echec de cookie
90
+        // le cas echeant.
91
+        if ($test_echec_cookie == 'oui') {
92
+            spip_setcookie('spip_session', 'test_echec_cookie');
93
+            if ($redirect) {
94
+                $redirect = parametre_url(
95
+                    parametre_url($redirect_echec, 'var_echec_cookie', 'oui', '&'),
96
+                    'url',
97
+                    rawurlencode($redirect),
98
+                    '&'
99
+                );
100
+            }
101
+        } else {
102
+            $cook = $_COOKIE['spip_admin'] ?? '';
103
+            // Suppression cookie d'admin ?
104
+            if ($set_cookie_admin == 'non') {
105
+                if ($cook) {
106
+                    spip_setcookie('spip_admin', $cook, [
107
+                        'expires' => time() - 3600 * 24
108
+                    ]);
109
+                }
110
+            } // Ajout de cookie d'admin
111
+            else {
112
+                if ($set_cookie_admin and _DUREE_COOKIE_ADMIN) {
113
+                    spip_setcookie('spip_admin', $set_cookie_admin, [
114
+                        'expires' => time() + max(_DUREE_COOKIE_ADMIN, 2 * _RENOUVELLE_ALEA)
115
+                    ]);
116
+                }
117
+            }
118
+        }
119
+    }
120 120
 
121
-	// Redirection finale
122
-	if ($redirect) {
123
-		redirige_par_entete($redirect, true);
124
-	}
121
+    // Redirection finale
122
+    if ($redirect) {
123
+        redirige_par_entete($redirect, true);
124
+    }
125 125
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	if ($change_session == 'oui') {
60 60
 		$session = charger_fonction('session', 'inc');
61 61
 		$session(true);
62
-		spip_log('statut 204 pour ' . $_SERVER['REQUEST_URI']);
62
+		spip_log('statut 204 pour '.$_SERVER['REQUEST_URI']);
63 63
 		http_response_code(204); // No Content
64 64
 		return;
65 65
 	}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 				_T('info_connexion_refusee'),
80 80
 				_T('login_login_pass_incorrect'),
81 81
 				_T('login_retour_site'),
82
-				'url=' . rawurlencode($redirect),
82
+				'url='.rawurlencode($redirect),
83 83
 				_T('login_nouvelle_tentative'),
84 84
 				(strpos($url, (string) _DIR_RESTREINT_ABS) !== false)
85 85
 			);
Please login to merge, or discard this patch.
ecrire/action/desinstaller_plugin.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -32,28 +32,28 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function action_desinstaller_plugin_dist() {
34 34
 
35
-	$securiser_action = charger_fonction('securiser_action', 'inc');
36
-	$arg = $securiser_action();
37
-	[$dir_plugins, $plugin] = explode('::', $arg);
38
-	$dir_type = '_DIR_PLUGINS';
39
-	if (defined('_DIR_PLUGINS_SUPPL') and $dir_plugins == _DIR_PLUGINS_SUPPL) {
40
-		$dir_type = '_DIR_PLUGINS_SUPPL';
41
-	}
42
-	$installer_plugins = charger_fonction('installer', 'plugins');
43
-	$infos = $installer_plugins($plugin, 'uninstall', $dir_type);
44
-	if ($infos and !$infos['install_test'][0]) {
45
-		include_spip('inc/plugin');
46
-		ecrire_plugin_actifs([$plugin], false, 'enleve');
47
-		$erreur = '';
48
-	} else {
49
-		$erreur = 'erreur_plugin_desinstalation_echouee';
50
-	}
51
-	if ($redirect = _request('redirect')) {
52
-		include_spip('inc/headers');
53
-		if ($erreur) {
54
-			$redirect = parametre_url($redirect, 'erreur', $erreur);
55
-		}
56
-		$redirect = str_replace('&amp;', '&', $redirect);
57
-		redirige_par_entete($redirect);
58
-	}
35
+    $securiser_action = charger_fonction('securiser_action', 'inc');
36
+    $arg = $securiser_action();
37
+    [$dir_plugins, $plugin] = explode('::', $arg);
38
+    $dir_type = '_DIR_PLUGINS';
39
+    if (defined('_DIR_PLUGINS_SUPPL') and $dir_plugins == _DIR_PLUGINS_SUPPL) {
40
+        $dir_type = '_DIR_PLUGINS_SUPPL';
41
+    }
42
+    $installer_plugins = charger_fonction('installer', 'plugins');
43
+    $infos = $installer_plugins($plugin, 'uninstall', $dir_type);
44
+    if ($infos and !$infos['install_test'][0]) {
45
+        include_spip('inc/plugin');
46
+        ecrire_plugin_actifs([$plugin], false, 'enleve');
47
+        $erreur = '';
48
+    } else {
49
+        $erreur = 'erreur_plugin_desinstalation_echouee';
50
+    }
51
+    if ($redirect = _request('redirect')) {
52
+        include_spip('inc/headers');
53
+        if ($erreur) {
54
+            $redirect = parametre_url($redirect, 'erreur', $erreur);
55
+        }
56
+        $redirect = str_replace('&amp;', '&', $redirect);
57
+        redirige_par_entete($redirect);
58
+    }
59 59
 }
Please login to merge, or discard this patch.
ecrire/balise/logo_.php 2 patches
Indentation   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 
@@ -54,84 +54,84 @@  discard block
 block discarded – undo
54 54
  */
55 55
 function balise_LOGO__dist($p) {
56 56
 
57
-	preg_match(',^LOGO_([A-Z_]+?)(|_NORMAL|_SURVOL|_RUBRIQUE)$,i', $p->nom_champ, $regs);
58
-	$type = strtolower($regs[1]);
59
-	$suite_logo = $regs[2];
60
-
61
-	// cas de #LOGO_SITE_SPIP
62
-	if ($type == 'site_spip') {
63
-		$type = 'site';
64
-		$_id_objet = "\"'0'\"";
65
-	}
66
-
67
-	$id_objet = id_table_objet($type);
68
-	if (!isset($_id_objet)) {
69
-		$_id_objet = champ_sql($id_objet, $p);
70
-	}
71
-
72
-	$fichier = ($p->etoile === '**') ? -1 : 0;
73
-	$coord = [];
74
-	$align = $lien = '';
75
-	$mode_logo = '';
76
-
77
-	if ($p->param and !$p->param[0][0]) {
78
-		$params = $p->param[0];
79
-		array_shift($params);
80
-		foreach ($params as $a) {
81
-			if ($a[0]->type === 'texte') {
82
-				$n = $a[0]->texte;
83
-				if (is_numeric($n)) {
84
-					$coord[] = $n;
85
-				} elseif (in_array($n, ['top', 'left', 'right', 'center', 'bottom'])) {
86
-					$align = $n;
87
-				} elseif (in_array($n, ['auto', 'icone', 'apercu', 'vignette'])) {
88
-					$mode_logo = $n;
89
-				}
90
-			} else {
91
-				$lien = calculer_liste($a, $p->descr, $p->boucles, $p->id_boucle);
92
-			}
93
-		}
94
-	}
95
-
96
-	$coord_x = !$coord ? 0 : intval(array_shift($coord));
97
-	$coord_y = !$coord ? 0 : intval(array_shift($coord));
98
-
99
-	if ($p->etoile === '*') {
100
-		include_spip('balise/url_');
101
-		$lien = generer_generer_url_arg($type, $p, $_id_objet);
102
-	}
103
-
104
-	$connect = $p->id_boucle ? $p->boucles[$p->id_boucle]->sql_serveur : '';
105
-	if ($type == 'document') {
106
-		$qconnect = _q($connect);
107
-		$doc = "quete_document($_id_objet, $qconnect)";
108
-		if ($fichier) {
109
-			$code = "quete_logo_file($doc, $qconnect)";
110
-		} else {
111
-			$code = "quete_logo_document($doc, " . ($lien ?: "''") . ", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)";
112
-		}
113
-		// (x=non-faux ? y : '') pour affecter x en retournant y
114
-		if ($p->descr['documents']) {
115
-			$code = '(($doublons["documents"] .= ",". '
116
-				. $_id_objet
117
-				. ") ? $code : '')";
118
-		}
119
-	} elseif ($connect) {
120
-		$code = "''";
121
-		spip_log('Les logos distants ne sont pas prevus');
122
-	} else {
123
-		$code = logo_survol($id_objet, $_id_objet, $type, $align, $fichier, $lien, $p, $suite_logo);
124
-	}
125
-
126
-	// demande de reduction sur logo avec ecriture spip 2.1 : #LOGO_xxx{200, 0}
127
-	if ($coord_x or $coord_y) {
128
-		$code = "filtrer('image_graver',filtrer('image_reduire'," . $code . ", '$coord_x', '$coord_y'))";
129
-	}
130
-
131
-	$p->code = $code;
132
-	$p->interdire_scripts = false;
133
-
134
-	return $p;
57
+    preg_match(',^LOGO_([A-Z_]+?)(|_NORMAL|_SURVOL|_RUBRIQUE)$,i', $p->nom_champ, $regs);
58
+    $type = strtolower($regs[1]);
59
+    $suite_logo = $regs[2];
60
+
61
+    // cas de #LOGO_SITE_SPIP
62
+    if ($type == 'site_spip') {
63
+        $type = 'site';
64
+        $_id_objet = "\"'0'\"";
65
+    }
66
+
67
+    $id_objet = id_table_objet($type);
68
+    if (!isset($_id_objet)) {
69
+        $_id_objet = champ_sql($id_objet, $p);
70
+    }
71
+
72
+    $fichier = ($p->etoile === '**') ? -1 : 0;
73
+    $coord = [];
74
+    $align = $lien = '';
75
+    $mode_logo = '';
76
+
77
+    if ($p->param and !$p->param[0][0]) {
78
+        $params = $p->param[0];
79
+        array_shift($params);
80
+        foreach ($params as $a) {
81
+            if ($a[0]->type === 'texte') {
82
+                $n = $a[0]->texte;
83
+                if (is_numeric($n)) {
84
+                    $coord[] = $n;
85
+                } elseif (in_array($n, ['top', 'left', 'right', 'center', 'bottom'])) {
86
+                    $align = $n;
87
+                } elseif (in_array($n, ['auto', 'icone', 'apercu', 'vignette'])) {
88
+                    $mode_logo = $n;
89
+                }
90
+            } else {
91
+                $lien = calculer_liste($a, $p->descr, $p->boucles, $p->id_boucle);
92
+            }
93
+        }
94
+    }
95
+
96
+    $coord_x = !$coord ? 0 : intval(array_shift($coord));
97
+    $coord_y = !$coord ? 0 : intval(array_shift($coord));
98
+
99
+    if ($p->etoile === '*') {
100
+        include_spip('balise/url_');
101
+        $lien = generer_generer_url_arg($type, $p, $_id_objet);
102
+    }
103
+
104
+    $connect = $p->id_boucle ? $p->boucles[$p->id_boucle]->sql_serveur : '';
105
+    if ($type == 'document') {
106
+        $qconnect = _q($connect);
107
+        $doc = "quete_document($_id_objet, $qconnect)";
108
+        if ($fichier) {
109
+            $code = "quete_logo_file($doc, $qconnect)";
110
+        } else {
111
+            $code = "quete_logo_document($doc, " . ($lien ?: "''") . ", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)";
112
+        }
113
+        // (x=non-faux ? y : '') pour affecter x en retournant y
114
+        if ($p->descr['documents']) {
115
+            $code = '(($doublons["documents"] .= ",". '
116
+                . $_id_objet
117
+                . ") ? $code : '')";
118
+        }
119
+    } elseif ($connect) {
120
+        $code = "''";
121
+        spip_log('Les logos distants ne sont pas prevus');
122
+    } else {
123
+        $code = logo_survol($id_objet, $_id_objet, $type, $align, $fichier, $lien, $p, $suite_logo);
124
+    }
125
+
126
+    // demande de reduction sur logo avec ecriture spip 2.1 : #LOGO_xxx{200, 0}
127
+    if ($coord_x or $coord_y) {
128
+        $code = "filtrer('image_graver',filtrer('image_reduire'," . $code . ", '$coord_x', '$coord_y'))";
129
+    }
130
+
131
+    $p->code = $code;
132
+    $p->interdire_scripts = false;
133
+
134
+    return $p;
135 135
 }
136 136
 
137 137
 /**
@@ -158,20 +158,20 @@  discard block
 block discarded – undo
158 158
  *     Code compilé retournant le chemin du logo ou le code HTML du logo.
159 159
  **/
160 160
 function logo_survol($id_objet, $_id_objet, $type, $align, $fichier, $_lien, $p, $suite) {
161
-	$code = "quete_logo('$id_objet', '" .
162
-		(($suite == '_SURVOL') ? 'off' :
163
-			(($suite == '_NORMAL') ? 'on' : 'ON')) .
164
-		"', $_id_objet," .
165
-		(($suite == '_RUBRIQUE') ?
166
-			champ_sql('id_rubrique', $p) :
167
-			(($type == 'rubrique') ? "quete_parent($_id_objet)" : "''")) .
168
-		', ' . intval($fichier) . ')';
169
-
170
-	if ($fichier) {
171
-		return $code;
172
-	}
173
-
174
-	$align = preg_replace(',\W,', '', $align);
175
-
176
-	return "quete_html_logo($code, '$align', " . ($_lien ?: "''") . ')';
161
+    $code = "quete_logo('$id_objet', '" .
162
+        (($suite == '_SURVOL') ? 'off' :
163
+            (($suite == '_NORMAL') ? 'on' : 'ON')) .
164
+        "', $_id_objet," .
165
+        (($suite == '_RUBRIQUE') ?
166
+            champ_sql('id_rubrique', $p) :
167
+            (($type == 'rubrique') ? "quete_parent($_id_objet)" : "''")) .
168
+        ', ' . intval($fichier) . ')';
169
+
170
+    if ($fichier) {
171
+        return $code;
172
+    }
173
+
174
+    $align = preg_replace(',\W,', '', $align);
175
+
176
+    return "quete_html_logo($code, '$align', " . ($_lien ?: "''") . ')';
177 177
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -10 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		if ($fichier) {
109 109
 			$code = "quete_logo_file($doc, $qconnect)";
110 110
 		} else {
111
-			$code = "quete_logo_document($doc, " . ($lien ?: "''") . ", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)";
111
+			$code = "quete_logo_document($doc, ".($lien ?: "''").", '$align', '$mode_logo', $coord_x, $coord_y, $qconnect)";
112 112
 		}
113 113
 		// (x=non-faux ? y : '') pour affecter x en retournant y
114 114
 		if ($p->descr['documents']) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
 	// demande de reduction sur logo avec ecriture spip 2.1 : #LOGO_xxx{200, 0}
127 127
 	if ($coord_x or $coord_y) {
128
-		$code = "filtrer('image_graver',filtrer('image_reduire'," . $code . ", '$coord_x', '$coord_y'))";
128
+		$code = "filtrer('image_graver',filtrer('image_reduire',".$code.", '$coord_x', '$coord_y'))";
129 129
 	}
130 130
 
131 131
 	$p->code = $code;
@@ -158,14 +158,12 @@  discard block
 block discarded – undo
158 158
  *     Code compilé retournant le chemin du logo ou le code HTML du logo.
159 159
  **/
160 160
 function logo_survol($id_objet, $_id_objet, $type, $align, $fichier, $_lien, $p, $suite) {
161
-	$code = "quete_logo('$id_objet', '" .
162
-		(($suite == '_SURVOL') ? 'off' :
163
-			(($suite == '_NORMAL') ? 'on' : 'ON')) .
164
-		"', $_id_objet," .
161
+	$code = "quete_logo('$id_objet', '".
162
+		(($suite == '_SURVOL') ? 'off' : (($suite == '_NORMAL') ? 'on' : 'ON')).
163
+		"', $_id_objet,".
165 164
 		(($suite == '_RUBRIQUE') ?
166
-			champ_sql('id_rubrique', $p) :
167
-			(($type == 'rubrique') ? "quete_parent($_id_objet)" : "''")) .
168
-		', ' . intval($fichier) . ')';
165
+			champ_sql('id_rubrique', $p) : (($type == 'rubrique') ? "quete_parent($_id_objet)" : "''")).
166
+		', '.intval($fichier).')';
169 167
 
170 168
 	if ($fichier) {
171 169
 		return $code;
@@ -173,5 +171,5 @@  discard block
 block discarded – undo
173 171
 
174 172
 	$align = preg_replace(',\W,', '', $align);
175 173
 
176
-	return "quete_html_logo($code, '$align', " . ($_lien ?: "''") . ')';
174
+	return "quete_html_logo($code, '$align', ".($_lien ?: "''").')';
177 175
 }
Please login to merge, or discard this patch.
ecrire/balise/url_logout.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 /**
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
  *     Pile complétée du code compilé
37 37
  **/
38 38
 function balise_URL_LOGOUT($p) {
39
-	return calculer_balise_dynamique($p, 'URL_LOGOUT', []);
39
+    return calculer_balise_dynamique($p, 'URL_LOGOUT', []);
40 40
 }
41 41
 
42 42
 
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
  *   Liste (url) des arguments collectés.
53 53
  */
54 54
 function balise_URL_LOGOUT_stat($args, $context_compil) {
55
-	$url = $args[0] ?? '';
55
+    $url = $args[0] ?? '';
56 56
 
57
-	return [$url];
57
+    return [$url];
58 58
 }
59 59
 
60 60
 /**
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
  **/
70 70
 function balise_URL_LOGOUT_dyn($cible) {
71 71
 
72
-	if (empty($GLOBALS['visiteur_session']['login']) and empty($GLOBALS['visiteur_session']['statut'])) {
73
-		return '';
74
-	}
72
+    if (empty($GLOBALS['visiteur_session']['login']) and empty($GLOBALS['visiteur_session']['statut'])) {
73
+        return '';
74
+    }
75 75
 
76
-	return generer_url_action('logout', 'logout=public&url=' . rawurlencode($cible ?: self('&')));
76
+    return generer_url_action('logout', 'logout=public&url=' . rawurlencode($cible ?: self('&')));
77 77
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,5 +73,5 @@
 block discarded – undo
73 73
 		return '';
74 74
 	}
75 75
 
76
-	return generer_url_action('logout', 'logout=public&url=' . rawurlencode($cible ?: self('&')));
76
+	return generer_url_action('logout', 'logout=public&url='.rawurlencode($cible ?: self('&')));
77 77
 }
Please login to merge, or discard this patch.
ecrire/balise/formulaire_inscription.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  **/
18 18
 
19 19
 if (!defined('_ECRIRE_INC_VERSION')) {
20
-	return;
20
+    return;
21 21
 }
22 22
 
23 23
 include_spip('base/abstract_sql');
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
  *     Pile complétée du code compilé
44 44
  **/
45 45
 function balise_FORMULAIRE_INSCRIPTION($p) {
46
-	return calculer_balise_dynamique($p, 'FORMULAIRE_INSCRIPTION', []);
46
+    return calculer_balise_dynamique($p, 'FORMULAIRE_INSCRIPTION', []);
47 47
 }
48 48
 
49 49
 /**
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
  *   - chaîne vide sinon.
73 73
  */
74 74
 function balise_FORMULAIRE_INSCRIPTION_stat($args, $context_compil) {
75
-	[$mode, $id, $retour] = array_pad($args, 3, null);
76
-	include_spip('action/inscrire_auteur');
77
-	$mode = tester_statut_inscription($mode, $id ?? 0);
75
+    [$mode, $id, $retour] = array_pad($args, 3, null);
76
+    include_spip('action/inscrire_auteur');
77
+    $mode = tester_statut_inscription($mode, $id ?? 0);
78 78
 
79
-	return $mode ? [$mode, $id, $retour] : '';
79
+    return $mode ? [$mode, $id, $retour] : '';
80 80
 }
Please login to merge, or discard this patch.
ecrire/public/styliser.php 1 patch
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  **/
21 21
 
22 22
 if (!defined('_ECRIRE_INC_VERSION')) {
23
-	return;
23
+    return;
24 24
 }
25 25
 
26 26
 // Ce fichier doit imperativement definir la fonction ci-dessous:
@@ -39,59 +39,59 @@  discard block
 block discarded – undo
39 39
  * @return array
40 40
  */
41 41
 function public_styliser_dist($fond, $contexte, $lang = '', string $connect = '') {
42
-	static $styliser_par_z;
43
-
44
-	// s'assurer que le fond est licite
45
-	// car il peut etre construit a partir d'une variable d'environnement
46
-	if (strpos($fond, '../') !== false or strncmp($fond, '/', 1) == 0) {
47
-		$fond = '404';
48
-	}
49
-
50
-	if (strncmp($fond, 'modeles/', 8) == 0) {
51
-		$modele = substr($fond, 8);
52
-		$modele = styliser_modele($modele, null, $contexte);
53
-		$fond = "modeles/$modele";
54
-	}
55
-
56
-	// Choisir entre $fond-dist.html, $fond=7.html, etc?
57
-	$id_rubrique = 0;
58
-	// Chercher le fond qui va servir de squelette
59
-	if ($r = quete_rubrique_fond($contexte)) {
60
-		[$id_rubrique, $lang] = $r;
61
-	}
62
-
63
-	// trouver un squelette du nom demande
64
-	// ne rien dire si on ne trouve pas,
65
-	// c'est l'appelant qui sait comment gerer la situation
66
-	// ou les plugins qui feront mieux dans le pipeline
67
-	$squelette = trouver_fond($fond, '', true);
68
-	$ext = $squelette['extension'];
69
-
70
-	$flux = [
71
-		'args' => [
72
-			'id_rubrique' => $id_rubrique,
73
-			'ext' => $ext,
74
-			'fond' => $fond,
75
-			'lang' => $lang,
76
-			'contexte' => $contexte, // le style d'un objet peut dependre de lui meme
77
-			'connect' => $connect
78
-		],
79
-		'data' => $squelette['fond'],
80
-	];
81
-
82
-	if (test_espace_prive() or defined('_ZPIP')) {
83
-		if (!$styliser_par_z) {
84
-			$styliser_par_z = charger_fonction('styliser_par_z', 'public');
85
-		}
86
-		$flux = $styliser_par_z($flux);
87
-	}
88
-
89
-	$flux = styliser_par_objets($flux);
90
-
91
-	// pipeline styliser
92
-	$squelette = pipeline('styliser', $flux);
93
-
94
-	return [$squelette, $ext, $ext, "$squelette.$ext"];
42
+    static $styliser_par_z;
43
+
44
+    // s'assurer que le fond est licite
45
+    // car il peut etre construit a partir d'une variable d'environnement
46
+    if (strpos($fond, '../') !== false or strncmp($fond, '/', 1) == 0) {
47
+        $fond = '404';
48
+    }
49
+
50
+    if (strncmp($fond, 'modeles/', 8) == 0) {
51
+        $modele = substr($fond, 8);
52
+        $modele = styliser_modele($modele, null, $contexte);
53
+        $fond = "modeles/$modele";
54
+    }
55
+
56
+    // Choisir entre $fond-dist.html, $fond=7.html, etc?
57
+    $id_rubrique = 0;
58
+    // Chercher le fond qui va servir de squelette
59
+    if ($r = quete_rubrique_fond($contexte)) {
60
+        [$id_rubrique, $lang] = $r;
61
+    }
62
+
63
+    // trouver un squelette du nom demande
64
+    // ne rien dire si on ne trouve pas,
65
+    // c'est l'appelant qui sait comment gerer la situation
66
+    // ou les plugins qui feront mieux dans le pipeline
67
+    $squelette = trouver_fond($fond, '', true);
68
+    $ext = $squelette['extension'];
69
+
70
+    $flux = [
71
+        'args' => [
72
+            'id_rubrique' => $id_rubrique,
73
+            'ext' => $ext,
74
+            'fond' => $fond,
75
+            'lang' => $lang,
76
+            'contexte' => $contexte, // le style d'un objet peut dependre de lui meme
77
+            'connect' => $connect
78
+        ],
79
+        'data' => $squelette['fond'],
80
+    ];
81
+
82
+    if (test_espace_prive() or defined('_ZPIP')) {
83
+        if (!$styliser_par_z) {
84
+            $styliser_par_z = charger_fonction('styliser_par_z', 'public');
85
+        }
86
+        $flux = $styliser_par_z($flux);
87
+    }
88
+
89
+    $flux = styliser_par_objets($flux);
90
+
91
+    // pipeline styliser
92
+    $squelette = pipeline('styliser', $flux);
93
+
94
+    return [$squelette, $ext, $ext, "$squelette.$ext"];
95 95
 }
96 96
 
97 97
 /**
@@ -110,32 +110,32 @@  discard block
 block discarded – undo
110 110
  *     Données du pipeline styliser
111 111
  **/
112 112
 function styliser_par_objets($flux) {
113
-	if (
114
-		test_espace_prive()
115
-		and !$squelette = $flux['data']
116
-		and strncmp($flux['args']['fond'], 'prive/objets/', 13) == 0
117
-		and $echafauder = charger_fonction('echafauder', 'prive', true)
118
-	) {
119
-		if (strncmp($flux['args']['fond'], 'prive/objets/liste/', 19) == 0) {
120
-			$table = table_objet(substr($flux['args']['fond'], 19));
121
-			$table_sql = table_objet_sql($table);
122
-			$objets = lister_tables_objets_sql();
123
-			if (isset($objets[$table_sql])) {
124
-				$flux['data'] = $echafauder($table, $table, $table_sql, 'prive/objets/liste/objets', $flux['args']['ext']);
125
-			}
126
-		}
127
-		if (strncmp($flux['args']['fond'], 'prive/objets/contenu/', 21) == 0) {
128
-			$type = substr($flux['args']['fond'], 21);
129
-			$table = table_objet($type);
130
-			$table_sql = table_objet_sql($table);
131
-			$objets = lister_tables_objets_sql();
132
-			if (isset($objets[$table_sql])) {
133
-				$flux['data'] = $echafauder($type, $table, $table_sql, 'prive/objets/contenu/objet', $flux['args']['ext']);
134
-			}
135
-		}
136
-	}
137
-
138
-	return $flux;
113
+    if (
114
+        test_espace_prive()
115
+        and !$squelette = $flux['data']
116
+        and strncmp($flux['args']['fond'], 'prive/objets/', 13) == 0
117
+        and $echafauder = charger_fonction('echafauder', 'prive', true)
118
+    ) {
119
+        if (strncmp($flux['args']['fond'], 'prive/objets/liste/', 19) == 0) {
120
+            $table = table_objet(substr($flux['args']['fond'], 19));
121
+            $table_sql = table_objet_sql($table);
122
+            $objets = lister_tables_objets_sql();
123
+            if (isset($objets[$table_sql])) {
124
+                $flux['data'] = $echafauder($table, $table, $table_sql, 'prive/objets/liste/objets', $flux['args']['ext']);
125
+            }
126
+        }
127
+        if (strncmp($flux['args']['fond'], 'prive/objets/contenu/', 21) == 0) {
128
+            $type = substr($flux['args']['fond'], 21);
129
+            $table = table_objet($type);
130
+            $table_sql = table_objet_sql($table);
131
+            $objets = lister_tables_objets_sql();
132
+            if (isset($objets[$table_sql])) {
133
+                $flux['data'] = $echafauder($type, $table, $table_sql, 'prive/objets/contenu/objet', $flux['args']['ext']);
134
+            }
135
+        }
136
+    }
137
+
138
+    return $flux;
139 139
 }
140 140
 
141 141
 /**
@@ -151,50 +151,50 @@  discard block
 block discarded – undo
151 151
  * @return array
152 152
  */
153 153
 function quete_rubrique_fond($contexte) {
154
-	static $liste_objets = null;
155
-	static $quete = [];
156
-	if (is_null($liste_objets)) {
157
-		$liste_objets = [];
158
-		include_spip('inc/urls');
159
-		include_spip('public/quete');
160
-		$l = urls_liste_objets(false);
161
-		// placer la rubrique en tete des objets
162
-		$l = array_diff($l, ['rubrique']);
163
-		array_unshift($l, 'rubrique');
164
-		foreach ($l as $objet) {
165
-			$id = id_table_objet($objet);
166
-			if (!isset($liste_objets[$id])) {
167
-				$liste_objets[$id] = objet_type($objet, false);
168
-			}
169
-		}
170
-	}
171
-	$c = array_intersect_key($contexte, $liste_objets);
172
-	if (!count($c)) {
173
-		return false;
174
-	}
175
-
176
-	$c = array_map('intval', $c);
177
-	$s = serialize($c);
178
-	if (isset($quete[$s])) {
179
-		return $quete[$s];
180
-	}
181
-
182
-	if (isset($c['id_rubrique']) and $r = $c['id_rubrique']) {
183
-		unset($c['id_rubrique']);
184
-		$c = ['id_rubrique' => $r] + $c;
185
-	}
186
-
187
-	foreach ($c as $_id => $id) {
188
-		if (
189
-			$id
190
-			and $row = quete_parent_lang(table_objet_sql($liste_objets[$_id]), $id)
191
-		) {
192
-			$lang = $row['lang'] ?? '';
193
-			if ($_id == 'id_rubrique' or (isset($row['id_rubrique']) and $id = $row['id_rubrique'])) {
194
-				return $quete[$s] = [$id, $lang];
195
-			}
196
-		}
197
-	}
198
-
199
-	return $quete[$s] = false;
154
+    static $liste_objets = null;
155
+    static $quete = [];
156
+    if (is_null($liste_objets)) {
157
+        $liste_objets = [];
158
+        include_spip('inc/urls');
159
+        include_spip('public/quete');
160
+        $l = urls_liste_objets(false);
161
+        // placer la rubrique en tete des objets
162
+        $l = array_diff($l, ['rubrique']);
163
+        array_unshift($l, 'rubrique');
164
+        foreach ($l as $objet) {
165
+            $id = id_table_objet($objet);
166
+            if (!isset($liste_objets[$id])) {
167
+                $liste_objets[$id] = objet_type($objet, false);
168
+            }
169
+        }
170
+    }
171
+    $c = array_intersect_key($contexte, $liste_objets);
172
+    if (!count($c)) {
173
+        return false;
174
+    }
175
+
176
+    $c = array_map('intval', $c);
177
+    $s = serialize($c);
178
+    if (isset($quete[$s])) {
179
+        return $quete[$s];
180
+    }
181
+
182
+    if (isset($c['id_rubrique']) and $r = $c['id_rubrique']) {
183
+        unset($c['id_rubrique']);
184
+        $c = ['id_rubrique' => $r] + $c;
185
+    }
186
+
187
+    foreach ($c as $_id => $id) {
188
+        if (
189
+            $id
190
+            and $row = quete_parent_lang(table_objet_sql($liste_objets[$_id]), $id)
191
+        ) {
192
+            $lang = $row['lang'] ?? '';
193
+            if ($_id == 'id_rubrique' or (isset($row['id_rubrique']) and $id = $row['id_rubrique'])) {
194
+                return $quete[$s] = [$id, $lang];
195
+            }
196
+        }
197
+    }
198
+
199
+    return $quete[$s] = false;
200 200
 }
Please login to merge, or discard this patch.