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 — master (#1805)
by
unknown
18:31
created
classes/xml/GeneralXmlParser.class.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	/**
62 62
 	 * Character data handler
63 63
 	 * Variable in the last element of this->output
64
-	 * @param resource $parse an instance of parser
64
+	 * @param resource $parser an instance of parser
65 65
 	 * @param string $body a data to be added
66 66
 	 * @return void
67 67
 	 */
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 	/**
75 75
 	 * End element handler
76
-	 * @param resource $parse an instance of parser
76
+	 * @param resource $parser an instance of parser
77 77
 	 * @param string $node_name name of xml node
78 78
 	 * @return void
79 79
 	 */
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		xml_parse($oParser, $input);
33 33
 		xml_parser_free($oParser);
34 34
 
35
-		if(count($this->output) < 1)
35
+		if (count($this->output) < 1)
36 36
 		{
37 37
 			return;
38 38
 		}
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 		$parent_obj = &$this->output[count($this->output) - 1];
85 85
 		$tmp_obj = &$parent_obj->childNodes[$node_name];
86 86
 
87
-		if($tmp_obj)
87
+		if ($tmp_obj)
88 88
 		{
89
-			if(is_array($tmp_obj))
89
+			if (is_array($tmp_obj))
90 90
 			{
91 91
 				$tmp_obj[] = $cur_obj;
92 92
 			}
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,13 +89,11 @@
 block discarded – undo
89 89
 			if(is_array($tmp_obj))
90 90
 			{
91 91
 				$tmp_obj[] = $cur_obj;
92
-			}
93
-			else
92
+			} else
94 93
 			{
95 94
 				$tmp_obj = array($tmp_obj, $cur_obj);
96 95
 			}
97
-		}
98
-		else
96
+		} else
99 97
 		{
100 98
 			$tmp_obj = $cur_obj;
101 99
 		}
Please login to merge, or discard this patch.
classes/xml/XmlLangParser.class.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 	/**
64 64
 	 * compile a xml_file only when a corresponding php lang file does not exists or is outdated
65
-	 * @return string|bool Returns compiled php file.
65
+	 * @return false|string Returns compiled php file.
66 66
 	 */
67 67
 	function compile()
