Completed
Push — v3.0 ( 23635d...e28df5 )
by Samir
23s
created
web_interface/astpp/index.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
  * as this file.
69 69
  *
70 70
  */
71
-       $assets_path='assets';
71
+       $assets_path = 'assets';
72 72
 /*
73 73
  *---------------------------------------------------------------
74 74
  * APPLICATION FOLDER NAME
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
188 188
 	
189 189
 	//Name of the "assets folder'
190
-	define('ASSETSDIR',realpath($assets_path).'/');
190
+	define('ASSETSDIR', realpath($assets_path).'/');
191 191
 	
192 192
 	// The path to the "application" folder
193 193
 	if (is_dir($application_folder))
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -193,8 +193,7 @@
 block discarded – undo
193 193
 	if (is_dir($application_folder))
194 194
 	{
195 195
 		define('APPPATH', $application_folder.'/');
196
-	}
197
-	else
196
+	} else
198 197
 	{
199 198
 		if ( ! is_dir(BASEPATH.$application_folder.'/'))
200 199
 		{
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Security.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 	 * @var string
33 33
 	 * @access protected
34 34
 	 */
35
-	protected $_xss_hash			= '';
35
+	protected $_xss_hash = '';
36 36
 	/**
37 37
 	 * Random Hash for Cross Site Request Forgery Protection Cookie
38 38
 	 *
39 39
 	 * @var string
40 40
 	 * @access protected
41 41
 	 */
42
-	protected $_csrf_hash			= '';
42
+	protected $_csrf_hash = '';
43 43
 	/**
44 44
 	 * Expiration time for Cross Site Request Forgery Protection Cookie
45 45
 	 * Defaults to two hours (in seconds)
@@ -47,21 +47,21 @@  discard block
 block discarded – undo
47 47
 	 * @var int
48 48
 	 * @access protected
49 49
 	 */
50
-	protected $_csrf_expire			= 7200;
50
+	protected $_csrf_expire = 7200;
51 51
 	/**
52 52
 	 * Token name for Cross Site Request Forgery Protection Cookie
53 53
 	 *
54 54
 	 * @var string
55 55
 	 * @access protected
56 56
 	 */
57
-	protected $_csrf_token_name		= 'ci_csrf_token';
57
+	protected $_csrf_token_name = 'ci_csrf_token';
58 58
 	/**
59 59
 	 * Cookie name for Cross Site Request Forgery Protection Cookie
60 60
 	 *
61 61
 	 * @var string
62 62
 	 * @access protected
63 63
 	 */
64
-	protected $_csrf_cookie_name	= 'ci_csrf_token';
64
+	protected $_csrf_cookie_name = 'ci_csrf_token';
65 65
 	/**
66 66
 	 * List of never allowed strings
67 67
 	 *
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	public function __construct()
102 102
 	{
103 103
 		// CSRF config
104
-		foreach(array('csrf_expire', 'csrf_token_name', 'csrf_cookie_name') as $key)
104
+		foreach (array('csrf_expire', 'csrf_token_name', 'csrf_cookie_name') as $key)
105 105
 		{
106 106
 			if (FALSE !== ($val = config_item($key)))
107 107
 			{
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 		}
355 355
 		else
356 356
 		{
357
-			$str = str_replace(array('<?', '?'.'>'),  array('&lt;?', '?&gt;'), $str);
357
+			$str = str_replace(array('<?', '?'.'>'), array('&lt;?', '?&gt;'), $str);
358 358
 		}
359 359
 
360 360
 		/*
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 				$str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str);
408 408
 			}
409 409
 		}
410
-		while($original != $str);
410
+		while ($original != $str);
411 411
 
412 412
 		unset($original);
413 413
 
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 
459 459
 		if ($is_image === TRUE)
460 460
 		{
461
-			return ($str == $converted_string) ? TRUE: FALSE;
461
+			return ($str == $converted_string) ? TRUE : FALSE;
462 462
 		}
463 463
 
464 464
 		log_message('debug', "XSS Filtering completed");
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 	 * @param	string
501 501
 	 * @return	string
502 502
 	 */
