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
Push — develop ( 03d863...653685 )
by gyeong-won
12:40
created
classes/context/Context.class.php 2 patches
Spacing   +298 added lines, -298 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	function &getInstance()
163 163
 	{
164 164
 		static $theInstance = null;
165
-		if(!$theInstance)
165
+		if (!$theInstance)
166 166
 		{
167 167
 			$theInstance = new Context();
168 168
 		}
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 
183 183
 		// include ssl action cache file
184 184
 		$this->sslActionCacheFile = FileHandler::getRealPath($this->sslActionCacheFile);
185
-		if(is_readable($this->sslActionCacheFile))
185
+		if (is_readable($this->sslActionCacheFile))
186 186
 		{
187 187
 			require($this->sslActionCacheFile);
188
-			if(isset($sslActions))
188
+			if (isset($sslActions))
189 189
 			{
190 190
 				$this->ssl_actions = $sslActions;
191 191
 			}
@@ -201,12 +201,12 @@  discard block
 block discarded – undo
201 201
 	function init()
202 202
 	{
203 203
 		// fix missing HTTP_RAW_POST_DATA in PHP 5.6 and above
204
-		if(!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === TRUE)
204
+		if (!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === TRUE)
205 205
 		{
206 206
 			$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input");
207 207
 			
208 208
 			// If content is not XML JSON, unset
209
-			if(!preg_match('/^[\<\{\[]/', $GLOBALS['HTTP_RAW_POST_DATA']) && strpos($_SERVER['CONTENT_TYPE'], 'json') === FALSE && strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json') === FALSE)
209
+			if (!preg_match('/^[\<\{\[]/', $GLOBALS['HTTP_RAW_POST_DATA']) && strpos($_SERVER['CONTENT_TYPE'], 'json') === FALSE && strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json') === FALSE)
210 210
 			{
211 211
 				unset($GLOBALS['HTTP_RAW_POST_DATA']);
212 212
 			}
@@ -228,11 +228,11 @@  discard block
 block discarded – undo
228 228
 		$this->_setUploadedArgument();
229 229
 
230 230
 		$this->loadDBInfo();
231
-		if($this->db_info->use_sitelock == 'Y')
231
+		if ($this->db_info->use_sitelock == 'Y')
232 232
 		{
233
-			if(is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
233
+			if (is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
234 234
 
235
-			if(!IpFilter::filter($whitelist))
235
+			if (!IpFilter::filter($whitelist))
236 236
 			{
237 237
 				$title = ($this->db_info->sitelock_title) ? $this->db_info->sitelock_title : 'Maintenance in progress...';
238 238
 				$message = $this->db_info->sitelock_message;
@@ -242,52 +242,52 @@  discard block
 block discarded – undo
242 242
 				define('_XE_SITELOCK_MESSAGE_', $message);
243 243
 
244 244
 				header("HTTP/1.1 403 Forbidden");
245
-				if(FileHandler::exists(_XE_PATH_ . 'common/tpl/sitelock.user.html'))
245
+				if (FileHandler::exists(_XE_PATH_.'common/tpl/sitelock.user.html'))
246 246
 				{
247
-					include _XE_PATH_ . 'common/tpl/sitelock.user.html';
247
+					include _XE_PATH_.'common/tpl/sitelock.user.html';
248 248
 				}
249 249
 				else
250 250
 				{
251
-					include _XE_PATH_ . 'common/tpl/sitelock.html';
251
+					include _XE_PATH_.'common/tpl/sitelock.html';
252 252
 				}
253 253
 				exit;
254 254
 			}
255 255
 		}
256 256
 
257 257
 		// If XE is installed, get virtual site information
258
-		if(self::isInstalled())
258
+		if (self::isInstalled())
259 259
 		{
260 260
 			$oModuleModel = getModel('module');
261 261
 			$site_module_info = $oModuleModel->getDefaultMid();
262 262
 
263
-			if(!isset($site_module_info))
263
+			if (!isset($site_module_info))
264 264
 			{
265 265
 				$site_module_info = new stdClass();
266 266
 			}
267 267
 
268 268
 			// if site_srl of site_module_info is 0 (default site), compare the domain to default_url of db_config
269
-			if($site_module_info->site_srl == 0 && $site_module_info->domain != $this->db_info->default_url)
269
+			if ($site_module_info->site_srl == 0 && $site_module_info->domain != $this->db_info->default_url)
270 270
 			{
271 271
 				$site_module_info->domain = $this->db_info->default_url;
272 272
 			}
273 273
 
274 274
 			$this->set('site_module_info', $site_module_info);
275
-			if($site_module_info->site_srl && isSiteID($site_module_info->domain))
275
+			if ($site_module_info->site_srl && isSiteID($site_module_info->domain))
276 276
 			{
277 277
 				$this->set('vid', $site_module_info->domain, TRUE);
278 278
 			}
279 279
 
280
-			if(!isset($this->db_info))
280
+			if (!isset($this->db_info))
281 281
 			{
282 282
 				$this->db_info = new stdClass();
283 283
 			}
284 284
 
285 285
 			$this->db_info->lang_type = $site_module_info->default_language;
286
-			if(!$this->db_info->lang_type)
286
+			if (!$this->db_info->lang_type)
287 287
 			{
288 288
 				$this->db_info->lang_type = 'en';
289 289
 			}
290
-			if(!$this->db_info->use_db_session)
290
+			if (!$this->db_info->use_db_session)
291 291
 			{
292 292
 				$this->db_info->use_db_session = 'N';
293 293
 			}
@@ -297,30 +297,30 @@  discard block
 block discarded – undo
297 297
 		$lang_supported = $this->loadLangSelected();
298 298
 
299 299
 		// Retrieve language type set in user's cookie
300
-		if($this->lang_type = $this->get('l'))
300
+		if ($this->lang_type = $this->get('l'))
301 301
 		{
302
-			if($_COOKIE['lang_type'] != $this->lang_type)
302
+			if ($_COOKIE['lang_type'] != $this->lang_type)
303 303
 			{
304 304
 				setcookie('lang_type', $this->lang_type, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000, '/');
305 305
 			}
306 306
 		}
307
-		elseif($_COOKIE['lang_type'])
307
+		elseif ($_COOKIE['lang_type'])
308 308
 		{
309 309
 			$this->lang_type = $_COOKIE['lang_type'];
310 310
 		}
311 311
 
312 312
 		// If it's not exists, follow default language type set in db_info
313
-		if(!$this->lang_type)
313
+		if (!$this->lang_type)
314 314
 		{
315 315
 			$this->lang_type = $this->db_info->lang_type;
316 316
 		}
317 317
 
318 318
 		// if still lang_type has not been set or has not-supported type , set as English.
319
-		if(!$this->lang_type)
319
+		if (!$this->lang_type)
320 320
 		{
321 321
 			$this->lang_type = 'en';
322 322
 		}
323
-		if(is_array($lang_supported) && !isset($lang_supported[$this->lang_type]))
323
+		if (is_array($lang_supported) && !isset($lang_supported[$this->lang_type]))
324 324
 		{
325 325
 			$this->lang_type = 'en';
326 326
 		}
@@ -329,10 +329,10 @@  discard block
 block discarded – undo
329 329
 		$this->setLangType($this->lang_type);
330 330
 
331 331
 		// load module module's language file according to language setting
332
-		$this->loadLang(_XE_PATH_ . 'modules/module/lang');
332
+		$this->loadLang(_XE_PATH_.'modules/module/lang');
333 333
 
334 334
 		// set session handler
335
-		if(self::isInstalled() && $this->db_info->use_db_session == 'Y')
335
+		if (self::isInstalled() && $this->db_info->use_db_session == 'Y')
336 336
 		{
337 337
 			$oSessionModel = getModel('session');
338 338
 			$oSessionController = getController('session');
@@ -341,11 +341,11 @@  discard block
 block discarded – undo
341 341
 			);
342 342
 		}
343 343
 
344
-		if($sess = $_POST[session_name()]) session_id($sess);
344
+		if ($sess = $_POST[session_name()]) session_id($sess);
345 345
 		session_start();
346 346
 
347 347
 		// set authentication information in Context and session
348
-		if(self::isInstalled())
348
+		if (self::isInstalled())
349 349
 		{
350 350
 			$oModuleModel = getModel('module');
351 351
 			$oModuleModel->loadModuleExtends();
@@ -353,15 +353,15 @@  discard block
 block discarded – undo
353 353
 			$oMemberModel = getModel('member');
354 354
 			$oMemberController = getController('member');
355 355
 
356
-			if($oMemberController && $oMemberModel)
356
+			if ($oMemberController && $oMemberModel)
357 357
 			{
358 358
 				// if signed in, validate it.
359
-				if($oMemberModel->isLogged())
359
+				if ($oMemberModel->isLogged())
360 360
 				{
361 361
 					$oMemberController->setSessionInfo();
362 362
 				}
363 363
 				// check auto sign-in
364
-				elseif($_COOKIE['xeak'])
364
+				elseif ($_COOKIE['xeak'])
365 365
 				{
366 366
 					$oMemberController->doAutologin();
367 367
 				}
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 
374 374
 		// load common language file
375 375
 		$this->lang = &$GLOBALS['lang'];
376
-		$this->loadLang(_XE_PATH_ . 'common/lang/');
376
+		$this->loadLang(_XE_PATH_.'common/lang/');
377 377
 
378 378
 		// check if using rewrite module
379 379
 		$this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE);
@@ -381,28 +381,28 @@  discard block
 block discarded – undo
381 381
 		// set locations for javascript use
382 382
 		$url = array();
383 383
 		$current_url = self::getRequestUri();
384
-		if($_SERVER['REQUEST_METHOD'] == 'GET')
384
+		if ($_SERVER['REQUEST_METHOD'] == 'GET')
385 385
 		{
386
-			if($this->get_vars)
386
+			if ($this->get_vars)
387 387
 			{
388 388
 				$url = array();
389
-				foreach($this->get_vars as $key => $val)
389
+				foreach ($this->get_vars as $key => $val)
390 390
 				{
391
-					if(is_array($val) && count($val) > 0)
391
+					if (is_array($val) && count($val) > 0)
392 392
 					{
393
-						foreach($val as $k => $v)
393
+						foreach ($val as $k => $v)
394 394
 						{
395
-							$url[] = $key . '[' . $k . ']=' . urlencode($v);
395
+							$url[] = $key.'['.$k.']='.urlencode($v);
396 396
 						}
397 397
 					}
398
-					elseif($val)
398
+					elseif ($val)
399 399
 					{
400
-						$url[] = $key . '=' . urlencode($val);
400
+						$url[] = $key.'='.urlencode($val);
401 401
 					}
402 402
 				}
403 403
 
404 404
 				$current_url = self::getRequestUri();
405
-				if($url) $current_url .= '?' . join('&', $url);
405
+				if ($url) $current_url .= '?'.join('&', $url);
406 406
 			}
407 407
 			else
408 408
 			{
@@ -417,12 +417,12 @@  discard block
 block discarded – undo
417 417
 		$this->set('current_url', $current_url);
418 418
 		$this->set('request_uri', self::getRequestUri());
419 419
 
420
-		if(strpos($current_url, 'xn--') !== FALSE)
420
+		if (strpos($current_url, 'xn--') !== FALSE)
421 421
 		{
422 422
 			$this->set('current_url', self::decodeIdna($current_url));
423 423
 		}
424 424
 
425
-		if(strpos(self::getRequestUri(), 'xn--') !== FALSE)
425
+		if (strpos(self::getRequestUri(), 'xn--') !== FALSE)
426 426
 		{
427 427
 			$this->set('request_uri', self::decodeIdna(self::getRequestUri()));
428 428
 		}
@@ -447,19 +447,19 @@  discard block
 block discarded – undo
447 447
 	{
448 448
 		$self = self::getInstance();
449 449
 
450
-		if(!$self->isInstalled())
450
+		if (!$self->isInstalled())
451 451
 		{
452 452
 			return;
453 453
 		}
454 454
 
455 455
 		$config_file = $self->getConfigFile();
456
-		if(is_readable($config_file))
456
+		if (is_readable($config_file))
457 457
 		{
458 458
 			include($config_file);
459 459
 		}
460 460
 
461 461
 		// If master_db information does not exist, the config file needs to be updated
462
-		if(!isset($db_info->master_db))
462
+		if (!isset($db_info->master_db))
463 463
 		{
464 464
 			$db_info->master_db = array();
465 465
 			$db_info->master_db["db_type"] = $db_info->db_type;
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 			$db_info->master_db["db_table_prefix"] = $db_info->db_table_prefix;
478 478
 			unset($db_info->db_table_prefix);
479 479
 
480
-			if(isset($db_info->master_db["db_table_prefix"]) && substr_compare($db_info->master_db["db_table_prefix"], '_', -1) !== 0)
480
+			if (isset($db_info->master_db["db_table_prefix"]) && substr_compare($db_info->master_db["db_table_prefix"], '_', -1) !== 0)
481 481
 			{
482 482
 				$db_info->master_db["db_table_prefix"] .= '_';
483 483
 			}
@@ -489,33 +489,33 @@  discard block
 block discarded – undo
489 489
 			$oInstallController->makeConfigFile();
490 490
 		}
491 491
 
492
-		if(!$db_info->use_prepared_statements)
492
+		if (!$db_info->use_prepared_statements)
493 493
 		{
494 494
 			$db_info->use_prepared_statements = 'Y';
495 495
 		}
496 496
 
497
-		if(!$db_info->time_zone)
497
+		if (!$db_info->time_zone)
498 498
 			$db_info->time_zone = date('O');
499 499
 		$GLOBALS['_time_zone'] = $db_info->time_zone;
500 500
 
501
-		if($db_info->qmail_compatibility != 'Y')
501
+		if ($db_info->qmail_compatibility != 'Y')
502 502
 			$db_info->qmail_compatibility = 'N';
503 503
 		$GLOBALS['_qmail_compatibility'] = $db_info->qmail_compatibility;
504 504
 
505
-		if(!$db_info->use_db_session)
505
+		if (!$db_info->use_db_session)
506 506
 			$db_info->use_db_session = 'N';
507
-		if(!$db_info->use_ssl)
507
+		if (!$db_info->use_ssl)
508 508
 			$db_info->use_ssl = 'none';
509 509
 		$this->set('_use_ssl', $db_info->use_ssl);
510 510
 
511 511
 		$self->set('_http_port', ($db_info->http_port) ? $db_info->http_port : NULL);
512 512
 		$self->set('_https_port', ($db_info->https_port) ? $db_info->https_port : NULL);
513 513
 
514
-		if(!$db_info->sitelock_whitelist) {
514
+		if (!$db_info->sitelock_whitelist) {
515 515
 			$db_info->sitelock_whitelist = '127.0.0.1';
516 516
 		}
517 517
 
518
-		if(is_string($db_info->sitelock_whitelist)) {
518
+		if (is_string($db_info->sitelock_whitelist)) {
519 519
 			$db_info->sitelock_whitelist = explode(',', $db_info->sitelock_whitelist);
520 520
 		}
521 521
 
@@ -586,10 +586,10 @@  discard block
 block discarded – undo
586 586
 	function loadLangSupported()
587 587
 	{
588 588
 		static $lang_supported = null;
589
-		if(!$lang_supported)
589
+		if (!$lang_supported)
590 590
 		{
591
-			$langs = file(_XE_PATH_ . 'common/lang/lang.info');
592
-			foreach($langs as $val)
591
+			$langs = file(_XE_PATH_.'common/lang/lang.info');
592
+			foreach ($langs as $val)
593 593
 			{
594 594
 				list($lang_prefix, $lang_text) = explode(',', $val);
595 595
 				$lang_text = trim($lang_text);
@@ -607,17 +607,17 @@  discard block
 block discarded – undo
607 607
 	function loadLangSelected()
608 608
 	{
609 609
 		static $lang_selected = null;
610
-		if(!$lang_selected)
610
+		if (!$lang_selected)
611 611
 		{
612
-			$orig_lang_file = _XE_PATH_ . 'common/lang/lang.info';
613
-			$selected_lang_file = _XE_PATH_ . 'files/config/lang_selected.info';
614
-			if(!FileHandler::hasContent($selected_lang_file))
612
+			$orig_lang_file = _XE_PATH_.'common/lang/lang.info';
613
+			$selected_lang_file = _XE_PATH_.'files/config/lang_selected.info';
614
+			if (!FileHandler::hasContent($selected_lang_file))
615 615
 			{
616
-				$old_selected_lang_file = _XE_PATH_ . 'files/cache/lang_selected.info';
616
+				$old_selected_lang_file = _XE_PATH_.'files/cache/lang_selected.info';
617 617
 				FileHandler::moveFile($old_selected_lang_file, $selected_lang_file);
618 618
 			}
619 619
 
620
-			if(!FileHandler::hasContent($selected_lang_file))
620
+			if (!FileHandler::hasContent($selected_lang_file))
621 621
 			{
622 622
 				$buff = FileHandler::readFile($orig_lang_file);
623 623
 				FileHandler::writeFile($selected_lang_file, $buff);
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 			else
627 627
 			{
628 628
 				$langs = file($selected_lang_file);
629
-				foreach($langs as $val)
629
+				foreach ($langs as $val)
630 630
 				{
631 631
 					list($lang_prefix, $lang_text) = explode(',', $val);
632 632
 					$lang_text = trim($lang_text);
@@ -645,44 +645,44 @@  discard block
 block discarded – undo
645 645
 	function checkSSO()
646 646
 	{
647 647
 		// pass if it's not GET request or XE is not yet installed
648
-		if($this->db_info->use_sso != 'Y' || isCrawler())
648
+		if ($this->db_info->use_sso != 'Y' || isCrawler())
649 649
 		{
650 650
 			return TRUE;
651 651
 		}
652 652
 		$checkActList = array('rss' => 1, 'atom' => 1);
653
-		if(self::getRequestMethod() != 'GET' || !self::isInstalled() || isset($checkActList[self::get('act')]))
653
+		if (self::getRequestMethod() != 'GET' || !self::isInstalled() || isset($checkActList[self::get('act')]))
654 654
 		{
655 655
 			return TRUE;
656 656
 		}
657 657
 
658 658
 		// pass if default URL is not set
659 659
 		$default_url = trim($this->db_info->default_url);
660
-		if(!$default_url)
660
+		if (!$default_url)
661 661
 		{
662 662
 			return TRUE;
663 663
 		}
664 664
 
665
-		if(substr_compare($default_url, '/', -1) !== 0)
665
+		if (substr_compare($default_url, '/', -1) !== 0)
666 666
 		{
667 667
 			$default_url .= '/';
668 668
 		}
669 669
 
670 670
 		// for sites recieving SSO valdiation
671
-		if($default_url == self::getRequestUri())
671
+		if ($default_url == self::getRequestUri())
672 672
 		{
673
-			if(self::get('url'))
673
+			if (self::get('url'))
674 674
 			{
675 675
 				$url = base64_decode(self::get('url'));
676 676
 				$url_info = parse_url($url);
677
-				if(!Password::checkSignature($url, self::get('sig')))
677
+				if (!Password::checkSignature($url, self::get('sig')))
678 678
 				{
679 679
 					echo self::get('lang')->msg_invalid_request;
680 680
 					return false;
681 681
 				}
682 682
 
683
-				$url_info['query'].= ($url_info['query'] ? '&' : '') . 'SSOID=' . urlencode(session_id()) . '&sig=' . urlencode(Password::createSignature(session_id()));
684
-				$redirect_url = sprintf('%s://%s%s%s?%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':' . $url_info['port'] : '', $url_info['path'], $url_info['query']);
685
-				header('location:' . $redirect_url);
683
+				$url_info['query'] .= ($url_info['query'] ? '&' : '').'SSOID='.urlencode(session_id()).'&sig='.urlencode(Password::createSignature(session_id()));
684
+				$redirect_url = sprintf('%s://%s%s%s?%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':'.$url_info['port'] : '', $url_info['path'], $url_info['query']);
685
+				header('location:'.$redirect_url);
686 686
 
687 687
 				return FALSE;
688 688
 			}
@@ -691,9 +691,9 @@  discard block
 block discarded – undo
691 691
 		else
692 692
 		{
693 693
 			// result handling : set session_name()
694
-			if($session_name = self::get('SSOID'))
694
+			if ($session_name = self::get('SSOID'))
695 695
 			{
696
-				if(!Password::checkSignature($session_name, self::get('sig')))
696
+				if (!Password::checkSignature($session_name, self::get('sig')))
697 697
 				{
698 698
 					echo self::get('lang')->msg_invalid_request;
699 699
 					return false;
@@ -702,17 +702,17 @@  discard block
 block discarded – undo
702 702
 				setcookie(session_name(), $session_name);
703 703
 
704 704
 				$url = preg_replace('/[\?\&]SSOID=.+$/', '', self::getRequestUrl());
705
-				header('location:' . $url);
705
+				header('location:'.$url);
706 706
 				return FALSE;
707 707
 				// send SSO request
708 708
 			}
709
-			else if(!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
709
+			else if (!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
710 710
 			{
711 711
 				setcookie('sso', md5(self::getRequestUri()), 0, '/');
712 712
 				$origin_url = self::getRequestUrl();
713 713
 				$origin_sig = Password::createSignature($origin_url);
714 714
 				$url = sprintf("%s?url=%s&sig=%s", $default_url, urlencode(base64_encode($origin_url)), urlencode($origin_sig));
715
-				header('location:' . $url);
715
+				header('location:'.$url);
716 716
 				return FALSE;
717 717
 			}
718 718
 		}
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 	{
740 740
 		$self = self::getInstance();
741 741
 
742
-		if(!$self->isFTPRegisted())
742
+		if (!$self->isFTPRegisted())
743 743
 		{
744 744
 			return null;
745 745
 		}
@@ -757,15 +757,15 @@  discard block
 block discarded – undo
757 757
 	 */
758 758
 	function addBrowserTitle($site_title)
759 759
 	{
760
-		if(!$site_title)
760
+		if (!$site_title)
761 761
 		{
762 762
 			return;
763 763
 		}
764 764
 		$self = self::getInstance();
765 765
 
766
-		if($self->site_title)
766
+		if ($self->site_title)
767 767
 		{
768
-			$self->site_title .= ' - ' . $site_title;
768
+			$self->site_title .= ' - '.$site_title;
769 769
 		}
770 770
 		else
771 771
 		{
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 	 */
782 782
 	function setBrowserTitle($site_title)
783 783
 	{
784
-		if(!$site_title)
784
+		if (!$site_title)
785 785
 		{
786 786
 			return;
787 787
 		}
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 		$oModuleModel = getModel('module');
814 814
 		$moduleConfig = $oModuleModel->getModuleConfig('module');
815 815
 
816
-		if(isset($moduleConfig->siteTitle))
816
+		if (isset($moduleConfig->siteTitle))
817 817
 		{
818 818
 			return $moduleConfig->siteTitle;
819 819
 		}
@@ -840,30 +840,30 @@  discard block
 block discarded – undo
840 840
 		global $lang;
841 841
 
842 842
 		$self = self::getInstance();
843
-		if(!$self->lang_type)
843
+		if (!$self->lang_type)
844 844
 		{
845 845
 			return;
846 846
 		}
847
-		if(!is_object($lang))
847
+		if (!is_object($lang))
848 848
 		{
849 849
 			$lang = new stdClass;
850 850
 		}
851 851
 
852
-		if(!($filename = $self->_loadXmlLang($path)))
852
+		if (!($filename = $self->_loadXmlLang($path)))
853 853
 		{
854 854
 			$filename = $self->_loadPhpLang($path);
855 855
 		}
856 856
 
857
-		if(!is_array($self->loaded_lang_files))
857
+		if (!is_array($self->loaded_lang_files))
858 858
 		{
859 859
 			$self->loaded_lang_files = array();
860 860
 		}
861
-		if(in_array($filename, $self->loaded_lang_files))
861
+		if (in_array($filename, $self->loaded_lang_files))
862 862
 		{
863 863
 			return;
864 864
 		}
865 865
 
866
-		if($filename && is_readable($filename))
866
+		if ($filename && is_readable($filename))
867 867
 		{
868 868
 			$self->loaded_lang_files[] = $filename;
869 869
 			include($filename);
@@ -884,24 +884,24 @@  discard block
 block discarded – undo
884 884
 	{
885 885
 		global $lang;
886 886
 
887
-		if(!$path) return;
887
+		if (!$path) return;
888 888
 
889
-		$_path = 'eval://' . $path;
889
+		$_path = 'eval://'.$path;
890 890
 
891
-		if(in_array($_path, $this->loaded_lang_files))
891
+		if (in_array($_path, $this->loaded_lang_files))
892 892
 		{
893 893
 			return;
894 894
 		}
895 895
 
896
-		if(substr_compare($path, '/', -1) !== 0)
896
+		if (substr_compare($path, '/', -1) !== 0)
897 897
 		{
898 898
 			$path .= '/';
899 899
 		}
900 900
 
901
-		$oXmlLangParser = new XmlLangParser($path . 'lang.xml', $this->lang_type);
901
+		$oXmlLangParser = new XmlLangParser($path.'lang.xml', $this->lang_type);
902 902
 		$content = $oXmlLangParser->getCompileContent();
903 903
 
904
-		if($content)
904
+		if ($content)
905 905
 		{
906 906
 			$this->loaded_lang_files[] = $_path;
907 907
 			eval($content);
@@ -916,9 +916,9 @@  discard block
 block discarded – undo
916 916
 	 */
917 917
 	function _loadXmlLang($path)
918 918
 	{
919
-		if(!$path) return;
919
+		if (!$path) return;
920 920
 
921
-		$oXmlLangParser = new XmlLangParser($path . ((substr_compare($path, '/', -1) !== 0) ? '/' : '') . 'lang.xml', $this->lang_type);
921
+		$oXmlLangParser = new XmlLangParser($path.((substr_compare($path, '/', -1) !== 0) ? '/' : '').'lang.xml', $this->lang_type);
922 922
 		return $oXmlLangParser->compile();
923 923
 	}
924 924
 
@@ -930,22 +930,22 @@  discard block
 block discarded – undo
930 930
 	 */
931 931
 	function _loadPhpLang($path)
932 932
 	{
933
-		if(!$path) return;
933
+		if (!$path) return;
934 934
 
935
-		if(substr_compare($path, '/', -1) !== 0)
935
+		if (substr_compare($path, '/', -1) !== 0)
936 936
 		{
937 937
 			$path .= '/';
938 938
 		}
939
-		$path_tpl = $path . '%s.lang.php';
939
+		$path_tpl = $path.'%s.lang.php';
940 940
 		$file = sprintf($path_tpl, $this->lang_type);
941 941
 
942 942
 		$langs = array('ko', 'en'); // this will be configurable.
943
-		while(!is_readable($file) && $langs[0])
943
+		while (!is_readable($file) && $langs[0])
944 944
 		{
945 945
 			$file = sprintf($path_tpl, array_shift($langs));
946 946
 		}
947 947
 
948
-		if(!is_readable($file))
948
+		if (!is_readable($file))
949 949
 		{
950 950
 			return FALSE;
951 951
 		}
@@ -987,11 +987,11 @@  discard block
 block discarded – undo
987 987
 	 */
988 988
 	function getLang($code)
989 989
 	{
990
-		if(!$code)
990
+		if (!$code)
991 991
 		{
992 992
 			return;
993 993
 		}
994
-		if($GLOBALS['lang']->{$code})
994
+		if ($GLOBALS['lang']->{$code})
995 995
 		{
996 996
 			return $GLOBALS['lang']->{$code};
997 997
 		}
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 	 */
1008 1008
 	function setLang($code, $val)
1009 1009
 	{
1010
-		if(!isset($GLOBALS['lang']))
1010
+		if (!isset($GLOBALS['lang']))
1011 1011
 		{
1012 1012
 			$GLOBALS['lang'] = new stdClass();
1013 1013
 		}
@@ -1035,17 +1035,17 @@  discard block
 block discarded – undo
1035 1035
 
1036 1036
 		$obj = clone $source_obj;
1037 1037
 
1038
-		foreach($charset_list as $charset)
1038
+		foreach ($charset_list as $charset)
1039 1039
 		{
1040
-			array_walk($obj,'Context::checkConvertFlag',$charset);
1040
+			array_walk($obj, 'Context::checkConvertFlag', $charset);
1041 1041
 			$flag = self::checkConvertFlag($flag = TRUE);
1042
-			if($flag)
1042
+			if ($flag)
1043 1043
 			{
1044
-				if($charset == 'UTF-8')
1044
+				if ($charset == 'UTF-8')
1045 1045
 				{
1046 1046
 					return $obj;
1047 1047
 				}
1048
-				array_walk($obj,'Context::doConvertEncoding',$charset);
1048
+				array_walk($obj, 'Context::doConvertEncoding', $charset);
1049 1049
 				return $obj;
1050 1050
 			}
1051 1051
 		}
@@ -1064,11 +1064,11 @@  discard block
 block discarded – undo
1064 1064
 	function checkConvertFlag(&$val, $key = null, $charset = null)
1065 1065
 	{
1066 1066
 		static $flag = TRUE;
1067
-		if($charset)
1067
+		if ($charset)
1068 1068
 		{
1069
-			if(is_array($val))
1070
-				array_walk($val,'Context::checkConvertFlag',$charset);
1071
-			else if($val && iconv($charset,$charset,$val)!=$val) $flag = FALSE;
1069
+			if (is_array($val))
1070
+				array_walk($val, 'Context::checkConvertFlag', $charset);
1071
+			else if ($val && iconv($charset, $charset, $val) != $val) $flag = FALSE;
1072 1072
 			else $flag = FALSE;
1073 1073
 		}
1074 1074
 		else
@@ -1092,9 +1092,9 @@  discard block
 block discarded – undo
1092 1092
 	{
1093 1093
 		if (is_array($val))
1094 1094
 		{
1095
-			array_walk($val,'Context::doConvertEncoding',$charset);
1095
+			array_walk($val, 'Context::doConvertEncoding', $charset);
1096 1096
 		}
1097
-		else $val = iconv($charset,'UTF-8',$val);
1097
+		else $val = iconv($charset, 'UTF-8', $val);
1098 1098
 	}
1099 1099
 
1100 1100
 	/**
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
 	 */
1106 1106
 	function convertEncodingStr($str)
1107 1107
 	{
1108
-        if(!$str) return null;
1108
+        if (!$str) return null;
1109 1109
 		$obj = new stdClass();
1110 1110
 		$obj->str = $str;
1111 1111
 		$obj = self::convertEncoding($obj);
@@ -1114,9 +1114,9 @@  discard block
 block discarded – undo
1114 1114
 
1115 1115
 	function decodeIdna($domain)
1116 1116
 	{
1117
-		if(strpos($domain, 'xn--') !== FALSE)
1117
+		if (strpos($domain, 'xn--') !== FALSE)
1118 1118
 		{
1119
-			require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php');
1119
+			require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php');
1120 1120
 			$IDN = new idna_convert(array('idn_version' => 2008));
1121 1121
 			$domain = $IDN->decode($domain);
1122 1122
 		}
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
 	{
1148 1148
 		$self = self::getInstance();
1149 1149
 
1150
-		if($self->response_method)
1150
+		if ($self->response_method)
1151 1151
 		{
1152 1152
 			return $self->response_method;
1153 1153
 		}
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
 		$this->_recursiveCheckVar($_SERVER['HTTP_HOST']);
1188 1188
 
1189 1189
 		$pattern = "/[\,\"\'\{\}\[\]\(\);$]/";
1190
-		if(preg_match($pattern, $_SERVER['HTTP_HOST']))
1190
+		if (preg_match($pattern, $_SERVER['HTTP_HOST']))
1191 1191
 		{
1192 1192
 			$this->isSuccessInit = FALSE;
1193 1193
 		}
@@ -1200,30 +1200,30 @@  discard block
 block discarded – undo
1200 1200
 	 */
1201 1201
 	function _setRequestArgument()
1202 1202
 	{
1203
-		if(!count($_REQUEST))
1203
+		if (!count($_REQUEST))
1204 1204
 		{
1205 1205
 			return;
1206 1206
 		}
1207 1207
 
1208 1208
 		$requestMethod = $this->getRequestMethod();
1209
-		foreach($_REQUEST as $key => $val)
1209
+		foreach ($_REQUEST as $key => $val)
1210 1210
 		{
1211
-			if($val === '' || self::get($key))
1211
+			if ($val === '' || self::get($key))
1212 1212
 			{
1213 1213
 				continue;
1214 1214
 			}
1215 1215
 			$key = htmlentities($key);
1216 1216
 			$val = $this->_filterRequestVar($key, $val);
1217 1217
 
1218
-			if($requestMethod == 'GET' && isset($_GET[$key]))
1218
+			if ($requestMethod == 'GET' && isset($_GET[$key]))
1219 1219
 			{
1220 1220
 				$set_to_vars = TRUE;
1221 1221
 			}
1222
-			elseif($requestMethod == 'POST' && isset($_POST[$key]))
1222
+			elseif ($requestMethod == 'POST' && isset($_POST[$key]))
1223 1223
 			{
1224 1224
 				$set_to_vars = TRUE;
1225 1225
 			}
1226
-			elseif($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1226
+			elseif ($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1227 1227
 			{
1228 1228
 				$set_to_vars = TRUE;
1229 1229
 			}
@@ -1232,7 +1232,7 @@  discard block
 block discarded – undo
1232 1232
 				$set_to_vars = FALSE;
1233 1233
 			}
1234 1234
 
1235
-			if($set_to_vars)
1235
+			if ($set_to_vars)
1236 1236
 			{
1237 1237
 				$this->_recursiveCheckVar($val);
1238 1238
 			}
@@ -1243,20 +1243,20 @@  discard block
 block discarded – undo
1243 1243
 
1244 1244
 	function _recursiveCheckVar($val)
1245 1245
 	{
1246
-		if(is_string($val))
1246
+		if (is_string($val))
1247 1247
 		{
1248
-			foreach($this->patterns as $pattern)
1248
+			foreach ($this->patterns as $pattern)
1249 1249
 			{
1250
-				if(preg_match($pattern, $val))
1250
+				if (preg_match($pattern, $val))
1251 1251
 				{
1252 1252
 					$this->isSuccessInit = FALSE;
1253 1253
 					return;
1254 1254
 				}
1255 1255
 			}
1256 1256
 		}
1257
-		else if(is_array($val))
1257
+		else if (is_array($val))
1258 1258
 		{
1259
-			foreach($val as $val2)
1259
+			foreach ($val as $val2)
1260 1260
 			{
1261 1261
 				$this->_recursiveCheckVar($val2);
1262 1262
 			}
@@ -1270,7 +1270,7 @@  discard block
 block discarded – undo
1270 1270
 	 */
1271 1271
 	function _setJSONRequestArgument()
1272 1272
 	{
1273
-		if($this->getRequestMethod() != 'JSON')
1273
+		if ($this->getRequestMethod() != 'JSON')
1274 1274
 		{
1275 1275
 			return;
1276 1276
 		}
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
 		$params = array();
1279 1279
 		parse_str($GLOBALS['HTTP_RAW_POST_DATA'], $params);
1280 1280
 
1281
-		foreach($params as $key => $val)
1281
+		foreach ($params as $key => $val)
1282 1282
 		{
1283 1283
 			$this->set($key, $this->_filterRequestVar($key, $val, 1), TRUE);
1284 1284
 		}
@@ -1291,13 +1291,13 @@  discard block
 block discarded – undo
1291 1291
 	 */
1292 1292
 	function _setXmlRpcArgument()
1293 1293
 	{
1294
-		if($this->getRequestMethod() != 'XMLRPC')
1294
+		if ($this->getRequestMethod() != 'XMLRPC')
1295 1295
 		{
1296 1296
 			return;
1297 1297
 		}
1298 1298
 
1299 1299
 		$xml = $GLOBALS['HTTP_RAW_POST_DATA'];
1300
-		if(Security::detectingXEE($xml))
1300
+		if (Security::detectingXEE($xml))
1301 1301
 		{
1302 1302
 			header("HTTP/1.0 400 Bad Request");
1303 1303
 			exit;
@@ -1309,12 +1309,12 @@  discard block
 block discarded – undo
1309 1309
 		$params = $xml_obj->methodcall->params;
1310 1310
 		unset($params->node_name, $params->attrs, $params->body);
1311 1311
 
1312
-		if(!count(get_object_vars($params)))
1312
+		if (!count(get_object_vars($params)))
1313 1313
 		{
1314 1314
 			return;
1315 1315
 		}
1316 1316
 
1317
-		foreach($params as $key => $val)
1317
+		foreach ($params as $key => $val)
1318 1318
 		{
1319 1319
 			$this->set($key, $this->_filterXmlVars($key, $val), TRUE);
1320 1320
 		}
@@ -1329,10 +1329,10 @@  discard block
 block discarded – undo
1329 1329
 	 */
1330 1330
 	function _filterXmlVars($key, $val)
1331 1331
 	{
1332
-		if(is_array($val))
1332
+		if (is_array($val))
1333 1333
 		{
1334 1334
 			$stack = array();
1335
-			foreach($val as $k => $v)
1335
+			foreach ($val as $k => $v)
1336 1336
 			{
1337 1337
 				$stack[$k] = $this->_filterXmlVars($k, $v);
1338 1338
 			}
@@ -1342,20 +1342,20 @@  discard block
 block discarded – undo
1342 1342
 
1343 1343
 		$body = $val->body;
1344 1344
 		unset($val->node_name, $val->attrs, $val->body);
1345
-		if(!count(get_object_vars($val)))
1345
+		if (!count(get_object_vars($val)))
1346 1346
 		{
1347 1347
 			return $this->_filterRequestVar($key, $body, 0);
1348 1348
 		}
1349 1349
 
1350 1350
 		$stack = new stdClass();
1351
-		foreach($val as $k => $v)
1351
+		foreach ($val as $k => $v)
1352 1352
 		{
1353 1353
 			$output = $this->_filterXmlVars($k, $v);
1354
-			if(is_object($v) && $v->attrs->type == 'array')
1354
+			if (is_object($v) && $v->attrs->type == 'array')
1355 1355
 			{
1356 1356
 				$output = array($output);
1357 1357
 			}
1358
-			if($k == 'value' && (is_array($v) || $v->attrs->type == 'array'))
1358
+			if ($k == 'value' && (is_array($v) || $v->attrs->type == 'array'))
1359 1359
 			{
1360 1360
 				return $output;
1361 1361
 			}
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
 			$stack->{$k} = $output;
1364 1364
 		}
1365 1365
 
1366
-		if(!count(get_object_vars($stack)))
1366
+		if (!count(get_object_vars($stack)))
1367 1367
 		{
1368 1368
 			return NULL;
1369 1369
 		}
@@ -1382,32 +1382,32 @@  discard block
 block discarded – undo
1382 1382
 	 */
1383 1383
 	function _filterRequestVar($key, $val, $do_stripslashes = 1)
1384 1384
 	{
1385
-		if(!($isArray = is_array($val)))
1385
+		if (!($isArray = is_array($val)))
1386 1386
 		{
1387 1387
 			$val = array($val);
1388 1388
 		}
1389 1389
 
1390 1390
 		$result = array();
1391
-		foreach($val as $k => $v)
1391
+		foreach ($val as $k => $v)
1392 1392
 		{
1393 1393
 			$k = htmlentities($k);
1394
-			if($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
1394
+			if ($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
1395 1395
 			{
1396 1396
 				$result[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v;
1397 1397
 			}
1398
-			elseif($key === 'mid' || $key === 'search_keyword')
1398
+			elseif ($key === 'mid' || $key === 'search_keyword')
1399 1399
 			{
1400 1400
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1401 1401
 			}
1402
-			elseif($key === 'vid')
1402
+			elseif ($key === 'vid')
1403 1403
 			{
1404 1404
 				$result[$k] = urlencode($v);
1405 1405
 			}
1406
-			elseif($key === 'xe_validator_id')
1406
+			elseif ($key === 'xe_validator_id')
1407 1407
 			{
1408 1408
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1409 1409
 			}
1410
-			elseif(stripos($key, 'XE_VALIDATOR', 0) === 0)
1410
+			elseif (stripos($key, 'XE_VALIDATOR', 0) === 0)
1411 1411
 			{
1412 1412
 				unset($result[$k]);
1413 1413
 			}
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
 			{
1416 1416
 				$result[$k] = $v;
1417 1417
 
1418
-				if($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc())
1418
+				if ($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc())
1419 1419
 				{
1420 1420
 					if (is_array($result[$k]))
1421 1421
 					{
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
 					}
1428 1428
 				}
1429 1429
 
1430
-				if(is_array($result[$k]))
1430
+				if (is_array($result[$k]))
1431 1431
 				{
1432 1432
 					array_walk_recursive($result[$k], function(&$val) { $val = trim($val); });
1433 1433
 				}
@@ -1459,17 +1459,17 @@  discard block
 block discarded – undo
1459 1459
 	 */
1460 1460
 	function _setUploadedArgument()
1461 1461
 	{
1462
-		if($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || (stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE && stripos($_SERVER['HTTP_CONTENT_TYPE'], 'multipart/form-data') === FALSE))
1462
+		if ($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || (stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE && stripos($_SERVER['HTTP_CONTENT_TYPE'], 'multipart/form-data') === FALSE))
1463 1463
 		{
1464 1464
 			return;
1465 1465
 		}
1466 1466
 
1467
-		foreach($_FILES as $key => $val)
1467
+		foreach ($_FILES as $key => $val)
1468 1468
 		{
1469 1469
 			$tmp_name = $val['tmp_name'];
1470
-			if(!is_array($tmp_name))
1470
+			if (!is_array($tmp_name))
1471 1471
 			{
1472
-				if(!$tmp_name || !is_uploaded_file($tmp_name))
1472
+				if (!$tmp_name || !is_uploaded_file($tmp_name))
1473 1473
 				{
1474 1474
 					continue;
1475 1475
 				}
@@ -1479,9 +1479,9 @@  discard block
 block discarded – undo
1479 1479
 			}
1480 1480
 			else
1481 1481
 			{
1482
-				for($i = 0, $c = count($tmp_name); $i < $c; $i++)
1482
+				for ($i = 0, $c = count($tmp_name); $i < $c; $i++)
1483 1483
 				{
1484
-					if($val['size'][$i] > 0)
1484
+					if ($val['size'][$i] > 0)
1485 1485
 					{
1486 1486
 						$file['name'] = $val['name'][$i];
1487 1487
 						$file['type'] = $val['type'][$i];
@@ -1513,16 +1513,16 @@  discard block
 block discarded – undo
1513 1513
 	function getRequestUrl()
1514 1514
 	{
1515 1515
 		static $url = null;
1516
-		if(is_null($url))
1516
+		if (is_null($url))
1517 1517
 		{
1518 1518
 			$url = self::getRequestUri();
1519
-			if(count($_GET) > 0)
1519
+			if (count($_GET) > 0)
1520 1520
 			{
1521
-				foreach($_GET as $key => $val)
1521
+				foreach ($_GET as $key => $val)
1522 1522
 				{
1523
-					$vars[] = $key . '=' . ($val ? urlencode(self::convertEncodingStr($val)) : '');
1523
+					$vars[] = $key.'='.($val ? urlencode(self::convertEncodingStr($val)) : '');
1524 1524
 				}
1525
-				$url .= '?' . join('&', $vars);
1525
+				$url .= '?'.join('&', $vars);
1526 1526
 			}
1527 1527
 		}
1528 1528
 		return $url;
@@ -1537,7 +1537,7 @@  discard block
 block discarded – undo
1537 1537
 		$self = self::getInstance();
1538 1538
 		$js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : $_POST['xe_js_callback'];
1539 1539
 
1540
-		if(!preg_match('/^[a-z0-9\.]+$/i', $js_callback_func))
1540
+		if (!preg_match('/^[a-z0-9\.]+$/i', $js_callback_func))
1541 1541
 		{
1542 1542
 			unset($js_callback_func);
1543 1543
 			unset($_GET['xe_js_callback']);
@@ -1565,22 +1565,22 @@  discard block
 block discarded – undo
1565 1565
 		$self = self::getInstance();
1566 1566
 
1567 1567
 		// retrieve virtual site information
1568
-		if(is_null($site_module_info))
1568
+		if (is_null($site_module_info))
1569 1569
 		{
1570 1570
 			$site_module_info = self::get('site_module_info');
1571 1571
 		}
1572 1572
 
1573 1573
 		// If $domain is set, handle it (if $domain is vid type, remove $domain and handle with $vid)
1574
-		if($domain && isSiteID($domain))
1574
+		if ($domain && isSiteID($domain))
1575 1575
 		{
1576 1576
 			$vid = $domain;
1577 1577
 			$domain = '';
1578 1578
 		}
1579 1579
 
1580 1580
 		// If $domain, $vid are not set, use current site information
1581
-		if(!$domain && !$vid)
1581
+		if (!$domain && !$vid)
1582 1582
 		{
1583
-			if($site_module_info->domain && isSiteID($site_module_info->domain))
1583
+			if ($site_module_info->domain && isSiteID($site_module_info->domain))
1584 1584
 			{
1585 1585
 				$vid = $site_module_info->domain;
1586 1586
 			}
@@ -1591,21 +1591,21 @@  discard block
 block discarded – undo
1591 1591
 		}
1592 1592
 
1593 1593
 		// if $domain is set, compare current URL. If they are same, remove the domain, otherwise link to the domain.
1594
-		if($domain)
1594
+		if ($domain)
1595 1595
 		{
1596 1596
 			$domain_info = parse_url($domain);
1597
-			if(is_null($current_info))
1597
+			if (is_null($current_info))
1598 1598
 			{
1599
-				$current_info = parse_url(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . getScriptPath());
1599
+				$current_info = parse_url(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].getScriptPath());
1600 1600
 			}
1601
-			if($domain_info['host'] . $domain_info['path'] == $current_info['host'] . $current_info['path'])
1601
+			if ($domain_info['host'].$domain_info['path'] == $current_info['host'].$current_info['path'])
1602 1602
 			{
1603 1603
 				unset($domain);
1604 1604
 			}
1605 1605
 			else
1606 1606
 			{
1607 1607
 				$domain = preg_replace('/^(http|https):\/\//i', '', trim($domain));
1608
-				if(substr_compare($domain, '/', -1) !== 0)
1608
+				if (substr_compare($domain, '/', -1) !== 0)
1609 1609
 				{
1610 1610
 					$domain .= '/';
1611 1611
 				}
@@ -1615,10 +1615,10 @@  discard block
 block discarded – undo
1615 1615
 		$get_vars = array();
1616 1616
 
1617 1617
 		// If there is no GET variables or first argument is '' to reset variables
1618
-		if(!$self->get_vars || $args_list[0] == '')
1618
+		if (!$self->get_vars || $args_list[0] == '')
1619 1619
 		{
1620 1620
 			// rearrange args_list
1621
-			if(is_array($args_list) && $args_list[0] == '')
1621
+			if (is_array($args_list) && $args_list[0] == '')
1622 1622
 			{
1623 1623
 				array_shift($args_list);
1624 1624
 			}
@@ -1630,13 +1630,13 @@  discard block
 block discarded – undo
1630 1630
 		}
1631 1631
 
1632 1632
 		// arrange args_list
1633
-		for($i = 0, $c = count($args_list); $i < $c; $i += 2)
1633
+		for ($i = 0, $c = count($args_list); $i < $c; $i += 2)
1634 1634
 		{
1635 1635
 			$key = $args_list[$i];
1636 1636
 			$val = trim($args_list[$i + 1]);
1637 1637
 
1638 1638
 			// If value is not set, remove the key
1639
-			if(!isset($val) || !strlen($val))
1639
+			if (!isset($val) || !strlen($val))
1640 1640
 			{
1641 1641
 				unset($get_vars[$key]);
1642 1642
 				continue;
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
 
1648 1648
 		// remove vid, rnd
1649 1649
 		unset($get_vars['rnd']);
1650
-		if($vid)
1650
+		if ($vid)
1651 1651
 		{
1652 1652
 			$get_vars['vid'] = $vid;
1653 1653
 		}
@@ -1664,17 +1664,17 @@  discard block
 block discarded – undo
1664 1664
 			'dispDocumentAdminManageDocument' => 'dispDocumentManageDocument',
1665 1665
 			'dispModuleAdminSelectList' => 'dispModuleSelectList'
1666 1666
 		);
1667
-		if($act_alias[$act])
1667
+		if ($act_alias[$act])
1668 1668
 		{
1669 1669
 			$get_vars['act'] = $act_alias[$act];
1670 1670
 		}
1671 1671
 
1672 1672
 		// organize URL
1673 1673
 		$query = '';
1674
-		if(count($get_vars) > 0)
1674
+		if (count($get_vars) > 0)
1675 1675
 		{
1676 1676
 			// if using rewrite mod
1677
-			if($self->allow_rewrite)
1677
+			if ($self->allow_rewrite)
1678 1678
 			{
1679 1679
 				$var_keys = array_keys($get_vars);
1680 1680
 				sort($var_keys);
@@ -1694,8 +1694,8 @@  discard block
 block discarded – undo
1694 1694
 					'vid' => $vid,
1695 1695
 					'mid' => $mid,
1696 1696
 					'mid.vid' => "$vid/$mid",
1697
-					'entry.mid' => "$mid/entry/" . $get_vars['entry'],
1698
-					'entry.mid.vid' => "$vid/$mid/entry/" . $get_vars['entry'],
1697
+					'entry.mid' => "$mid/entry/".$get_vars['entry'],
1698
+					'entry.mid.vid' => "$vid/$mid/entry/".$get_vars['entry'],
1699 1699
 					'document_srl' => $srl,
1700 1700
 					'document_srl.mid' => "$mid/$srl",
1701 1701
 					'document_srl.vid' => "$vid/$srl",
@@ -1712,66 +1712,66 @@  discard block
 block discarded – undo
1712 1712
 				$query = $target_map[$target];
1713 1713
 			}
1714 1714
 
1715
-			if(!$query)
1715
+			if (!$query)
1716 1716
 			{
1717 1717
 				$queries = array();
1718
-				foreach($get_vars as $key => $val)
1718
+				foreach ($get_vars as $key => $val)
1719 1719
 				{
1720
-					if(is_array($val) && count($val) > 0)
1720
+					if (is_array($val) && count($val) > 0)
1721 1721
 					{
1722
-						foreach($val as $k => $v)
1722
+						foreach ($val as $k => $v)
1723 1723
 						{
1724
-							$queries[] = $key . '[' . $k . ']=' . urlencode($v);
1724
+							$queries[] = $key.'['.$k.']='.urlencode($v);
1725 1725
 						}
1726 1726
 					}
1727
-					elseif(!is_array($val))
1727
+					elseif (!is_array($val))
1728 1728
 					{
1729
-						$queries[] = $key . '=' . urlencode($val);
1729
+						$queries[] = $key.'='.urlencode($val);
1730 1730
 					}
1731 1731
 				}
1732
-				if(count($queries) > 0)
1732
+				if (count($queries) > 0)
1733 1733
 				{
1734
-					$query = 'index.php?' . join('&', $queries);
1734
+					$query = 'index.php?'.join('&', $queries);
1735 1735
 				}
1736 1736
 			}
1737 1737
 		}
1738 1738
 
1739 1739
 		// If using SSL always
1740 1740
 		$_use_ssl = $self->get('_use_ssl');
1741
-		if($_use_ssl == 'always')
1741
+		if ($_use_ssl == 'always')
1742 1742
 		{
1743
-			$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1743
+			$query = $self->getRequestUri(ENFORCE_SSL, $domain).$query;
1744 1744
 			// optional SSL use
1745 1745
 		}
1746
-		elseif($_use_ssl == 'optional')
1746
+		elseif ($_use_ssl == 'optional')
1747 1747
 		{
1748 1748
 			$ssl_mode = (($self->get('module') === 'admin') || ($get_vars['module'] === 'admin') || (isset($get_vars['act']) && $self->isExistsSSLAction($get_vars['act']))) ? ENFORCE_SSL : RELEASE_SSL;
1749
-			$query = $self->getRequestUri($ssl_mode, $domain) . $query;
1749
+			$query = $self->getRequestUri($ssl_mode, $domain).$query;
1750 1750
 			// no SSL
1751 1751
 		}
1752 1752
 		else
1753 1753
 		{
1754 1754
 			// currently on SSL but target is not based on SSL
1755
-			if($_SERVER['HTTPS'] == 'on')
1755
+			if ($_SERVER['HTTPS'] == 'on')
1756 1756
 			{
1757
-				$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1757
+				$query = $self->getRequestUri(ENFORCE_SSL, $domain).$query;
1758 1758
 			}
1759
-			else if($domain) // if $domain is set
1759
+			else if ($domain) // if $domain is set
1760 1760
 			{
1761
-				$query = $self->getRequestUri(FOLLOW_REQUEST_SSL, $domain) . $query;
1761
+				$query = $self->getRequestUri(FOLLOW_REQUEST_SSL, $domain).$query;
1762 1762
 			}
1763 1763
 			else
1764 1764
 			{
1765
-				$query = getScriptPath() . $query;
1765
+				$query = getScriptPath().$query;
1766 1766
 			}
1767 1767
 		}
1768 1768
 
1769
-		if(!$encode)
1769
+		if (!$encode)
1770 1770
 		{
1771 1771
 			return $query;
1772 1772
 		}
1773 1773
 
1774
-		if(!$autoEncode)
1774
+		if (!$autoEncode)
1775 1775
 		{
1776 1776
 			return htmlspecialchars($query, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1777 1777
 		}
@@ -1780,16 +1780,16 @@  discard block
 block discarded – undo
1780 1780
 		$encode_queries = array();
1781 1781
 		$parsedUrl = parse_url($query);
1782 1782
 		parse_str($parsedUrl['query'], $output);
1783
-		foreach($output as $key => $value)
1783
+		foreach ($output as $key => $value)
1784 1784
 		{
1785
-			if(preg_match('/&([a-z]{2,}|#\d+);/', urldecode($value)))
1785
+			if (preg_match('/&([a-z]{2,}|#\d+);/', urldecode($value)))
1786 1786
 			{
1787 1787
 				$value = urlencode(htmlspecialchars_decode(urldecode($value)));
1788 1788
 			}
1789
-			$encode_queries[] = $key . '=' . $value;
1789
+			$encode_queries[] = $key.'='.$value;
1790 1790
 		}
1791 1791
 
1792
-		return htmlspecialchars($parsedUrl['path'] . '?' . join('&', $encode_queries), ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1792
+		return htmlspecialchars($parsedUrl['path'].'?'.join('&', $encode_queries), ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1793 1793
 	}
1794 1794
 
1795 1795
 	/**
@@ -1804,17 +1804,17 @@  discard block
 block discarded – undo
1804 1804
 		static $url = array();
1805 1805
 
1806 1806
 		// Check HTTP Request
1807
-		if(!isset($_SERVER['SERVER_PROTOCOL']))
1807
+		if (!isset($_SERVER['SERVER_PROTOCOL']))
1808 1808
 		{
1809 1809
 			return;
1810 1810
 		}
1811 1811
 
1812
-		if(self::get('_use_ssl') == 'always')
1812
+		if (self::get('_use_ssl') == 'always')
1813 1813
 		{
1814 1814
 			$ssl_mode = ENFORCE_SSL;
1815 1815
 		}
1816 1816
 
1817
-		if($domain)
1817
+		if ($domain)
1818 1818
 		{
1819 1819
 			$domain_key = md5($domain);
1820 1820
 		}
@@ -1823,14 +1823,14 @@  discard block
 block discarded – undo
1823 1823
 			$domain_key = 'default';
1824 1824
 		}
1825 1825
 
1826
-		if(isset($url[$ssl_mode][$domain_key]))
1826
+		if (isset($url[$ssl_mode][$domain_key]))
1827 1827
 		{
1828 1828
 			return $url[$ssl_mode][$domain_key];
1829 1829
 		}
1830 1830
 
1831 1831
 		$current_use_ssl = ($_SERVER['HTTPS'] == 'on');
1832 1832
 
1833
-		switch($ssl_mode)
1833
+		switch ($ssl_mode)
1834 1834
 		{
1835 1835
 			case FOLLOW_REQUEST_SSL: $use_ssl = $current_use_ssl;
1836 1836
 				break;
@@ -1840,34 +1840,34 @@  discard block
 block discarded – undo
1840 1840
 				break;
1841 1841
 		}
1842 1842
 
1843
-		if($domain)
1843
+		if ($domain)
1844 1844
 		{
1845 1845
 			$target_url = trim($domain);
1846
-			if(substr_compare($target_url, '/', -1) !== 0)
1846
+			if (substr_compare($target_url, '/', -1) !== 0)
1847 1847
 			{
1848
-				$target_url.= '/';
1848
+				$target_url .= '/';
1849 1849
 			}
1850 1850
 		}
1851 1851
 		else
1852 1852
 		{
1853
-			$target_url = $_SERVER['HTTP_HOST'] . getScriptPath();
1853
+			$target_url = $_SERVER['HTTP_HOST'].getScriptPath();
1854 1854
 		}
1855 1855
 
1856
-		$url_info = parse_url('http://' . $target_url);
1856
+		$url_info = parse_url('http://'.$target_url);
1857 1857
 
1858
-		if($current_use_ssl != $use_ssl)
1858
+		if ($current_use_ssl != $use_ssl)
1859 1859
 		{
1860 1860
 			unset($url_info['port']);
1861 1861
 		}
1862 1862
 
1863
-		if($use_ssl)
1863
+		if ($use_ssl)
1864 1864
 		{
1865 1865
 			$port = self::get('_https_port');
1866
-			if($port && $port != 443)
1866
+			if ($port && $port != 443)
1867 1867
 			{
1868 1868
 				$url_info['port'] = $port;
1869 1869
 			}
1870
-			elseif($url_info['port'] == 443)
1870
+			elseif ($url_info['port'] == 443)
1871 1871
 			{
1872 1872
 				unset($url_info['port']);
1873 1873
 			}
@@ -1875,17 +1875,17 @@  discard block
 block discarded – undo
1875 1875
 		else
1876 1876
 		{
1877 1877
 			$port = self::get('_http_port');
1878
-			if($port && $port != 80)
1878
+			if ($port && $port != 80)
1879 1879
 			{
1880 1880
 				$url_info['port'] = $port;
1881 1881
 			}
1882
-			elseif($url_info['port'] == 80)
1882
+			elseif ($url_info['port'] == 80)
1883 1883
 			{
1884 1884
 				unset($url_info['port']);
1885 1885
 			}
1886 1886
 		}
1887 1887
 
1888
-		$url[$ssl_mode][$domain_key] = sprintf('%s://%s%s%s', $use_ssl ? 'https' : $url_info['scheme'], $url_info['host'], $url_info['port'] && $url_info['port'] != 80 ? ':' . $url_info['port'] : '', $url_info['path']);
1888
+		$url[$ssl_mode][$domain_key] = sprintf('%s://%s%s%s', $use_ssl ? 'https' : $url_info['scheme'], $url_info['host'], $url_info['port'] && $url_info['port'] != 80 ? ':'.$url_info['port'] : '', $url_info['path']);
1889 1889
 
1890 1890
 		return $url[$ssl_mode][$domain_key];
1891 1891
 	}
@@ -1902,16 +1902,16 @@  discard block
 block discarded – undo
1902 1902
 	{
1903 1903
 		$self = self::getInstance();
1904 1904
 		$self->context->{$key} = $val;
1905
-		if($set_to_get_vars === FALSE)
1905
+		if ($set_to_get_vars === FALSE)
1906 1906
 		{
1907 1907
 			return;
1908 1908
 		}
1909
-		if($val === NULL || $val === '')
1909
+		if ($val === NULL || $val === '')
1910 1910
 		{
1911 1911
 			unset($self->get_vars->{$key});
1912 1912
 			return;
1913 1913
 		}
1914
-		if($set_to_get_vars || $self->get_vars->{$key})
1914
+		if ($set_to_get_vars || $self->get_vars->{$key})
1915 1915
 		{
1916 1916
 			$self->get_vars->{$key} = $val;
1917 1917
 		}
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
 	{
1928 1928
 		$self = self::getInstance();
1929 1929
 
1930
-		if(!isset($self->context->{$key}))
1930
+		if (!isset($self->context->{$key}))
1931 1931
 		{
1932 1932
 			return null;
1933 1933
 		}
@@ -1942,7 +1942,7 @@  discard block
 block discarded – undo
1942 1942
 	function gets()
1943 1943
 	{
1944 1944
 		$num_args = func_num_args();
1945
-		if($num_args < 1)
1945
+		if ($num_args < 1)
1946 1946
 		{
1947 1947
 			return;
1948 1948
 		}
@@ -1950,7 +1950,7 @@  discard block
 block discarded – undo
1950 1950
 
1951 1951
 		$args_list = func_get_args();
1952 1952
 		$output = new stdClass();
1953
-		foreach($args_list as $v)
1953
+		foreach ($args_list as $v)
1954 1954
 		{
1955 1955
 			$output->{$v} = $self->get($v);
1956 1956
 		}
@@ -1976,7 +1976,7 @@  discard block
 block discarded – undo
1976 1976
 	function getRequestVars()
1977 1977
 	{
1978 1978
 		$self = self::getInstance();
1979
-		if($self->get_vars)
1979
+		if ($self->get_vars)
1980 1980
 		{
1981 1981
 			return clone($self->get_vars);
1982 1982
 		}
@@ -1993,13 +1993,13 @@  discard block
 block discarded – undo
1993 1993
 	{
1994 1994
 		$self = self::getInstance();
1995 1995
 
1996
-		if(!is_readable($self->sslActionCacheFile))
1996
+		if (!is_readable($self->sslActionCacheFile))
1997 1997
 		{
1998 1998
 			$buff = '<?php if(!defined("__XE__"))exit;';
1999 1999
 			FileHandler::writeFile($self->sslActionCacheFile, $buff);
2000 2000
 		}
2001 2001
 
2002
-		if(!isset($self->ssl_actions[$action]))
2002
+		if (!isset($self->ssl_actions[$action]))
2003 2003
 		{
2004 2004
 			$self->ssl_actions[$action] = 1;
2005 2005
 			$sslActionCacheString = sprintf('$sslActions[\'%s\'] = 1;', $action);
@@ -2017,16 +2017,16 @@  discard block
 block discarded – undo
2017 2017
 	{
2018 2018
 		$self = self::getInstance();
2019 2019
 
2020
-		if(!is_readable($self->sslActionCacheFile))
2020
+		if (!is_readable($self->sslActionCacheFile))
2021 2021
 		{
2022 2022
 			unset($self->ssl_actions);
2023 2023
 			$buff = '<?php if(!defined("__XE__"))exit;';
2024 2024
 			FileHandler::writeFile($self->sslActionCacheFile, $buff);
2025 2025
 		}
2026 2026
 
2027
-		foreach($action_array as $action)
2027
+		foreach ($action_array as $action)
2028 2028
 		{
2029
-			if(!isset($self->ssl_actions[$action]))
2029
+			if (!isset($self->ssl_actions[$action]))
2030 2030
 			{
2031 2031
 				$self->ssl_actions[$action] = 1;
2032 2032
 				$sslActionCacheString = sprintf('$sslActions[\'%s\'] = 1;', $action);
@@ -2045,7 +2045,7 @@  discard block
 block discarded – undo
2045 2045
 	{
2046 2046
 		$self = self::getInstance();
2047 2047
 
2048
-		if($self->isExistsSSLAction($action))
2048
+		if ($self->isExistsSSLAction($action))
2049 2049
 		{
2050 2050
 			$sslActionCacheString = sprintf('$sslActions[\'%s\'] = 1;', $action);
2051 2051
 			$buff = FileHandler::readFile($self->sslActionCacheFile);
@@ -2062,7 +2062,7 @@  discard block
 block discarded – undo
2062 2062
 	function getSSLActions()
2063 2063
 	{
2064 2064
 		$self = self::getInstance();
2065
-		if($self->getSslStatus() == 'optional')
2065
+		if ($self->getSslStatus() == 'optional')
2066 2066
 		{
2067 2067
 			return $self->ssl_actions;
2068 2068
 		}
@@ -2089,12 +2089,12 @@  discard block
 block discarded – undo
2089 2089
 	 */
2090 2090
 	function normalizeFilePath($file)
2091 2091
 	{
2092
-		if($file{0} != '/' && $file{0} != '.' && strpos($file, '://') === FALSE)
2092
+		if ($file{0} != '/' && $file{0} != '.' && strpos($file, '://') === FALSE)
2093 2093
 		{
2094
-			$file = './' . $file;
2094
+			$file = './'.$file;
2095 2095
 		}
2096 2096
 		$file = preg_replace('@/\./|(?<!:)\/\/@', '/', $file);
2097
-		while(strpos($file, '/../') !== FALSE)
2097
+		while (strpos($file, '/../') !== FALSE)
2098 2098
 		{
2099 2099
 			$file = preg_replace('/\/([^\/]+)\/\.\.\//s', '/', $file, 1);
2100 2100
 		}
@@ -2113,13 +2113,13 @@  discard block
 block discarded – undo
2113 2113
 	{
2114 2114
 		$file = self::normalizeFilePath($file);
2115 2115
 		$script_path = getScriptPath();
2116
-		if(strpos($file, './') === 0)
2116
+		if (strpos($file, './') === 0)
2117 2117
 		{
2118
-			$file = $script_path . substr($file, 2);
2118
+			$file = $script_path.substr($file, 2);
2119 2119
 		}
2120
-		elseif(strpos($file, '../') === 0)
2120
+		elseif (strpos($file, '../') === 0)
2121 2121
 		{
2122
-			$file = self::normalizeFilePath($script_path . $file);
2122
+			$file = self::normalizeFilePath($script_path.$file);
2123 2123
 		}
2124 2124
 
2125 2125
 		return $file;
@@ -2189,12 +2189,12 @@  discard block
 block discarded – undo
2189 2189
 	 */
2190 2190
 	function addJsFile($file, $optimized = FALSE, $targetie = '', $index = 0, $type = 'head', $isRuleset = FALSE, $autoPath = null)
2191 2191
 	{
2192
-		if($isRuleset)
2192
+		if ($isRuleset)
2193 2193
 		{
2194
-			if(strpos($file, '#') !== FALSE)
2194
+			if (strpos($file, '#') !== FALSE)
2195 2195
 			{
2196 2196
 				$file = str_replace('#', '', $file);
2197
-				if(!is_readable($file))
2197
+				if (!is_readable($file))
2198 2198
 				{
2199 2199
 					$file = $autoPath;
2200 2200
 				}
@@ -2259,9 +2259,9 @@  discard block
 block discarded – undo
2259 2259
 		ksort($files);
2260 2260
 		$files = array_values($files);
2261 2261
 		$filenames = array();
2262
-		for($i = 0, $c = count($files); $i < $c; ++$i)
2262
+		for ($i = 0, $c = count($files); $i < $c; ++$i)
2263 2263
 		{
2264
-			if(in_array($files[$i]['file'], $filenames))
2264
+			if (in_array($files[$i]['file'], $filenames))
2265 2265
 			{
2266 2266
 				unset($files[$i]);
2267 2267
 			}
@@ -2346,14 +2346,14 @@  discard block
 block discarded – undo
2346 2346
 	 */
2347 2347
 	function getJavascriptPluginInfo($pluginName)
2348 2348
 	{
2349
-		if($plugin_name == 'ui.datepicker')
2349
+		if ($plugin_name == 'ui.datepicker')
2350 2350
 		{
2351 2351
 			$plugin_name = 'ui';
2352 2352
 		}
2353 2353
 
2354
-		$plugin_path = './common/js/plugins/' . $pluginName . '/';
2355
-		$info_file = $plugin_path . 'plugin.load';
2356
-		if(!is_readable($info_file))
2354
+		$plugin_path = './common/js/plugins/'.$pluginName.'/';
2355
+		$info_file = $plugin_path.'plugin.load';
2356
+		if (!is_readable($info_file))
2357 2357
 		{
2358 2358
 			return;
2359 2359
 		}
@@ -2363,32 +2363,32 @@  discard block
 block discarded – undo
2363 2363
 		$result->jsList = array();
2364 2364
 		$result->cssList = array();
2365 2365
 
2366
-		foreach($list as $filename)
2366
+		foreach ($list as $filename)
2367 2367
 		{
2368 2368
 			$filename = trim($filename);
2369
-			if(!$filename)
2369
+			if (!$filename)
2370 2370
 			{
2371 2371
 				continue;
2372 2372
 			}
2373 2373
 
2374
-			if(strncasecmp('./', $filename, 2) === 0)
2374
+			if (strncasecmp('./', $filename, 2) === 0)
2375 2375
 			{
2376 2376
 				$filename = substr($filename, 2);
2377 2377
 			}
2378 2378
 
2379
-			if(substr_compare($filename, '.js', -3) === 0)
2379
+			if (substr_compare($filename, '.js', -3) === 0)
2380 2380
 			{
2381
-				$result->jsList[] = $plugin_path . $filename;
2381
+				$result->jsList[] = $plugin_path.$filename;
2382 2382
 			}
2383
-			elseif(substr_compare($filename, '.css', -4) === 0)
2383
+			elseif (substr_compare($filename, '.css', -4) === 0)
2384 2384
 			{
2385
-				$result->cssList[] = $plugin_path . $filename;
2385
+				$result->cssList[] = $plugin_path.$filename;
2386 2386
 			}
2387 2387
 		}
2388 2388
 
2389
-		if(is_dir($plugin_path . 'lang'))
2389
+		if (is_dir($plugin_path.'lang'))
2390 2390
 		{
2391
-			$result->langPath = $plugin_path . 'lang';
2391
+			$result->langPath = $plugin_path.'lang';
2392 2392
 		}
2393 2393
 
2394 2394
 		return $result;
@@ -2404,50 +2404,50 @@  discard block
 block discarded – undo
2404 2404
 		static $loaded_plugins = array();
2405 2405
 
2406 2406
 		$self = self::getInstance();
2407
-		if($plugin_name == 'ui.datepicker')
2407
+		if ($plugin_name == 'ui.datepicker')
2408 2408
 		{
2409 2409
 			$plugin_name = 'ui';
2410 2410
 		}
2411 2411
 
2412
-		if($loaded_plugins[$plugin_name])
2412
+		if ($loaded_plugins[$plugin_name])
2413 2413
 		{
2414 2414
 			return;
2415 2415
 		}
2416 2416
 		$loaded_plugins[$plugin_name] = TRUE;
2417 2417
 
2418
-		$plugin_path = './common/js/plugins/' . $plugin_name . '/';
2419
-		$info_file = $plugin_path . 'plugin.load';
2420
-		if(!is_readable($info_file))
2418
+		$plugin_path = './common/js/plugins/'.$plugin_name.'/';
2419
+		$info_file = $plugin_path.'plugin.load';
2420
+		if (!is_readable($info_file))
2421 2421
 		{
2422 2422
 			return;
2423 2423
 		}
2424 2424
 
2425 2425
 		$list = file($info_file);
2426
-		foreach($list as $filename)
2426
+		foreach ($list as $filename)
2427 2427
 		{
2428 2428
 			$filename = trim($filename);
2429
-			if(!$filename)
2429
+			if (!$filename)
2430 2430
 			{
2431 2431
 				continue;
2432 2432
 			}
2433 2433
 
2434
-			if(strncasecmp('./', $filename, 2) === 0)
2434
+			if (strncasecmp('./', $filename, 2) === 0)
2435 2435
 			{
2436 2436
 				$filename = substr($filename, 2);
2437 2437
 			}
2438
-			if(substr_compare($filename, '.js', -3) === 0)
2438
+			if (substr_compare($filename, '.js', -3) === 0)
2439 2439
 			{
2440
-				$self->loadFile(array($plugin_path . $filename, 'body', '', 0), TRUE);
2440
+				$self->loadFile(array($plugin_path.$filename, 'body', '', 0), TRUE);
2441 2441
 			}
2442
-			if(substr_compare($filename, '.css', -4) === 0)
2442
+			if (substr_compare($filename, '.css', -4) === 0)
2443 2443
 			{
2444
-				$self->loadFile(array($plugin_path . $filename, 'all', '', 0), TRUE);
2444
+				$self->loadFile(array($plugin_path.$filename, 'all', '', 0), TRUE);
2445 2445
 			}
2446 2446
 		}
2447 2447
 
2448
-		if(is_dir($plugin_path . 'lang'))
2448
+		if (is_dir($plugin_path.'lang'))
2449 2449
 		{
2450
-			$self->loadLang($plugin_path . 'lang');
2450
+			$self->loadLang($plugin_path.'lang');
2451 2451
 		}
2452 2452
 	}
2453 2453
 
@@ -2460,7 +2460,7 @@  discard block
 block discarded – undo
2460 2460
 	function addHtmlHeader($header)
2461 2461
 	{
2462 2462
 		$self = self::getInstance();
2463
-		$self->html_header .= "\n" . $header;
2463
+		$self->html_header .= "\n".$header;
2464 2464
 	}
2465 2465
 
2466 2466
 	function clearHtmlHeader()
@@ -2512,7 +2512,7 @@  discard block
 block discarded – undo
2512 2512
 	function addBodyHeader($header)
2513 2513
 	{
2514 2514
 		$self = self::getInstance();
2515
-		$self->body_header .= "\n" . $header;
2515
+		$self->body_header .= "\n".$header;
2516 2516
 	}
2517 2517
 
2518 2518
 	/**
@@ -2534,7 +2534,7 @@  discard block
 block discarded – undo
2534 2534
 	function addHtmlFooter($footer)
2535 2535
 	{
2536 2536
 		$self = self::getInstance();
2537
-		$self->html_footer .= ($self->Htmlfooter ? "\n" : '') . $footer;
2537
+		$self->html_footer .= ($self->Htmlfooter ? "\n" : '').$footer;
2538 2538
 	}
2539 2539
 
2540 2540
 	/**
@@ -2555,7 +2555,7 @@  discard block
 block discarded – undo
2555 2555
 	 */
2556 2556
 	function getConfigFile()
2557 2557
 	{
2558
-		return _XE_PATH_ . 'files/config/db.config.php';
2558
+		return _XE_PATH_.'files/config/db.config.php';
2559 2559
 	}
2560 2560
 
2561 2561
 	/**
@@ -2565,7 +2565,7 @@  discard block
 block discarded – undo
2565 2565
 	 */
2566 2566
 	function getFTPConfigFile()
2567 2567
 	{
2568
-		return _XE_PATH_ . 'files/config/ftp.config.php';
2568
+		return _XE_PATH_.'files/config/ftp.config.php';
2569 2569
 	}
2570 2570
 
2571 2571
 	/**
@@ -2617,14 +2617,14 @@  discard block
 block discarded – undo
2617 2617
 		$_path = explode('/', $path);
2618 2618
 		$_base = explode('/', $base_url);
2619 2619
 
2620
-		if(!$_base[count($_base) - 1])
2620
+		if (!$_base[count($_base) - 1])
2621 2621
 		{
2622 2622
 			array_pop($_base);
2623 2623
 		}
2624 2624
 
2625
-		foreach($_xe as $idx => $dir)
2625
+		foreach ($_xe as $idx => $dir)
2626 2626
 		{
2627
-			if($_path[0] != $dir)
2627
+			if ($_path[0] != $dir)
2628 2628
 			{
2629 2629
 				break;
2630 2630
 			}
@@ -2632,9 +2632,9 @@  discard block
 block discarded – undo
2632 2632
 		}
2633 2633
 
2634 2634
 		$idx = count($_xe) - $idx - 1;
2635
-		while($idx--)
2635
+		while ($idx--)
2636 2636
 		{
2637
-			if(count($_base) > 0)
2637
+			if (count($_base) > 0)
2638 2638
 			{
2639 2639
 				array_shift($_base);
2640 2640
 			}
@@ -2644,13 +2644,13 @@  discard block
 block discarded – undo
2644 2644
 			}
2645 2645
 		}
2646 2646
 
2647
-		if(count($_base) > 0)
2647
+		if (count($_base) > 0)
2648 2648
 		{
2649 2649
 			array_unshift($_path, join('/', $_base));
2650 2650
 		}
2651 2651
 
2652
-		$path = '/' . join('/', $_path);
2653
-		if(substr_compare($path, '/', -1) !== 0)
2652
+		$path = '/'.join('/', $_path);
2653
+		if (substr_compare($path, '/', -1) !== 0)
2654 2654
 		{
2655 2655
 			$path .= '/';
2656 2656
 		}
@@ -2665,13 +2665,13 @@  discard block
 block discarded – undo
2665 2665
 	{
2666 2666
 		$self = self::getInstance();
2667 2667
 
2668
-		if(!is_array($self->meta_tags))
2668
+		if (!is_array($self->meta_tags))
2669 2669
 		{
2670 2670
 			$self->meta_tags = array();
2671 2671
 		}
2672 2672
 
2673 2673
 		$ret = array();
2674
-		foreach($self->meta_tags as $key => $val)
2674
+		foreach ($self->meta_tags as $key => $val)
2675 2675
 		{
2676 2676
 			list($name, $is_http_equiv) = explode("\t", $key);
2677 2677
 			$ret[] = array('name' => $name, 'is_http_equiv' => $is_http_equiv, 'content' => $val);
@@ -2691,7 +2691,7 @@  discard block
 block discarded – undo
2691 2691
 	function addMetaTag($name, $content, $is_http_equiv = FALSE)
2692 2692
 	{
2693 2693
 		$self = self::getInstance();
2694
-		$self->meta_tags[$name . "\t" . ($is_http_equiv ? '1' : '0')] = $content;
2694
+		$self->meta_tags[$name."\t".($is_http_equiv ? '1' : '0')] = $content;
2695 2695
 	}
2696 2696
 
2697 2697
 }
Please login to merge, or discard this patch.
Braces   +83 added lines, -99 removed lines patch added patch discarded remove patch
@@ -230,7 +230,9 @@  discard block
 block discarded – undo
230 230
 		$this->loadDBInfo();
231 231
 		if($this->db_info->use_sitelock == 'Y')
232 232
 		{
233
-			if(is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
233
+			if(is_array($this->db_info->sitelock_whitelist)) {
234
+				$whitelist = $this->db_info->sitelock_whitelist;
235
+			}
234 236
 
235 237
 			if(!IpFilter::filter($whitelist))
236 238
 			{
@@ -245,8 +247,7 @@  discard block
 block discarded – undo
245 247
 				if(FileHandler::exists(_XE_PATH_ . 'common/tpl/sitelock.user.html'))
246 248
 				{
247 249
 					include _XE_PATH_ . 'common/tpl/sitelock.user.html';
248
-				}
249
-				else
250
+				} else
250 251
 				{
251 252
 					include _XE_PATH_ . 'common/tpl/sitelock.html';
252 253
 				}
@@ -303,8 +304,7 @@  discard block
 block discarded – undo
303 304
 			{
304 305
 				setcookie('lang_type', $this->lang_type, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000, '/');
305 306
 			}
306
-		}
307
-		elseif($_COOKIE['lang_type'])
307
+		} elseif($_COOKIE['lang_type'])
308 308
 		{
309 309
 			$this->lang_type = $_COOKIE['lang_type'];
310 310
 		}
@@ -341,7 +341,9 @@  discard block
 block discarded – undo
341 341
 			);
342 342
 		}
343 343
 
344
-		if($sess = $_POST[session_name()]) session_id($sess);
344
+		if($sess = $_POST[session_name()]) {
345
+			session_id($sess);
346
+		}
345 347
 		session_start();
346 348
 
347 349
 		// set authentication information in Context and session
@@ -394,22 +396,21 @@  discard block
 block discarded – undo
394 396
 						{
395 397
 							$url[] = $key . '[' . $k . ']=' . urlencode($v);
396 398
 						}
397
-					}
398
-					elseif($val)
399
+					} elseif($val)
399 400
 					{
400 401
 						$url[] = $key . '=' . urlencode($val);
401 402
 					}
402 403
 				}
403 404
 
404 405
 				$current_url = self::getRequestUri();
405
-				if($url) $current_url .= '?' . join('&', $url);
406
-			}
407
-			else
406
+				if($url) {
407
+					$current_url .= '?' . join('&', $url);
408
+				}
409
+			} else
408 410
 			{
409 411
 				$current_url = $this->getUrl();
410 412
 			}
411
-		}
412
-		else
413
+		} else
413 414
 		{
414 415
 			$current_url = self::getRequestUri();
415 416
 		}
@@ -494,18 +495,22 @@  discard block
 block discarded – undo
494 495
 			$db_info->use_prepared_statements = 'Y';
495 496
 		}
496 497
 
497
-		if(!$db_info->time_zone)
498
-			$db_info->time_zone = date('O');
498
+		if(!$db_info->time_zone) {
499
+					$db_info->time_zone = date('O');
500
+		}
499 501
 		$GLOBALS['_time_zone'] = $db_info->time_zone;
500 502
 
501
-		if($db_info->qmail_compatibility != 'Y')
502
-			$db_info->qmail_compatibility = 'N';
503
+		if($db_info->qmail_compatibility != 'Y') {
504
+					$db_info->qmail_compatibility = 'N';
505
+		}
503 506
 		$GLOBALS['_qmail_compatibility'] = $db_info->qmail_compatibility;
504 507
 
505
-		if(!$db_info->use_db_session)
506
-			$db_info->use_db_session = 'N';
507
-		if(!$db_info->use_ssl)
508
-			$db_info->use_ssl = 'none';
508
+		if(!$db_info->use_db_session) {
509
+					$db_info->use_db_session = 'N';
510
+		}
511
+		if(!$db_info->use_ssl) {
512
+					$db_info->use_ssl = 'none';
513
+		}
509 514
 		$this->set('_use_ssl', $db_info->use_ssl);
510 515
 
511 516
 		$self->set('_http_port', ($db_info->http_port) ? $db_info->http_port : NULL);
@@ -622,8 +627,7 @@  discard block
 block discarded – undo
622 627
 				$buff = FileHandler::readFile($orig_lang_file);
623 628
 				FileHandler::writeFile($selected_lang_file, $buff);
624 629
 				$lang_selected = self::loadLangSupported();
625
-			}
626
-			else
630
+			} else
627 631
 			{
628 632
 				$langs = file($selected_lang_file);
629 633
 				foreach($langs as $val)
@@ -687,8 +691,7 @@  discard block
 block discarded – undo
687 691
 				return FALSE;
688 692
 			}
689 693
 			// for sites requesting SSO validation
690
-		}
691
-		else
694
+		} else
692 695
 		{
693 696
 			// result handling : set session_name()
694 697
 			if($session_name = self::get('SSOID'))
@@ -705,8 +708,7 @@  discard block
 block discarded – undo
705 708
 				header('location:' . $url);
706 709
 				return FALSE;
707 710
 				// send SSO request
708
-			}
709
-			else if(!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
711
+			} else if(!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
710 712
 			{
711 713
 				setcookie('sso', md5(self::getRequestUri()), 0, '/');
712 714
 				$origin_url = self::getRequestUrl();
@@ -766,8 +768,7 @@  discard block
 block discarded – undo
766 768
 		if($self->site_title)
767 769
 		{
768 770
 			$self->site_title .= ' - ' . $site_title;
769
-		}
770
-		else
771
+		} else
771 772
 		{
772 773
 			$self->site_title = $site_title;
773 774
 		}
@@ -867,8 +868,7 @@  discard block
 block discarded – undo
867 868
 		{
868 869
 			$self->loaded_lang_files[] = $filename;
869 870
 			include($filename);
870
-		}
871
-		else
871
+		} else
872 872
 		{
873 873
 			$self->_evalxmlLang($path);
874 874
 		}
@@ -884,7 +884,9 @@  discard block
 block discarded – undo
884 884
 	{
885 885
 		global $lang;
886 886
 
887
-		if(!$path) return;
887
+		if(!$path) {
888
+			return;
889
+		}
888 890
 
889 891
 		$_path = 'eval://' . $path;
890 892
 
@@ -916,7 +918,9 @@  discard block
 block discarded – undo
916 918
 	 */
917 919
 	function _loadXmlLang($path)
918 920
 	{
919
-		if(!$path) return;
921
+		if(!$path) {
922
+			return;
923
+		}
920 924
 
921 925
 		$oXmlLangParser = new XmlLangParser($path . ((substr_compare($path, '/', -1) !== 0) ? '/' : '') . 'lang.xml', $this->lang_type);
922 926
 		return $oXmlLangParser->compile();
@@ -930,7 +934,9 @@  discard block
 block discarded – undo
930 934
 	 */
931 935
 	function _loadPhpLang($path)
932 936
 	{
933
-		if(!$path) return;
937
+		if(!$path) {
938
+			return;
939
+		}
934 940
 
935 941
 		if(substr_compare($path, '/', -1) !== 0)
936 942
 		{
@@ -1066,12 +1072,14 @@  discard block
 block discarded – undo
1066 1072
 		static $flag = TRUE;
1067 1073
 		if($charset)
1068 1074
 		{
1069
-			if(is_array($val))
1070
-				array_walk($val,'Context::checkConvertFlag',$charset);
1071
-			else if($val && iconv($charset,$charset,$val)!=$val) $flag = FALSE;
1072
-			else $flag = FALSE;
1073
-		}
1074
-		else
1075
+			if(is_array($val)) {
1076
+							array_walk($val,'Context::checkConvertFlag',$charset);
1077
+			} else if($val && iconv($charset,$charset,$val)!=$val) {
1078
+				$flag = FALSE;
1079
+			} else {
1080
+				$flag = FALSE;
1081
+			}
1082
+		} else
1075 1083
 		{
1076 1084
 			$return = $flag;
1077 1085
 			$flag = TRUE;
@@ -1093,8 +1101,9 @@  discard block
 block discarded – undo
1093 1101
 		if (is_array($val))
1094 1102
 		{
1095 1103
 			array_walk($val,'Context::doConvertEncoding',$charset);
1104
+		} else {
1105
+			$val = iconv($charset,'UTF-8',$val);
1096 1106
 		}
1097
-		else $val = iconv($charset,'UTF-8',$val);
1098 1107
 	}
1099 1108
 
1100 1109
 	/**
@@ -1105,7 +1114,9 @@  discard block
 block discarded – undo
1105 1114
 	 */
1106 1115
 	function convertEncodingStr($str)
1107 1116
 	{
1108
-        if(!$str) return null;
1117
+        if(!$str) {
1118
+        	return null;
1119
+        }
1109 1120
 		$obj = new stdClass();
1110 1121
 		$obj->str = $str;
1111 1122
 		$obj = self::convertEncoding($obj);
@@ -1218,16 +1229,13 @@  discard block
 block discarded – undo
1218 1229
 			if($requestMethod == 'GET' && isset($_GET[$key]))
1219 1230
 			{
1220 1231
 				$set_to_vars = TRUE;
1221
-			}
1222
-			elseif($requestMethod == 'POST' && isset($_POST[$key]))
1232
+			} elseif($requestMethod == 'POST' && isset($_POST[$key]))
1223 1233
 			{
1224 1234
 				$set_to_vars = TRUE;
1225
-			}
1226
-			elseif($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1235
+			} elseif($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1227 1236
 			{
1228 1237
 				$set_to_vars = TRUE;
1229
-			}
1230
-			else
1238
+			} else
1231 1239
 			{
1232 1240
 				$set_to_vars = FALSE;
1233 1241
 			}
@@ -1253,8 +1261,7 @@  discard block
 block discarded – undo
1253 1261
 					return;
1254 1262
 				}
1255 1263
 			}
1256
-		}
1257
-		else if(is_array($val))
1264
+		} else if(is_array($val))
1258 1265
 		{
1259 1266
 			foreach($val as $val2)
1260 1267
 			{
@@ -1394,24 +1401,19 @@  discard block
 block discarded – undo
1394 1401
 			if($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
1395 1402
 			{
1396 1403
 				$result[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v;
1397
-			}
1398
-			elseif($key === 'mid' || $key === 'search_keyword')
1404
+			} elseif($key === 'mid' || $key === 'search_keyword')
1399 1405
 			{
1400 1406
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1401
-			}
1402
-			elseif($key === 'vid')
1407
+			} elseif($key === 'vid')
1403 1408
 			{
1404 1409
 				$result[$k] = urlencode($v);
1405
-			}
1406
-			elseif($key === 'xe_validator_id')
1410
+			} elseif($key === 'xe_validator_id')
1407 1411
 			{
1408 1412
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1409
-			}
1410
-			elseif(stripos($key, 'XE_VALIDATOR', 0) === 0)
1413
+			} elseif(stripos($key, 'XE_VALIDATOR', 0) === 0)
1411 1414
 			{
1412 1415
 				unset($result[$k]);
1413
-			}
1414
-			else
1416
+			} else
1415 1417
 			{
1416 1418
 				$result[$k] = $v;
1417 1419
 
@@ -1420,8 +1422,7 @@  discard block
 block discarded – undo
1420 1422
 					if (is_array($result[$k]))
1421 1423
 					{
1422 1424
 						array_walk_recursive($result[$k], function(&$val) { $val = stripslashes($val); });
1423
-					}
1424
-					else
1425
+					} else
1425 1426
 					{
1426 1427
 						$result[$k] = stripslashes($result[$k]);
1427 1428
 					}
@@ -1430,8 +1431,7 @@  discard block
 block discarded – undo
1430 1431
 				if(is_array($result[$k]))
1431 1432
 				{
1432 1433
 					array_walk_recursive($result[$k], function(&$val) { $val = trim($val); });
1433
-				}
1434
-				else
1434
+				} else
1435 1435
 				{
1436 1436
 					$result[$k] = trim($result[$k]);
1437 1437
 				}
@@ -1476,8 +1476,7 @@  discard block
 block discarded – undo
1476 1476
 				$val['name'] = htmlspecialchars($val['name'], ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1477 1477
 				$this->set($key, $val, TRUE);
1478 1478
 				$this->is_uploaded = TRUE;
1479
-			}
1480
-			else
1479
+			} else
1481 1480
 			{
1482 1481
 				for($i = 0, $c = count($tmp_name); $i < $c; $i++)
1483 1482
 				{
@@ -1583,8 +1582,7 @@  discard block
 block discarded – undo
1583 1582
 			if($site_module_info->domain && isSiteID($site_module_info->domain))
1584 1583
 			{
1585 1584
 				$vid = $site_module_info->domain;
1586
-			}
1587
-			else
1585
+			} else
1588 1586
 			{
1589 1587
 				$domain = $site_module_info->domain;
1590 1588
 			}
@@ -1601,8 +1599,7 @@  discard block
 block discarded – undo
1601 1599
 			if($domain_info['host'] . $domain_info['path'] == $current_info['host'] . $current_info['path'])
1602 1600
 			{
1603 1601
 				unset($domain);
1604
-			}
1605
-			else
1602
+			} else
1606 1603
 			{
1607 1604
 				$domain = preg_replace('/^(http|https):\/\//i', '', trim($domain));
1608 1605
 				if(substr_compare($domain, '/', -1) !== 0)
@@ -1622,8 +1619,7 @@  discard block
 block discarded – undo
1622 1619
 			{
1623 1620
 				array_shift($args_list);
1624 1621
 			}
1625
-		}
1626
-		else
1622
+		} else
1627 1623
 		{
1628 1624
 			// Otherwise, make GET variables into array
1629 1625
 			$get_vars = get_object_vars($self->get_vars);
@@ -1650,8 +1646,7 @@  discard block
 block discarded – undo
1650 1646
 		if($vid)
1651 1647
 		{
1652 1648
 			$get_vars['vid'] = $vid;
1653
-		}
1654
-		else
1649
+		} else
1655 1650
 		{
1656 1651
 			unset($get_vars['vid']);
1657 1652
 		}
@@ -1723,8 +1718,7 @@  discard block
 block discarded – undo
1723 1718
 						{
1724 1719
 							$queries[] = $key . '[' . $k . ']=' . urlencode($v);
1725 1720
 						}
1726
-					}
1727
-					elseif(!is_array($val))
1721
+					} elseif(!is_array($val))
1728 1722
 					{
1729 1723
 						$queries[] = $key . '=' . urlencode($val);
1730 1724
 					}
@@ -1742,25 +1736,23 @@  discard block
 block discarded – undo
1742 1736
 		{
1743 1737
 			$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1744 1738
 			// optional SSL use
1745
-		}
1746
-		elseif($_use_ssl == 'optional')
1739
+		} elseif($_use_ssl == 'optional')
1747 1740
 		{
1748 1741
 			$ssl_mode = (($self->get('module') === 'admin') || ($get_vars['module'] === 'admin') || (isset($get_vars['act']) && $self->isExistsSSLAction($get_vars['act']))) ? ENFORCE_SSL : RELEASE_SSL;
1749 1742
 			$query = $self->getRequestUri($ssl_mode, $domain) . $query;
1750 1743
 			// no SSL
1751
-		}
1752
-		else
1744
+		} else
1753 1745
 		{
1754 1746
 			// currently on SSL but target is not based on SSL
1755 1747
 			if($_SERVER['HTTPS'] == 'on')
1756 1748
 			{
1757 1749
 				$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1758
-			}
1759
-			else if($domain) // if $domain is set
1750
+			} else if($domain) {
1751
+				// if $domain is set
1760 1752
 			{
1761 1753
 				$query = $self->getRequestUri(FOLLOW_REQUEST_SSL, $domain) . $query;
1762 1754
 			}
1763
-			else
1755
+			} else
1764 1756
 			{
1765 1757
 				$query = getScriptPath() . $query;
1766 1758
 			}
@@ -1817,8 +1809,7 @@  discard block
 block discarded – undo
1817 1809
 		if($domain)
1818 1810
 		{
1819 1811
 			$domain_key = md5($domain);
1820
-		}
1821
-		else
1812
+		} else
1822 1813
 		{
1823 1814
 			$domain_key = 'default';
1824 1815
 		}
@@ -1847,8 +1838,7 @@  discard block
 block discarded – undo
1847 1838
 			{
1848 1839
 				$target_url.= '/';
1849 1840
 			}
1850
-		}
1851
-		else
1841
+		} else
1852 1842
 		{
1853 1843
 			$target_url = $_SERVER['HTTP_HOST'] . getScriptPath();
1854 1844
 		}
@@ -1866,20 +1856,17 @@  discard block
 block discarded – undo
1866 1856
 			if($port && $port != 443)
1867 1857
 			{
1868 1858
 				$url_info['port'] = $port;
1869
-			}
1870
-			elseif($url_info['port'] == 443)
1859
+			} elseif($url_info['port'] == 443)
1871 1860
 			{
1872 1861
 				unset($url_info['port']);
1873 1862
 			}
1874
-		}
1875
-		else
1863
+		} else
1876 1864
 		{
1877 1865
 			$port = self::get('_http_port');
1878 1866
 			if($port && $port != 80)
1879 1867
 			{
1880 1868
 				$url_info['port'] = $port;
1881
-			}
1882
-			elseif($url_info['port'] == 80)
1869
+			} elseif($url_info['port'] == 80)
1883 1870
 			{
1884 1871
 				unset($url_info['port']);
1885 1872
 			}
@@ -2116,8 +2103,7 @@  discard block
 block discarded – undo
2116 2103
 		if(strpos($file, './') === 0)
2117 2104
 		{
2118 2105
 			$file = $script_path . substr($file, 2);
2119
-		}
2120
-		elseif(strpos($file, '../') === 0)
2106
+		} elseif(strpos($file, '../') === 0)
2121 2107
 		{
2122 2108
 			$file = self::normalizeFilePath($script_path . $file);
2123 2109
 		}
@@ -2379,8 +2365,7 @@  discard block
 block discarded – undo
2379 2365
 			if(substr_compare($filename, '.js', -3) === 0)
2380 2366
 			{
2381 2367
 				$result->jsList[] = $plugin_path . $filename;
2382
-			}
2383
-			elseif(substr_compare($filename, '.css', -4) === 0)
2368
+			} elseif(substr_compare($filename, '.css', -4) === 0)
2384 2369
 			{
2385 2370
 				$result->cssList[] = $plugin_path . $filename;
2386 2371
 			}
@@ -2637,8 +2622,7 @@  discard block
 block discarded – undo
2637 2622
 			if(count($_base) > 0)
2638 2623
 			{
2639 2624
 				array_shift($_base);
2640
-			}
2641
-			else
2625
+			} else
2642 2626
 			{
2643 2627
 				array_unshift($_base, '..');
2644 2628
 			}
Please login to merge, or discard this patch.