GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — develop (#1814)
by
unknown
11:57
created
classes/security/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php 3 patches
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -8,95 +8,95 @@
 block discarded – undo
8 8
 class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser
9 9
 {
10 10
 
11
-    protected function parseImplementation($var, $type, $allow_null) {
12
-        if ($allow_null && $var === null) return null;
13
-        switch ($type) {
14
-            // Note: if code "breaks" from the switch, it triggers a generic
15
-            // exception to be thrown. Specific errors can be specifically
16
-            // done here.
17
-            case self::MIXED :
18
-            case self::ISTRING :
19
-            case self::STRING :
20
-            case self::TEXT :
21
-            case self::ITEXT :
22
-                return $var;
23
-            case self::INT :
24
-                if (is_string($var) && ctype_digit($var)) $var = (int) $var;
25
-                return $var;
26
-            case self::FLOAT :
27
-                if ((is_string($var) && is_numeric($var)) || is_int($var)) $var = (float) $var;
28
-                return $var;
29
-            case self::BOOL :
30
-                if (is_int($var) && ($var === 0 || $var === 1)) {
31
-                    $var = (bool) $var;
32
-                } elseif (is_string($var)) {
33
-                    if ($var == 'on' || $var == 'true' || $var == '1') {
34
-                        $var = true;
35
-                    } elseif ($var == 'off' || $var == 'false' || $var == '0') {
36
-                        $var = false;
37
-                    } else {
38
-                        throw new HTMLPurifier_VarParserException("Unrecognized value '$var' for $type");
39
-                    }
40
-                }
41
-                return $var;
42
-            case self::ALIST :
43
-            case self::HASH :
44
-            case self::LOOKUP :
45
-                if (is_string($var)) {
46
-                    // special case: technically, this is an array with
47
-                    // a single empty string item, but having an empty
48
-                    // array is more intuitive
49
-                    if ($var == '') return array();
50
-                    if (strpos($var, "\n") === false && strpos($var, "\r") === false) {
51
-                        // simplistic string to array method that only works
52
-                        // for simple lists of tag names or alphanumeric characters
53
-                        $var = explode(',',$var);
54
-                    } else {
55
-                        $var = preg_split('/(,|[\n\r]+)/', $var);
56
-                    }
57
-                    // remove spaces
58
-                    foreach ($var as $i => $j) $var[$i] = trim($j);
59
-                    if ($type === self::HASH) {
60
-                        // key:value,key2:value2
61
-                        $nvar = array();
62
-                        foreach ($var as $keypair) {
63
-                            $c = explode(':', $keypair, 2);
64
-                            if (!isset($c[1])) continue;
65
-                            $nvar[trim($c[0])] = trim($c[1]);
66
-                        }
67
-                        $var = $nvar;
68
-                    }
69
-                }
70
-                if (!is_array($var)) break;
71
-                $keys = array_keys($var);
72
-                if ($keys === array_keys($keys)) {
73
-                    if ($type == self::ALIST) return $var;
74
-                    elseif ($type == self::LOOKUP) {
75
-                        $new = array();
76
-                        foreach ($var as $key) {
77
-                            $new[$key] = true;
78
-                        }
79
-                        return $new;
80
-                    } else break;
81
-                }
82
-                if ($type === self::ALIST) {
83
-                    trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING);
84
-                    return array_values($var);
85
-                }
86
-                if ($type === self::LOOKUP) {
87
-                    foreach ($var as $key => $value) {
88
-                        if ($value !== true) {
89
-                            trigger_error("Lookup array has non-true value at key '$key'; maybe your input array was not indexed numerically", E_USER_WARNING);
90
-                        }
91
-                        $var[$key] = true;
92
-                    }
93
-                }
94
-                return $var;
95
-            default:
96
-                $this->errorInconsistent(__CLASS__, $type);
97
-        }
98
-        $this->errorGeneric($var, $type);
99
-    }
11
+	protected function parseImplementation($var, $type, $allow_null) {
12
+		if ($allow_null && $var === null) return null;
13
+		switch ($type) {
14
+			// Note: if code "breaks" from the switch, it triggers a generic
15
+			// exception to be thrown. Specific errors can be specifically
16
+			// done here.
17
+			case self::MIXED :
18
+			case self::ISTRING :
19
+			case self::STRING :
20
+			case self::TEXT :
21
+			case self::ITEXT :
22
+				return $var;
23
+			case self::INT :
24
+				if (is_string($var) && ctype_digit($var)) $var = (int) $var;
25
+				return $var;
26
+			case self::FLOAT :
27
+				if ((is_string($var) && is_numeric($var)) || is_int($var)) $var = (float) $var;
28
+				return $var;
29
+			case self::BOOL :
30
+				if (is_int($var) && ($var === 0 || $var === 1)) {
31
+					$var = (bool) $var;
32
+				} elseif (is_string($var)) {
33
+					if ($var == 'on' || $var == 'true' || $var == '1') {
34
+						$var = true;
35
+					} elseif ($var == 'off' || $var == 'false' || $var == '0') {
36
+						$var = false;
37
+					} else {
38
+						throw new HTMLPurifier_VarParserException("Unrecognized value '$var' for $type");
39
+					}
40
+				}
41
+				return $var;
42
+			case self::ALIST :
43
+			case self::HASH :
44
+			case self::LOOKUP :
45
+				if (is_string($var)) {
46
+					// special case: technically, this is an array with
47
+					// a single empty string item, but having an empty
48
+					// array is more intuitive
49
+					if ($var == '') return array();
50
+					if (strpos($var, "\n") === false && strpos($var, "\r") === false) {
51
+						// simplistic string to array method that only works
52
+						// for simple lists of tag names or alphanumeric characters
53
+						$var = explode(',',$var);
54
+					} else {
55
+						$var = preg_split('/(,|[\n\r]+)/', $var);
56
+					}
57
+					// remove spaces
58
+					foreach ($var as $i => $j) $var[$i] = trim($j);
59
+					if ($type === self::HASH) {
60
+						// key:value,key2:value2
61
+						$nvar = array();
62
+						foreach ($var as $keypair) {
63
+							$c = explode(':', $keypair, 2);
64
+							if (!isset($c[1])) continue;
65
+							$nvar[trim($c[0])] = trim($c[1]);
66
+						}
67
+						$var = $nvar;
68
+					}
69
+				}
70
+				if (!is_array($var)) break;
71
+				$keys = array_keys($var);
72
+				if ($keys === array_keys($keys)) {
73
+					if ($type == self::ALIST) return $var;
74
+					elseif ($type == self::LOOKUP) {
75
+						$new = array();
76
+						foreach ($var as $key) {
77
+							$new[$key] = true;
78
+						}
79
+						return $new;
80
+					} else break;
81
+				}
82
+				if ($type === self::ALIST) {
83
+					trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING);
84
+					return array_values($var);
85
+				}
86
+				if ($type === self::LOOKUP) {
87
+					foreach ($var as $key => $value) {
88
+						if ($value !== true) {
89
+							trigger_error("Lookup array has non-true value at key '$key'; maybe your input array was not indexed numerically", E_USER_WARNING);
90
+						}
91
+						$var[$key] = true;
92
+					}
93
+				}
94
+				return $var;
95
+			default:
96
+				$this->errorInconsistent(__CLASS__, $type);
97
+		}
98
+		$this->errorGeneric($var, $type);
99
+	}
100 100
 