503
-	public function entity_decode($str, $charset='UTF-8')
503
+	public function entity_decode($str, $charset = 'UTF-8')
504 504
 	{
505 505
 		if (stristr($str, '&') === FALSE)
506 506
 		{
@@ -543,17 +543,17 @@  discard block
 block discarded – undo
543 543
 						'?',
544 544
 						"%20",
545 545
 						"%22",
546
-						"%3c",		// <
547
-						"%253c",	// <
548
-						"%3e",		// >
549
-						"%0e",		// >
550
-						"%28",		// (
551
-						"%29",		// )
552
-						"%2528",	// (
553
-						"%26",		// &
554
-						"%24",		// $
555
-						"%3f",		// ?
556
-						"%3b",		// ;
546
+						"%3c", // <
547
+						"%253c", // <
548
+						"%3e", // >
549
+						"%0e", // >
550
+						"%28", // (
551
+						"%29", // )
552
+						"%2528", // (
553
+						"%26", // &
554
+						"%24", // $
555
+						"%3f", // ?
556
+						"%3b", // ;
557 557
 						"%3d"		// =
558 558
 					);
559 559
 
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 			$attribs = array();
620 620
 			
621 621
 			// find occurrences of illegal attribute strings without quotes
622
-			preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*([^\s]*)/is",  $str, $matches, PREG_SET_ORDER);
622
+			preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*([^\s]*)/is", $str, $matches, PREG_SET_ORDER);
623 623
 			
624 624
 			foreach ($matches as $attr)
625 625
 			{
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 			}
628 628
 			
629 629
 			// find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes)
630
-			preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is",  $str, $matches, PREG_SET_ORDER);
630
+			preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is", $str, $matches, PREG_SET_ORDER);
631 631
 
632 632
 			foreach ($matches as $attr)
633 633
 			{
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
 		 * Just as above, adds a semicolon if missing.
798 798
 		 *
799 799
 		 */
800
-		$str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str);
800
+		$str = preg_replace('#(&\#x?)([0-9A-F]+);?#i', "\\1\\2;", $str);
801 801
 
802 802
 		/*
803 803
 		 * Un-Protect GET variables in URLs
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 
3 5
 // ------------------------------------------------------------------------
4 6
 
@@ -59,8 +61,7 @@  discard block
 block discarded – undo
59 61
 		if ($download == "")
60 62
 		{
61 63
 			return $str;	
62
-		}
63
-		else
64
+		} else
64 65
 		{	
65 66
 			echo $str;
66 67
 		}		
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Output.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -41,35 +41,35 @@  discard block
 block discarded – undo
41 41
 	 * @var int
42 42
 	 * @access 	protected
43 43
 	 */
44
-	protected $cache_expiration	= 0;
44
+	protected $cache_expiration = 0;
45 45
 	/**
46 46
 	 * List of server headers
47 47
 	 *
48 48
 	 * @var array
49 49
 	 * @access 	protected
50 50
 	 */
51
-	protected $headers			= array();
51
+	protected $headers = array();
52 52
 	/**
53 53
 	 * List of mime types
54 54
 	 *
55 55
 	 * @var array
56 56
 	 * @access 	protected
57 57
 	 */
58
-	protected $mime_types		= array();
58
+	protected $mime_types = array();
59 59
 	/**
60 60
 	 * Determines wether profiler is enabled
61 61
 	 *
62 62
 	 * @var book
63 63
 	 * @access 	protected
64 64
 	 */
65
-	protected $enable_profiler	= FALSE;
65
+	protected $enable_profiler = FALSE;
66 66
 	/**
67 67
 	 * Determines if output compression is enabled
68 68
 	 *
69 69
 	 * @var bool
70 70
 	 * @access 	protected
71 71
 	 */
72
-	protected $_zlib_oc			= FALSE;
72
+	protected $_zlib_oc = FALSE;
73 73
 	/**
74 74
 	 * List of profiler sections
75 75
 	 *
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * @var bool
84 84
 	 * @access 	protected
85 85
 	 */
86
-	protected $parse_exec_vars	= TRUE;
86
+	protected $parse_exec_vars = TRUE;
87 87
 
88 88
 	/**
89 89
 	 * Constructor
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 			// Is this extension supported?
218 218
 			if (isset($this->mime_types[$extension]))
219 219
 			{
220
-				$mime_type =& $this->mime_types[$extension];
220
+				$mime_type = & $this->mime_types[$extension];
221 221
 
222 222
 				if (is_array($mime_type))
223 223
 				{
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 		// Grab the super object if we can.
332 332
 		if (class_exists('CI_Controller'))
333 333
 		{
334
-			$CI =& get_instance();
334
+			$CI = & get_instance();
335 335
 		}
336 336
 
337 337
 		// --------------------------------------------------------------------
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 		// Set the output data
340 340
 		if ($output == '')
341 341
 		{
342
-			$output =& $this->final_output;
342
+			$output = & $this->final_output;
343 343
 		}
344 344
 
345 345
 		// --------------------------------------------------------------------
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
 		if ($this->parse_exec_vars === TRUE)
363 363
 		{
364
-			$memory	 = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
364
+			$memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage() / 1024 / 1024, 2).'MB';
365 365
 
366 366
 			$output = str_replace('{elapsed_time}', $elapsed, $output);
367 367
 			$output = str_replace('{memory_usage}', $memory, $output);
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 		}
443 443
 		else
444 444
 		{
445
-			echo $output;  // Send it to the browser!
445
+			echo $output; // Send it to the browser!
446 446
 		}
447 447
 
448 448
 		log_message('debug', "Final output sent to browser");
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	 */
461 461
 	function _write_cache($output)
462 462
 	{
463
-		$CI =& get_instance();
463
+		$CI = & get_instance();
464 464
 		$path = $CI->config->item('cache_path');
465 465
 
466 466
 		$cache_path = ($path == '') ? APPPATH.'cache/' : $path;
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 			return;
472 472
 		}
473 473
 
474
-		$uri =	$CI->config->item('base_url').
474
+		$uri = $CI->config->item('base_url').
475 475
 				$CI->config->item('index_page').
476 476
 				$CI->uri->uri_string();
477 477
 
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 		$cache_path = ($CFG->item('cache_path') == '') ? APPPATH.'cache/' : $CFG->item('cache_path');
517 517
 
518 518
 		// Build the file path.  The file name is an MD5 hash of the full URI
519
-		$uri =	$CFG->item('base_url').
519
+		$uri = $CFG->item('base_url').
520 520
 				$CFG->item('index_page').
521 521
 				$URI->uri_string;
522 522
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -97,8 +99,7 @@  discard block
 block discarded – undo
97 99
 		if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
98 100
 		{
99 101
 		    include APPPATH.'config/'.ENVIRONMENT.'/mimes.php';
100
-		}
101
-		else
102
+		} else
102 103
 		{
103 104
 			include APPPATH.'config/mimes.php';
104 105
 		}
