Completed
Push — master ( 4f83b9...ea8a4d )
by cam
01:04
created
ecrire/inc/journal.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 		return;
29 29
 	}
30 30
 	if ($opt) {
31
-		$phrase .= ' :: ' . str_replace("\n", ' ', join(', ', $opt));
31
+		$phrase .= ' :: '.str_replace("\n", ' ', join(', ', $opt));
32 32
 	}
33 33
 	spip_log($phrase, 'journal');
34 34
 }
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
  * @param array $opt
25 25
  */
26 26
 function inc_journal_dist($phrase, $opt = []) {
27
-	if (!strlen($phrase)) {
28
-		return;
29
-	}
30
-	if ($opt) {
31
-		$phrase .= ' :: ' . str_replace("\n", ' ', join(', ', $opt));
32
-	}
33
-	spip_log($phrase, 'journal');
27
+    if (!strlen($phrase)) {
28
+        return;
29
+    }
30
+    if ($opt) {
31
+        $phrase .= ' :: ' . str_replace("\n", ' ', join(', ', $opt));
32
+    }
33
+    spip_log($phrase, 'journal');
34 34
 }
Please login to merge, or discard this patch.
ecrire/inc/json.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 		case is_null($var):
32 32
 			return 'null';
33 33
 		case is_string($var):
34
-			return '"' . addcslashes($var, "\"\\\n\r/") . '"';
34
+			return '"'.addcslashes($var, "\"\\\n\r/").'"';
35 35
 		case is_bool($var):
36 36
 			return $var ? 'true' : 'false';
37 37
 		case is_scalar($var):
38
-			return (string)$var;
38
+			return (string) $var;
39 39
 		case is_object($var):// blam
40 40
 			$var = get_object_vars($var);
41 41
 			$asso = true;
@@ -50,19 +50,19 @@  discard block
 block discarded – undo
50 50
 			if ($asso) {
51 51
 				$ret = '{';
52 52
 				foreach ($var as $key => $elt) {
53
-					$ret .= $sep . '"' . $key . '":' . var2js($elt);
53
+					$ret .= $sep.'"'.$key.'":'.var2js($elt);
54 54
 					$sep = ',';
55 55
 				}
56 56
 
57
-				return $ret . '}';
57
+				return $ret.'}';
58 58
 			} else {
59 59
 				$ret = '[';
60 60
 				foreach ($var as $elt) {
61
-					$ret .= $sep . var2js($elt);
61
+					$ret .= $sep.var2js($elt);
62 62
 					$sep = ',';
63 63
 				}
64 64
 
65
-				return $ret . ']';
65
+				return $ret.']';
66 66
 			}
67 67
 	}
68 68
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	// flag indiquant qu'on est en iframe et qu'il faut proteger nos
83 83
 	// donnees dans un <textarea> ; attention $_FILES a ete vide par array_pop
84 84
 	if (defined('FILE_UPLOAD')) {
85
-		return '<textarea>' . spip_htmlspecialchars($var) . '</textarea>';
85
+		return '<textarea>'.spip_htmlspecialchars($var).'</textarea>';
86 86
 	} else {
87 87
 		return $var;
88 88
 	}
Please login to merge, or discard this patch.
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 // Les fonctions de toggg pour faire du JSON
@@ -25,63 +25,63 @@  discard block
 block discarded – undo
25 25
  */
26 26
 
