@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * Start the timer... tick tock tick tock... |
186 | 186 | * ------------------------------------------------------ |
187 | 187 | */ |
188 | - $BM =& load_class('Benchmark', 'core'); |
|
188 | + $BM = & load_class('Benchmark', 'core'); |
|
189 | 189 | $BM->mark('total_execution_time_start'); |
190 | 190 | $BM->mark('loading_time:_base_classes_start'); |
191 | 191 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * Instantiate the hooks class |
195 | 195 | * ------------------------------------------------------ |
196 | 196 | */ |
197 | - $EXT =& load_class('Hooks', 'core'); |
|
197 | + $EXT = & load_class('Hooks', 'core'); |
|
198 | 198 | |
199 | 199 | /* |
200 | 200 | * ------------------------------------------------------ |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * depending on another class that uses it. |
214 | 214 | * |
215 | 215 | */ |
216 | - $CFG =& load_class('Config', 'core'); |
|
216 | + $CFG = & load_class('Config', 'core'); |
|
217 | 217 | |
218 | 218 | // Do we have any manually set config items in the index.php file? |
219 | 219 | if (isset($assign_to_config) && is_array($assign_to_config)) |
@@ -291,28 +291,28 @@ discard block |
||
291 | 291 | * Instantiate the UTF-8 class |
292 | 292 | * ------------------------------------------------------ |
293 | 293 | */ |
294 | - $UNI =& load_class('Utf8', 'core'); |
|
294 | + $UNI = & load_class('Utf8', 'core'); |
|
295 | 295 | |
296 | 296 | /* |
297 | 297 | * ------------------------------------------------------ |
298 | 298 | * Instantiate the URI class |
299 | 299 | * ------------------------------------------------------ |
300 | 300 | */ |
301 | - $URI =& load_class('URI', 'core'); |
|
301 | + $URI = & load_class('URI', 'core'); |
|
302 | 302 | |
303 | 303 | /* |
304 | 304 | * ------------------------------------------------------ |
305 | 305 | * Instantiate the routing class and set the routing |
306 | 306 | * ------------------------------------------------------ |
307 | 307 | */ |
308 | - $RTR =& load_class('Router', 'core', isset($routing) ? $routing : NULL); |
|
308 | + $RTR = & load_class('Router', 'core', isset($routing) ? $routing : NULL); |
|
309 | 309 | |
310 | 310 | /* |
311 | 311 | * ------------------------------------------------------ |
312 | 312 | * Instantiate the output class |
313 | 313 | * ------------------------------------------------------ |
314 | 314 | */ |
315 | - $OUT =& load_class('Output', 'core'); |
|
315 | + $OUT = & load_class('Output', 'core'); |
|
316 | 316 | |
317 | 317 | /* |
318 | 318 | * ------------------------------------------------------ |
@@ -329,21 +329,21 @@ discard block |
||
329 | 329 | * Load the security class for xss and csrf support |
330 | 330 | * ----------------------------------------------------- |
331 | 331 | */ |
332 | - $SEC =& load_class('Security', 'core'); |
|
332 | + $SEC = & load_class('Security', 'core'); |
|
333 | 333 | |
334 | 334 | /* |
335 | 335 | * ------------------------------------------------------ |
336 | 336 | * Load the Input class and sanitize globals |
337 | 337 | * ------------------------------------------------------ |
338 | 338 | */ |
339 | - $IN =& load_class('Input', 'core'); |
|
339 | + $IN = & load_class('Input', 'core'); |
|
340 | 340 | |
341 | 341 | /* |
342 | 342 | * ------------------------------------------------------ |
343 | 343 | * Load the Language class |
344 | 344 | * ------------------------------------------------------ |
345 | 345 | */ |
346 | - $LANG =& load_class('Lang', 'core'); |
|
346 | + $LANG = & load_class('Lang', 'core'); |
|
347 | 347 | |
348 | 348 | /* |
349 | 349 | * ------------------------------------------------------ |
@@ -169,12 +169,10 @@ discard block |
||
169 | 169 | file_exists(APPPATH.'vendor/autoload.php') |
170 | 170 | ? require_once(APPPATH.'vendor/autoload.php') |
171 | 171 | : log_message('error', '$config[\'composer_autoload\'] is set to TRUE but '.APPPATH.'vendor/autoload.php was not found.'); |
172 | - } |
|
173 | - elseif (file_exists($composer_autoload)) |
|
172 | + } elseif (file_exists($composer_autoload)) |
|
174 | 173 | { |
175 | 174 | require_once($composer_autoload); |
176 | - } |
|
177 | - else |
|
175 | + } else |
|
178 | 176 | { |
179 | 177 | log_message('error', 'Could not find the specified $config[\'composer_autoload\'] path: '.$composer_autoload); |
180 | 178 | } |
@@ -250,8 +248,7 @@ discard block |
||
250 | 248 | // This is required for mb_convert_encoding() to strip invalid characters. |
251 | 249 | // That's utilized by CI_Utf8, but it's also done for consistency with iconv. |
252 | 250 | mb_substitute_character('none'); |
253 | - } |
|
254 | - else |
|
251 | + } else |
|
255 | 252 | { |
256 | 253 | define('MB_ENABLED', FALSE); |
257 | 254 | } |
@@ -264,8 +261,7 @@ discard block |
||
264 | 261 | // iconv.internal_encoding is deprecated starting with PHP 5.6 |
265 | 262 | // and it's usage triggers E_DEPRECATED messages. |
266 | 263 | @ini_set('iconv.internal_encoding', $charset); |
267 | - } |
|
268 | - else |
|
264 | + } else |
|
269 | 265 | { |
270 | 266 | define('ICONV_ENABLED', FALSE); |
271 | 267 | } |
@@ -402,16 +398,14 @@ discard block |
||
402 | 398 | if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php')) |
403 | 399 | { |
404 | 400 | $e404 = TRUE; |
405 | - } |
|
406 | - else |
|
401 | + } else |
|
407 | 402 | { |
408 | 403 | require_once(APPPATH.'controllers/'.$RTR->directory.$class.'.php'); |
409 | 404 | |
410 | 405 | if ( ! class_exists($class, FALSE) OR $method[0] === '_' OR method_exists('CI_Controller', $method)) |
411 | 406 | { |
412 | 407 | $e404 = TRUE; |
413 | - } |
|
414 | - elseif (method_exists($class, '_remap')) |
|
408 | + } elseif (method_exists($class, '_remap')) |
|
415 | 409 | { |
416 | 410 | $params = array($method, array_slice($URI->rsegments, 2)); |
417 | 411 | $method = '_remap'; |
@@ -453,8 +447,7 @@ discard block |
||
453 | 447 | $RTR->directory = ''; |
454 | 448 | } |
455 | 449 | } |
456 | - } |
|
457 | - else |
|
450 | + } else |
|
458 | 451 | { |
459 | 452 | $e404 = FALSE; |
460 | 453 | } |
@@ -470,8 +463,7 @@ discard block |
||
470 | 463 | 1 => $class, |
471 | 464 | 2 => $method |
472 | 465 | ); |
473 | - } |
|
474 | - else |
|
466 | + } else |
|
475 | 467 | { |
476 | 468 | show_404($RTR->directory.$class.'/'.$method); |
477 | 469 | } |
@@ -65,17 +65,17 @@ |
||
65 | 65 | */ |
66 | 66 | public function __construct() |
67 | 67 | { |
68 | - self::$instance =& $this; |
|
68 | + self::$instance = & $this; |
|
69 | 69 | |
70 | 70 | // Assign all the class objects that were instantiated by the |
71 | 71 | // bootstrap file (CodeIgniter.php) to local class variables |
72 | 72 | // so that CI can run as one big super object. |
73 | 73 | foreach (is_loaded() as $var => $class) |
74 | 74 | { |
75 | - $this->$var =& load_class($class); |
|
75 | + $this->$var = & load_class($class); |
|
76 | 76 | } |
77 | 77 | |
78 | - $this->load =& load_class('Loader', 'core'); |
|
78 | + $this->load = & load_class('Loader', 'core'); |
|
79 | 79 | $this->load->initialize(); |
80 | 80 | log_message('info', 'Controller Class Initialized'); |
81 | 81 | } |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @var array |
55 | 55 | */ |
56 | - public $language = array(); |
|
56 | + public $language = array(); |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * List of loaded language files |
60 | 60 | * |
61 | 61 | * @var array |
62 | 62 | */ |
63 | - public $is_loaded = array(); |
|
63 | + public $is_loaded = array(); |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Class constructor |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | if (empty($idiom) OR ! preg_match('/^[a-z_-]+$/i', $idiom)) |
110 | 110 | { |
111 | - $config =& get_config(); |
|
111 | + $config = & get_config(); |
|
112 | 112 | $idiom = empty($config['language']) ? 'english' : $config['language']; |
113 | 113 | } |
114 | 114 |
@@ -266,8 +266,7 @@ |
||
266 | 266 | if ($reduce_linebreaks === TRUE) |
267 | 267 | { |
268 | 268 | $table['#<p>\n*</p>#'] = ''; |
269 | - } |
|
270 | - else |
|
269 | + } else |
|
271 | 270 | { |
272 | 271 | // If we have empty paragraph tags we add a non-breaking space |
273 | 272 | // otherwise most browsers won't treat them as true paragraphs |
@@ -113,7 +113,7 @@ |
||
113 | 113 | */ |
114 | 114 | public function __construct() |
115 | 115 | { |
116 | - $config =& get_config(); |
|
116 | + $config = & get_config(); |
|
117 | 117 | |
118 | 118 | $this->_log_path = ($config['log_path'] !== '') ? $config['log_path'] : APPPATH.'logs/'; |
119 | 119 | $this->_file_ext = (isset($config['log_file_extension']) && $config['log_file_extension'] !== '') |
@@ -129,8 +129,7 @@ discard block |
||
129 | 129 | if (is_numeric($config['log_threshold'])) |
130 | 130 | { |
131 | 131 | $this->_threshold = (int) $config['log_threshold']; |
132 | - } |
|
133 | - elseif (is_array($config['log_threshold'])) |
|
132 | + } elseif (is_array($config['log_threshold'])) |
|
134 | 133 | { |
135 | 134 | $this->_threshold = 0; |
136 | 135 | $this->_threshold_array = array_flip($config['log_threshold']); |
@@ -198,8 +197,7 @@ discard block |
||
198 | 197 | $microtime_short = sprintf("%06d", ($microtime_full - floor($microtime_full)) * 1000000); |
199 | 198 | $date = new DateTime(date('Y-m-d H:i:s.'.$microtime_short, $microtime_full)); |
200 | 199 | $date = $date->format($this->_date_fmt); |
201 | - } |
|
202 | - else |
|
200 | + } else |
|
203 | 201 | { |
204 | 202 | $date = date($this->_date_fmt); |
205 | 203 | } |
@@ -62,21 +62,21 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @var array |
64 | 64 | */ |
65 | - public $routes = array(); |
|
65 | + public $routes = array(); |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Current class name |
69 | 69 | * |
70 | 70 | * @var string |
71 | 71 | */ |
72 | - public $class = ''; |
|
72 | + public $class = ''; |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * Current method name |
76 | 76 | * |
77 | 77 | * @var string |
78 | 78 | */ |
79 | - public $method = 'index'; |
|
79 | + public $method = 'index'; |
|
80 | 80 | |
81 | 81 | /** |
82 | 82 | * Sub-directory that contains the requested controller class |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function __construct($routing = NULL) |
125 | 125 | { |
126 | - $this->config =& load_class('Config', 'core'); |
|
127 | - $this->uri =& load_class('URI', 'core'); |
|
126 | + $this->config = & load_class('Config', 'core'); |
|
127 | + $this->uri = & load_class('URI', 'core'); |
|
128 | 128 | |
129 | 129 | $this->enable_query_strings = ( ! is_cli() && $this->config->item('enable_query_strings') === TRUE); |
130 | 130 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | if (is_array($routing)) |
137 | 137 | { |
138 | 138 | empty($routing['controller']) OR $this->set_class($routing['controller']); |
139 | - empty($routing['function']) OR $this->set_method($routing['function']); |
|
139 | + empty($routing['function']) OR $this->set_method($routing['function']); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | log_message('info', 'Router Class Initialized'); |
@@ -211,8 +211,7 @@ discard block |
||
211 | 211 | 1 => $this->class, |
212 | 212 | 2 => $this->method |
213 | 213 | ); |
214 | - } |
|
215 | - else |
|
214 | + } else |
|
216 | 215 | { |
217 | 216 | $this->_set_default_controller(); |
218 | 217 | } |
@@ -226,8 +225,7 @@ discard block |
||
226 | 225 | if ($this->uri->uri_string !== '') |
227 | 226 | { |
228 | 227 | $this->_parse_routes(); |
229 | - } |
|
230 | - else |
|
228 | + } else |
|
231 | 229 | { |
232 | 230 | $this->_set_default_controller(); |
233 | 231 | } |
@@ -269,8 +267,7 @@ discard block |
||
269 | 267 | if (isset($segments[1])) |
270 | 268 | { |
271 | 269 | $this->set_method($segments[1]); |
272 | - } |
|
273 | - else |
|
270 | + } else |
|
274 | 271 | { |
275 | 272 | $segments[1] = 'index'; |
276 | 273 | } |
@@ -385,8 +382,7 @@ discard block |
||
385 | 382 | if (isset($val[$http_verb])) |
386 | 383 | { |
387 | 384 | $val = $val[$http_verb]; |
388 | - } |
|
389 | - else |
|
385 | + } else |
|
390 | 386 | { |
391 | 387 | continue; |
392 | 388 | } |
@@ -489,8 +485,7 @@ discard block |
||
489 | 485 | if ($append !== TRUE OR empty($this->directory)) |
490 | 486 | { |
491 | 487 | $this->directory = str_replace('.', '', trim($dir, '/')).'/'; |
492 | - } |
|
493 | - else |
|
488 | + } else |
|
494 | 489 | { |
495 | 490 | $this->directory .= str_replace('.', '', trim($dir, '/')).'/'; |
496 | 491 | } |
@@ -53,22 +53,22 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @var array |
55 | 55 | */ |
56 | - public $filename_bad_chars = array( |
|
56 | + public $filename_bad_chars = array( |
|
57 | 57 | '../', '<!--', '-->', '<', '>', |
58 | 58 | "'", '"', '&', '$', '#', |
59 | 59 | '{', '}', '[', ']', '=', |
60 | 60 | ';', '?', '%20', '%22', |
61 | - '%3c', // < |
|
62 | - '%253c', // < |
|
63 | - '%3e', // > |
|
64 | - '%0e', // > |
|
65 | - '%28', // ( |
|
66 | - '%29', // ) |
|
67 | - '%2528', // ( |
|
68 | - '%26', // & |
|
69 | - '%24', // $ |
|
70 | - '%3f', // ? |
|
71 | - '%3b', // ; |
|
61 | + '%3c', // < |
|
62 | + '%253c', // < |
|
63 | + '%3e', // > |
|
64 | + '%0e', // > |
|
65 | + '%28', // ( |
|
66 | + '%29', // ) |
|
67 | + '%2528', // ( |
|
68 | + '%26', // & |
|
69 | + '%24', // $ |
|
70 | + '%3f', // ? |
|
71 | + '%3b', // ; |
|
72 | 72 | '%3d' // = |
73 | 73 | ); |
74 | 74 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * |
108 | 108 | * @var int |
109 | 109 | */ |
110 | - protected $_csrf_expire = 7200; |
|
110 | + protected $_csrf_expire = 7200; |
|
111 | 111 | |
112 | 112 | /** |
113 | 113 | * CSRF Token name |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @var string |
118 | 118 | */ |
119 | - protected $_csrf_token_name = 'ci_csrf_token'; |
|
119 | + protected $_csrf_token_name = 'ci_csrf_token'; |
|
120 | 120 | |
121 | 121 | /** |
122 | 122 | * CSRF Cookie name |
@@ -125,14 +125,14 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @var string |
127 | 127 | */ |
128 | - protected $_csrf_cookie_name = 'ci_csrf_token'; |
|
128 | + protected $_csrf_cookie_name = 'ci_csrf_token'; |
|
129 | 129 | |
130 | 130 | /** |
131 | 131 | * List of never allowed strings |
132 | 132 | * |
133 | 133 | * @var array |
134 | 134 | */ |
135 | - protected $_never_allowed_str = array( |
|
135 | + protected $_never_allowed_str = array( |
|
136 | 136 | 'document.cookie' => '[removed]', |
137 | 137 | 'document.write' => '[removed]', |
138 | 138 | '.parentNode' => '[removed]', |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | */ |
796 | 796 | protected function _sanitize_naughty_html($matches) |
797 | 797 | { |
798 | - static $naughty_tags = array( |
|
798 | + static $naughty_tags = array( |
|
799 | 799 | 'alert', 'prompt', 'confirm', 'applet', 'audio', 'basefont', 'base', 'behavior', 'bgsound', |
800 | 800 | 'blink', 'body', 'embed', 'expression', 'form', 'frameset', 'frame', 'head', 'html', 'ilayer', |
801 | 801 | 'iframe', 'input', 'button', 'select', 'isindex', 'layer', 'link', 'meta', 'keygen', 'object', |
@@ -225,10 +225,12 @@ discard block |
||
225 | 225 | |
226 | 226 | // Do the tokens exist in both the _POST and _COOKIE arrays? |
227 | 227 | if ( ! isset($_POST[$this->_csrf_token_name], $_COOKIE[$this->_csrf_cookie_name]) |
228 | - OR $_POST[$this->_csrf_token_name] !== $_COOKIE[$this->_csrf_cookie_name]) // Do the tokens match? |
|
228 | + OR $_POST[$this->_csrf_token_name] !== $_COOKIE[$this->_csrf_cookie_name]) { |
|
229 | + // Do the tokens match? |
|
229 | 230 | { |
230 | 231 | $this->csrf_show_error(); |
231 | 232 | } |
233 | + } |
|
232 | 234 | |
233 | 235 | // We kill this since we're done and we don't want to polute the _POST array |
234 | 236 | unset($_POST[$this->_csrf_token_name]); |
@@ -421,8 +423,7 @@ discard block |
||
421 | 423 | // closing tags every so often so we skip those and only |
422 | 424 | // do the long opening tags. |
423 | 425 | $str = preg_replace('/<\?(php)/i', '<?\\1', $str); |
424 | - } |
|
425 | - else |
|
426 | + } else |
|
426 | 427 | { |
427 | 428 | $str = str_replace(array('<?', '?'.'>'), array('<?', '?>'), $str); |
428 | 429 | } |
@@ -599,8 +600,7 @@ discard block |
||
599 | 600 | { |
600 | 601 | // The cast is required to avoid TypeError |
601 | 602 | return random_bytes((int) $length); |
602 | - } |
|
603 | - catch (Exception $e) |
|
603 | + } catch (Exception $e) |
|
604 | 604 | { |
605 | 605 | // If random_bytes() can't do the job, we can't either ... |
606 | 606 | // There's no point in using fallbacks. |
@@ -854,8 +854,7 @@ discard block |
||
854 | 854 | ) |
855 | 855 | { |
856 | 856 | $attributes[] = 'xss=removed'; |
857 | - } |
|
858 | - else |
|
857 | + } else |
|
859 | 858 | { |
860 | 859 | $attributes[] = $attribute[0][0]; |
861 | 860 | } |
@@ -1237,6 +1237,7 @@ |
||
1237 | 1237 | * Valid Email |
1238 | 1238 | * |
1239 | 1239 | * @param string |
1240 | + * @param string $str |
|
1240 | 1241 | * @return bool |
1241 | 1242 | */ |
1242 | 1243 | public function valid_email($str) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function __construct() |
100 | 100 | { |
101 | - $this->config =& load_class('Config', 'core'); |
|
101 | + $this->config = & load_class('Config', 'core'); |
|
102 | 102 | |
103 | 103 | // If query strings are enabled, we don't need to parse any segments. |
104 | 104 | // However, they don't make sense under CLI. |
@@ -558,11 +558,11 @@ discard block |
||
558 | 558 | |
559 | 559 | if ($where === 'trailing') |
560 | 560 | { |
561 | - $leading = ''; |
|
561 | + $leading = ''; |
|
562 | 562 | } |
563 | 563 | elseif ($where === 'leading') |
564 | 564 | { |
565 | - $trailing = ''; |
|
565 | + $trailing = ''; |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | return $leading.$this->$which($n).$trailing; |
@@ -110,8 +110,7 @@ discard block |
||
110 | 110 | if (is_cli()) |
111 | 111 | { |
112 | 112 | $uri = $this->_parse_argv(); |
113 | - } |
|
114 | - else |
|
113 | + } else |
|
115 | 114 | { |
116 | 115 | $protocol = $this->config->item('uri_protocol'); |
117 | 116 | empty($protocol) && $protocol = 'REQUEST_URI'; |
@@ -212,8 +211,7 @@ discard block |
||
212 | 211 | if (strpos($uri, $_SERVER['SCRIPT_NAME']) === 0) |
213 | 212 | { |
214 | 213 | $uri = (string) substr($uri, strlen($_SERVER['SCRIPT_NAME'])); |
215 | - } |
|
216 | - elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0) |
|
214 | + } elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0) |
|
217 | 215 | { |
218 | 216 | $uri = (string) substr($uri, strlen(dirname($_SERVER['SCRIPT_NAME']))); |
219 | 217 | } |
@@ -226,8 +224,7 @@ discard block |
||
226 | 224 | $query = explode('?', $query, 2); |
227 | 225 | $uri = $query[0]; |
228 | 226 | $_SERVER['QUERY_STRING'] = isset($query[1]) ? $query[1] : ''; |
229 | - } |
|
230 | - else |
|
227 | + } else |
|
231 | 228 | { |
232 | 229 | $_SERVER['QUERY_STRING'] = $query; |
233 | 230 | } |
@@ -259,8 +256,7 @@ discard block |
||
259 | 256 | if (trim($uri, '/') === '') |
260 | 257 | { |
261 | 258 | return ''; |
262 | - } |
|
263 | - elseif (strncmp($uri, '/', 1) === 0) |
|
259 | + } elseif (strncmp($uri, '/', 1) === 0) |
|
264 | 260 | { |
265 | 261 | $uri = explode('?', $uri, 2); |
266 | 262 | $_SERVER['QUERY_STRING'] = isset($uri[1]) ? $uri[1] : ''; |
@@ -456,8 +452,7 @@ discard block |
||
456 | 452 | if ($i % 2) |
457 | 453 | { |
458 | 454 | $retval[$lastval] = $seg; |
459 | - } |
|
460 | - else |
|
455 | + } else |
|
461 | 456 | { |
462 | 457 | $retval[$seg] = NULL; |
463 | 458 | $lastval = $seg; |
@@ -559,8 +554,7 @@ discard block |
||
559 | 554 | if ($where === 'trailing') |
560 | 555 | { |
561 | 556 | $leading = ''; |
562 | - } |
|
563 | - elseif ($where === 'leading') |
|
557 | + } elseif ($where === 'leading') |
|
564 | 558 | { |
565 | 559 | $trailing = ''; |
566 | 560 | } |
@@ -67,8 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | define('UTF8_ENABLED', TRUE); |
69 | 69 | log_message('debug', 'UTF-8 Support Enabled'); |
70 | - } |
|
71 | - else |
|
70 | + } else |
|
72 | 71 | { |
73 | 72 | define('UTF8_ENABLED', FALSE); |
74 | 73 | log_message('debug', 'UTF-8 Support Disabled'); |
@@ -94,8 +93,7 @@ discard block |
||
94 | 93 | if (MB_ENABLED) |
95 | 94 | { |
96 | 95 | $str = mb_convert_encoding($str, 'UTF-8', 'UTF-8'); |
97 | - } |
|
98 | - elseif (ICONV_ENABLED) |
|
96 | + } elseif (ICONV_ENABLED) |
|
99 | 97 | { |
100 | 98 | $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str); |
101 | 99 | } |
@@ -137,8 +135,7 @@ discard block |
||
137 | 135 | if (MB_ENABLED) |
138 | 136 | { |
139 | 137 | return mb_convert_encoding($str, 'UTF-8', $encoding); |
140 | - } |
|
141 | - elseif (ICONV_ENABLED) |
|
138 | + } elseif (ICONV_ENABLED) |
|
142 | 139 | { |
143 | 140 | return @iconv($encoding, 'UTF-8', $str); |
144 | 141 | } |
@@ -73,13 +73,11 @@ discard block |
||
73 | 73 | { |
74 | 74 | trigger_error('hash_equals(): Expected known_string to be a string, '.strtolower(gettype($known_string)).' given', E_USER_WARNING); |
75 | 75 | return FALSE; |
76 | - } |
|
77 | - elseif ( ! is_string($user_string)) |
|
76 | + } elseif ( ! is_string($user_string)) |
|
78 | 77 | { |
79 | 78 | trigger_error('hash_equals(): Expected user_string to be a string, '.strtolower(gettype($user_string)).' given', E_USER_WARNING); |
80 | 79 | return FALSE; |
81 | - } |
|
82 | - elseif (($length = strlen($known_string)) !== strlen($user_string)) |
|
80 | + } elseif (($length = strlen($known_string)) !== strlen($user_string)) |
|
83 | 81 | { |
84 | 82 | return FALSE; |
85 | 83 | } |
@@ -135,8 +133,7 @@ discard block |
||
135 | 133 | if (is_string($iterations) && is_numeric($iterations)) |
136 | 134 | { |
137 | 135 | $iterations = (int) $iterations; |
138 | - } |
|
139 | - else |
|
136 | + } else |
|
140 | 137 | { |
141 | 138 | trigger_error('hash_pbkdf2() expects parameter 4 to be long, '.$type.' given', E_USER_WARNING); |
142 | 139 | return NULL; |
@@ -159,8 +156,7 @@ discard block |
||
159 | 156 | if (is_string($length) && is_numeric($length)) |
160 | 157 | { |
161 | 158 | $length = (int) $length; |
162 | - } |
|
163 | - else |
|
159 | + } else |
|
164 | 160 | { |
165 | 161 | trigger_error('hash_pbkdf2() expects parameter 5 to be long, '.$type.' given', E_USER_WARNING); |
166 | 162 | return NULL; |