@@ -158,8 +159,7 @@  discard block
 block discarded – undo
158 159
 		if ($this->final_output == '')
159 160
 		{
160 161
 			$this->final_output = $output;
161
-		}
162
-		else
162
+		} else
163 163
 		{
164 164
 			$this->final_output .= $output;
165 165
 		}
@@ -425,8 +425,7 @@  discard block
 block discarded – undo
425 425
 				$output  = preg_replace("|</body>.*?</html>|is", '', $output);
426 426
 				$output .= $CI->profiler->run();
427 427
 				$output .= '</body></html>';
428
-			}
429
-			else
428
+			} else
430 429
 			{
431 430
 				$output .= $CI->profiler->run();
432 431
 			}
@@ -439,8 +438,7 @@  discard block
 block discarded – undo
439 438
 		if (method_exists($CI, '_output'))
440 439
 		{
441 440
 			$CI->_output($output);
442
-		}
443
-		else
441
+		} else
444 442
 		{
445 443
 			echo $output;  // Send it to the browser!
446 444
 		}
@@ -489,8 +487,7 @@  discard block
 block discarded – undo
489 487
 		{
490 488
 			fwrite($fp, $expire.'TS--->'.$output);
491 489
 			flock($fp, LOCK_UN);
492
-		}
493
-		else
490
+		} else
494 491
 		{
495 492
 			log_message('error', "Unable to secure a file lock for file at: ".$cache_path);
496 493
 			return;
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Config.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 */
61 61
 	function __construct()
62 62
 	{
63
-		$this->config =& get_config();
63
+		$this->config = & get_config();
64 64
 		log_message('debug', "Config Class Initialized");
65 65
 
66 66
 		// Set the base_url automatically if none was provided
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 			if (isset($_SERVER['HTTP_HOST']))
70 70
 			{
71 71
 				$base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
72
-				$base_url .= '://'. $_SERVER['HTTP_HOST'];
72
+				$base_url .= '://'.$_SERVER['HTTP_HOST'];
73 73
 				$base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
74 74
 			}
75 75
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 		{
232 232
 			return FALSE;
233 233
 		}
234
-		if( trim($this->config[$item]) == '')
234
+		if (trim($this->config[$item]) == '')
235 235
 		{
236 236
 			return '';
237 237
 		}
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 */
280 280
 	function base_url($uri = '')
281 281
 	{
282
-		return $this->slash_item('base_url').ltrim($this->_uri_string($uri),'/');
282
+		return $this->slash_item('base_url').ltrim($this->_uri_string($uri), '/');
283 283
 	}
284 284
 
285 285
 	// -------------------------------------------------------------
Please login to merge, or discard this patch.
Braces   +9 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -71,9 +73,7 @@  discard block
 block discarded – undo
71 73
 				$base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
72 74
 				$base_url .= '://'. $_SERVER['HTTP_HOST'];
73 75
 				$base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
74
-			}
75
-
76
-			else
76
+			} else
77 77
 			{
78 78
 				$base_url = 'http://localhost/';
79 79
 			}