27 27
 function var2js($var) {
28
-	$asso = false;
29
-	switch (true) {
30
-		case is_null($var):
31
-			return 'null';
32
-		case is_string($var):
33
-			return '"' . addcslashes($var, "\"\\\n\r/") . '"';
34
-		case is_bool($var):
35
-			return $var ? 'true' : 'false';
36
-		case is_scalar($var):
37
-			return (string)$var;
38
-		case is_object($var):// blam
39
-			$var = get_object_vars($var);
40
-			$asso = true;
41
-			// $var devient un array, on continue
42
-		case is_array($var):
43
-			$keys = array_keys($var);
44
-			$ikey = count($keys);
45
-			while (!$asso && $ikey--) {
46
-				$asso = $ikey !== $keys[$ikey];
47
-			}
48
-			$sep = '';
49
-			if ($asso) {
50
-				$ret = '{';
51
-				foreach ($var as $key => $elt) {
52
-					$ret .= $sep . '"' . $key . '":' . var2js($elt);
53
-					$sep = ',';
54
-				}
28
+    $asso = false;
29
+    switch (true) {
30
+        case is_null($var):
31
+            return 'null';
32
+        case is_string($var):
33
+            return '"' . addcslashes($var, "\"\\\n\r/") . '"';
34
+        case is_bool($var):
35
+            return $var ? 'true' : 'false';
36
+        case is_scalar($var):
37
+            return (string)$var;
38
+        case is_object($var):// blam
39
+            $var = get_object_vars($var);
40
+            $asso = true;
41
+            // $var devient un array, on continue
42
+        case is_array($var):
43
+            $keys = array_keys($var);
44
+            $ikey = count($keys);
45
+            while (!$asso && $ikey--) {
46
+                $asso = $ikey !== $keys[$ikey];
47
+            }
48
+            $sep = '';
49
+            if ($asso) {
50
+                $ret = '{';
51
+                foreach ($var as $key => $elt) {
52
+                    $ret .= $sep . '"' . $key . '":' . var2js($elt);
53
+                    $sep = ',';
54
+                }
55 55
 
56
-				return $ret . '}';
57
-			} else {
58
-				$ret = '[';
59
-				foreach ($var as $elt) {
60
-					$ret .= $sep . var2js($elt);
61
-					$sep = ',';
62
-				}
56
+                return $ret . '}';
57
+            } else {
58
+                $ret = '[';
59
+                foreach ($var as $elt) {
60
+                    $ret .= $sep . var2js($elt);
61
+                    $sep = ',';
62
+                }
63 63
 
64
-				return $ret . ']';
65
-			}
66
-	}
64
+                return $ret . ']';
65
+            }
66
+    }
67 67
 
68
-	return false;
68
+    return false;
69 69
 }
70 70
 
71 71
 if (!function_exists('json_encode')) {
72
-	function json_encode($v) {
73
-		return var2js($v);
74
-	}
72
+    function json_encode($v) {
73
+        return var2js($v);
74
+    }
75 75
 }
76 76
 
77 77
 function json_export($var) {
78
-	$var = json_encode($var, JSON_THROW_ON_ERROR);
78
+    $var = json_encode($var, JSON_THROW_ON_ERROR);
79 79
 
80
-	// flag indiquant qu'on est en iframe et qu'il faut proteger nos
81
-	// donnees dans un <textarea> ; attention $_FILES a ete vide par array_pop
82
-	if (defined('FILE_UPLOAD')) {
83
-		return '<textarea>' . spip_htmlspecialchars($var) . '</textarea>';
84
-	} else {
85
-		return $var;
86
-	}
80
+    // flag indiquant qu'on est en iframe et qu'il faut proteger nos
81
+    // donnees dans un <textarea> ; attention $_FILES a ete vide par array_pop
82
+    if (defined('FILE_UPLOAD')) {
83
+        return '<textarea>' . spip_htmlspecialchars($var) . '</textarea>';
84
+    } else {
85
+        return $var;
86
+    }
87 87
 }
Please login to merge, or discard this patch.
ecrire/inc/lien_court.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 /*
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
  * http://zoumzamzouilam/truc/chose/machin..."
23 23
  */
24 24
 function inc_lien_court($url) {
25
-	$long_url = defined('_MAX_LONG_URL') ? _MAX_LONG_URL : 40;
26
-	$coupe_url = defined('_MAX_COUPE_URL') ? _MAX_COUPE_URL : 35;
25
+    $long_url = defined('_MAX_LONG_URL') ? _MAX_LONG_URL : 40;
26
+    $coupe_url = defined('_MAX_COUPE_URL') ? _MAX_COUPE_URL : 35;
27 27
 
28
-	if (strlen($url) > $long_url) {
29
-		$url = substr($url, 0, $coupe_url) . '...';
30
-	}
28
+    if (strlen($url) > $long_url) {
29
+        $url = substr($url, 0, $coupe_url) . '...';
30
+    }
31 31
 
32
-	return $url;
32
+    return $url;
33 33
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 	$coupe_url = defined('_MAX_COUPE_URL') ? _MAX_COUPE_URL : 35;
27 27
 
28 28
 	if (strlen($url) > $long_url) {
29
-		$url = substr($url, 0, $coupe_url) . '...';
29
+		$url = substr($url, 0, $coupe_url).'...';
30 30
 	}
31 31
 
32 32
 	return $url;
Please login to merge, or discard this patch.
ecrire/inc/simplexml_to_array.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 			$namespace[null] = null;
58 58
 		}
59 59
 