68 68
 	{
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
 	/**
135 135
 	 * Writing cache file
136
-	 * @return void|bool
136
+	 * @return null|false
137 137
 	 */
138 138
 	function _writeFile()
139 139
 	{
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -66,17 +66,17 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	function compile()
68 68
 	{
69
-		if(!file_exists($this->xml_file))
69
+		if (!file_exists($this->xml_file))
70 70
 		{
71 71
 			return FALSE;
72 72
 		}
73
-		if(!file_exists($this->php_file))
73
+		if (!file_exists($this->php_file))
74 74
 		{
75 75
 			$this->_compile();
76 76
 		}
77 77
 		else
78 78
 		{
79
-			if(filemtime($this->xml_file) > filemtime($this->php_file))
79
+			if (filemtime($this->xml_file) > filemtime($this->php_file))
80 80
 			{
81 81
 				$this->_compile();
82 82
 			}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	function getCompileContent()
97 97
 	{
98
-		if(!file_exists($this->xml_file))
98
+		if (!file_exists($this->xml_file))
99 99
 		{
100 100
 			return FALSE;
101 101
 		}
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
 		$xml_obj = parent::parse($buff);
122 122
 
123 123
 		$item = $xml_obj->lang->item;
124
-		if(!is_array($item))
124
+		if (!is_array($item))
125 125
 		{
126 126
 			$item = array($item);
127 127
 		}
128
-		foreach($item as $i)
128
+		foreach ($item as $i)
129 129
 		{
130 130
 			$this->_parseItem($i, $var = '$lang->%s');
131 131
 		}
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 */
138 138
 	function _writeFile()
139 139
 	{
140
-		if(!$this->code)
140
+		if (!$this->code)
141 141
 		{
142 142
 			return;
143 143
 		}
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
 		$value = $item->value;
158 158
 		$var = sprintf($var, $name);
159 159
 
160
-		if($item->item)
160
+		if ($item->item)
161 161
 		{
162 162
 			$type = $item->attrs->type;
163 163
 			$mode = $item->attrs->mode;
164 164
 
165
-			if($type == 'array')
165
+			if ($type == 'array')
166 166
 			{
167 167
 				$this->code .= "if(!is_array({$var})){\n";
168 168
 				$this->code .= "	{$var} = array();\n";
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
 			}
179 179
 
180 180
 			$items = $item->item;
181
-			if(!is_array($items))
181
+			if (!is_array($items))
182 182
 			{
183 183
 				$items = array($items);
184 184
 			}
185
-			foreach($items as $item)
185
+			foreach ($items as $item)
186 186
 			{
187 187
 				$this->_parseItem($item, $var);
188 188
 			}
@@ -202,41 +202,41 @@  discard block
 block discarded – undo
202 202
 	 */
203 203
 	function _parseValues($nodes, $var)
204 204
 	{
205
-		if(!is_array($nodes))
205
+		if (!is_array($nodes))
206 206
 		{
207 207
 			$nodes = array($nodes);
208 208
 		}
209 209
 
210 210
 		$value = array();
211
-		foreach($nodes as $node)
211
+		foreach ($nodes as $node)
212 212
 		{
213 213
 			$return = $this->_parseValue($node, $var);
214
-			if($return && is_array($return))
214
+			if ($return && is_array($return))
215 215
 			{
216 216
 				$value = array_merge($value, $return);
217 217
 			}
218 218
 		}
219 219
 
220
-		if($value[$this->lang_type])
220
+		if ($value[$this->lang_type])
221 221
 		{
222 222
 			return $value[$this->lang_type];
223 223
 		}
224
-		else if($value['en'])
224
+		else if ($value['en'])
225 225
 		{
226 226
 			return $value['en'];
227 227
 		}
228
-		else if($value['ko'])
228
+		else if ($value['ko'])
229 229
 		{
230 230
 			return $value['ko'];
231 231
 		}
232 232
 
233
-		foreach($this->lang_types as $lang_type)
233
+		foreach ($this->lang_types as $lang_type)
234 234
 		{
235
-			if($lang_type == 'en' || $lang_type == 'ko' || $lang_type == $this->lang_type)
235
+			if ($lang_type == 'en' || $lang_type == 'ko' || $lang_type == $this->lang_type)
236 236
 			{
237 237
 				continue;
238 238
 			}
239
-			if($value[$lang_type])
239
+			if ($value[$lang_type])
240 240
 			{
241 241
 				return $value[$lang_type];
242 242
 			}
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	{
256 256
 		$lang_type = $node->attrs->xml_lang;
257 257
 		$value = $node->body;
258
-		if(!$value)
258
+		if (!$value)
259 259
 		{
260 260
 			return false;
261 261
 		}
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -73,14 +73,12 @@  discard block
 block discarded – undo
73 73
 		if(!file_exists($this->php_file))
74 74
 		{
75 75
 			$this->_compile();
76
-		}
77
-		else
76
+		} else
78 77
 		{
79 78
 			if(filemtime($this->xml_file) > filemtime($this->php_file))
80 79
 			{
81 80
 				$this->_compile();
82
-			}
83
-			else
81
+			} else
84 82
 			{
85 83
 				return $this->php_file;
86 84
 			}
@@ -168,8 +166,7 @@  discard block
 block discarded – undo
168 166
 				$this->code .= "	{$var} = array();\n";
169 167
 				$this->code .= "}\n";
170 168
 				$var .= '[\'%s\']';
171
-			}
172
-			else
169
+			} else
173 170
 			{
174 171
 				$this->code .= "if(!is_object({$var})){\n";
175 172
 				$this->code .= "	{$var} = new stdClass();\n";
@@ -186,8 +183,7 @@  discard block
 block discarded – undo
186 183
 			{
187 184
 				$this->_parseItem($item, $var);
188 185
 			}
189
-		}
190
-		else
186
+		} else
191 187
 		{
192 188
 			$code = $this->_parseValues($value, $var);
193 189
 			$this->code .= $code;
@@ -220,12 +216,10 @@  discard block
 block discarded – undo
220 216
 		if($value[$this->lang_type])
221 217
 		{
222 218
 			return $value[$this->lang_type];
223
-		}
224
-		else if($value['en'])
219
+		} else if($value['en'])
225 220
 		{
226 221
 			return $value['en'];
227
-		}
228
-		else if($value['ko'])
222
+		} else if($value['ko'])
229 223
 		{
230 224
 			return $value['ko'];
231 225
 		}
Please login to merge, or discard this patch.
classes/xml/XmlParser.class.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
 	/**
153 153
 	 * Start element handler.
154
-	 * @param resource $parse an instance of parser
154
+	 * @param resource $parser an instance of parser
155 155
 	 * @param string $node_name a name of node
156 156
 	 * @param array $attrs attributes to be set
157 157
 	 * @return array
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	/**
169 169
 	 * Character data handler
170 170
 	 * Variable in the last element of this->output
171
-	 * @param resource $parse an instance of parser
171
+	 * @param resource $parser an instance of parser
172 172
 	 * @param string $body a data to be added
173 173
 	 * @return void
174 174
 	 */
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
 	/**
182 182
 	 * End element handler
183
-	 * @param resource $parse an instance of parser
183
+	 * @param resource $parser an instance of parser
184 184
 	 * @param string $node_name name of xml node
185 185
 	 * @return void
186 186
 	 */
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	function loadXmlFile($filename)
71 71
 	{
72
-		if(!file_exists($filename))
72
+		if (!file_exists($filename))
73 73
 		{
74 74
 			return;
75 75
 		}
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	function parse($input = '', $arg1 = NULL, $arg2 = NULL)
90 90
 	{
91 91
 		// Save the compile starting time for debugging
92
-		if(__DEBUG__ == 3)
92
+		if (__DEBUG__ == 3)
93 93
 		{
94 94
 			$start = getMicroTime();
95 95
 		}
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
 		preg_match_all("/xml:lang=\"([^\"].+)\"/i", $this->input, $matches);
104 104
 
105 105
 		// extracts the supported lanuage when xml:lang is used
106
-		if(count($matches[1]) && $supported_lang = array_unique($matches[1]))
106
+		if (count($matches[1]) && $supported_lang = array_unique($matches[1]))
107 107
 		{
108 108
 			$tmpLangList = array_flip($supported_lang);
109 109
 			// if lang of the first log-in user doesn't exist, apply en by default if exists. Otherwise apply the first lang.
110
-			if(!isset($tmpLangList[$this->lang]))
110
+			if (!isset($tmpLangList[$this->lang]))
111 111
 			{
112
-				if(isset($tmpLangList['en']))
112
+				if (isset($tmpLangList['en']))
113 113
 				{
114 114
 					$this->lang = 'en';
115 115
 				}
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
 		xml_parse($this->oParser, $this->input);
135 135
 		xml_parser_free($this->oParser);
136 136
 
137
-		if(!count($this->output))
137
+		if (!count($this->output))
138 138
 		{
139 139
 			return;
140 140
 		}
141 141
 
142 142
 		$output = array_shift($this->output);
143 143
 		// Save compile starting time for debugging
144
-		if(__DEBUG__ == 3)
144
+		if (__DEBUG__ == 3)
145 145
 		{
146 146
 			$GLOBALS['__xmlparse_elapsed__'] += getMicroTime() - $start;
147 147
 		}
@@ -189,19 +189,19 @@  discard block
 block discarded – undo
189 189
 		$node_name = strtolower($node_name);
190 190
 		$cur_obj = array_pop($this->output);
191 191
 		$parent_obj = &$this->output[count($this->output) - 1];
192
-		if($this->lang && $cur_obj->attrs->{'xml:lang'} && $cur_obj->attrs->{'xml:lang'} != $this->lang)
192
+		if ($this->lang && $cur_obj->attrs->{'xml:lang'} && $cur_obj->attrs->{'xml:lang'} != $this->lang)
193 193
 		{
194 194
 			return;
195 195
 		}
196
-		if($this->lang && $parent_obj->{$node_name}->attrs->{'xml:lang'} && $parent_obj->{$node_name}->attrs->{'xml:lang'} != $this->lang)
196
+		if ($this->lang && $parent_obj->{$node_name}->attrs->{'xml:lang'} && $parent_obj->{$node_name}->attrs->{'xml:lang'} != $this->lang)
197 197
 		{
198 198
 			return;
199 199
 		}
200 200
 
201
-		if(isset($parent_obj->{$node_name}))
201
+		if (isset($parent_obj->{$node_name}))
202 202
 		{
203 203
 			$tmp_obj = $parent_obj->{$node_name};
204
-			if(is_array($tmp_obj))
204
+			if (is_array($tmp_obj))
205 205
 			{
206 206
 				$parent_obj->{$node_name}[] = $cur_obj;
207 207
 			}
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		}
213 213
 		else
214 214
 		{
215
-			if(!is_object($parent_obj))
215
+			if (!is_object($parent_obj))
216 216
 			{
217 217
 				$parent_obj = (object) $parent_obj;
218 218
 			}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	function _arrToAttrsObj($arr)
230 230
 	{
231 231
 		$output = new Xml_Node_();
232
-		foreach($arr as $key => $val)
232
+		foreach ($arr as $key => $val)
233 233
 		{
234 234
 			$key = strtolower($key);
235 235
 			$output->{$key} = $val;
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -112,15 +112,13 @@  discard block
 block discarded – undo
112 112
 				if(isset($tmpLangList['en']))
113 113
 				{
114 114
 					$this->lang = 'en';
115
-				}
116
-				else
115
+				} else
117 116
 				{
118 117
 					$this->lang = array_shift($supported_lang);
119 118
 				}
120 119
 			}
121 120
 			// uncheck the language if no specific language is set.
122
-		}
123
-		else
121
+		} else
124 122
 		{
125 123
 			$this->lang = '';
126 124
 		}
@@ -204,13 +202,11 @@  discard block
 block discarded – undo
204 202
 			if(is_array($tmp_obj))
205 203
 			{
206 204
 				$parent_obj->{$node_name}[] = $cur_obj;
207
-			}
208
-			else
205
+			} else
209 206
 			{
210 207
 				$parent_obj->{$node_name} = array($tmp_obj, $cur_obj);
211 208
 			}
212
-		}
213
-		else
209
+		} else
214 210
 		{
215 211
 			if(!is_object($parent_obj))
216 212
 			{
Please login to merge, or discard this patch.
classes/xml/xmlquery/argument/Argument.class.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -90,6 +90,9 @@  discard block
 block discarded – undo
90 90
 		$this->type = $value;
91 91
 	}
92 92
 
93
+	/**
94
+	 * @param string $operation
95
+	 */
93 96
 	function setColumnOperation($operation)
94 97
 	{
95 98
 		$this->column_operation = $operation;
@@ -282,6 +285,9 @@  discard block
 block discarded – undo
282 285
 		return $this->errorMessage;
283 286
 	}
284 287
 
288
+	/**
289
+	 * @param integer $default_value
290
+	 */
285 291
 	function ensureDefaultValue($default_value)
286 292
 	{
287 293
 		if($this->value === NULL || $this->value === '')
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
 
74 74
 	function getType()
75 75
 	{
76
-		if(isset($this->type))
76
+		if (isset($this->type))
77 77
 		{
78 78
 			return $this->type;
79 79
 		}
80
-		if(is_string($this->value))
80
+		if (is_string($this->value))
81 81
 		{
82 82
 			return 'column_name';
83 83
 		}
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 	function getValue()
104 104
 	{
105
-		if(!isset($this->_value))
105
+		if (!isset($this->_value))
106 106
 		{
107 107
 			$value = $this->getEscapedValue();
108 108
 			$this->_value = $this->toString($value);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
 	function getUnescapedValue()
129 129
 	{
130
-		if($this->value === 'null')
130
+		if ($this->value === 'null')
131 131
 		{
132 132
 			return null;
133 133
 		}
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 	 */
142 142
 	function toString($value)
143 143
 	{
144
-		if(is_array($value))
144
+		if (is_array($value))
145 145
 		{
146
-			if(count($value) === 0)
146
+			if (count($value) === 0)
147 147
 			{
148 148
 				return '';
149 149
 			}
150
-			if(count($value) === 1 && $value[0] === '')
150
+			if (count($value) === 1 && $value[0] === '')
151 151
 			{
152 152
 				return '';
153 153
 			}
@@ -164,42 +164,42 @@  discard block
 block discarded – undo
164 164
 	function escapeValue($value)
165 165
 	{
166 166
 		$column_type = $this->getType();
167
-		if($column_type == 'column_name')
167
+		if ($column_type == 'column_name')
168 168
 		{
169 169
 			$dbParser = DB::getParser();
170 170
 			return $dbParser->parseExpression($value);
171 171
 		}
172
-		if(!isset($value))
172
+		if (!isset($value))
173 173
 		{
174 174
 			return null;
175 175
 		}
176 176
 
177 177
 		$columnTypeList = array('date' => 1, 'varchar' => 1, 'char' => 1, 'text' => 1, 'bigtext' => 1);
178
-		if(isset($columnTypeList[$column_type]))
178
+		if (isset($columnTypeList[$column_type]))
179 179
 		{
180
-			if(!is_array($value))
180
+			if (!is_array($value))
181 181
 			{
182 182
 				$value = $this->_escapeStringValue($value);
183 183
 			}
184 184
 			else
185 185
 			{
186
-				foreach($value as $key=>$val)
186
+				foreach ($value as $key=>$val)
187 187
 				{
188 188
 					$value[$key] = $this->_escapeStringValue($val);
189 189
 				}
190 190
 			}
191 191
 		}
192
-		if($this->uses_default_value)
192
+		if ($this->uses_default_value)
193 193
 		{
194 194
 			return $value;
195 195
 		}
196
-		if($column_type == 'number')
196
+		if ($column_type == 'number')
197 197
 		{
198
-			if(is_array($value))
198
+			if (is_array($value))
199 199
 			{
200
-				foreach($value AS $key => $val)
200
+				foreach ($value AS $key => $val)
201 201
 				{
202
-					if(isset($val) && $val !== '')
202
+					if (isset($val) && $val !== '')
203 203
 					{
204 204
 						$value[$key] = (int) $val;
205 205
 					}
@@ -232,15 +232,15 @@  discard block
 block discarded – undo
232 232
 
233 233
 	function utf8Replacer($captures)
234 234
 	{
235
-		if(strlen($captures[1]))
235
+		if (strlen($captures[1]))
236 236
 		{
237 237
 			// Valid byte sequence. Return unmodified.
238 238
 			return $captures[1];
239 239
 		}
240
-		else if(strlen($captures[2]))
240
+		else if (strlen($captures[2]))
241 241
 		{
242 242
 			// Remove user defined area
243
-			if("\xF3\xB0\x80\x80" <= $captures[2])
243
+			if ("\xF3\xB0\x80\x80" <= $captures[2])
244 244
 			{
245 245
 				return;
246 246
 			}
@@ -262,15 +262,15 @@  discard block
 block discarded – undo
262 262
 	{
263 263
 		$type = $this->getType();
264 264
 		$value = $this->getUnescapedValue();
265
-		if($type == 'column_name')
265
+		if ($type == 'column_name')
266 266
 		{
267 267
 			return TRUE;
268 268
 		}
269
-		if($type == 'number' && is_null($value))
269
+		if ($type == 'number' && is_null($value))
270 270
 		{
271 271
 			return FALSE;
272 272
 		}
273
-		if($type == 'number' && !is_numeric($value) && $this->uses_default_value)
273
+		if ($type == 'number' && !is_numeric($value) && $this->uses_default_value)
274 274
 		{
275 275
 			return TRUE;
276 276
 		}
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
 	function ensureDefaultValue($default_value)
286 286
 	{
287
-		if($this->value === NULL || $this->value === '')
287
+		if ($this->value === NULL || $this->value === '')
288 288
 		{
289 289
 			$this->value = $default_value;
290 290
 			$this->uses_default_value = TRUE;
@@ -298,23 +298,23 @@  discard block
 block discarded – undo
298 298
 	 */
299 299
 	function checkFilter($filter_type)
300 300
 	{
301
-		if(isset($this->value) && $this->value != '')
301
+		if (isset($this->value) && $this->value != '')
302 302
 		{
303 303
 			global $lang;
304 304
 			$val = $this->value;
305 305
 			$key = $this->name;
306
-			switch($filter_type)
306
+			switch ($filter_type)
307 307
 			{
308 308
 				case 'email' :
309 309
 				case 'email_address' :
310
-					if(!preg_match('/^[\w-]+((?:\.|\+|\~)[\w-]+)*@[\w-]+(\.[\w-]+)+$/is', $val))
310
+					if (!preg_match('/^[\w-]+((?:\.|\+|\~)[\w-]+)*@[\w-]+(\.[\w-]+)+$/is', $val))
311 311
 					{
312 312
 						$this->isValid = FALSE;
313 313
 						$this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_email, $lang->{$key} ? $lang->{$key} : $key));
314 314
 					}
315 315
 					break;
316 316
 				case 'homepage' :
317
-					if(!preg_match('/^(http|https)+(:\/\/)+[0-9a-z_-]+\.[^ ]+$/is', $val))
317
+					if (!preg_match('/^(http|https)+(:\/\/)+[0-9a-z_-]+\.[^ ]+$/is', $val))
318 318
 					{
319 319
 						$this->isValid = FALSE;
320 320
 						$this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_homepage, $lang->{$key} ? $lang->{$key} : $key));
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 					break;
323 323
 				case 'userid' :
324 324
 				case 'user_id' :
325
-					if(!preg_match('/^[a-zA-Z]+([_0-9a-zA-Z]+)*$/is', $val))
325
+					if (!preg_match('/^[a-zA-Z]+([_0-9a-zA-Z]+)*$/is', $val))
326 326
 					{
327 327
 						$this->isValid = FALSE;
328 328
 						$this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_userid, $lang->{$key} ? $lang->{$key} : $key));
@@ -330,25 +330,25 @@  discard block
 block discarded – undo
330 330
 					break;
331 331
 				case 'number' :
332 332
 				case 'numbers' :
333
-					if(is_array($val))
333
+					if (is_array($val))
334 334
 					{
335 335
 						$val = join(',', $val);
336 336
 					}
337
-					if(!preg_match('/^(-?)[0-9]+(,\-?[0-9]+)*$/is', $val))
337
+					if (!preg_match('/^(-?)[0-9]+(,\-?[0-9]+)*$/is', $val))
338 338
 					{
339 339
 						$this->isValid = FALSE;
340 340
 						$this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_number, $lang->{$key} ? $lang->{$key} : $key));
341 341
 					}
342 342
 					break;
343 343
 				case 'alpha' :
344
-					if(!preg_match('/^[a-z]+$/is', $val))
344
+					if (!preg_match('/^[a-z]+$/is', $val))
345 345
 					{
346 346
 						$this->isValid = FALSE;
347 347
 						$this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_alpha, $lang->{$key} ? $lang->{$key} : $key));
348 348
 					}
349 349
 					break;
350 350
 				case 'alpha_number' :
351
-					if(!preg_match('/^[0-9a-z]+$/is', $val))
351
+					if (!preg_match('/^[0-9a-z]+$/is', $val))
352 352
 					{
353 353
 						$this->isValid = FALSE;
354 354
 						$this->errorMessage = new Object(-1, sprintf($lang->filter->invalid_alpha_number, $lang->{$key} ? $lang->{$key} : $key));
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
 	function checkMaxLength($length)
362 362
 	{
363
-		if($this->value && (strlen($this->value) > $length))
363
+		if ($this->value && (strlen($this->value) > $length))
364 364
 		{
365 365
 			global $lang;
366 366
 			$this->isValid = FALSE;
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
 	function checkMinLength($length)
373 373
 	{
374
-		if($this->value && (strlen($this->value) < $length))
374
+		if ($this->value && (strlen($this->value) < $length))
375 375
 		{
376 376
 			global $lang;
377 377
 			$this->isValid = FALSE;
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 
383 383
 	function checkNotNull()
384 384
 	{
385
-		if(!isset($this->value))
385
+		if (!isset($this->value))
386 386
 		{
387 387
 			global $lang;
388 388
 			$this->isValid = FALSE;
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -180,8 +180,7 @@  discard block
 block discarded – undo
180 180
 			if(!is_array($value))
181 181
 			{
182 182
 				$value = $this->_escapeStringValue($value);
183
-			}
184
-			else
183
+			} else
185 184
 			{
186 185
 				foreach($value as $key=>$val)
187 186
 				{
@@ -204,8 +203,7 @@  discard block
 block discarded – undo
204 203
 						$value[$key] = (int) $val;
205 204
 					}
206 205
 				}
207
-			}
208
-			else
206
+			} else
209 207
 			{
210 208
 				$value = (int) $value;
211 209
 			}
@@ -236,8 +234,7 @@  discard block
 block discarded – undo
236 234
 		{
237 235
 			// Valid byte sequence. Return unmodified.
238 236
 			return $captures[1];
239
-		}
240
-		else if(strlen($captures[2]))
237
+		} else if(strlen($captures[2]))
241 238
 		{
242 239
 			// Remove user defined area
243 240
 			if("\xF3\xB0\x80\x80" <= $captures[2])
@@ -246,8 +243,7 @@  discard block
 block discarded – undo
246 243
 			}
247 244
 
248 245
 			return $captures[2];
249
-		}
250
-		else
246
+		} else
251 247
 		{
252 248
 			return;
253 249
 		}
Please login to merge, or discard this patch.
classes/xml/xmlquery/argument/ConditionArgument.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
116 116
 	 * In this case, the column type is retrieved according to argument
117 117
 	 * value type (using the PHP function is_numeric).
118 118
 	 *
119
-	 * @return type string
119
+	 * @return string string
120 120
 	 */
121 121
 	function getType()
122 122
 	{
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	function ConditionArgument($name, $value, $operation)
27 27
 	{
28 28
 		$operationList = array('in' => 1, 'notin' => 1, 'not_in' => 1, 'between' => 1);
29
-		if(isset($value) && isset($operationList[$operation]) && !is_array($value) && $value != '')
29
+		if (isset($value) && isset($operationList[$operation]) && !is_array($value) && $value != '')
30 30
 		{
31 31
 			$value = str_replace(' ', '', $value);
32 32
 			$value = str_replace('\'', '', $value);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	function createConditionValue()
44 44
 	{
45
-		if(!isset($this->value))
45
+		if (!isset($this->value))
46 46
 		{
47 47
 			return;
48 48
 		}
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 		$operation = $this->operation;
51 51
 		$value = $this->value;
52 52
 
53
-		switch($operation)
53
+		switch ($operation)
54 54
 		{
55 55
 			case 'like_prefix' :
56
-				if(defined('__CUBRID_VERSION__') && __CUBRID_VERSION__ >= '8.4.1')
56
+				if (defined('__CUBRID_VERSION__') && __CUBRID_VERSION__ >= '8.4.1')
57 57
 				{
58 58
 					$this->value = '^' . str_replace('%', '(.*)', preg_quote($value));
59 59
 				}
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 				}
64 64
 				break;
65 65
 			case 'like_tail' :
66
-				if(defined('__CUBRID_VERSION__') && __CUBRID_VERSION__ >= '8.4.1')
66
+				if (defined('__CUBRID_VERSION__') && __CUBRID_VERSION__ >= '8.4.1')
67 67
 				{
68 68
 					$this->value = str_replace('%', '(.*)', preg_quote($value)) . '$';
69 69
 				}
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 				}
74 74
 				break;
75 75
 			case 'like' :
76
-				if(defined('__CUBRID_VERSION__') && __CUBRID_VERSION__ >= '8.4.1')
76
+				if (defined('__CUBRID_VERSION__') && __CUBRID_VERSION__ >= '8.4.1')
77 77
 				{
78 78
 					$this->value = str_replace('%', '(.*)', preg_quote($value));
79 79
 				}
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
 				$this->value = '%' . $value;
93 93
 				break;
94 94
 			case 'in':
95
-				if(!is_array($value))
95
+				if (!is_array($value))
96 96
 				{
97 97
 					$this->value = array($value);
98 98
 				}
99 99
 				break;
100 100
 			case 'notin':
101 101
 			case 'not_in':
102
-				if(!is_array($value))
102
+				if (!is_array($value))
103 103
 				{
104 104
 					$this->value = array($value);
105 105
 				}
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	function getType()
122 122
 	{
123
-		if($this->type)
123
+		if ($this->type)
124 124
 		{
125 125
 			return $this->type;
126 126
 		}
127
-		else if(!is_numeric($this->value))
127
+		else if (!is_numeric($this->value))
128 128
 		{
129 129
 			return 'varchar';
130 130
 		}
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
 
137 137
 	function setColumnType($column_type)
138 138
 	{
139
-		if(!isset($this->value))
139
+		if (!isset($this->value))
140 140
 		{
141 141
 			return;
142 142
 		}
143
-		if($column_type === '')
143
+		if ($column_type === '')
144 144
 		{
145 145
 			return;
146 146
 		}
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
 				if(defined('__CUBRID_VERSION__') && __CUBRID_VERSION__ >= '8.4.1')
57 57
 				{
58 58
 					$this->value = '^' . str_replace('%', '(.*)', preg_quote($value));
59
-				}
60
-				else
59
+				} else
61 60
 				{
62 61
 					$this->value = $value . '%';
63 62
 				}
@@ -66,8 +65,7 @@  discard block
 block discarded – undo
66 65
 				if(defined('__CUBRID_VERSION__') && __CUBRID_VERSION__ >= '8.4.1')
67 66
 				{
68 67
 					$this->value = str_replace('%', '(.*)', preg_quote($value)) . '$';
69
-				}
70
-				else
68
+				} else
71 69
 				{
72 70
 					$this->value = '%' . $value;
73 71
 				}
@@ -76,8 +74,7 @@  discard block
 block discarded – undo
76 74
 				if(defined('__CUBRID_VERSION__') && __CUBRID_VERSION__ >= '8.4.1')
77 75
 				{
78 76
 					$this->value = str_replace('%', '(.*)', preg_quote($value));
79
-				}
80
-				else
77
+				} else
81 78
 				{
82 79
 					$this->value = '%' . $value . '%';
83 80
 				}
@@ -123,12 +120,10 @@  discard block
 block discarded – undo
123 120
 		if($this->type)
124 121
 		{
125 122
 			return $this->type;
126
-		}
127
-		else if(!is_numeric($this->value))
123
+		} else if(!is_numeric($this->value))
128 124
 		{
129 125
 			return 'varchar';
130
-		}
131
-		else
126
+		} else
132 127
 		{
133 128
 			return '';
134 129
 		}
Please login to merge, or discard this patch.
classes/xml/xmlquery/QueryParser.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 	 *
29 29
 	 * @param object $query XML object obtained after reading the XML Query file
30 30
 	 * @param bool $isSubQuery
31
-	 * @return void
31
+	 * @return string
32 32
 	 */
33 33
 	function QueryParser($query = NULL, $isSubQuery = FALSE)
34 34
 	{
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	function QueryParser($query = NULL, $isSubQuery = FALSE)
34 34
 	{
35
-		if($query)
35
+		if ($query)
36 36
 		{
37 37
 			$this->queryTag = new QueryTag($query, $isSubQuery);
38 38
 		}
@@ -54,17 +54,17 @@  discard block
 block discarded – undo
54 54
 		$module = '';
55 55
 
56 56
 		$id_args = explode('.', $query_id);
57
-		if(count($id_args) == 2)
57
+		if (count($id_args) == 2)
58 58
 		{
59 59
 			$target = 'modules';
60 60
 			$module = $id_args[0];
61 61
 			$id = $id_args[1];
62 62
 		}
63
-		else if(count($id_args) == 3)
63
+		else if (count($id_args) == 3)
64 64
 		{
65 65
 			$target = $id_args[0];
66 66
 			$targetList = array('modules' => 1, 'addons' => 1, 'widgets' => 1);
67
-			if(!isset($targetList[$target]))
67
+			if (!isset($targetList[$target]))
68 68
 			{
69 69
 				return;
70 70
 			}
@@ -74,33 +74,33 @@  discard block
 block discarded – undo
74 74
 
75 75
 		// get column properties from the table
76 76
 		$table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $module, $table_name);
77
-		if(!file_exists($table_file))
77
+		if (!file_exists($table_file))
78 78
 		{
79 79
 			$searched_list = FileHandler::readDir(_XE_PATH_ . 'modules');
80 80
 			$searched_count = count($searched_list);
81
-			for($i = 0; $i < $searched_count; $i++)
81
+			for ($i = 0; $i < $searched_count; $i++)
82 82
 			{
83 83
 				$table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $searched_list[$i], $table_name);
84
-				if(file_exists($table_file))
84
+				if (file_exists($table_file))
85 85
 				{
86 86
 					break;
87 87
 				}
88 88
 			}
89 89
 		}
90 90
 
91
-		if(file_exists($table_file))
91
+		if (file_exists($table_file))
92 92
 		{
93 93
 			$table_xml = FileHandler::readFile($table_file);
94 94
 			$xml_parser = new XmlParser();
95 95
 			$table_obj = $xml_parser->parse($table_xml);
96
-			if($table_obj->table)
96
+			if ($table_obj->table)
97 97
 			{
98
-				if(isset($table_obj->table->column) && !is_array($table_obj->table->column))
98
+				if (isset($table_obj->table->column) && !is_array($table_obj->table->column))
99 99
 				{
100 100
 					$table_obj->table->column = array($table_obj->table->column);
101 101
 				}
102 102
 
103
-				foreach($table_obj->table->column as $k => $v)
103
+				foreach ($table_obj->table->column as $k => $v)
104 104
 				{
105 105
 					$column_type[$v->attrs->name] = $v->attrs->type;
106 106
 				}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@
 block discarded – undo
59 59
 			$target = 'modules';
60 60
 			$module = $id_args[0];
61 61
 			$id = $id_args[1];
62
-		}
63
-		else if(count($id_args) == 3)
62
+		} else if(count($id_args) == 3)
64 63
 		{
65 64
 			$target = $id_args[0];
66 65
 			$targetList = array('modules' => 1, 'addons' => 1, 'widgets' => 1);
Please login to merge, or discard this patch.
classes/xml/xmlquery/tags/query/QueryTag.class.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -169,6 +169,9 @@
 block discarded – undo
169 169
 		return $this->query->attrs->action;
170 170
 	}
171 171
 
172
+	/**
173
+	 * @param TablesTag $tables
174
+	 */
172 175
 	function setTableColumnTypes($tables)
173 176
 	{
174 177
 		$query_id = $this->getQueryId();
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
 		$this->priority = $query->attrs->priority;
127 127
 		$this->query = $query;
128 128
 		$this->isSubQuery = $isSubQuery;
129
-		if($this->isSubQuery)
129
+		if ($this->isSubQuery)
130 130
 		{
131 131
 			$this->action = 'select';
132 132
 		}
133
-		if($query->attrs->alias)
133
+		if ($query->attrs->alias)
134 134
 		{
135 135
 			$dbParser = DB::getParser();
136 136
 			$this->alias = $dbParser->escape($query->attrs->alias);
@@ -172,13 +172,13 @@  discard block
 block discarded – undo
172 172
 	function setTableColumnTypes($tables)
173 173
 	{
174 174
 		$query_id = $this->getQueryId();
175
-		if(!isset($this->column_type[$query_id]))
175
+		if (!isset($this->column_type[$query_id]))
176 176
 		{
177 177
 			$table_tags = $tables->getTables();
178 178
 			$column_type = array();
179
-			foreach($table_tags as $table_tag)
179
+			foreach ($table_tags as $table_tag)
180 180
 			{
181
-				if(is_a($table_tag, 'TableTag'))
181
+				if (is_a($table_tag, 'TableTag'))
182 182
 				{
183 183
 					$table_name = $table_tag->getTableName();
184 184
 					$table_alias = $table_tag->getTableAlias();
@@ -192,19 +192,19 @@  discard block
 block discarded – undo
192 192
 
193 193
 	function getColumns()
194 194
 	{
195
-		if($this->action == 'select')
195
+		if ($this->action == 'select')
196 196
 		{
197 197
 			return $this->columns = new SelectColumnsTag($this->query->columns);
198 198
 		}
199
-		else if($this->action == 'insert' || $this->action == 'insert-select')
199
+		else if ($this->action == 'insert' || $this->action == 'insert-select')
200 200
 		{
201 201
 			return $this->columns = new InsertColumnsTag($this->query->columns->column);
202 202
 		}
203
-		else if($this->action == 'update')
203
+		else if ($this->action == 'update')
204 204
 		{
205 205
 			return $this->columns = new UpdateColumnsTag($this->query->columns->column);
206 206
 		}
207
-		else if($this->action == 'delete')
207
+		else if ($this->action == 'delete')
208 208
 		{
209 209
 			return $this->columns = null;
210 210
 		}
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
 	function getPrebuff()
214 214
 	{
215
-		if($this->isSubQuery)
215
+		if ($this->isSubQuery)
216 216
 		{
217 217
 			return;
218 218
 		}
@@ -220,20 +220,20 @@  discard block
 block discarded – undo
220 220
 		$arguments = $this->getArguments();
221 221
 
222 222
 		$prebuff = '';
223
-		foreach($arguments as $argument)
223
+		foreach ($arguments as $argument)
224 224
 		{
225
-			if(isset($argument))
225
+			if (isset($argument))
226 226
 			{
227 227
 				$arg_name = $argument->getArgumentName();
228
-				if($arg_name)
228
+				if ($arg_name)
229 229
 				{
230 230
 					unset($column_type);
231 231
 					$prebuff .= $argument->toString();
232 232
 
233 233
 					$table_alias = $argument->getTableName();
234
-					if(isset($table_alias))
234
+					if (isset($table_alias))
235 235
 					{
236
-						if(isset($this->column_type[$this->getQueryId()][$table_alias][$argument->getColumnName()]))
236
+						if (isset($this->column_type[$this->getQueryId()][$table_alias][$argument->getColumnName()]))
237 237
 						{
238 238
 							$column_type = $this->column_type[$this->getQueryId()][$table_alias][$argument->getColumnName()];
239 239
 						}
@@ -242,16 +242,16 @@  discard block
 block discarded – undo
242 242
 					{
243 243
 						$current_tables = $this->column_type[$this->getQueryId()];
244 244
 						$column_name = $argument->getColumnName();
245
-						foreach($current_tables as $current_table)
245
+						foreach ($current_tables as $current_table)
246 246
 						{
247
-							if(isset($current_table[$column_name]))
247
+							if (isset($current_table[$column_name]))
248 248
 							{
249 249
 								$column_type = $current_table[$column_name];
250 250
 							}
251 251
 						}
252 252
 					}
253 253
 
254
-					if(isset($column_type))
254
+					if (isset($column_type))
255 255
 					{
256 256
 						$prebuff .= sprintf('if(${\'%s_argument\'} !== null) ${\'%s_argument\'}->setColumnType(\'%s\');' . "\n"
257 257
 								, $arg_name
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
 	function getBuff()
270 270
 	{
271 271
 		$buff = '';
272
-		if($this->isSubQuery)
272
+		if ($this->isSubQuery)
273 273
 		{
274 274
 			$buff = 'new Subquery(';
275 275
 			$buff .= "'" . $this->alias . '\', ';
276
-			$buff .= ($this->columns ? $this->columns->toString() : 'null' ) . ', ' . PHP_EOL;
276
+			$buff .= ($this->columns ? $this->columns->toString() : 'null') . ', ' . PHP_EOL;
277 277
 			$buff .= $this->tables->toString() . ',' . PHP_EOL;
278 278
 			$buff .= $this->conditions->toString() . ',' . PHP_EOL;
279 279
 			$buff .= $this->groups->toString() . ',' . PHP_EOL;
@@ -292,13 +292,13 @@  discard block
 block discarded – undo
292 292
 		$buff .= sprintf('$query->setAction("%s");%s', $this->action, "\n");
293 293
 		$buff .= sprintf('$query->setPriority("%s");%s', $this->priority, "\n");
294 294
 		$buff .= $this->preBuff;
295
-		if($this->columns)
295
+		if ($this->columns)
296 296
 		{
297 297
 			$buff .= '$query->setColumns(' . $this->columns->toString() . ');' . PHP_EOL;
298 298
 		}
299 299
 
300 300
 		$buff .= '$query->setTables(' . $this->tables->toString() . ');' . PHP_EOL;
301
-		if($this->action == 'insert-select')
301
+		if ($this->action == 'insert-select')
302 302
 		{
303 303
 			$buff .= '$query->setSubquery(' . $this->subquery->toString() . ');' . PHP_EOL;
304 304
 		}
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 
314 314
 	function getTables()
315 315
 	{
316
-		if($this->query->index_hint && ($this->query->index_hint->attrs->for == 'ALL' || Context::getDBType() == strtolower($this->query->index_hint->attrs->for)))
316
+		if ($this->query->index_hint && ($this->query->index_hint->attrs->for == 'ALL' || Context::getDBType() == strtolower($this->query->index_hint->attrs->for)))
317 317
 		{
318 318
 			return $this->tables = new TablesTag($this->query->tables, $this->query->index_hint);
319 319
 		}
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 
326 326
 	function getSubquery()
327 327
 	{
328
-		if($this->query->query)
328
+		if ($this->query->query)
329 329
 		{
330 330
 			$this->subquery = new QueryTag($this->query->query, true);
331 331
 		}
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 
339 339
 	function getGroups()
340 340
 	{
341
-		if($this->query->groups)
341
+		if ($this->query->groups)
342 342
 		{
343 343
 			return $this->groups = new GroupsTag($this->query->groups->group);
344 344
 		}
@@ -376,11 +376,11 @@  discard block
 block discarded – undo
376 376
 	function getArguments()
377 377
 	{
378 378
 		$arguments = array();
379
-		if($this->columns)
379
+		if ($this->columns)
380 380
 		{
381 381
 			$arguments = array_merge($arguments, $this->columns->getArguments());
382 382
 		}
383
-		if($this->action == 'insert-select')
383
+		if ($this->action == 'insert-select')
384 384
 		{
385 385
 			$arguments = array_merge($arguments, $this->subquery->getArguments());
386 386
 		}
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -195,16 +195,13 @@  discard block
 block discarded – undo
195 195
 		if($this->action == 'select')
196 196
 		{
197 197
 			return $this->columns = new SelectColumnsTag($this->query->columns);
198
-		}
199
-		else if($this->action == 'insert' || $this->action == 'insert-select')
198
+		} else if($this->action == 'insert' || $this->action == 'insert-select')
200 199
 		{
201 200
 			return $this->columns = new InsertColumnsTag($this->query->columns->column);
202
-		}
203
-		else if($this->action == 'update')
201
+		} else if($this->action == 'update')
204 202
 		{
205 203
 			return $this->columns = new UpdateColumnsTag($this->query->columns->column);
206
-		}
207
-		else if($this->action == 'delete')
204
+		} else if($this->action == 'delete')
208 205
 		{
209 206
 			return $this->columns = null;
210 207
 		}
@@ -237,8 +234,7 @@  discard block
 block discarded – undo
237 234
 						{
238 235
 							$column_type = $this->column_type[$this->getQueryId()][$table_alias][$argument->getColumnName()];
239 236
 						}
240
-					}
241
-					else
237
+					} else
242 238
 					{
243 239
 						$current_tables = $this->column_type[$this->getQueryId()];
244 240
 						$column_name = $argument->getColumnName();
@@ -316,8 +312,7 @@  discard block
 block discarded – undo
316 312
 		if($this->query->index_hint && ($this->query->index_hint->attrs->for == 'ALL' || Context::getDBType() == strtolower($this->query->index_hint->attrs->for)))
317 313
 		{
318 314
 			return $this->tables = new TablesTag($this->query->tables, $this->query->index_hint);
319
-		}
320
-		else
315
+		} else
321 316
 		{
322 317
 			return $this->tables = new TablesTag($this->query->tables);
323 318
 		}
@@ -341,8 +336,7 @@  discard block
 block discarded – undo
341 336
 		if($this->query->groups)
342 337
 		{
343 338
 			return $this->groups = new GroupsTag($this->query->groups->group);
344
-		}
345
-		else
339
+		} else
346 340
 		{
347 341
 			return $this->groups = new GroupsTag(NULL);
348 342
 		}
Please login to merge, or discard this patch.
classes/xml/XmlQueryParser.class.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,9 +79,9 @@
 block discarded – undo
79 79
 	/**
80 80
 	 * Override for parent "parse" method
81 81
 	 *
82
-	 * @param null $query_id
83
-	 * @param null $xml_file
84
-	 * @param null $cache_file
82
+	 * @param string $query_id
83
+	 * @param string $xml_file
84
+	 * @param string $cache_file
85 85
 	 *
86 86
 	 * @return void
87 87
 	 */
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 /**
5 5
  * File containing the XE 1.5 XmlQueryParserClass
6 6
  */
7
-if(!defined('__XE_LOADED_XML_CLASS__'))
7
+if (!defined('__XE_LOADED_XML_CLASS__'))
8 8
 {
9 9
 	define('__XE_LOADED_XML_CLASS__', 1);
10 10
 }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	function &getInstance()
38 38
 	{
39 39
 		static $theInstance = NULL;
40
-		if(!isset($theInstance))
40
+		if (!isset($theInstance))
41 41
 		{
42 42
 			$theInstance = new XmlQueryParser();
43 43
 		}
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 		// insert, update, delete, select action
66 66
 		$action = strtolower($xml_obj->query->attrs->action);
67
-		if(!$action)
67
+		if (!$action)
68 68
 		{
69 69
 			return;
70 70
 		}
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	{
102 102
 		$buff = FileHandler::readFile($xml_file);
103 103
 		$xml_obj = parent::parse($buff);
104
-		if(!$xml_obj)
104
+		if (!$xml_obj)
105 105
 		{
106 106
 			return;
107 107
 		}
Please login to merge, or discard this patch.
config/func.inc.php 3 patches
Doc Comments   +19 added lines, -16 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
  * @param string $module_name The module name to get a instance
75 75
  * @param string $type disp, proc, controller, class
76 76
  * @param string $kind admin, null
77
- * @return mixed Module instance
77
+ * @return ModuleObject Module instance
78 78
  */
79 79
 function getModule($module_name, $type = 'view', $kind = '')
80 80
 {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
  * Create a controller instance of the module
86 86
  *
87 87
  * @param string $module_name The module name to get a controller instance
88
- * @return mixed Module controller instance
88
+ * @return ModuleObject Module controller instance
89 89
  */
90 90
 function getController($module_name)
91 91
 {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
  * Create a admin controller instance of the module
97 97
  *
98 98
  * @param string $module_name The module name to get a admin controller instance
99
- * @return mixed Module admin controller instance
99
+ * @return ModuleObject Module admin controller instance
100 100
  */
101 101
 function getAdminController($module_name)
102 102
 {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
  * Create a view instance of the module
108 108
  *
109 109
  * @param string $module_name The module name to get a view instance
110
- * @return mixed Module view instance
110
+ * @return ModuleObject Module view instance
111 111
  */
112 112
 function getView($module_name)
113 113
 {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
  * Create a mobile instance of the module
119 119
  *
120 120
  * @param string $module_name The module name to get a mobile instance
121
- * @return mixed Module mobile instance
121
+ * @return ModuleObject Module mobile instance
122 122
  */
123 123
 function &getMobile($module_name)
124 124
 {
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
  * Create a admin view instance of the module
130 130
  *
131 131
  * @param string $module_name The module name to get a admin view instance
132
- * @return mixed Module admin view instance
132
+ * @return ModuleObject Module admin view instance
133 133
  */
134 134
 function getAdminView($module_name)
135 135
 {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
  * Create a model instance of the module
141 141
  *
142 142
  * @param string $module_name The module name to get a model instance
143
- * @return mixed Module model instance
143
+ * @return ModuleObject Module model instance
144 144
  */
145 145
 function getModel($module_name)
146 146
 {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
  * Create an admin model instance of the module
152 152
  *
153 153
  * @param string $module_name The module name to get a admin model instance
154
- * @return mixed Module admin model instance
154
+ * @return ModuleObject Module admin model instance
155 155
  */
156 156
 function getAdminModel($module_name)
157 157
 {
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
  * Create an api instance of the module
163 163
  *
164 164
  * @param string $module_name The module name to get a api instance
165
- * @return mixed Module api class instance
165
+ * @return ModuleObject Module api class instance
166 166
  */
167 167
 function getAPI($module_name)
168 168
 {
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
  * Create a wap instance of the module
174 174
  *
175 175
  * @param string $module_name The module name to get a wap instance
176
- * @return mixed Module wap class instance
176
+ * @return ModuleObject Module wap class instance
177 177
  */
178 178
 function getWAP($module_name)
179 179
 {
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
  * Create a class instance of the module
185 185
  *
186 186
  * @param string $module_name The module name to get a class instance
187
- * @return mixed Module class instance
187
+ * @return ModuleObject Module class instance
188 188
  */
189 189
 function getClass($module_name)
190 190
 {
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
  * Return if domain of the virtual site is url type or id type
488 488
  *
489 489
  * @param string $domain
490
- * @return bool
490
+ * @return integer
491 491
  */
492 492
 function isSiteID($domain)
493 493
 {
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 /**
557 557
  * Get a time gap between server's timezone and XE's timezone
558 558
  *
559
- * @return int
559
+ * @return double
560 560
  */
561 561
 function zgap()
562 562
 {
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
  * YYYYMMDDHHIISS format changed to unix time value
598 598
  *
599 599
  * @param string $str Time value in format of YYYYMMDDHHIISS
600
- * @return int
600
+ * @return null|double
601 601
  */
602 602
 function ztime($str)
603 603
 {
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
  * Display $buff contents into the file ./files/_debug_message.php.
791 791
  * You can see the file on your prompt by command: tail-f./files/_debug_message.php
792 792
  *
793
- * @param mixed $debug_output Target object to be printed
793
+ * @param string $debug_output Target object to be printed
794 794
  * @param bool $display_option boolean Flag whether to print seperator (default:true)
795 795
  * @param string $file Target file name
796 796
  * @return void
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 /**
885 885
  * @param string $type query, trigger
886 886
  * @param float $elapsed_time
887
- * @param object $obj
887
+ * @param stdClass $obj
888 888
  */
889 889
 function writeSlowlog($type, $elapsed_time, $obj)
890 890
 {
@@ -1631,6 +1631,9 @@  discard block
 block discarded – undo
1631 1631
 	}
1632 1632
 }
1633 1633
 
1634
+/**
1635
+ * @param string $key
1636
+ */
1634 1637
 function changeValueInUrl($key, $requestKey, $dbKey, $urlName = 'success_return_url')
1635 1638
 {
1636 1639
 	if($requestKey != $dbKey)
Please login to merge, or discard this patch.
Spacing   +135 added lines, -135 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
  *
7 7
  * @author NAVER ([email protected])
8 8
  */
9
-if(!defined('__XE__'))
9
+if (!defined('__XE__'))
10 10
 {
11 11
 	exit();
12 12
 }
13 13
 
14 14
 // define an empty function to avoid errors when iconv function doesn't exist
15
-if(!function_exists('iconv'))
15
+if (!function_exists('iconv'))
16 16
 {
17 17
 	eval('
18 18
 		function iconv($in_charset, $out_charset, $str)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 {
221 221
 	$oDB = DB::getInstance();
222 222
 	$output = $oDB->executeQuery($query_id, $args, $arg_columns);
223
-	if(!is_array($output->data) && count($output->data) > 0)
223
+	if (!is_array($output->data) && count($output->data) > 0)
224 224
 	{
225 225
 		$output->data = array($output->data);
226 226
 	}
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 function setUserSequence($seq)
251 251
 {
252 252
 	$arr_seq = array();
253
-	if(isset($_SESSION['seq']))
253
+	if (isset($_SESSION['seq']))
254 254
 	{
255 255
 		$arr_seq = $_SESSION['seq'];
256 256
 	}
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
  */
267 267
 function checkUserSequence($seq)
268 268
 {
269
-	if(!isset($_SESSION['seq']))
269
+	if (!isset($_SESSION['seq']))
270 270
 	{
271 271
 		return false;
272 272
 	}
273
-	if(!in_array($seq, $_SESSION['seq']))
273
+	if (!in_array($seq, $_SESSION['seq']))
274 274
 	{
275 275
 		return false;
276 276
 	}
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	$num_args = func_num_args();
297 297
 	$args_list = func_get_args();
298 298
 
299
-	if($num_args)
299
+	if ($num_args)
300 300
 		$url = Context::getUrl($num_args, $args_list);
301 301
 	else
302 302
 		$url = Context::getRequestUri();
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	$num_args = func_num_args();
316 316
 	$args_list = func_get_args();
317 317
 
318
-	if($num_args)
318
+	if ($num_args)
319 319
 	{
320 320
 		$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
321 321
 	}
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	$num_args = func_num_args();
339 339
 	$args_list = func_get_args();
340 340
 
341
-	if($num_args)
341
+	if ($num_args)
342 342
 	{
343 343
 		$url = Context::getUrl($num_args, $args_list, NULL, TRUE, TRUE);
344 344
 	}
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
 	$num_args = func_num_args();
361 361
 	$args_list = func_get_args();
362 362
 	$request_uri = Context::getRequestUri();
363
-	if(!$num_args)
363
+	if (!$num_args)
364 364
 	{
365 365
 		return $request_uri;
366 366
 	}
367 367
 
368 368
 	$url = Context::getUrl($num_args, $args_list);
369
-	if(strncasecmp('http', $url, 4) !== 0)
369
+	if (strncasecmp('http', $url, 4) !== 0)
370 370
 	{
371 371
 		preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
372 372
 		return substr($match[0], 0, -1) . $url;
@@ -384,13 +384,13 @@  discard block
 block discarded – undo
384 384
 	$num_args = func_num_args();
385 385
 	$args_list = func_get_args();
386 386
 	$request_uri = Context::getRequestUri();
387
-	if(!$num_args)
387
+	if (!$num_args)
388 388
 	{
389 389
 		return $request_uri;
390 390
 	}
391 391
 
392 392
 	$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
393
-	if(strncasecmp('http', $url, 4) !== 0)
393
+	if (strncasecmp('http', $url, 4) !== 0)
394 394
 	{
395 395
 		preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
396 396
 		$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	$num_args = func_num_args();
411 411
 	$args_list = func_get_args();
412 412
 
413
-	if(!$num_args)
413
+	if (!$num_args)
414 414
 	{
415 415
 		return Context::getRequestUri();
416 416
 	}
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 	$num_args = func_num_args();
433 433
 	$args_list = func_get_args();
434 434
 
435
-	if(!$num_args)
435
+	if (!$num_args)
436 436
 	{
437 437
 		return Context::getRequestUri();
438 438
 	}
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 	$args_list = func_get_args();
455 455
 
456 456
 	$request_uri = Context::getRequestUri();
457
-	if(!$num_args)
457
+	if (!$num_args)
458 458
 	{
459 459
 		return $request_uri;
460 460
 	}
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 	$num_args = count($args_list);
464 464
 
465 465
 	$url = Context::getUrl($num_args, $args_list, $domain);
466
-	if(strncasecmp('http', $url, 4) !== 0)
466
+	if (strncasecmp('http', $url, 4) !== 0)
467 467
 	{
468 468
 		preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
469 469
 		return substr($match[0], 0, -1) . $url;
@@ -504,12 +504,12 @@  discard block
 block discarded – undo
504 504
  */
505 505
 function cut_str($string, $cut_size = 0, $tail = '...')
506 506
 {
507
-	if($cut_size < 1 || !$string)
507
+	if ($cut_size < 1 || !$string)
508 508
 	{
509 509
 		return $string;
510 510
 	}
511 511
 
512
-	if($GLOBALS['use_mb_strimwidth'] || function_exists('mb_strimwidth'))
512
+	if ($GLOBALS['use_mb_strimwidth'] || function_exists('mb_strimwidth'))
513 513
 	{
514 514
 		$GLOBALS['use_mb_strimwidth'] = TRUE;
515 515
 		return mb_strimwidth($string, 0, $cut_size + 4, $tail, 'utf-8');
@@ -523,16 +523,16 @@  discard block
 block discarded – undo
523 523
 	$char_count = 0;
524 524
 
525 525
 	$idx = 0;
526
-	while($idx < $string_length && $char_count < $cut_size && $char_width <= $max_width)
526
+	while ($idx < $string_length && $char_count < $cut_size && $char_width <= $max_width)
527 527
 	{
528 528
 		$c = ord(substr($string, $idx, 1));
529 529
 		$char_count++;
530
-		if($c < 128)
530
+		if ($c < 128)
531 531
 		{
532 532
 			$char_width += (int) $chars[$c - 32];
533 533
 			$idx++;
534 534
 		}
535
-		else if(191 < $c && $c < 224)
535
+		else if (191 < $c && $c < 224)
536 536
 		{
537 537
 			$char_width += $chars[4];
538 538
 			$idx += 2;
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 	}
546 546
 
547 547
 	$output = substr($string, 0, $idx);
548
-	if(strlen($output) < $string_length)
548
+	if (strlen($output) < $string_length)
549 549
 	{
550 550
 		$output .= $tail;
551 551
 	}
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 function zgap()
562 562
 {
563 563
 	$time_zone = $GLOBALS['_time_zone'];
564
-	if($time_zone < 0)
564
+	if ($time_zone < 0)
565 565
 	{
566 566
 		$to = -1;
567 567
 	}
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	$t_min = substr($time_zone, 3, 2) * $to;
575 575
 
576 576
 	$server_time_zone = date("O");
577
-	if($server_time_zone < 0)
577
+	if ($server_time_zone < 0)
578 578
 	{
579 579
 		$so = -1;
580 580
 	}
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
  */
602 602
 function ztime($str)
603 603
 {
604
-	if(!$str)
604
+	if (!$str)
605 605
 	{
606 606
 		return;
607 607
 	}
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 	$year = (int) substr($str, 0, 4);
613 613
 	$month = (int) substr($str, 4, 2);
614 614
 	$day = (int) substr($str, 6, 2);
615
-	if(strlen($str) <= 8)
615
+	if (strlen($str) <= 8)
616 616
 	{
617 617
 		$gap = 0;
618 618
 	}
@@ -636,19 +636,19 @@  discard block
 block discarded – undo
636 636
 	$gap = $_SERVER['REQUEST_TIME'] + zgap() - ztime($date);
637 637
 
638 638
 	$lang_time_gap = Context::getLang('time_gap');
639
-	if($gap < 60)
639
+	if ($gap < 60)
640 640
 	{
641 641
 		$buff = sprintf($lang_time_gap['min'], (int) ($gap / 60) + 1);
642 642
 	}
643
-	elseif($gap < 60 * 60)
643
+	elseif ($gap < 60 * 60)
644 644
 	{
645 645
 		$buff = sprintf($lang_time_gap['mins'], (int) ($gap / 60) + 1);
646 646
 	}
647
-	elseif($gap < 60 * 60 * 2)
647
+	elseif ($gap < 60 * 60 * 2)
648 648
 	{
649 649
 		$buff = sprintf($lang_time_gap['hour'], (int) ($gap / 60 / 60) + 1);
650 650
 	}
651
-	elseif($gap < 60 * 60 * 24)
651
+	elseif ($gap < 60 * 60 * 24)
652 652
 	{
653 653
 		$buff = sprintf($lang_time_gap['hours'], (int) ($gap / 60 / 60) + 1);
654 654
 	}
@@ -685,40 +685,40 @@  discard block
 block discarded – undo
685 685
 function zdate($str, $format = 'Y-m-d H:i:s', $conversion = TRUE)
686 686
 {
687 687
 	// return null if no target time is specified
688
-	if(!$str)
688
+	if (!$str)
689 689
 	{
690 690
 		return;
691 691
 	}
692 692
 	// convert the date format according to the language
693
-	if($conversion == TRUE)
693
+	if ($conversion == TRUE)
694 694
 	{
695
-		switch(Context::getLangType())
695
+		switch (Context::getLangType())
696 696
 		{
697 697
 			case 'en' :
698 698
 			case 'es' :
699
-				if($format == 'Y-m-d')
699
+				if ($format == 'Y-m-d')
700 700
 				{
701 701
 					$format = 'M d, Y';
702 702
 				}
703
-				elseif($format == 'Y-m-d H:i:s')
703
+				elseif ($format == 'Y-m-d H:i:s')
704 704
 				{
705 705
 					$format = 'M d, Y H:i:s';
706 706
 				}
707
-				elseif($format == 'Y-m-d H:i')
707
+				elseif ($format == 'Y-m-d H:i')
708 708
 				{
709 709
 					$format = 'M d, Y H:i';
710 710
 				}
711 711
 				break;
712 712
 			case 'vi' :
713
-				if($format == 'Y-m-d')
713
+				if ($format == 'Y-m-d')
714 714
 				{
715 715
 					$format = 'd-m-Y';
716 716
 				}
717
-				elseif($format == 'Y-m-d H:i:s')
717
+				elseif ($format == 'Y-m-d H:i:s')
718 718
 				{
719 719
 					$format = 'H:i:s d-m-Y';
720 720
 				}
721
-				elseif($format == 'Y-m-d H:i')
721
+				elseif ($format == 'Y-m-d H:i')
722 722
 				{
723 723
 					$format = 'H:i d-m-Y';
724 724
 				}
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 	}
728 728
 
729 729
 	// If year value is less than 1970, handle it separately.
730
-	if((int) substr($str, 0, 4) < 1970)
730
+	if ((int) substr($str, 0, 4) < 1970)
731 731
 	{
732 732
 		$hour = (int) substr($str, 8, 2);
733 733
 		$min = (int) substr($str, 10, 2);
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 function getEncodeEmailAddress($email)
778 778
 {
779 779
 	$return = '';
780
-	for($i = 0, $c = strlen($email); $i < $c; $i++)
780
+	for ($i = 0, $c = strlen($email); $i < $c; $i++)
781 781
 	{
782 782
 		$return .= '&#' . (rand(0, 1) == 0 ? ord($email[$i]) : 'X' . dechex(ord($email[$i]))) . ';';
783 783
 	}
@@ -800,14 +800,14 @@  discard block
 block discarded – undo
800 800
 	static $debug_file;
801 801
 	static $debug_file_exist;
802 802
 
803
-	if(!(__DEBUG__ & 1))
803
+	if (!(__DEBUG__ & 1))
804 804
 	{
805 805
 		return;
806 806
 	}
807 807
 
808 808
 	static $firephp;
809 809
 	$bt = debug_backtrace();
810
-	if(is_array($bt))
810
+	if (is_array($bt))
811 811
 	{
812 812
 		$bt_debug_print = array_shift($bt);
813 813
 		$bt_called_function = array_shift($bt);
@@ -816,9 +816,9 @@  discard block
 block discarded – undo
816 816
 	$line_num = $bt_debug_print['line'];
817 817
 	$function = $bt_called_function['class'] . $bt_called_function['type'] . $bt_called_function['function'];
818 818
 
819
-	if(__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1)
819
+	if (__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1)
820 820
 	{
821
-		if(!isset($firephp))
821
+		if (!isset($firephp))
822 822
 		{
823 823
 			$firephp = FirePHP::getInstance(TRUE);
824 824
 		}
@@ -827,16 +827,16 @@  discard block
 block discarded – undo
827 827
 		$label = sprintf('[%s:%d] %s() (Memory usage: current=%s, peak=%s)', $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage()), FileHandler::filesize(memory_get_peak_usage()));
828 828
 
829 829
 		// Check a FirePHP option
830
-		if($display_option === 'TABLE')
830
+		if ($display_option === 'TABLE')
831 831
 		{
832 832
 			$label = $display_option;
833 833
 		}
834
-		if($display_option === 'ERROR')
834
+		if ($display_option === 'ERROR')
835 835
 		{
836 836
 			$type = $display_option;
837 837
 		}
838 838
 		// Check if the IP specified by __DEBUG_PROTECT__ option is same as the access IP.
839
-		if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
839
+		if (__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
840 840
 		{
841 841
 			$debug_output = 'The IP address is not allowed. Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php';
842 842
 			$label = NULL;
@@ -846,18 +846,18 @@  discard block
 block discarded – undo
846 846
 	}
847 847
 	else
848 848
 	{
849
-		if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
849
+		if (__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
850 850
 		{
851 851
 			return;
852 852
 		}
853 853
 
854 854
 		$print = array();
855
-		if($debug_file_exist === NULL) $print[] = '<?php exit() ?>';
855
+		if ($debug_file_exist === NULL) $print[] = '<?php exit() ?>';
856 856
 
857
-		if(!$debug_file) $debug_file =  _XE_PATH_ . 'files/' . $file;
858
-		if(!$debug_file_exist) $debug_file_exist = file_exists($debug_file);
857
+		if (!$debug_file) $debug_file = _XE_PATH_ . 'files/' . $file;
858
+		if (!$debug_file_exist) $debug_file_exist = file_exists($debug_file);
859 859
 
860
-		if($display_option === TRUE || $display_option === 'ERROR')
860
+		if ($display_option === TRUE || $display_option === 'ERROR')
861 861
 		{
862 862
 			$print[] = str_repeat('=', 80);
863 863
 		}
@@ -865,11 +865,11 @@  discard block
 block discarded – undo
865 865
 		$print[] = sprintf("[%s %s:%d] %s() - mem(%s)", date('Y-m-d H:i:s'), $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage()));
866 866
 
867 867
 		$type = gettype($debug_output);
868
-		if(!in_array($type, array('array', 'object', 'resource')))
868
+		if (!in_array($type, array('array', 'object', 'resource')))
869 869
 		{
870
-			if($display_option === 'ERROR') $print[] = 'ERROR : ' . var_export($debug_output, TRUE);
870
+			if ($display_option === 'ERROR') $print[] = 'ERROR : ' . var_export($debug_output, TRUE);
871 871
 			else $print[] = $type . '(' . var_export($debug_output, TRUE) . ')';
872
-			$print[] = PHP_EOL.PHP_EOL;
872
+			$print[] = PHP_EOL . PHP_EOL;
873 873
 		}
874 874
 		else
875 875
 		{
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 			$print[] = PHP_EOL;
878 878
 		}
879 879
 
880
-		@file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND|LOCK_EX);
880
+		@file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND | LOCK_EX);
881 881
 	}
882 882
 }
883 883
 
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
  */
889 889
 function writeSlowlog($type, $elapsed_time, $obj)
890 890
 {
891
-	if(!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return;
891
+	if (!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return;
892 892
 
893 893
 	static $log_filename = array(
894 894
 		'query' => 'files/_slowlog_query.php',
@@ -904,21 +904,21 @@  discard block
 block discarded – undo
904 904
 	$buff[] = '<?php exit(); ?>';
905 905
 	$buff[] = date('c');
906 906
 
907
-	if($type == 'trigger' && __LOG_SLOW_TRIGGER__ > 0 && $elapsed_time > __LOG_SLOW_TRIGGER__)
907
+	if ($type == 'trigger' && __LOG_SLOW_TRIGGER__ > 0 && $elapsed_time > __LOG_SLOW_TRIGGER__)
908 908
 	{
909 909
 		$buff[] = "\tCaller : " . $obj->caller;
910 910
 		$buff[] = "\tCalled : " . $obj->called;
911 911
 	}
912
-	else if($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__)
912
+	else if ($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__)
913 913
 	{
914 914
 		$buff[] = "\tAddon : " . $obj->called;
915 915
 		$buff[] = "\tCalled position : " . $obj->caller;
916 916
 	}
917
-	else if($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__)
917
+	else if ($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__)
918 918
 	{
919 919
 		$buff[] = "\tWidget : " . $obj->called;
920 920
 	}
921
-	else if($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
921
+	else if ($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
922 922
 	{
923 923
 
924 924
 		$buff[] = $obj->query;
@@ -931,14 +931,14 @@  discard block
 block discarded – undo
931 931
 		$write_file = false;
932 932
 	}
933 933
 
934
-	if($write_file)
934
+	if ($write_file)
935 935
 	{
936 936
 		$buff[] = sprintf("\t%0.6f sec", $elapsed_time);
937 937
 		$buff[] = PHP_EOL . PHP_EOL;
938 938
 		file_put_contents($log_file, implode(PHP_EOL, $buff), FILE_APPEND);
939 939
 	}
940 940
 
941
-	if($type != 'query')
941
+	if ($type != 'query')
942 942
 	{
943 943
 		$trigger_args = $obj;
944 944
 		$trigger_args->_log_type = $type;
@@ -978,11 +978,11 @@  discard block
 block discarded – undo
978 978
  */
979 979
 function delObjectVars($target_obj, $del_obj)
980 980
 {
981
-	if(!is_object($target_obj))
981
+	if (!is_object($target_obj))
982 982
 	{
983 983
 		return;
984 984
 	}
985
-	if(!is_object($del_obj))
985
+	if (!is_object($del_obj))
986 986
 	{
987 987
 		return;
988 988
 	}
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 
993 993
 	$target = array_keys($target_vars);
994 994
 	$del = array_keys($del_vars);
995
-	if(!count($target) || !count($del))
995
+	if (!count($target) || !count($del))
996 996
 	{
997 997
 		return $target_obj;
998 998
 	}
@@ -1000,10 +1000,10 @@  discard block
 block discarded – undo
1000 1000
 	$return_obj = new stdClass();
1001 1001
 
1002 1002
 	$target_count = count($target);
1003
-	for($i = 0; $i < $target_count; $i++)
1003
+	for ($i = 0; $i < $target_count; $i++)
1004 1004
 	{
1005 1005
 		$target_key = $target[$i];
1006
-		if(!in_array($target_key, $del))
1006
+		if (!in_array($target_key, $del))
1007 1007
 		{
1008 1008
 			$return_obj->{$target_key} = $target_obj->{$target_key};
1009 1009
 		}
@@ -1016,10 +1016,10 @@  discard block
 block discarded – undo
1016 1016
 {
1017 1017
 	$del_vars = array('error_return_url', 'success_return_url', 'ruleset', 'xe_validator_id');
1018 1018
 
1019
-	foreach($del_vars as $var)
1019
+	foreach ($del_vars as $var)
1020 1020
 	{
1021
-		if(is_array($vars)) unset($vars[$var]);
1022
-		else if(is_object($vars)) unset($vars->$var);
1021
+		if (is_array($vars)) unset($vars[$var]);
1022
+		else if (is_object($vars)) unset($vars->$var);
1023 1023
 	}
1024 1024
 
1025 1025
 	return $vars;
@@ -1036,12 +1036,12 @@  discard block
 block discarded – undo
1036 1036
  */
1037 1037
 function handleError($errno, $errstr, $file, $line)
1038 1038
 {
1039
-	if(!__DEBUG__)
1039
+	if (!__DEBUG__)
1040 1040
 	{
1041 1041
 		return;
1042 1042
 	}
1043 1043
 	$errors = array(E_USER_ERROR, E_ERROR, E_PARSE);
1044
-	if(!in_array($errno, $errors))
1044
+	if (!in_array($errno, $errors))
1045 1045
 	{
1046 1046
 		return;
1047 1047
 	}
@@ -1062,7 +1062,7 @@  discard block
 block discarded – undo
1062 1062
 {
1063 1063
 	$mod = pow(10, $size);
1064 1064
 	$output = sprintf('%0' . $size . 'd/', $no % $mod);
1065
-	if($no >= $mod)
1065
+	if ($no >= $mod)
1066 1066
 	{
1067 1067
 		$output .= getNumberingPath((int) $no / $mod, $size);
1068 1068
 	}
@@ -1151,13 +1151,13 @@  discard block
 block discarded – undo
1151 1151
 {
1152 1152
 	$content = preg_replace('@<(/?)xmp.*?>@i', '<\1xmp>', $content);
1153 1153
 
1154
-	if(($start_xmp = strrpos($content, '<xmp>')) !== FALSE)
1154
+	if (($start_xmp = strrpos($content, '<xmp>')) !== FALSE)
1155 1155
 	{
1156
-		if(($close_xmp = strrpos($content, '</xmp>')) === FALSE)
1156
+		if (($close_xmp = strrpos($content, '</xmp>')) === FALSE)
1157 1157
 		{
1158 1158
 			$content .= '</xmp>';
1159 1159
 		}
1160
-		else if($close_xmp < $start_xmp)
1160
+		else if ($close_xmp < $start_xmp)
1161 1161
 		{
1162 1162
 			$content .= '</xmp>';
1163 1163
 		}
@@ -1177,25 +1177,25 @@  discard block
 block discarded – undo
1177 1177
 	$tag = strtolower($match[2]);
1178 1178
 
1179 1179
 	// xmp tag ?뺣━
1180
-	if($tag == 'xmp')
1180
+	if ($tag == 'xmp')
1181 1181
 	{
1182 1182
 		return "<{$match[1]}xmp>";
1183 1183
 	}
1184
-	if($match[1])
1184
+	if ($match[1])
1185 1185
 	{
1186 1186
 		return $match[0];
1187 1187
 	}
1188
-	if($match[4])
1188
+	if ($match[4])
1189 1189
 	{
1190 1190
 		$match[4] = ' ' . $match[4];
1191 1191
 	}
1192 1192
 
1193 1193
 	$attrs = array();
1194
-	if(preg_match_all('/([\w:-]+)\s*=(?:\s*(["\']))?(?(2)(.*?)\2|([^ ]+))/s', $match[3], $m))
1194
+	if (preg_match_all('/([\w:-]+)\s*=(?:\s*(["\']))?(?(2)(.*?)\2|([^ ]+))/s', $match[3], $m))
1195 1195
 	{
1196
-		foreach($m[1] as $idx => $name)
1196
+		foreach ($m[1] as $idx => $name)
1197 1197
 		{
1198
-			if(strlen($name) >= 2 && substr_compare($name, 'on', 0, 2) === 0)
1198
+			if (strlen($name) >= 2 && substr_compare($name, 'on', 0, 2) === 0)
1199 1199
 			{
1200 1200
 				continue;
1201 1201
 			}
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
 			$val = preg_replace('/&#(?:x([a-fA-F0-9]+)|0*(\d+));/e', 'chr("\\1"?0x00\\1:\\2+0)', $m[3][$idx] . $m[4][$idx]);
1204 1204
 			$val = preg_replace('/^\s+|[\t\n\r]+/', '', $val);
1205 1205
 
1206
-			if(preg_match('/^[a-z]+script:/i', $val))
1206
+			if (preg_match('/^[a-z]+script:/i', $val))
1207 1207
 			{
1208 1208
 				continue;
1209 1209
 			}
@@ -1212,30 +1212,30 @@  discard block
 block discarded – undo
1212 1212
 		}
1213 1213
 	}
1214 1214
 
1215
-	if(isset($attrs['style']) && preg_match('@(?:/\*|\*/|\n|:\s*expression\s*\()@i', $attrs['style']))
1215
+	if (isset($attrs['style']) && preg_match('@(?:/\*|\*/|\n|:\s*expression\s*\()@i', $attrs['style']))
1216 1216
 	{
1217 1217
 		unset($attrs['style']);
1218 1218
 	}
1219 1219
 
1220 1220
 	$attr = array();
1221
-	foreach($attrs as $name => $val)
1221
+	foreach ($attrs as $name => $val)
1222 1222
 	{
1223
-		if($tag == 'object' || $tag == 'embed' || $tag == 'a')
1223
+		if ($tag == 'object' || $tag == 'embed' || $tag == 'a')
1224 1224
 		{
1225 1225
 			$attribute = strtolower(trim($name));
1226
-			if($attribute == 'data' || $attribute == 'src' || $attribute == 'href')
1226
+			if ($attribute == 'data' || $attribute == 'src' || $attribute == 'href')
1227 1227
 			{
1228
-				if(stripos($val, 'data:') === 0)
1228
+				if (stripos($val, 'data:') === 0)
1229 1229
 				{
1230 1230
 					continue;
1231 1231
 				}
1232 1232
 			}
1233 1233
 		}
1234 1234
 
1235
-		if($tag == 'img')
1235
+		if ($tag == 'img')
1236 1236
 		{
1237 1237
 			$attribute = strtolower(trim($name));
1238
-			if(stripos($val, 'data:') === 0)
1238
+			if (stripos($val, 'data:') === 0)
1239 1239
 			{
1240 1240
 				continue;
1241 1241
 			}
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
 }
1250 1250
 
1251 1251
 // convert hexa value to RGB
1252
-if(!function_exists('hexrgb'))
1252
+if (!function_exists('hexrgb'))
1253 1253
 {
1254 1254
 
1255 1255
 	/**
@@ -1285,9 +1285,9 @@  discard block
 block discarded – undo
1285 1285
 
1286 1286
 	settype($password, "string");
1287 1287
 
1288
-	for($i = 0; $i < strlen($password); $i++)
1288
+	for ($i = 0; $i < strlen($password); $i++)
1289 1289
 	{
1290
-		if($password[$i] == ' ' || $password[$i] == '\t')
1290
+		if ($password[$i] == ' ' || $password[$i] == '\t')
1291 1291
 		{
1292 1292
 			continue;
1293 1293
 		}
@@ -1299,11 +1299,11 @@  discard block
 block discarded – undo
1299 1299
 	$result1 = sprintf("%08lx", $nr & ((1 << 31) - 1));
1300 1300
 	$result2 = sprintf("%08lx", $nr2 & ((1 << 31) - 1));
1301 1301
 
1302
-	if($result1 == '80000000')
1302
+	if ($result1 == '80000000')
1303 1303
 	{
1304 1304
 		$nr += 0x80000000;
1305 1305
 	}
1306
-	if($result2 == '80000000')
1306
+	if ($result2 == '80000000')
1307 1307
 	{
1308 1308
 		$nr2 += 0x80000000;
1309 1309
 	}
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
 function getScriptPath()
1320 1320
 {
1321 1321
 	static $url = NULL;
1322
-	if($url == NULL)
1322
+	if ($url == NULL)
1323 1323
 	{
1324 1324
 		$url = str_ireplace('/tools/', '/', preg_replace('/index.php$/i', '', str_replace('\\', '/', $_SERVER['SCRIPT_NAME'])));
1325 1325
 	}
@@ -1349,14 +1349,14 @@  discard block
 block discarded – undo
1349 1349
 	$decodedStr = '';
1350 1350
 	$pos = 0;
1351 1351
 	$len = strlen($source);
1352
-	while($pos < $len)
1352
+	while ($pos < $len)
1353 1353
 	{
1354 1354
 		$charAt = substr($source, $pos, 1);
1355
-		if($charAt == '%')
1355
+		if ($charAt == '%')
1356 1356
 		{
1357 1357
 			$pos++;
1358 1358
 			$charAt = substr($source, $pos, 1);
1359
-			if($charAt == 'u')
1359
+			if ($charAt == 'u')
1360 1360
 			{
1361 1361
 				// we got a unicode character
1362 1362
 				$pos++;
@@ -1390,19 +1390,19 @@  discard block
 block discarded – undo
1390 1390
  */
1391 1391
 function _code2utf($num)
1392 1392
 {
1393
-	if($num < 128)
1393
+	if ($num < 128)
1394 1394
 	{
1395 1395
 		return chr($num);
1396 1396
 	}
1397
-	if($num < 2048)
1397
+	if ($num < 2048)
1398 1398
 	{
1399 1399
 		return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
1400 1400
 	}
1401
-	if($num < 65536)
1401
+	if ($num < 65536)
1402 1402
 	{
1403 1403
 		return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
1404 1404
 	}
1405
-	if($num < 2097152)
1405
+	if ($num < 2097152)
1406 1406
 	{
1407 1407
 		return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
1408 1408
 	}
@@ -1419,7 +1419,7 @@  discard block
 block discarded – undo
1419 1419
  */
1420 1420
 function detectUTF8($string, $return_convert = FALSE, $urldecode = TRUE)
1421 1421
 {
1422
-	if($urldecode)
1422
+	if ($urldecode)
1423 1423
 	{
1424 1424
 		$string = urldecode($string);
1425 1425
 	}
@@ -1427,12 +1427,12 @@  discard block
 block discarded – undo
1427 1427
 	$sample = iconv('utf-8', 'utf-8', $string);
1428 1428
 	$is_utf8 = (md5($sample) == md5($string));
1429 1429
 
1430
-	if(!$urldecode)
1430
+	if (!$urldecode)
1431 1431
 	{
1432 1432
 		$string = urldecode($string);
1433 1433
 	}
1434 1434
 
1435
-	if($return_convert)
1435
+	if ($return_convert)
1436 1436
 	{
1437 1437
 		return ($is_utf8) ? $string : iconv('euc-kr', 'utf-8', $string);
1438 1438
 	}
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
  */
1449 1449
 function json_encode2($data)
1450 1450
 {
1451
-	switch(gettype($data))
1451
+	switch (gettype($data))
1452 1452
 	{
1453 1453
 		case 'boolean':
1454 1454
 			return $data ? 'true' : 'false';
@@ -1462,9 +1462,9 @@  discard block
 block discarded – undo
1462 1462
 		case 'array':
1463 1463
 			$rel = FALSE; // relative array?
1464 1464
 			$key = array_keys($data);
1465
-			foreach($key as $v)
1465
+			foreach ($key as $v)
1466 1466
 			{
1467
-				if(!is_int($v))
1467
+				if (!is_int($v))
1468 1468
 				{
1469 1469
 					$rel = TRUE;
1470 1470
 					break;
@@ -1472,7 +1472,7 @@  discard block
 block discarded – undo
1472 1472
 			}
1473 1473
 
1474 1474
 			$arr = array();
1475
-			foreach($data as $k => $v)
1475
+			foreach ($data as $k => $v)
1476 1476
 			{
1477 1477
 				$arr[] = ($rel ? '"' . strtr($k, array('\\' => '\\\\', '"' => '\\"')) . '":' : '') . json_encode2($v);
1478 1478
 			}
@@ -1491,7 +1491,7 @@  discard block
 block discarded – undo
1491 1491
  */
1492 1492
 function isCrawler($agent = NULL)
1493 1493
 {
1494
-	if(!$agent)
1494
+	if (!$agent)
1495 1495
 	{
1496 1496
 		$agent = $_SERVER['HTTP_USER_AGENT'];
1497 1497
 	}
@@ -1501,9 +1501,9 @@  discard block
 block discarded – undo
1501 1501
 		/*'211.245.21.110-211.245.21.119' mixsh is closed */
1502 1502
 	);
1503 1503
 
1504
-	foreach($check_agent as $str)
1504
+	foreach ($check_agent as $str)
1505 1505
 	{
1506
-		if(stristr($agent, $str) != FALSE)
1506
+		if (stristr($agent, $str) != FALSE)
1507 1507
 		{
1508 1508
 			return TRUE;
1509 1509
 		}
@@ -1521,7 +1521,7 @@  discard block
 block discarded – undo
1521 1521
  */
1522 1522
 function stripEmbedTagForAdmin(&$content, $writer_member_srl)
1523 1523
 {
1524
-	if(!Context::get('is_logged'))
1524
+	if (!Context::get('is_logged'))
1525 1525
 	{
1526 1526
 		return;
1527 1527
 	}
@@ -1529,13 +1529,13 @@  discard block
 block discarded – undo
1529 1529
 	$oModuleModel = getModel('module');
1530 1530
 	$logged_info = Context::get('logged_info');
1531 1531
 
1532
-	if($writer_member_srl != $logged_info->member_srl && ($logged_info->is_admin == "Y" || $oModuleModel->isSiteAdmin($logged_info)))
1532
+	if ($writer_member_srl != $logged_info->member_srl && ($logged_info->is_admin == "Y" || $oModuleModel->isSiteAdmin($logged_info)))
1533 1533
 	{
1534
-		if($writer_member_srl)
1534
+		if ($writer_member_srl)
1535 1535
 		{
1536 1536
 			$oMemberModel = getModel('member');
1537 1537
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($writer_member_srl);
1538
-			if($member_info->is_admin == "Y")
1538
+			if ($member_info->is_admin == "Y")
1539 1539
 			{
1540 1540
 				return;
1541 1541
 			}
@@ -1556,7 +1556,7 @@  discard block
 block discarded – undo
1556 1556
  */
1557 1557
 function requirePear()
1558 1558
 {
1559
-	if(version_compare(PHP_VERSION, "5.3.0") < 0)
1559
+	if (version_compare(PHP_VERSION, "5.3.0") < 0)
1560 1560
 	{
1561 1561
 		set_include_path(_XE_PATH_ . "libs/PEAR" . PATH_SEPARATOR . get_include_path());
1562 1562
 	}
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 
1569 1569
 function checkCSRF()
1570 1570
 {
1571
-	if($_SERVER['REQUEST_METHOD'] != 'POST')
1571
+	if ($_SERVER['REQUEST_METHOD'] != 'POST')
1572 1572
 	{
1573 1573
 		return FALSE;
1574 1574
 	}
@@ -1576,7 +1576,7 @@  discard block
 block discarded – undo
1576 1576
 	$default_url = Context::getDefaultUrl();
1577 1577
 	$referer = $_SERVER["HTTP_REFERER"];
1578 1578
 
1579
-	if(strpos($default_url, 'xn--') !== FALSE && strpos($referer, 'xn--') === FALSE)
1579
+	if (strpos($default_url, 'xn--') !== FALSE && strpos($referer, 'xn--') === FALSE)
1580 1580
 	{
1581 1581
 		require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php');
1582 1582
 		$IDN = new idna_convert(array('idn_version' => 2008));
@@ -1589,9 +1589,9 @@  discard block
 block discarded – undo
1589 1589
 	$oModuleModel = getModel('module');
1590 1590
 	$siteModuleInfo = $oModuleModel->getDefaultMid();
1591 1591
 
1592
-	if($siteModuleInfo->site_srl == 0)
1592
+	if ($siteModuleInfo->site_srl == 0)
1593 1593
 	{
1594
-		if($default_url['host'] !== $referer['host'])
1594
+		if ($default_url['host'] !== $referer['host'])
1595 1595
 		{
1596 1596
 			return FALSE;
1597 1597
 		}
@@ -1599,7 +1599,7 @@  discard block
 block discarded – undo
1599 1599
 	else
1600 1600
 	{
1601 1601
 		$virtualSiteInfo = $oModuleModel->getSiteInfo($siteModuleInfo->site_srl);
1602
-		if(strtolower($virtualSiteInfo->domain) != strtolower(Context::get('vid')) && !strstr(strtolower($virtualSiteInfo->domain), strtolower($referer['host'])))
1602
+		if (strtolower($virtualSiteInfo->domain) != strtolower(Context::get('vid')) && !strstr(strtolower($virtualSiteInfo->domain), strtolower($referer['host'])))
1603 1603
 		{
1604 1604
 			return FALSE;
1605 1605
 		}
@@ -1615,15 +1615,15 @@  discard block
 block discarded – undo
1615 1615
  */
1616 1616
 function recurciveExposureCheck(&$menu)
1617 1617
 {
1618
-	if(is_array($menu))
1618
+	if (is_array($menu))
1619 1619
 	{
1620
-		foreach($menu AS $key=>$value)
1620
+		foreach ($menu AS $key=>$value)
1621 1621
 		{
1622
-			if(!$value['isShow'])
1622
+			if (!$value['isShow'])
1623 1623
 			{
1624 1624
 				unset($menu[$key]);
1625 1625
 			}
1626
-			if(is_array($value['list']) && count($value['list']) > 0)
1626
+			if (is_array($value['list']) && count($value['list']) > 0)
1627 1627
 			{
1628 1628
 				recurciveExposureCheck($menu[$key]['list']);
1629 1629
 			}
@@ -1633,17 +1633,17 @@  discard block
 block discarded – undo
1633 1633
 
1634 1634
 function changeValueInUrl($key, $requestKey, $dbKey, $urlName = 'success_return_url')
1635 1635
 {
1636
-	if($requestKey != $dbKey)
1636
+	if ($requestKey != $dbKey)
1637 1637
 	{
1638 1638
 		$arrayUrl = parse_url(Context::get('success_return_url'));
1639
-		if($arrayUrl['query'])
1639
+		if ($arrayUrl['query'])
1640 1640
 		{
1641 1641
 			parse_str($arrayUrl['query'], $parsedStr);
1642 1642
 
1643
-			if(isset($parsedStr[$key]))
1643
+			if (isset($parsedStr[$key]))
1644 1644
 			{
1645 1645
 				$parsedStr[$key] = $requestKey;
1646
-				$successReturnUrl .= $arrayUrl['path'].'?'.http_build_query($parsedStr);
1646
+				$successReturnUrl .= $arrayUrl['path'] . '?' . http_build_query($parsedStr);
1647 1647
 				Context::set($urlName, $successReturnUrl);
1648 1648
 			}
1649 1649
 		}
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
  */
1684 1684
 function alertScript($msg)
1685 1685
 {
1686
-	if(!$msg)
1686
+	if (!$msg)
1687 1687
 	{
1688 1688
 		return;
1689 1689
 	}
Please login to merge, or discard this patch.
Braces   +54 added lines, -66 removed lines patch added patch discarded remove patch
@@ -296,10 +296,11 @@  discard block
 block discarded – undo
296 296
 	$num_args = func_num_args();
297 297
 	$args_list = func_get_args();
298 298
 
299
-	if($num_args)
300
-		$url = Context::getUrl($num_args, $args_list);
301
-	else
302
-		$url = Context::getRequestUri();
299
+	if($num_args) {
300
+			$url = Context::getUrl($num_args, $args_list);
301
+	} else {
302
+			$url = Context::getRequestUri();
303
+	}
303 304
 
304 305
 	return preg_replace('@\berror_return_url=[^&]*|\w+=(?:&|$)@', '', $url);
305 306
 }
@@ -318,8 +319,7 @@  discard block
 block discarded – undo
318 319
 	if($num_args)
319 320
 	{
320 321
 		$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
321
-	}
322
-	else
322
+	} else
323 323
 	{
324 324
 		$url = Context::getRequestUri();
325 325
 	}
@@ -341,8 +341,7 @@  discard block
 block discarded – undo
341 341
 	if($num_args)
342 342
 	{
343 343
 		$url = Context::getUrl($num_args, $args_list, NULL, TRUE, TRUE);
344
-	}
345
-	else
344
+	} else
346 345
 	{
347 346
 		$url = Context::getRequestUri();
348 347
 	}
@@ -531,13 +530,11 @@  discard block
 block discarded – undo
531 530
 		{
532 531
 			$char_width += (int) $chars[$c - 32];
533 532
 			$idx++;
534
-		}
535
-		else if(191 < $c && $c < 224)
533
+		} else if(191 < $c && $c < 224)
536 534
 		{
537 535
 			$char_width += $chars[4];
538 536
 			$idx += 2;
539
-		}
540
-		else
537
+		} else
541 538
 		{
542 539
 			$char_width += $chars[0];
543 540
 			$idx += 3;
@@ -564,8 +561,7 @@  discard block
 block discarded – undo
564 561
 	if($time_zone < 0)
565 562
 	{
566 563
 		$to = -1;
567
-	}
568
-	else
564
+	} else
569 565
 	{
570 566
 		$to = 1;
571 567
 	}
@@ -577,8 +573,7 @@  discard block
 block discarded – undo
577 573
 	if($server_time_zone < 0)
578 574
 	{
579 575
 		$so = -1;
580
-	}
581
-	else
576
+	} else
582 577
 	{
583 578
 		$so = 1;
584 579
 	}
@@ -615,8 +610,7 @@  discard block
 block discarded – undo
615 610
 	if(strlen($str) <= 8)
616 611
 	{
617 612
 		$gap = 0;
618
-	}
619
-	else
613
+	} else
620 614
 	{
621 615
 		$gap = zgap();
622 616
 	}
@@ -639,20 +633,16 @@  discard block
 block discarded – undo
639 633
 	if($gap < 60)
640 634
 	{
641 635
 		$buff = sprintf($lang_time_gap['min'], (int) ($gap / 60) + 1);
642
-	}
643
-	elseif($gap < 60 * 60)
636
+	} elseif($gap < 60 * 60)
644 637
 	{
645 638
 		$buff = sprintf($lang_time_gap['mins'], (int) ($gap / 60) + 1);
646
-	}
647
-	elseif($gap < 60 * 60 * 2)
639
+	} elseif($gap < 60 * 60 * 2)
648 640
 	{
649 641
 		$buff = sprintf($lang_time_gap['hour'], (int) ($gap / 60 / 60) + 1);
650
-	}
651
-	elseif($gap < 60 * 60 * 24)
642
+	} elseif($gap < 60 * 60 * 24)
652 643
 	{
653 644
 		$buff = sprintf($lang_time_gap['hours'], (int) ($gap / 60 / 60) + 1);
654
-	}
655
-	else
645
+	} else
656 646
 	{
657 647
 		$buff = zdate($date, $format);
658 648
 	}
@@ -699,12 +689,10 @@  discard block
 block discarded – undo
699 689
 				if($format == 'Y-m-d')
700 690
 				{
701 691
 					$format = 'M d, Y';
702
-				}
703
-				elseif($format == 'Y-m-d H:i:s')
692
+				} elseif($format == 'Y-m-d H:i:s')
704 693
 				{
705 694
 					$format = 'M d, Y H:i:s';
706
-				}
707
-				elseif($format == 'Y-m-d H:i')
695
+				} elseif($format == 'Y-m-d H:i')
708 696
 				{
709 697
 					$format = 'M d, Y H:i';
710 698
 				}
@@ -713,12 +701,10 @@  discard block
 block discarded – undo
713 701
 				if($format == 'Y-m-d')
714 702
 				{
715 703
 					$format = 'd-m-Y';
716
-				}
717
-				elseif($format == 'Y-m-d H:i:s')
704
+				} elseif($format == 'Y-m-d H:i:s')
718 705
 				{
719 706
 					$format = 'H:i:s d-m-Y';
720
-				}
721
-				elseif($format == 'Y-m-d H:i')
707
+				} elseif($format == 'Y-m-d H:i')
722 708
 				{
723 709
 					$format = 'H:i d-m-Y';
724 710
 				}
@@ -754,8 +740,7 @@  discard block
 block discarded – undo
754 740
 		);
755 741
 
756 742
 		$string = strtr($format, $trans);
757
-	}
758
-	else
743
+	} else
759 744
 	{
760 745
 		// if year value is greater than 1970, get unixtime by using ztime() for date() function's argument. 
761 746
 		$string = date($format, ztime($str));
@@ -843,8 +828,7 @@  discard block
 block discarded – undo
843 828
 		}
844 829
 
845 830
 		$firephp->fb($debug_output, $label, $type);
846
-	}
847
-	else
831
+	} else
848 832
 	{
849 833
 		if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
850 834
 		{
@@ -852,10 +836,16 @@  discard block
 block discarded – undo
852 836
 		}
853 837
 
854 838
 		$print = array();
855
-		if($debug_file_exist === NULL) $print[] = '<?php exit() ?>';
839
+		if($debug_file_exist === NULL) {
840
+			$print[] = '<?php exit() ?>';
841
+		}
856 842
 
857
-		if(!$debug_file) $debug_file =  _XE_PATH_ . 'files/' . $file;
858
-		if(!$debug_file_exist) $debug_file_exist = file_exists($debug_file);
843
+		if(!$debug_file) {
844
+			$debug_file =  _XE_PATH_ . 'files/' . $file;
845
+		}
846
+		if(!$debug_file_exist) {
847
+			$debug_file_exist = file_exists($debug_file);
848
+		}
859 849
 
860 850
 		if($display_option === TRUE || $display_option === 'ERROR')
861 851
 		{
@@ -867,11 +857,13 @@  discard block
 block discarded – undo
867 857
 		$type = gettype($debug_output);
868 858
 		if(!in_array($type, array('array', 'object', 'resource')))
869 859
 		{
870
-			if($display_option === 'ERROR') $print[] = 'ERROR : ' . var_export($debug_output, TRUE);
871
-			else $print[] = $type . '(' . var_export($debug_output, TRUE) . ')';
860
+			if($display_option === 'ERROR') {
861
+				$print[] = 'ERROR : ' . var_export($debug_output, TRUE);
862
+			} else {
863
+				$print[] = $type . '(' . var_export($debug_output, TRUE) . ')';
864
+			}
872 865
 			$print[] = PHP_EOL.PHP_EOL;
873
-		}
874
-		else
866
+		} else
875 867
 		{
876 868
 			$print[] = print_r($debug_output, TRUE);
877 869
 			$print[] = PHP_EOL;
@@ -888,7 +880,9 @@  discard block
 block discarded – undo
888 880
  */
889 881
 function writeSlowlog($type, $elapsed_time, $obj)
890 882
 {
891
-	if(!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return;
883
+	if(!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) {
884
+		return;
885
+	}
892 886
 
893 887
 	static $log_filename = array(
894 888
 		'query' => 'files/_slowlog_query.php',
@@ -908,25 +902,21 @@  discard block
 block discarded – undo
908 902
 	{
909 903
 		$buff[] = "\tCaller : " . $obj->caller;
910 904
 		$buff[] = "\tCalled : " . $obj->called;
911
-	}
912
-	else if($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__)
905
+	} else if($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__)
913 906
 	{
914 907
 		$buff[] = "\tAddon : " . $obj->called;
915 908
 		$buff[] = "\tCalled position : " . $obj->caller;
916
-	}
917
-	else if($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__)
909
+	} else if($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__)
918 910
 	{
919 911
 		$buff[] = "\tWidget : " . $obj->called;
920
-	}
921
-	else if($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
912
+	} else if($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
922 913
 	{
923 914
 
924 915
 		$buff[] = $obj->query;
925 916
 		$buff[] = "\tQuery ID   : " . $obj->query_id;
926 917
 		$buff[] = "\tCaller     : " . $obj->caller;
927 918
 		$buff[] = "\tConnection : " . $obj->connection;
928
-	}
929
-	else
919
+	} else
930 920
 	{
931 921
 		$write_file = false;
932 922
 	}
@@ -1018,8 +1008,11 @@  discard block
 block discarded – undo
1018 1008
 
1019 1009
 	foreach($del_vars as $var)
1020 1010
 	{
1021
-		if(is_array($vars)) unset($vars[$var]);
1022
-		else if(is_object($vars)) unset($vars->$var);
1011
+		if(is_array($vars)) {
1012
+			unset($vars[$var]);
1013
+		} else if(is_object($vars)) {
1014
+			unset($vars->$var);
1015
+		}
1023 1016
 	}
1024 1017
 
1025 1018
 	return $vars;
@@ -1156,8 +1149,7 @@  discard block
 block discarded – undo
1156 1149
 		if(($close_xmp = strrpos($content, '</xmp>')) === FALSE)
1157 1150
 		{
1158 1151
 			$content .= '</xmp>';
1159
-		}
1160
-		else if($close_xmp < $start_xmp)
1152
+		} else if($close_xmp < $start_xmp)
1161 1153
 		{
1162 1154
 			$content .= '</xmp>';
1163 1155
 		}
@@ -1364,16 +1356,14 @@  discard block
 block discarded – undo
1364 1356
 				$unicode = hexdec($unicodeHexVal);
1365 1357
 				$decodedStr .= _code2utf($unicode);
1366 1358
 				$pos += 4;
1367
-			}
1368
-			else
1359
+			} else
1369 1360
 			{
1370 1361
 				// we have an escaped ascii character
1371 1362
 				$hexVal = substr($source, $pos, 2);
1372 1363
 				$decodedStr .= chr(hexdec($hexVal));
1373 1364
 				$pos += 2;
1374 1365
 			}
1375
-		}
1376
-		else
1366
+		} else
1377 1367
 		{
1378 1368
 			$decodedStr .= $charAt;
1379 1369
 			$pos++;
@@ -1559,8 +1549,7 @@  discard block
 block discarded – undo
1559 1549
 	if(version_compare(PHP_VERSION, "5.3.0") < 0)
1560 1550
 	{
1561 1551
 		set_include_path(_XE_PATH_ . "libs/PEAR" . PATH_SEPARATOR . get_include_path());
1562
-	}
1563
-	else
1552
+	} else
1564 1553
 	{
1565 1554
 		set_include_path(_XE_PATH_ . "libs/PEAR.1.9.5" . PATH_SEPARATOR . get_include_path());
1566 1555
 	}
@@ -1595,8 +1584,7 @@  discard block
 block discarded – undo
1595 1584
 		{
1596 1585
 			return FALSE;
1597 1586
 		}
1598
-	}
1599
-	else
1587
+	} else
1600 1588
 	{
1601 1589
 		$virtualSiteInfo = $oModuleModel->getSiteInfo($siteModuleInfo->site_srl);
1602 1590
 		if(strtolower($virtualSiteInfo->domain) != strtolower(Context::get('vid')) && !strstr(strtolower($virtualSiteInfo->domain), strtolower($referer['host'])))
Please login to merge, or discard this patch.