@@ -143,13 +143,11 @@  discard block
 block discarded – undo
143 143
 				if (isset($this->config[$file]))
144 144
 				{
145 145
 					$this->config[$file] = array_merge($this->config[$file], $config);
146
-				}
147
-				else
146
+				} else
148 147
 				{
149 148
 					$this->config[$file] = $config;
150 149
 				}
151
-			}
152
-			else
150
+			} else
153 151
 			{
154 152
 				$this->config = array_merge($this->config, $config);
155 153
 			}
@@ -196,8 +194,7 @@  discard block
 block discarded – undo
196 194
 			}
197 195
 
198 196
 			$pref = $this->config[$item];
199
-		}
200
-		else
197
+		} else
201 198
 		{
202 199
 			if ( ! isset($this->config[$index]))
203 200
 			{
@@ -260,8 +257,7 @@  discard block
 block discarded – undo
260 257
 		{
261 258
 			$suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
262 259
 			return $this->slash_item('base_url').$this->slash_item('index_page').$this->_uri_string($uri).$suffix;
263
-		}
264
-		else
260
+		} else
265 261
 		{
266 262
 			return $this->slash_item('base_url').$this->item('index_page').'?'.$this->_uri_string($uri);
267 263
 		}
@@ -300,8 +296,7 @@  discard block
 block discarded – undo
300 296
 				$uri = implode('/', $uri);
301 297
 			}
302 298
 			$uri = trim($uri, '/');