60
-		$name = strtolower((string)$obj->getName());
61
-		$text = trim((string)$obj);
60
+		$name = strtolower((string) $obj->getName());
61
+		$text = trim((string) $obj);
62 62
 		if (strlen($text) <= 0) {
63 63
 			$text = null;
64 64
 		}
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
 			// attributes
72 72
 			$objAttributes = $obj->attributes($ns, true);
73 73
 			foreach ($objAttributes as $attributeName => $attributeValue) {
74
-				$attribName = strtolower(trim((string)$attributeName));
75
-				$attribVal = trim((string)$attributeValue);
74
+				$attribName = strtolower(trim((string) $attributeName));
75
+				$attribVal = trim((string) $attributeValue);
76 76
 				if (!empty($ns)) {
77
-					$attribName = $ns . ':' . $attribName;
77
+					$attribName = $ns.':'.$attribName;
78 78
 				}
79 79
 				$attributes[$attribName] = $attribVal;
80 80
 			}
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 			// children
83 83
 			$objChildren = $obj->children($ns, true);
84 84
 			foreach ($objChildren as $childName => $child) {
85
-				$childName = strtolower((string)$childName);
85
+				$childName = strtolower((string) $childName);
86 86
 				if (!empty($ns)) {
87
-					$childName = $ns . ':' . $childName;
87
+					$childName = $ns.':'.$childName;
88 88
 				}
89 89
 				$children[$childName][] = xmlObjToArr($child, $namespace);
90 90
 			}
Please login to merge, or discard this patch.
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
  * @return array
24 24
  */
25 25
 function inc_simplexml_to_array_dist($u, $utiliser_namespace = false) {
26
-	// decoder la chaine en SimpleXML si pas deja fait
27
-	if (is_string($u)) {
28
-		$u = simplexml_load_string($u);
29
-	}
26
+    // decoder la chaine en SimpleXML si pas deja fait
27
+    if (is_string($u)) {
28
+        $u = simplexml_load_string($u);
29
+    }
30 30
 
31
-	return ['root' => @xmlObjToArr($u, $utiliser_namespace)];
31
+    return ['root' => @xmlObjToArr($u, $utiliser_namespace)];
32 32
 }
33 33
 
34 34
 
@@ -43,67 +43,67 @@  discard block
 block discarded – undo
43 43
  **/
44 44
 function xmlObjToArr($obj, $utiliser_namespace = false) {
45 45
 
46
-	$namespace = [];
47
-	$tableau = [];
46
+    $namespace = [];
47
+    $tableau = [];
48 48
 
49
-	// Cette fonction getDocNamespaces() est longue sur de gros xml. On permet donc
50
-	// de l'activer ou pas suivant le contenu supposé du XML
51
-	if (is_object($obj)) {
52
-		if (is_array($utiliser_namespace)) {
53
-			$namespace = $utiliser_namespace;
54
-		} else {
55
-			if ($utiliser_namespace) {
56
-				$namespace = $obj->getDocNamespaces(true);
57
-			}
58
-			$namespace[null] = null;
59
-		}
49
+    // Cette fonction getDocNamespaces() est longue sur de gros xml. On permet donc
50
+    // de l'activer ou pas suivant le contenu supposé du XML
51
+    if (is_object($obj)) {
52
+        if (is_array($utiliser_namespace)) {
53
+            $namespace = $utiliser_namespace;
54
+        } else {
55
+            if ($utiliser_namespace) {
56
+                $namespace = $obj->getDocNamespaces(true);
57
+            }
58
+            $namespace[null] = null;
59
+        }
60 60
 
61
-		$name = strtolower((string)$obj->getName());
62
-		$text = trim((string)$obj);
63
-		if (strlen($text) <= 0) {
64
-			$text = null;
65
-		}
61
+        $name = strtolower((string)$obj->getName());
62
+        $text = trim((string)$obj);
63
+        if (strlen($text) <= 0) {
64
+            $text = null;
65
+        }
66 66
 
67
-		$children = [];
68
-		$attributes = [];
67
+        $children = [];
68
+        $attributes = [];
69 69
 
70
-		// get info for all namespaces
71
-		foreach ($namespace as $ns => $nsUrl) {
72
-			// attributes
73
-			$objAttributes = $obj->attributes($ns, true);
74
-			foreach ($objAttributes as $attributeName => $attributeValue) {
75
-				$attribName = strtolower(trim((string)$attributeName));
76
-				$attribVal = trim((string)$attributeValue);
77
-				if (!empty($ns)) {
78
-					$attribName = $ns . ':' . $attribName;
79
-				}
80
-				$attributes[$attribName] = $attribVal;
81
-			}
70
+        // get info for all namespaces
71
+        foreach ($namespace as $ns => $nsUrl) {
72
+            // attributes
73
+            $objAttributes = $obj->attributes($ns, true);
74
+            foreach ($objAttributes as $attributeName => $attributeValue) {
75
+                $attribName = strtolower(trim((string)$attributeName));
76
+                $attribVal = trim((string)$attributeValue);
77
+                if (!empty($ns)) {
78
+                    $attribName = $ns . ':' . $attribName;
79
+                }
80
+                $attributes[$attribName] = $attribVal;
81
+            }
82 82
 
83
-			// children
84
-			$objChildren = $obj->children($ns, true);
85
-			foreach ($objChildren as $childName => $child) {
86
-				$childName = strtolower((string)$childName);
87
-				if (!empty($ns)) {
88
-					$childName = $ns . ':' . $childName;
89
-				}
90
-				$children[$childName][] = xmlObjToArr($child, $namespace);
91
-			}
92
-		}
83
+            // children
84
+            $objChildren = $obj->children($ns, true);
85
+            foreach ($objChildren as $childName => $child) {
86
+                $childName = strtolower((string)$childName);
87
+                if (!empty($ns)) {
88
+                    $childName = $ns . ':' . $childName;
89
+                }
90
+                $children[$childName][] = xmlObjToArr($child, $namespace);
91
+            }
92
+        }
93 93
 
94
-		$tableau = [
95
-			'name' => $name,
96
-		];
97
-		if ($text) {
98
-			$tableau['text'] = $text;
99
-		}
100
-		if ($attributes) {
101
-			$tableau['attributes'] = $attributes;
102
-		}
103
-		if ($children) {
104
-			$tableau['children'] = $children;
105
-		}
106
-	}
94
+        $tableau = [
95
+            'name' => $name,
96
+        ];
97
+        if ($text) {
98
+            $tableau['text'] = $text;
99
+        }
100
+        if ($attributes) {
101
+            $tableau['attributes'] = $attributes;
102
+        }
103
+        if ($children) {
104
+            $tableau['children'] = $children;
105
+        }
106
+    }
107 107
 
108
-	return $tableau;
108
+    return $tableau;
109 109
 }