101 101
 }
102 102
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
                     if (strpos($var, "\n") === false && strpos($var, "\r") === false) {
51 51
                         // simplistic string to array method that only works
52 52
                         // for simple lists of tag names or alphanumeric characters
53
-                        $var = explode(',',$var);
53
+                        $var = explode(',', $var);
54 54
                     } else {
55 55
                         $var = preg_split('/(,|[\n\r]+)/', $var);
56 56
                     }
Please login to merge, or discard this patch.
Braces   +27 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,7 +9,9 @@  discard block
 block discarded – undo
9 9
 {
10 10
 
11 11
     protected function parseImplementation($var, $type, $allow_null) {
12
-        if ($allow_null && $var === null) return null;
12
+        if ($allow_null && $var === null) {
13
+        	return null;
14
+        }
13 15
         switch ($type) {
14 16
             // Note: if code "breaks" from the switch, it triggers a generic
15 17
             // exception to be thrown. Specific errors can be specifically
@@ -21,10 +23,14 @@  discard block
 block discarded – undo
21 23
             case self::ITEXT :
22 24
                 return $var;
23 25
             case self::INT :
24
-                if (is_string($var) && ctype_digit($var)) $var = (int) $var;
26
+                if (is_string($var) && ctype_digit($var)) {
27
+                	$var = (int) $var;
28
+                }
25 29
                 return $var;
26 30
             case self::FLOAT :
27
-                if ((is_string($var) && is_numeric($var)) || is_int($var)) $var = (float) $var;
31
+                if ((is_string($var) && is_numeric($var)) || is_int($var)) {
32
+                	$var = (float) $var;
33
+                }
28 34
                 return $var;
29 35
             case self::BOOL :
30 36
                 if (is_int($var) && ($var === 0 || $var === 1)) {
@@ -46,7 +52,9 @@  discard block
 block discarded – undo
46 52
                     // special case: technically, this is an array with
47 53
                     // a single empty string item, but having an empty
48 54
                     // array is more intuitive
49
-                    if ($var == '') return array();
55
+                    if ($var == '') {
56
+                    	return array();
57
+                    }
50 58
                     if (strpos($var, "\n") === false && strpos($var, "\r") === false) {
51 59
                         // simplistic string to array method that only works
52 60
                         // for simple lists of tag names or alphanumeric characters
@@ -55,29 +63,38 @@  discard block
 block discarded – undo
55 63
                         $var = preg_split('/(,|[\n\r]+)/', $var);
56 64
                     }
57 65
                     // remove spaces
58
-                    foreach ($var as $i => $j) $var[$i] = trim($j);
66
+                    foreach ($var as $i => $j) {
67
+                    	$var[$i] = trim($j);
68
+                    }
59 69
                     if ($type === self::HASH) {
60 70
                         // key:value,key2:value2
61 71
                         $nvar = array();
62 72
                         foreach ($var as $keypair) {
63 73
                             $c = explode(':', $keypair, 2);
64
-                            if (!isset($c[1])) continue;
74
+                            if (!isset($c[1])) {
75
+                            	continue;
76
+                            }
65 77
                             $nvar[trim($c[0])] = trim($c[1]);
66 78
                         }
67 79
                         $var = $nvar;
68 80
                     }
69 81
                 }
70
-                if (!is_array($var)) break;
82
+                if (!is_array($var)) {
83
+                	break;
84
+                }
71 85
                 $keys = array_keys($var);
72 86
                 if ($keys === array_keys($keys)) {
73
-                    if ($type == self::ALIST) return $var;
74
-                    elseif ($type == self::LOOKUP) {
87
+                    if ($type == self::ALIST) {
88
+                    	return $var;
89
+                    } elseif ($type == self::LOOKUP) {
75 90
                         $new = array();
76 91
                         foreach ($var as $key) {
77 92
                             $new[$key] = true;
78 93
                         }
79 94
                         return $new;
80
-                    } else break;
95
+                    } else {
96
+                    	break;
97
+                    }
81 98
                 }
82 99
                 if ($type === self::ALIST) {
83 100
                     trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING);
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/VarParser/Native.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@
 block discarded – undo
8 8
 class HTMLPurifier_VarParser_Native extends HTMLPurifier_VarParser
9 9
 {
10 10
 
11
-    protected function parseImplementation($var, $type, $allow_null) {
12
-        return $this->evalExpression($var);
13
-    }
11
+	protected function parseImplementation($var, $type, $allow_null) {
12
+		return $this->evalExpression($var);
13
+	}
14 14
 
15
-    protected function evalExpression($expr) {
16
-        $var = null;
17
-        $result = eval("\$var = $expr;");
18
-        if ($result === false) {
19
-            throw new HTMLPurifier_VarParserException("Fatal error in evaluated code");
20
-        }
21
-        return $var;
22
-    }
15
+	protected function evalExpression($expr) {
16
+		$var = null;
17
+		$result = eval("\$var = $expr;");
18
+		if ($result === false) {
19
+			throw new HTMLPurifier_VarParserException("Fatal error in evaluated code");
20
+		}
21
+		return $var;
22
+	}
23 23
 
24 24
 }
25 25
 
Please login to merge, or discard this patch.
classes/xml/XmlGenerator.class.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$buff = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
21 21
 
22
-		foreach($xml as $nodeName => $nodeItem)
22
+		foreach ($xml as $nodeName => $nodeItem)
23 23
 		{
24 24
 			$buff .= $this->_makexml($nodeItem);
25 25
 		}
@@ -34,16 +34,16 @@  discard block
 block discarded – undo
34 34
 	function _makexml($node)
35 35
 	{
36 36
 		$body = '';
37
-		foreach($node as $key => $value)
37
+		foreach ($node as $key => $value)
38 38
 		{
39
-			switch($key)
39
+			switch ($key)
40 40
 			{
41 41
 				case 'node_name' : break;
42 42
 				case 'attrs' : {
43 43
 						$attrs = '';
44
-						if(isset($value))
44
+						if (isset($value))
45 45
 						{
46
-							foreach($value as $attrName => $attrValue)
46
+							foreach ($value as $attrName => $attrValue)
47 47
 							{
48 48
 								$attrs .= sprintf(' %s="%s"', $attrName, htmlspecialchars($attrValue, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
49 49
 							}
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 					$body = $value;
55 55
 					break;
56 56
 				default : {
57
-						if(is_array($value))
57
+						if (is_array($value))
58 58
 						{
59
-							foreach($value as $idx => $arrNode)
59
+							foreach ($value as $idx => $arrNode)
60 60
 							{
61 61
 								$body .= $this->_makexml($arrNode);
62 62
 							}
63 63
 						}
64
-						else if(is_object($value))
64
+						else if (is_object($value))
65 65
 						{
66 66
 							$body = $this->_makexml($value);
67 67
 						}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@
 block discarded – undo
60 60
 							{
61 61
 								$body .= $this->_makexml($arrNode);
62 62
 							}
63
-						}
64
-						else if(is_object($value))
63
+						} else if(is_object($value))
65 64
 						{
66 65
 							$body = $this->_makexml($value);
67 66
 						}
Please login to merge, or discard this patch.
classes/xml/XmlJsFilter.class.php 2 patches
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
 	function XmlJsFilter($path, $xml_file)
83 83
 	{
84
-		if(substr($path, -1) !== '/')
84
+		if (substr($path, -1) !== '/')
85 85
 		{
86 86
 			$path .= '/';
87 87
 		}
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	function compile()
97 97
 	{
98
-		if(!file_exists($this->xml_file))
98
+		if (!file_exists($this->xml_file))
99 99
 		{
100 100
 			return;
101 101
 		}
102
-		if(!file_exists($this->js_file))
102
+		if (!file_exists($this->js_file))
103 103
 		{
104 104
 			$this->_compile();
105 105
 		}
106
-		else if(filemtime($this->xml_file) > filemtime($this->js_file))
106
+		else if (filemtime($this->xml_file) > filemtime($this->js_file))
107 107
 		{
108 108
 			$this->_compile();
109 109
 		}
@@ -136,25 +136,25 @@  discard block
 block discarded – undo
136 136
 
137 137
 
138 138
 		$field_node = $xml_obj->filter->form->node;
139
-		if($field_node && !is_array($field_node))
139
+		if ($field_node && !is_array($field_node))
140 140
 		{
141 141
 			$field_node = array($field_node);
142 142
 		}
143 143
 
144 144
 		$parameter_param = $xml_obj->filter->parameter->param;
145
-		if($parameter_param && !is_array($parameter_param))
145
+		if ($parameter_param && !is_array($parameter_param))
146 146
 		{
147 147
 			$parameter_param = array($parameter_param);
148 148
 		}
149 149
 
150 150
 		$response_tag = $xml_obj->filter->response->tag;
151
-		if($response_tag && !is_array($response_tag))
151
+		if ($response_tag && !is_array($response_tag))
152 152
 		{
153 153
 			$response_tag = array($response_tag);
154 154
 		}
155 155
 
156 156
 		// If extend_filter exists, result returned by calling the method
157
-		if($extend_filter)
157
+		if ($extend_filter)
158 158
 		{
159 159
 			// If extend_filter exists, it changes the name of cache not to use cache
160 160
 			$this->js_file .= '.nocache.js';
@@ -163,24 +163,24 @@  discard block
 block discarded – undo
163 163
 			list($module_name, $method) = explode('.', $extend_filter);
164 164
 
165 165
 			// contibue if both module_name and methos exist.
166
-			if($module_name && $method)
166
+			if ($module_name && $method)
167 167
 			{
168 168
 				// get model object of the module
169 169
 				$oExtendFilter = getModel($module_name);
170 170
 
171 171
 				// execute if method exists
172
-				if(method_exists($oExtendFilter, $method))
172
+				if (method_exists($oExtendFilter, $method))
173 173
 				{
174 174
 					// get the result
175 175
 					$extend_filter_list = $oExtendFilter->{$method}(TRUE);
176 176
 					$extend_filter_count = count($extend_filter_list);
177 177
 
178 178
 					// apply lang_value from the result to the variable
179
-					for($i = 0; $i < $extend_filter_count; $i++)
179
+					for ($i = 0; $i < $extend_filter_count; $i++)
180 180
 					{
181 181
 						$name = $extend_filter_list[$i]->name;
182 182
 						$lang_value = $extend_filter_list[$i]->lang;
183
-						if($lang_value)
183
+						if ($lang_value)
184 184
 						{
185 185
 							$lang->{$name} = $lang_value;
186 186
 						}
@@ -200,15 +200,15 @@  discard block
 block discarded – undo
200 200
 		$fields = array();
201 201
 
202 202
 		// create custom rule
203
-		if($rules && $rules->rule)
203
+		if ($rules && $rules->rule)
204 204
 		{
205
-			if(!is_array($rules->rule))
205
+			if (!is_array($rules->rule))
206 206
 			{
207 207
 				$rules->rule = array($rules->rule);
208 208
 			}
209
-			foreach($rules->rule as $r)
209
+			foreach ($rules->rule as $r)
210 210
 			{
211
-				if($r->attrs->type == 'regex')
211
+				if ($r->attrs->type == 'regex')
212 212
 				{
213 213
 					$js_rules[] = "v.cast('ADD_RULE', ['{$r->attrs->name}', {$r->body}]);";
214 214
 				}
@@ -217,14 +217,14 @@  discard block
 block discarded – undo
217 217
 
218 218
 		// generates a field, which is a script of the checked item
219 219
 		$node_count = count($field_node);
220
-		if($node_count)
220
+		if ($node_count)
221 221
 		{
222
-			foreach($field_node as $key => $node)
222
+			foreach ($field_node as $key => $node)
223 223
 			{
224 224
 				$attrs = $node->attrs;
225 225
 				$target = trim($attrs->target);
226 226
 
227
-				if(!$target)
227
+				if (!$target)
228 228
 				{
229 229
 					continue;
230 230
 				}
@@ -234,34 +234,34 @@  discard block
 block discarded – undo
234 234
 
235 235
 				$field = array();
236 236
 
237
-				if($attrs->required == 'true')
237
+				if ($attrs->required == 'true')
238 238
 				{
239 239
 					$field[] = 'required:true';
240 240
 				}
241
-				if($attrs->minlength > 0)
241
+				if ($attrs->minlength > 0)
242 242
 				{
243 243
 					$field[] = 'minlength:' . $attrs->minlength;
244 244
 				}
245
-				if($attrs->maxlength > 0)
245
+				if ($attrs->maxlength > 0)
246 246
 				{
247 247
 					$field[] = 'maxlength:' . $attrs->maxlength;
248 248
 				}
249
-				if($equalto)
249
+				if ($equalto)
250 250
 				{
251 251
 					$field[] = "equalto:'{$attrs->equalto}'";
252 252
 				}
253
-				if($rule)
253
+				if ($rule)
254 254
 				{
255 255
 					$field[] = "rule:'{$rule}'";
256 256
 				}
257 257
 
258 258
 				$fields[] = "'{$target}': {" . implode(',', $field) . "}";
259 259
 
260
-				if(!in_array($target, $target_list))
260
+				if (!in_array($target, $target_list))
261 261
 				{
262 262
 					$target_list[] = $target;
263 263
 				}
264
-				if(!$target_type_list[$target])
264
+				if (!$target_type_list[$target])
265 265
 				{
266 266
 					$target_type_list[$target] = $filter;
267 267
 				}
@@ -271,12 +271,12 @@  discard block
 block discarded – undo
271 271
 		// Check extend_filter_item
272 272
 		$rule_types = array('homepage' => 'homepage', 'email_address' => 'email');
273 273
 
274
-		for($i = 0; $i < $extend_filter_count; $i++)
274
+		for ($i = 0; $i < $extend_filter_count; $i++)
275 275
 		{
276 276
 			$filter_item = $extend_filter_list[$i];
277 277
 			$target = trim($filter_item->name);
278 278
 
279
-			if(!$target)
279
+			if (!$target)
280 280
 			{
281 281
 				continue;
282 282
 			}
@@ -287,21 +287,21 @@  discard block
 block discarded – undo
287 287
 			$required = ($filter_item->required == 'true');
288 288
 
289 289
 			$field = array();
290
-			if($required)
290
+			if ($required)
291 291
 			{
292 292
 				$field[] = 'required:true';
293 293
 			}
294
-			if($rule)
294
+			if ($rule)
295 295
 			{
296 296
 				$field[] = "rule:'{$rule}'";
297 297
 			}
298 298
 			$fields[] = "\t\t'{$target}' : {" . implode(',', $field) . "}";
299 299
 
300
-			if(!in_array($target, $target_list))
300
+			if (!in_array($target, $target_list))
301 301
 			{
302 302
 				$target_list[] = $target;
303 303
 			}
304
-			if(!$target_type_list[$target])
304
+			if (!$target_type_list[$target])
305 305
 			{
306 306
 				$target_type_list[$target] = $type;
307 307
 			}
@@ -310,37 +310,37 @@  discard block
 block discarded – undo
310 310
 		// generates parameter script to create dbata
311 311
 		$rename_params = array();
312 312
 		$parameter_count = count($parameter_param);
313
-		if($parameter_count)
313
+		if ($parameter_count)
314 314
 		{
315 315
 			// contains parameter of the default filter contents
316
-			foreach($parameter_param as $key => $param)
316
+			foreach ($parameter_param as $key => $param)
317 317
 			{
318 318
 				$attrs = $param->attrs;
319 319
 				$name = trim($attrs->name);
320 320
 				$target = trim($attrs->target);
321 321
 
322 322
 				//if($name && $target && ($name != $target)) $js_doc[] = "\t\tparams['{$name}'] = params['{$target}']; delete params['{$target}'];";
323
-				if($name && $target && ($name != $target))
323
+				if ($name && $target && ($name != $target))
324 324
 				{
325 325
 					$rename_params[] = "'{$target}':'{$name}'";
326 326
 				}
327
-				if($name && !in_array($name, $target_list))
327
+				if ($name && !in_array($name, $target_list))
328 328
 				{
329 329
 					$target_list[] = $name;
330 330
 				}
331 331
 			}
332 332
 
333 333
 			// Check extend_filter_item
334
-			for($i = 0; $i < $extend_filter_count; $i++)
334
+			for ($i = 0; $i < $extend_filter_count; $i++)
335 335
 			{
336 336
 				$filter_item = $extend_filter_list[$i];
337 337
 				$target = $name = trim($filter_item->name);
338
-				if(!$name || !$target)
338
+				if (!$name || !$target)
339 339
 				{
340 340
 					continue;
341 341
 				}
342 342
 
343
-				if(!in_array($name, $target_list))
343
+				if (!in_array($name, $target_list))
344 344
 				{
345 345
 					$target_list[] = $name;
346 346
 				}
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 		// generates the response script
351 351
 		$response_count = count($response_tag);
352 352
 		$responses = array();
353
-		for($i = 0; $i < $response_count; $i++)
353
+		for ($i = 0; $i < $response_count; $i++)
354 354
 		{
355 355
 			$attrs = $response_tag[$i]->attrs;
356 356
 			$name = $attrs->name;
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
 
360 360
 		// writes lang values of the form field
361 361
 		$target_count = count($target_list);
362
-		for($i = 0; $i < $target_count; $i++)
362
+		for ($i = 0; $i < $target_count; $i++)
363 363
 		{
364 364
 			$target = $target_list[$i];
365
-			if(!$lang->{$target})
365
+			if (!$lang->{$target})
366 366
 			{
367 367
 				$lang->{$target} = $target;
368 368
 			}
@@ -381,9 +381,9 @@  discard block
 block discarded – undo
381 381
 		 */
382 382
 
383 383
 		// writes error messages
384
-		foreach($lang->filter as $key => $val)
384
+		foreach ($lang->filter as $key => $val)
385 385
 		{
386
-			if(!$val)
386
+			if (!$val)
387 387
 			{
388 388
 				$val = $key;
389 389
 			}
@@ -392,13 +392,13 @@  discard block
 block discarded – undo
392 392
 		}
393 393
 
394 394
 		$callback_func = $xml_obj->filter->response->attrs->callback_func;
395
-		if(!$callback_func)
395
+		if (!$callback_func)
396 396
 		{
397 397
 			$callback_func = "filterAlertMessage";
398 398
 		}
399 399
 
400 400
 		$confirm_msg = '';
401
-		if($confirm_msg_code)
401
+		if ($confirm_msg_code)
402 402
 		{
403 403
 			$confirm_msg = $lang->{$confirm_msg_code};
404 404
 		}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,8 +102,7 @@
 block discarded – undo
102 102
 		if(!file_exists($this->js_file))
103 103
 		{
104 104
 			$this->_compile();
105
-		}
106
-		else if(filemtime($this->xml_file) > filemtime($this->js_file))
105
+		} else if(filemtime($this->xml_file) > filemtime($this->js_file))
107 106
 		{
108 107
 			$this->_compile();
109 108
 		}
Please login to merge, or discard this patch.
classes/xml/xmlquery/DBParser.class.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	function DBParser($escape_char_left, $escape_char_right = "", $table_prefix = "xe_")
64 64
 	{
65 65
 		$this->escape_char_left = $escape_char_left;
66
-		if($escape_char_right !== "")
66
+		if ($escape_char_right !== "")
67 67
 		{
68 68
 			$this->escape_char_right = $escape_char_right;
69 69
 		}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	function getEscapeChar($leftOrRight)
84 84
 	{
85
-		if($leftOrRight === 'left')
85
+		if ($leftOrRight === 'left')
86 86
 		{
87 87
 			return $this->escape_char_left;
88 88
 		}
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	function escapeStringValue($value)
124 124
 	{
125
-		if($value == "*")
125
+		if ($value == "*")
126 126
 		{
127 127
 			return $value;
128 128
 		}
129
-		if(is_string($value))
129
+		if (is_string($value))
130 130
 		{
131 131
 			return $value = str_replace("'", "''", $value);
132 132
 		}
@@ -165,11 +165,11 @@  discard block
 block discarded – undo
165 165
 	 */
166 166
 	function escapeColumn($column_name)
167 167
 	{
168
-		if($this->isUnqualifiedColumnName($column_name))
168
+		if ($this->isUnqualifiedColumnName($column_name))
169 169
 		{
170 170
 			return $this->escape($column_name);
171 171
 		}
172
-		if($this->isQualifiedColumnName($column_name))
172
+		if ($this->isQualifiedColumnName($column_name))
173 173
 		{
174 174
 			list($table, $column) = explode('.', $column_name);
175 175
 			// $table can also be an alias, so the prefix should not be added
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	function isUnqualifiedColumnName($column_name)
191 191
 	{
192
-		if(strpos($column_name, '.') === FALSE && strpos($column_name, '(') === FALSE)
192
+		if (strpos($column_name, '.') === FALSE && strpos($column_name, '(') === FALSE)
193 193
 		{
194 194
 			return TRUE;
195 195
 		}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 */
208 208
 	function isQualifiedColumnName($column_name)
209 209
 	{
210
-		if(strpos($column_name, '.') !== FALSE && strpos($column_name, '(') === FALSE)
210
+		if (strpos($column_name, '.') !== FALSE && strpos($column_name, '(') === FALSE)
211 211
 		{
212 212
 			return TRUE;
213 213
 		}
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
 	function parseExpression($column_name)
236 236
 	{
237 237
 		$functions = preg_split('/([\+\-\*\/\ ])/', $column_name, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
238
-		foreach($functions as $k => $v)
238
+		foreach ($functions as $k => $v)
239 239
 		{
240 240
 			$function = &$functions[$k];
241
-			if(strlen($function) == 1)
241
+			if (strlen($function) == 1)
242 242
 			{
243 243
 				continue; // skip delimiters
244 244
 			}
@@ -246,25 +246,25 @@  discard block
 block discarded – undo
246 246
 			$matches = preg_split('/([a-zA-Z0-9_*]+)/', $function, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
247 247
 			$total_brackets = substr_count($function, "(");
248 248
 			$brackets = 0;
249
-			foreach($matches as $i => $j)
249
+			foreach ($matches as $i => $j)
250 250
 			{
251 251
 				$match = &$matches[$i];
252
-				if($match == '(')
252
+				if ($match == '(')
253 253
 				{
254 254
 					$brackets++;
255 255
 					continue;
256 256
 				}
257
-				if(strpos($match, ')') !== FALSE)
257
+				if (strpos($match, ')') !== FALSE)
258 258
 				{
259 259
 					continue;
260 260
 				}
261
-				if(in_array($match, array(',', '.')))
261
+				if (in_array($match, array(',', '.')))
262 262
 				{
263 263
 					continue;
264 264
 				}
265
-				if($brackets == $total_brackets)
265
+				if ($brackets == $total_brackets)
266 266
 				{
267
-					if(!is_numeric($match) && !in_array(strtoupper($match), array('UNSIGNED', 'INTEGER', 'AS')))
267
+					if (!is_numeric($match) && !in_array(strtoupper($match), array('UNSIGNED', 'INTEGER', 'AS')))
268 268
 					{
269 269
 						$match = $this->escapeColumnExpression($match);
270 270
 					}
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 	 */
284 284
 	function isStar($column_name)
285 285
 	{
286
-		if(substr($column_name, -1) == '*')
286
+		if (substr($column_name, -1) == '*')
287 287
 		{
288 288
 			return TRUE;
289 289
 		}
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	 */
300 300
 	function isStarFunction($column_name)
301 301
 	{
302
-		if(strpos($column_name, "(*)") !== FALSE)
302
+		if (strpos($column_name, "(*)") !== FALSE)
303 303
 		{
304 304
 			return TRUE;
305 305
 		}
@@ -313,15 +313,15 @@  discard block
 block discarded – undo
313 313
 	 */
314 314
 	function escapeColumnExpression($column_name)
315 315
 	{
316
-		if($this->isStar($column_name))
316
+		if ($this->isStar($column_name))
317 317
 		{
318 318
 			return $column_name;
319 319
 		}
320
-		if($this->isStarFunction($column_name))
320
+		if ($this->isStarFunction($column_name))
321 321
 		{
322 322
 			return $column_name;
323 323
 		}
324
-		if(stripos($column_name, 'distinct') !== FALSE)
324
+		if (stripos($column_name, 'distinct') !== FALSE)
325 325
 		{
326 326
 			return $column_name;
327 327
 		}
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@  discard block
 block discarded – undo
85 85
 		if(strpos($name, '.') === FALSE)
86 86
 		{
87 87
 			$this->column_name = $name;
88
-		}
89
-		else
88
+		} else
90 89
 		{
91 90
 			list($prefix, $name) = explode('.', $name);
92 91
 			$this->column_name = $name;
@@ -159,8 +158,7 @@  discard block
 block discarded – undo
159 158
 					, $this->argument_name
160 159
 					, $this->argument_name
161 160
 			);
162
-		}
163
-		else
161
+		} else
164 162
 		{
165 163
 			$arg = sprintf("\n" . '${\'%s_argument\'} = new Argument(\'%s\', %s);' . "\n"
166 164
 					, $this->argument_name
Please login to merge, or discard this patch.
classes/xml/xmlquery/queryargument/DefaultValue.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	{
71 71
 		return $this->_is_string;
72 72
 		$str_pos = strpos($this->value, '(');
73
-		if($str_pos === false)
73
+		if ($str_pos === false)
74 74
 		{
75 75
 			return TRUE;
76 76
 		}
@@ -99,21 +99,21 @@  discard block
 block discarded – undo
99 99
 
100 100
 	function _setValue()
101 101
 	{
102
-		if(!isset($this->value))
102
+		if (!isset($this->value))
103 103
 		{
104 104
 			return;
105 105
 		}
106 106
 
107 107
 		// If value contains comma separated values and does not contain paranthesis
108 108
 		//  -> default value is an array
109
-		if(strpos($this->value, ',') !== FALSE && strpos($this->value, '(') === FALSE)
109
+		if (strpos($this->value, ',') !== FALSE && strpos($this->value, '(') === FALSE)
110 110
 		{
111 111
 			return sprintf('array(%s)', $this->value);
112 112
 		}
113 113
 
114 114
 		$str_pos = strpos($this->value, '(');
115 115
 		// // TODO Replace this with parseExpression
116
-		if($str_pos === FALSE)
116
+		if ($str_pos === FALSE)
117 117
 		{
118 118
 			$this->_is_string = TRUE;
119 119
 			return '\'' . $this->value . '\'';
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		$func_name = substr($this->value, 0, $str_pos);
124 124
 		$args = substr($this->value, $str_pos + 1, -1);
125 125
 
126
-		switch($func_name)
126
+		switch ($func_name)
127 127
 		{
128 128
 			case 'ipaddress' :
129 129
 				$val = '$_SERVER[\'REMOTE_ADDR\']';
Please login to merge, or discard this patch.
classes/xml/xmlquery/queryargument/QueryArgument.class.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 		static $number_of_arguments = 0;
64 64
 
65 65
 		$this->argument_name = $tag->attrs->var;
66
-		if(!$this->argument_name)
66
+		if (!$this->argument_name)
67 67
 		{
68 68
 			$this->argument_name = str_replace('.', '_', $tag->attrs->name);
69 69
 		}
70
-		if(!$this->argument_name)
70
+		if (!$this->argument_name)
71 71
 		{
72 72
 			$this->argument_name = str_replace('.', '_', $tag->attrs->column);
73 73
 		}
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
 		$this->argument_name .= $number_of_arguments;
79 79
 
80 80
 		$name = $tag->attrs->name;
81
-		if(!$name)
81
+		if (!$name)
82 82
 		{
83 83
 			$name = $tag->attrs->column;
84 84
 		}
85
-		if(strpos($name, '.') === FALSE)
85
+		if (strpos($name, '.') === FALSE)
86 86
 		{
87 87
 			$this->column_name = $name;
88 88
 		}
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 			$this->table_name = $prefix;
94 94
 		}
95 95
 
96
-		if($tag->attrs->operation)
96
+		if ($tag->attrs->operation)
97 97
 		{
98 98
 			$this->operation = $tag->attrs->operation;
99 99
 		}
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
 	function isConditionArgument()
126 126
 	{
127
-		if($this->operation)
127
+		if ($this->operation)
128 128
 		{
129 129
 			return TRUE;
130 130
 		}
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 */
138 138
 	function toString()
139 139
 	{
140
-		if($this->isConditionArgument())
140
+		if ($this->isConditionArgument())
141 141
 		{
142 142
 			// Instantiation
143 143
 			$arg = sprintf("\n" . '${\'%s_argument\'} = new ConditionArgument(\'%s\', %s, \'%s\');' . "\n"
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 		}
177 177
 
178 178
 		// If the argument is null, skip it
179
-		if($this->argument_validator->isIgnorable())
179
+		if ($this->argument_validator->isIgnorable())
180 180
 		{
181 181
 			$arg = sprintf("if(isset(%s)) {", '$args->' . $this->variable_name)
182 182
 					. $arg
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@  discard block
 block discarded – undo
85 85
 		if(strpos($name, '.') === FALSE)
86 86
 		{
87 87
 			$this->column_name = $name;
88
-		}
89
-		else
88
+		} else
90 89
 		{
91 90
 			list($prefix, $name) = explode('.', $name);
92 91
 			$this->column_name = $name;
@@ -159,8 +158,7 @@  discard block
 block discarded – undo
159 158
 					, $this->argument_name
160 159
 					, $this->argument_name
161 160
 			);
162
-		}
163
-		else
161
+		} else
164 162
 		{
165 163
 			$arg = sprintf("\n" . '${\'%s_argument\'} = new Argument(\'%s\', %s);' . "\n"
166 164
 					, $this->argument_name
Please login to merge, or discard this patch.
xml/xmlquery/queryargument/validator/QueryArgumentValidator.class.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 	function isIgnorable()
75 75
 	{
76
-		if(isset($this->default_value) || isset($this->notnull))
76
+		if (isset($this->default_value) || isset($this->notnull))
77 77
 		{
78 78
 			return FALSE;
79 79
 		}
@@ -83,33 +83,33 @@  discard block
 block discarded – undo
83 83
 	function toString()
84 84
 	{
85 85
 		$validator = '';
86
-		if($this->filter)
86
+		if ($this->filter)
87 87
 		{
88 88
 			$validator .= sprintf('${\'%s_argument\'}->checkFilter(\'%s\');' . "\n"
89 89
 					, $this->argument_name
90 90
 					, $this->filter
91 91
 			);
92 92
 		}
93
-		if($this->min_length)
93
+		if ($this->min_length)
94 94
 		{
95 95
 			$validator .= sprintf('${\'%s_argument\'}->checkMinLength(%s);' . "\n"
96 96
 					, $this->argument_name
97 97
 					, $this->min_length
98 98
 			);
99 99
 		}
100
-		if($this->max_length)
100
+		if ($this->max_length)
101 101
 		{
102 102
 			$validator .= sprintf('${\'%s_argument\'}->checkMaxLength(%s);' . "\n"
103 103
 					, $this->argument_name
104 104
 					, $this->max_length
105 105
 			);
106 106
 		}
107
-		if(isset($this->default_value))
107
+		if (isset($this->default_value))
108 108
 		{
109 109
 			$this->default_value = new DefaultValue($this->argument_name, $this->default_value);
110
-			if($this->default_value->isSequence())
110
+			if ($this->default_value->isSequence())
111 111
 				$validator .= '$db = DB::getInstance(); $sequence = $db->getNextSequence(); ';
112
-			if($this->default_value->isOperation())
112
+			if ($this->default_value->isOperation())
113 113
 			{
114 114
 				$validator .= sprintf('${\'%s_argument\'}->setColumnOperation(\'%s\');' . "\n"
115 115
 						, $this->argument_name
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 					, $this->default_value->toString()
122 122
 			);
123 123
 		}
124
-		if($this->notnull)
124
+		if ($this->notnull)
125 125
 		{
126 126
 			$validator .= sprintf('${\'%s_argument\'}->checkNotNull();' . "\n"
127 127
 					, $this->argument_name
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,8 +107,9 @@
 block discarded – undo
107 107
 		if(isset($this->default_value))
108 108
 		{
109 109
 			$this->default_value = new DefaultValue($this->argument_name, $this->default_value);
110
-			if($this->default_value->isSequence())
111
-				$validator .= '$db = DB::getInstance(); $sequence = $db->getNextSequence(); ';
110
+			if($this->default_value->isSequence()) {
111
+							$validator .= '$db = DB::getInstance(); $sequence = $db->getNextSequence(); ';
112
+			}
112 113
 			if($this->default_value->isOperation())
113 114
 			{
114 115
 				$validator .= sprintf('${\'%s_argument\'}->setColumnOperation(\'%s\');' . "\n"
Please login to merge, or discard this patch.
classes/xml/xmlquery/tags/column/InsertColumnsTag.class.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,23 +28,23 @@  discard block
 block discarded – undo
28 28
 	{
29 29
 		$this->columns = array();
30 30
 
31
-		if(!$xml_columns)
31
+		if (!$xml_columns)
32 32
 		{
33 33
 			return;
34 34
 		}
35 35
 
36
-		if(!is_array($xml_columns))
36
+		if (!is_array($xml_columns))
37 37
 		{
38 38
 			$xml_columns = array($xml_columns);
39 39
 		}
40 40
 
41
-		foreach($xml_columns as $column)
41
+		foreach ($xml_columns as $column)
42 42
 		{
43
-			if($column->name === 'query')
43
+			if ($column->name === 'query')
44 44
 			{
45 45
 				$this->columns[] = new QueryTag($column, TRUE);
46 46
 			}
47
-			else if(!isset($column->attrs->var) && !isset($column->attrs->default))
47
+			else if (!isset($column->attrs->var) && !isset($column->attrs->default))
48 48
 			{
49 49
 				$this->columns[] = new InsertColumnTagWithoutArgument($column);
50 50
 			}
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	function toString()
64 64
 	{
65 65
 		$output_columns = 'array(' . PHP_EOL;
66
-		foreach($this->columns as $column)
66
+		foreach ($this->columns as $column)
67 67
 		{
68 68
 			$output_columns .= $column->getExpressionString() . PHP_EOL . ',';
69 69
 		}
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	function getArguments()
81 81
 	{
82 82
 		$arguments = array();
83
-		foreach($this->columns as $column)
83
+		foreach ($this->columns as $column)
84 84
 		{
85 85
 			$arguments[] = $column->getArgument();
86 86
 		}
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,12 +43,10 @@
 block discarded – undo
43 43
 			if($column->name === 'query')
44 44
 			{
45 45
 				$this->columns[] = new QueryTag($column, TRUE);
46
-			}
47
-			else if(!isset($column->attrs->var) && !isset($column->attrs->default))
46
+			} else if(!isset($column->attrs->var) && !isset($column->attrs->default))
48 47
 			{
49 48
 				$this->columns[] = new InsertColumnTagWithoutArgument($column);
50
-			}
51
-			else
49
+			} else
52 50
 			{
53 51
 				$this->columns[] = new InsertColumnTag($column);
54 52
 			}
Please login to merge, or discard this patch.