303
-		}
304
-		else
299
+		} else
305 300
 		{
306 301
 			if (is_array($uri))
307 302
 			{
Please login to merge, or discard this patch.
web_interface/astpp/system/core/CodeIgniter.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
  *  Start the timer... tick tock tick tock...
113 113
  * ------------------------------------------------------
114 114
  */
115
-	$BM =& load_class('Benchmark', 'core');
115
+	$BM = & load_class('Benchmark', 'core');
116 116
 	$BM->mark('total_execution_time_start');
117 117
 	$BM->mark('loading_time:_base_classes_start');
118 118
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
  *  Instantiate the hooks class
122 122
  * ------------------------------------------------------
123 123
  */
124
-	$EXT =& load_class('Hooks', 'core');
124
+	$EXT = & load_class('Hooks', 'core');
125 125
 
126 126
 /*
127 127
  * ------------------------------------------------------
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
  *  Instantiate the config class
136 136
  * ------------------------------------------------------
137 137
  */
138
-	$CFG =& load_class('Config', 'core');
138
+	$CFG = & load_class('Config', 'core');
139 139
 
140 140
 	// Do we have any manually set config items in the index.php file?
141 141
 	if (isset($assign_to_config))
@@ -155,21 +155,21 @@  discard block
 block discarded – undo
155 155
  *
156 156
  */
157 157
 
158
-	$UNI =& load_class('Utf8', 'core');
158
+	$UNI = & load_class('Utf8', 'core');
159 159
 
160 160
 /*
161 161
  * ------------------------------------------------------
162 162
  *  Instantiate the URI class
163 163
  * ------------------------------------------------------
164 164
  */
165
-	$URI =& load_class('URI', 'core');
165
+	$URI = & load_class('URI', 'core');
166 166
 
167 167
 /*
168 168
  * ------------------------------------------------------
169 169
  *  Instantiate the routing class and set the routing
170 170
  * ------------------------------------------------------
171 171
  */
172
-	$RTR =& load_class('Router', 'core');
172
+	$RTR = & load_class('Router', 'core');
173 173
 	$RTR->_set_routing();
174 174
 
175 175
 	// Set any routing overrides that may exist in the main index file
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
  *  Instantiate the output class
184 184
  * ------------------------------------------------------
185 185
  */
186
-	$OUT =& load_class('Output', 'core');
186
+	$OUT = & load_class('Output', 'core');
187 187
 
188 188
 /*
189 189
  * ------------------------------------------------------
@@ -203,21 +203,21 @@  discard block
 block discarded – undo
203 203
  * Load the security class for xss and csrf support
204 204
  * -----------------------------------------------------
205 205
  */
206
-	$SEC =& load_class('Security', 'core');
206
+	$SEC = & load_class('Security', 'core');
207 207
 
208 208
 /*
209 209
  * ------------------------------------------------------
210 210
  *  Load the Input class and sanitize globals
211 211
  * ------------------------------------------------------
212 212
  */
213
-	$IN	=& load_class('Input', 'core');
213
+	$IN = & load_class('Input', 'core');
214 214
 
215 215
 /*
216 216
  * ------------------------------------------------------
217 217
  *  Load the Language class
218 218
  * ------------------------------------------------------
219 219
  */
220
-	$LANG =& load_class('Lang', 'core');
220
+	$LANG = & load_class('Lang', 'core');
221 221
 
222 222
 /*
223 223
  * ------------------------------------------------------
Please login to merge, or discard this patch.
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -58,8 +60,7 @@  discard block
 block discarded – undo
58 60
 	if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php'))
59 61
 	{
60 62
 		require(APPPATH.'config/'.ENVIRONMENT.'/constants.php');
61
-	}
62
-	else
63
+	} else
63 64
 	{
64 65
 		require(APPPATH.'config/constants.php');
65 66
 	}
@@ -283,8 +284,7 @@  discard block
 block discarded – undo
283 284
 
284 285
 				include_once(APPPATH.'controllers/'.$class.'.php');
285 286
 			}
286
-		}
287
-		else
287
+		} else
288 288
 		{
289 289
 			show_404("{$class}/{$method}");
290 290
 		}
@@ -323,8 +323,7 @@  discard block
 block discarded – undo
323 323
 	if (method_exists($CI, '_remap'))
324 324
 	{
325 325
 		$CI->_remap($method, array_slice($URI->rsegments, 2));
326
-	}
327
-	else
326
+	} else
328 327
 	{
329 328
 		// is_callable() returns TRUE on some versions of PHP 5 for private and protected
330 329
 		// methods, so we'll use this workaround for consistent behavior
@@ -347,8 +346,7 @@  discard block
 block discarded – undo
347 346
 					unset($CI);
348 347
 					$CI = new $class();
349 348
 				}
350
-			}
351
-			else
349
+			} else
352 350
 			{
353 351
 				show_404("{$class}/{$method}");
354 352
 			}
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Common.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		// write a file then read it.  Bah...
82 82
 		if (is_dir($file))
83 83
 		{
84
-			$file = rtrim($file, '/').'/'.md5(mt_rand(1,100).mt_rand(1,100));
84
+			$file = rtrim($file, '/').'/'.md5(mt_rand(1, 100).mt_rand(1, 100));
85 85
 
86 86
 			if (($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE)
87 87
 			{
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 				}
254 254
 			}
255 255
 		}
256
-		$_config[0] =& $config;
256
+		$_config[0] = & $config;
257 257
                 return $_config[0];
258 258
 
259 259
 	}
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
 		if ( ! isset($_config_item[$item]))
277 277
 		{
278
-			$config =& get_config();
278
+			$config = & get_config();
279 279
 
280 280
 			if ( ! isset($config[$item]))
281 281
 			{
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 {
307 307
 	function show_error($message, $status_code = 500, $heading = 'An Error Was Encountered')
308 308
 	{
309
-		$_error =& load_class('Exceptions', 'core');
309
+		$_error = & load_class('Exceptions', 'core');
310 310
 		echo $_error->show_error($heading, $message, 'error_general', $status_code);
311 311
 		exit;
312 312
 	}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 {
329 329
 	function show_404($page = '', $log_error = TRUE)
330 330
 	{
331
-		$_error =& load_class('Exceptions', 'core');
331
+		$_error = & load_class('Exceptions', 'core');
332 332
 		$_error->show_404($page, $log_error);
333 333
 		exit;
334 334
 	}
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 			return;
357 357
 		}
358 358
 
359
-		$_log =& load_class('Log');
359
+		$_log = & load_class('Log');
360 360
 		$_log->write_log($level, $message, $php_error);
361 361
 	}
362 362
 }
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 			return;
480 480
 		}
481 481
 
482
-		$_error =& load_class('Exceptions', 'core');
482
+		$_error = & load_class('Exceptions', 'core');
483 483
 
484 484
 		// Should we display the error? We'll get the current error_reporting
485 485
 		// level and add its bits with the severity bits to find out.
@@ -521,11 +521,11 @@  discard block
 block discarded – undo
521 521
 		
522 522
 		if ($url_encoded)
523 523
 		{
524
-			$non_displayables[] = '/%0[0-8bcef]/';	// url encoded 00-08, 11, 12, 14, 15
525
-			$non_displayables[] = '/%1[0-9a-f]/';	// url encoded 16-31
524
+			$non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15
525
+			$non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31
526 526
 		}
527 527
 		
528
-		$non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S';	// 00-08, 11, 12, 14-31, 127
528
+		$non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127
529 529
 
530 530
 		do
531 531
 		{
Please login to merge, or discard this patch.
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -92,8 +94,7 @@  discard block
 block discarded – undo
92 94
 			@chmod($file, DIR_WRITE_MODE);
93 95
 			@unlink($file);
94 96
 			return TRUE;
95
-		}
96
-		elseif ( ! is_file($file) OR ($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE)
97
+		} elseif ( ! is_file($file) OR ($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE)
97 98
 		{
98 99
 			return FALSE;
99 100
 		}
@@ -437,12 +438,10 @@  discard block
 block discarded – undo
437 438
 		if (substr(php_sapi_name(), 0, 3) == 'cgi')
438 439
 		{
439 440
 			header("Status: {$code} {$text}", TRUE);
440
-		}
441
-		elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0')
441
+		} elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0')
442 442
 		{
443 443
 			header($server_protocol." {$code} {$text}", TRUE, $code);
444
-		}
445
-		else
444
+		} else
446 445
 		{
447 446
 			header("HTTP/1.1 {$code} {$text}", TRUE, $code);
448 447
 		}
@@ -553,8 +552,7 @@  discard block
 block discarded – undo
553 552
 		if (is_array($var))
554 553
 		{
555 554
 			return array_map('html_escape', $var);
556
-		}
557
-		else
555
+		} else
558 556
 		{
559 557
 			return htmlspecialchars($var, ENT_QUOTES, config_item('charset'));
560 558
 		}
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Input.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -33,45 +33,45 @@  discard block
 block discarded – undo
33 33
 	 *
34 34
 	 * @var string
35 35
 	 */
36
-	var $ip_address				= FALSE;
36
+	var $ip_address = FALSE;
37 37
 	/**
38 38
 	 * user agent (web browser) being used by the current user
39 39
 	 *
40 40
 	 * @var string
41 41
 	 */
42
-	var $user_agent				= FALSE;
42
+	var $user_agent = FALSE;
43 43
 	/**
44 44
 	 * If FALSE, then $_GET will be set to an empty array
45 45
 	 *
46 46
 	 * @var bool
47 47
 	 */
48
-	var $_allow_get_array		= TRUE;
48
+	var $_allow_get_array = TRUE;
49 49
 	/**
50 50
 	 * If TRUE, then newlines are standardized
51 51
 	 *
52 52
 	 * @var bool
53 53
 	 */
54
-	var $_standardize_newlines	= TRUE;
54
+	var $_standardize_newlines = TRUE;
55 55
 	/**
56 56
 	 * Determines whether the XSS filter is always active when GET, POST or COOKIE data is encountered
57 57
 	 * Set automatically based on config setting
58 58
 	 *
59 59
 	 * @var bool
60 60
 	 */
61
-	var $_enable_xss			= FALSE;
61
+	var $_enable_xss = FALSE;
62 62
 	/**
63 63
 	 * Enables a CSRF cookie token to be set.
64 64
 	 * Set automatically based on config setting
65 65
 	 *
66 66
 	 * @var bool
67 67
 	 */
68
-	var $_enable_csrf			= FALSE;
68
+	var $_enable_csrf = FALSE;
69 69
 	/**
70 70
 	 * List of all HTTP request headers
71 71
 	 *
72 72
 	 * @var array
73 73
 	 */
74
-	protected $headers			= array();
74
+	protected $headers = array();
75 75
 
76 76
 
77 77
 	/**
@@ -85,18 +85,18 @@  discard block
 block discarded – undo
85 85
 	{
86 86
 		log_message('debug', "Input Class Initialized");
87 87
 
88
-		$this->_allow_get_array	= (config_item('allow_get_array') === TRUE);
89
-		$this->_enable_xss		= (config_item('global_xss_filtering') === TRUE);
90
-		$this->_enable_csrf		= (config_item('csrf_protection') === TRUE);
88
+		$this->_allow_get_array = (config_item('allow_get_array') === TRUE);
89
+		$this->_enable_xss = (config_item('global_xss_filtering') === TRUE);
90
+		$this->_enable_csrf = (config_item('csrf_protection') === TRUE);
91 91
 
92 92
 		global $SEC;
93
-		$this->security =& $SEC;
93
+		$this->security = & $SEC;
94 94
 
95 95
 		// Do we need the UTF-8 class?
96 96
 		if (UTF8_ENABLED === TRUE)
97 97
 		{
98 98
 			global $UNI;
99
-			$this->uni =& $UNI;
99
+			$this->uni = & $UNI;
100 100
 		}
101 101
 
102 102
 		// Sanitize global arrays
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	*/
201 201
 	function get_post($index = '', $xss_clean = FALSE)
202 202
 	{
203
-		if ( ! isset($_POST[$index]) )
203
+		if ( ! isset($_POST[$index]))
204 204
 		{
205 205
 			return $this->get($index, $xss_clean);
206 206
 		}
Please login to merge, or discard this patch.
Braces   +12 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -203,8 +205,7 @@  discard block
 block discarded – undo
203 205
 		if ( ! isset($_POST[$index]) )
204 206
 		{
205 207
 			return $this->get($index, $xss_clean);
206
-		}
207
-		else
208
+		} else
208 209
 		{
209 210
 			return $this->post($index, $xss_clean);
210 211
 		}
@@ -277,8 +278,7 @@  discard block
 block discarded – undo
277 278
 		if ( ! is_numeric($expire))
278 279
 		{
279 280
 			$expire = time() - 86500;
280
-		}
281
-		else
281
+		} else
282 282
 		{
283 283
 			$expire = ($expire > 0) ? time() + $expire : 0;
284 284
 		}
@@ -322,20 +322,16 @@  discard block
 block discarded – undo
322 322
 			$proxies = is_array($proxies) ? $proxies : array($proxies);
323 323
 
324 324
 			$this->ip_address = in_array($_SERVER['REMOTE_ADDR'], $proxies) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
325
-		}
326
-		elseif ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP'))
325
+		} elseif ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP'))
327 326
 		{
328 327
 			$this->ip_address = $_SERVER['HTTP_CLIENT_IP'];
329
-		}
330
-		elseif ($this->server('REMOTE_ADDR'))
328
+		} elseif ($this->server('REMOTE_ADDR'))
331 329
 		{
332 330
 			$this->ip_address = $_SERVER['REMOTE_ADDR'];
333
-		}
334
-		elseif ($this->server('HTTP_CLIENT_IP'))
331
+		} elseif ($this->server('HTTP_CLIENT_IP'))
335 332
 		{
336 333
 			$this->ip_address = $_SERVER['HTTP_CLIENT_IP'];
337
-		}
338
-		elseif ($this->server('HTTP_X_FORWARDED_FOR'))
334
+		} elseif ($this->server('HTTP_X_FORWARDED_FOR'))
339 335
 		{
340 336
 			$this->ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
341 337
 		}