Please login to merge, or discard this patch.
ecrire/inc/precharger_article.php 1 patch
Indentation   +3 added lines, -3 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/precharger_objet');
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
  *     Couples clés / valeurs des champs du formulaire à charger.
40 40
  **/
41 41
 function inc_precharger_article_dist($id_article, $id_rubrique = 0, $lier_trad = 0) {
42
-	return precharger_objet('article', $id_article, $id_rubrique, $lier_trad, 'titre');
42
+    return precharger_objet('article', $id_article, $id_rubrique, $lier_trad, 'titre');
43 43
 }
44 44
 
45 45
 
@@ -60,5 +60,5 @@  discard block
 block discarded – undo
60 60
  *     Couples clés / valeurs des champs du formulaire à charger
61 61
  **/
62 62
 function inc_precharger_traduction_article_dist($id_article, $id_rubrique = 0, $lier_trad = 0) {
63
-	return precharger_traduction_objet('article', $id_article, $id_rubrique, $lier_trad, 'titre');
63
+    return precharger_traduction_objet('article', $id_article, $id_rubrique, $lier_trad, 'titre');
64 64
 }
Please login to merge, or discard this patch.
ecrire/base/serial.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
  **/
22 22
 
23 23
 if (!defined('_ECRIRE_INC_VERSION')) {
24
-	return;
24
+    return;
25 25
 }
26 26
 
27 27
 include_spip('base/objets');
Please login to merge, or discard this patch.
prive/objets/liste/auteurs_associer_fonctions.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 include_spip('prive/objets/liste/auteurs_fonctions');
Please login to merge, or discard this patch.
prive/objets/liste/visiteurs_fonctions.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 \***************************************************************************/
12 12
 
13 13
 if (!defined('_ECRIRE_INC_VERSION')) {
14
-	return;
14
+    return;
15 15
 }
16 16
 
17 17
 include_spip('prive/objets/liste/auteurs_fonctions');
Please login to merge, or discard this patch.
prive/squelettes/inclure/menu-navigation_fonctions.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if (!defined('_ECRIRE_INC_VERSION')) {
4
-	return;
4
+    return;
5 5
 }
6 6
 
7 7
 include_spip('inc/bandeau');
Please login to merge, or discard this patch.