@@ -454,8 +450,7 @@  discard block
 block discarded – undo
454 450
 					global $$global;
455 451
 					$$global = NULL;
456 452
 				}
457
-			}
458
-			else
453
+			} else
459 454
 			{
460 455
 				foreach ($global as $key => $val)
461 456
 				{
@@ -472,8 +467,7 @@  discard block
 block discarded – undo
472 467
 		if ($this->_allow_get_array == FALSE)
473 468
 		{
474 469
 			$_GET = array();
475
-		}
476
-		else
470
+		} else
477 471
 		{
478 472
 			if (is_array($_GET) AND count($_GET) > 0)
479 473
 			{
@@ -631,8 +625,7 @@  discard block
 block discarded – undo
631 625
 		if (function_exists('apache_request_headers'))
632 626
 		{
633 627
 			$headers = apache_request_headers();
634
-		}
635
-		else
628
+		} else
636 629
 		{
637 630
 			$headers['Content-Type'] = (isset($_SERVER['CONTENT_TYPE'])) ? $_SERVER['CONTENT_TYPE'] : @getenv('CONTENT_TYPE');
638 631
 
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Lang.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
 	 *
32 32
 	 * @var array
33 33
 	 */
34
-	var $language	= array();
34
+	var $language = array();
35 35
 	/**
36 36
 	 * List of loaded language files
37 37
 	 *
38 38
 	 * @var array
39 39
 	 */
40
-	var $is_loaded	= array();
40
+	var $is_loaded = array();
41 41
 
42 42
 	/**
43 43
 	 * Constructor
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			return;
79 79
 		}
80 80
 
81
-		$config =& get_config();
81
+		$config = & get_config();
82 82
 
83 83
 		if ($idiom == '')
84 84
 		{
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 
3 5
 // ------------------------------------------------------------------------
4 6
 
@@ -59,8 +61,7 @@  discard block
 block discarded – undo
59 61
 		if ($download == "")
60 62
 		{
61 63
 			return $str;	
62
-		}
63
-		else
64
+		} else
64 65
 		{	
65 66
 			echo $str;
66 67
 		}		
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Hooks.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,19 +33,19 @@  discard block
 block discarded – undo
33 33
 	 *
34 34
 	 * @var bool
35 35
 	 */
36
-	var $enabled		= FALSE;
36
+	var $enabled = FALSE;
37 37
 	/**
38 38
 	 * List of all hooks set in config/hooks.php
39 39
 	 *
40 40
 	 * @var array
41 41
 	 */
42
-	var $hooks			= array();
42
+	var $hooks = array();
43 43
 	/**
44 44
 	 * Determines wether hook is in progress, used to prevent infinte loops
45 45
 	 *
46 46
 	 * @var bool
47 47
 	 */
48
-	var $in_progress	= FALSE;
48
+	var $in_progress = FALSE;
49 49
 
50 50
 	/**
51 51
 	 * Constructor
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 */
68 68
 	function _initialize()
69 69
 	{
70
-		$CFG =& load_class('Config', 'core');
70
+		$CFG = & load_class('Config', 'core');
71 71
 
72 72
 		// If hooks are not enabled in the config file
73 73
 		// there is nothing else to do
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			return;
96 96
 		}
97 97
 
98
-		$this->hooks =& $hook;
98
+		$this->hooks = & $hook;
99 99
 		$this->enabled = TRUE;
100 100
 	}
101 101
 
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
 		// Set class/function name
183 183
 		// -----------------------------------
184 184
 
185
-		$class		= FALSE;
186
-		$function	= FALSE;
187
-		$params		= '';
185
+		$class = FALSE;
186
+		$function = FALSE;
187
+		$params = '';
188 188
 
189 189
 		if (isset($data['class']) AND $data['class'] != '')
190 190
 		{
Please login to merge, or discard this patch.
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -83,8 +85,7 @@  discard block
 block discarded – undo
83 85
 		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'))
84 86
 		{
85 87
 		    include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php');
86
-		}
87
-		elseif (is_file(APPPATH.'config/hooks.php'))
88
+		} elseif (is_file(APPPATH.'config/hooks.php'))
88 89
 		{
89 90
 			include(APPPATH.'config/hooks.php');
90 91
 		}
@@ -123,8 +124,7 @@  discard block
 block discarded – undo
123 124
 			{
124 125
 				$this->_run_hook($val);
125 126
 			}
126
-		}
127
-		else
127
+		} else
128 128
 		{
129 129
 			$this->_run_hook($this->hooks[$which]);
130 130
 		}
@@ -225,8 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
 			$HOOK = new $class;
227 227
 			$HOOK->$function($params);
228
-		}
229
-		else
228
+		} else
230 229
 		{
231 230
 			if ( ! function_exists($function))
232 231
 			{
Please login to merge, or discard this patch.