@@ -72,8 +72,7 @@ discard block |
||
72 | 72 | if (is_string($token)) |
73 | 73 | { |
74 | 74 | $new_source .= $token; |
75 | - } |
|
76 | - elseif (isset($replacement['key']) && $i == $replacement['key']) |
|
75 | + } elseif (isset($replacement['key']) && $i == $replacement['key']) |
|
77 | 76 | { |
78 | 77 | $new_source .= $replacement['value']; |
79 | 78 | $replacement['key'] = key(self::$replacement); |
@@ -83,8 +82,7 @@ discard block |
||
83 | 82 | { |
84 | 83 | $replacement = false; |
85 | 84 | } |
86 | - } |
|
87 | - else |
|
85 | + } else |
|
88 | 86 | { |
89 | 87 | $new_source .= $token[1]; |
90 | 88 | } |
@@ -27,20 +27,17 @@ |
||
27 | 27 | if (is_string($token)) |
28 | 28 | { |
29 | 29 | $new_source .= $token; |
30 | - } |
|
31 | - elseif ($token[0] === T_EXIT) |
|
30 | + } elseif ($token[0] === T_EXIT) |
|
32 | 31 | { |
33 | 32 | if ($tokens[$i+1] === ';') |
34 | 33 | { |
35 | 34 | $new_source .= 'exit__()'; |
36 | - } |
|
37 | - else |
|
35 | + } else |
|
38 | 36 | { |
39 | 37 | $new_source .= 'exit__'; |
40 | 38 | } |
41 | 39 | $patched = true; |
42 | - } |
|
43 | - else |
|
40 | + } else |
|
44 | 41 | { |
45 | 42 | $new_source .= $token[1]; |
46 | 43 | } |
@@ -72,8 +72,7 @@ discard block |
||
72 | 72 | if (is_string($token)) |
73 | 73 | { |
74 | 74 | $new_source .= $token; |
75 | - } |
|
76 | - elseif (isset($replacement['key']) && $i == $replacement['key']) |
|
75 | + } elseif (isset($replacement['key']) && $i == $replacement['key']) |
|
77 | 76 | { |
78 | 77 | $new_source .= $replacement['value']; |
79 | 78 | $replacement['key'] = key(self::$replacement); |
@@ -83,8 +82,7 @@ discard block |
||
83 | 82 | { |
84 | 83 | $replacement = false; |
85 | 84 | } |
86 | - } |
|
87 | - else |
|
85 | + } else |
|
88 | 86 | { |
89 | 87 | $new_source .= $token[1]; |
90 | 88 | } |
@@ -66,8 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | if(self::isVoidFunction($tokens, $key)){ |
68 | 68 | $new_source .= '{ ' . self::CODENORET; |
69 | - } |
|
70 | - else{ |
|
69 | + } else{ |
|
71 | 70 | $new_source .= '{ ' . self::CODE; |
72 | 71 | } |
73 | 72 | $start_method = false; |
@@ -78,13 +77,11 @@ discard block |
||
78 | 77 | { |
79 | 78 | $replacement = false; |
80 | 79 | } |
81 | - } |
|
82 | - else |
|
80 | + } else |
|
83 | 81 | { |
84 | 82 | $new_source .= $token; |
85 | 83 | } |
86 | - } |
|
87 | - else |
|
84 | + } else |
|
88 | 85 | { |
89 | 86 | $new_source .= $token[1]; |
90 | 87 | } |
@@ -19,16 +19,13 @@ |
||
19 | 19 | if ($phpParserVersion->isGreaterThanOrEqualTo('4.6')) { |
20 | 20 | // PHP-Parser 4.6 - |
21 | 21 | require __DIR__ . '/4.x/MonkeyPatchManager.php'; |
22 | - } |
|
23 | - elseif ($phpParserVersion->isGreaterThanOrEqualTo('4.0')) { |
|
22 | + } elseif ($phpParserVersion->isGreaterThanOrEqualTo('4.0')) { |
|
24 | 23 | // PHP-Parser 4.0 - 4.5 |
25 | 24 | require __DIR__ . '/4.5/MonkeyPatchManager.php'; |
26 | - } |
|
27 | - elseif ($phpParserVersion->isGreaterThanOrEqualTo('3.0')) { |
|
25 | + } elseif ($phpParserVersion->isGreaterThanOrEqualTo('3.0')) { |
|
28 | 26 | // PHP-Parser 3.x |
29 | 27 | require __DIR__ . '/3.x/MonkeyPatchManager.php'; |
30 | - } |
|
31 | - else { |
|
28 | + } else { |
|
32 | 29 | // PHP-Parser 2.x |
33 | 30 | require __DIR__ . '/2.x/MonkeyPatchManager.php'; |
34 | 31 | } |
@@ -201,29 +201,30 @@ discard block |
||
201 | 201 | if (isset($array[$index])) |
202 | 202 | { |
203 | 203 | $value = $array[$index]; |
204 | - } |
|
205 | - elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) // Does the index contain array notation |
|
204 | + } elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) { |
|
205 | + // Does the index contain array notation |
|
206 | 206 | { |
207 | 207 | $value = $array; |
208 | + } |
|
208 | 209 | for ($i = 0; $i < $count; $i++) |
209 | 210 | { |
210 | 211 | $key = trim($matches[0][$i], '[]'); |
211 | - if ($key === '') // Empty notation will return the value as array |
|
212 | + if ($key === '') { |
|
213 | + // Empty notation will return the value as array |
|
212 | 214 | { |
213 | 215 | break; |
214 | 216 | } |
217 | + } |
|
215 | 218 | |
216 | 219 | if (isset($value[$key])) |
217 | 220 | { |
218 | 221 | $value = $value[$key]; |
219 | - } |
|
220 | - else |
|
222 | + } else |
|
221 | 223 | { |
222 | 224 | return NULL; |
223 | 225 | } |
224 | 226 | } |
225 | - } |
|
226 | - else |
|
227 | + } else |
|
227 | 228 | { |
228 | 229 | return NULL; |
229 | 230 | } |
@@ -421,8 +422,7 @@ discard block |
||
421 | 422 | if ( ! is_numeric($expire)) |
422 | 423 | { |
423 | 424 | $expire = time() - 86500; |
424 | - } |
|
425 | - else |
|
425 | + } else |
|
426 | 426 | { |
427 | 427 | $expire = ($expire > 0) ? time() + $expire : 0; |
428 | 428 | } |
@@ -432,8 +432,7 @@ discard block |
||
432 | 432 | { |
433 | 433 | $samesite = ucfirst(strtolower($samesite)); |
434 | 434 | in_array($samesite, array('Lax', 'Strict', 'None'), TRUE) OR $samesite = 'Lax'; |
435 | - } |
|
436 | - else |
|
435 | + } else |
|
437 | 436 | { |
438 | 437 | $samesite = 'Lax'; |
439 | 438 | } |
@@ -524,8 +523,7 @@ discard block |
||
524 | 523 | if ( ! $this->valid_ip($spoof)) |
525 | 524 | { |
526 | 525 | $spoof = NULL; |
527 | - } |
|
528 | - else |
|
526 | + } else |
|
529 | 527 | { |
530 | 528 | break; |
531 | 529 | } |
@@ -578,8 +576,7 @@ discard block |
||
578 | 576 | } |
579 | 577 | |
580 | 578 | $sprintf = '%016b%016b%016b%016b%016b%016b%016b%016b'; |
581 | - } |
|
582 | - else |
|
579 | + } else |
|
583 | 580 | { |
584 | 581 | $ip = explode('.', $this->ip_address); |
585 | 582 | $sprintf = '%08b%08b%08b%08b'; |
@@ -599,8 +596,7 @@ discard block |
||
599 | 596 | { |
600 | 597 | $netaddr[$j] = intval($netaddr[$j], 16); |
601 | 598 | } |
602 | - } |
|
603 | - else |
|
599 | + } else |
|
604 | 600 | { |
605 | 601 | $netaddr = explode('.', $netaddr); |
606 | 602 | } |
@@ -687,8 +683,7 @@ discard block |
||
687 | 683 | if ($this->_allow_get_array === FALSE) |
688 | 684 | { |
689 | 685 | $_GET = array(); |
690 | - } |
|
691 | - elseif (is_array($_GET)) |
|
686 | + } elseif (is_array($_GET)) |
|
692 | 687 | { |
693 | 688 | foreach ($_GET as $key => $val) |
694 | 689 | { |
@@ -724,8 +719,7 @@ discard block |
||
724 | 719 | if (($cookie_key = $this->_clean_input_keys($key)) !== FALSE) |
725 | 720 | { |
726 | 721 | $_COOKIE[$cookie_key] = $this->_clean_input_data($val); |
727 | - } |
|
728 | - else |
|
722 | + } else |
|
729 | 723 | { |
730 | 724 | unset($_COOKIE[$key]); |
731 | 725 | } |
@@ -815,8 +809,7 @@ discard block |
||
815 | 809 | if ($fatal === TRUE) |
816 | 810 | { |
817 | 811 | return FALSE; |
818 | - } |
|
819 | - else |
|
812 | + } else |
|
820 | 813 | { |
821 | 814 | set_status_header(503); |
822 | 815 | echo 'Disallowed Key Characters.'; |
@@ -855,8 +848,7 @@ discard block |
||
855 | 848 | if (function_exists('apache_request_headers')) |
856 | 849 | { |
857 | 850 | $this->headers = apache_request_headers(); |
858 | - } |
|
859 | - else |
|
851 | + } else |
|
860 | 852 | { |
861 | 853 | isset($_SERVER['CONTENT_TYPE']) && $this->headers['Content-Type'] = $_SERVER['CONTENT_TYPE']; |
862 | 854 | |
@@ -985,8 +977,7 @@ discard block |
||
985 | 977 | { |
986 | 978 | isset($this->_raw_input_stream) OR $this->_raw_input_stream = file_get_contents('php://input'); |
987 | 979 | return $this->_raw_input_stream; |
988 | - } |
|
989 | - elseif ($name === 'ip_address') |
|
980 | + } elseif ($name === 'ip_address') |
|
990 | 981 | { |
991 | 982 | return $this->ip_address; |
992 | 983 | } |
@@ -200,16 +200,14 @@ discard block |
||
200 | 200 | if (empty($library)) |
201 | 201 | { |
202 | 202 | return $this; |
203 | - } |
|
204 | - elseif (is_array($library)) |
|
203 | + } elseif (is_array($library)) |
|
205 | 204 | { |
206 | 205 | foreach ($library as $key => $value) |
207 | 206 | { |
208 | 207 | if (is_int($key)) |
209 | 208 | { |
210 | 209 | $this->library($value, $params); |
211 | - } |
|
212 | - else |
|
210 | + } else |
|
213 | 211 | { |
214 | 212 | $this->library($key, $params, $value); |
215 | 213 | } |
@@ -246,8 +244,7 @@ discard block |
||
246 | 244 | if (empty($model)) |
247 | 245 | { |
248 | 246 | return $this; |
249 | - } |
|
250 | - elseif (is_array($model)) |
|
247 | + } elseif (is_array($model)) |
|
251 | 248 | { |
252 | 249 | foreach ($model as $key => $value) |
253 | 250 | { |
@@ -315,8 +312,7 @@ discard block |
||
315 | 312 | } |
316 | 313 | |
317 | 314 | log_message('info', 'CI_Model class loaded'); |
318 | - } |
|
319 | - elseif ( ! class_exists('CI_Model', FALSE)) |
|
315 | + } elseif ( ! class_exists('CI_Model', FALSE)) |
|
320 | 316 | { |
321 | 317 | require_once(BASEPATH.'core'.DIRECTORY_SEPARATOR.'Model.php'); |
322 | 318 | } |
@@ -477,8 +473,7 @@ discard block |
||
477 | 473 | require_once($driver_path); |
478 | 474 | $class = 'CI_DB_'.$db->dbdriver.'_'.$db->subdriver.'_forge'; |
479 | 475 | } |
480 | - } |
|
481 | - else |
|
476 | + } else |
|
482 | 477 | { |
483 | 478 | $class = 'CI_DB_'.$db->dbdriver.'_forge'; |
484 | 479 | } |
@@ -765,16 +760,14 @@ discard block |
||
765 | 760 | if (is_int($key)) |
766 | 761 | { |
767 | 762 | $this->driver($value, $params); |
768 | - } |
|
769 | - else |
|
763 | + } else |
|
770 | 764 | { |
771 | 765 | $this->driver($key, $params, $value); |
772 | 766 | } |
773 | 767 | } |
774 | 768 | |
775 | 769 | return $this; |
776 | - } |
|
777 | - elseif (empty($library)) |
|
770 | + } elseif (empty($library)) |
|
778 | 771 | { |
779 | 772 | return FALSE; |
780 | 773 | } |
@@ -873,8 +866,7 @@ discard block |
||
873 | 866 | array_shift($this->_ci_helper_paths); |
874 | 867 | array_shift($this->_ci_view_paths); |
875 | 868 | array_pop($config->_config_paths); |
876 | - } |
|
877 | - else |
|
869 | + } else |
|
878 | 870 | { |
879 | 871 | $path = rtrim($path, '/').'/'; |
880 | 872 | foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) |
@@ -938,8 +930,7 @@ discard block |
||
938 | 930 | { |
939 | 931 | $_ci_x = explode('/', $_ci_path); |
940 | 932 | $_ci_file = end($_ci_x); |
941 | - } |
|
942 | - else |
|
933 | + } else |
|
943 | 934 | { |
944 | 935 | $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); |
945 | 936 | $_ci_file = ($_ci_ext === '') ? $_ci_view.'.php' : $_ci_view; |
@@ -1006,8 +997,7 @@ discard block |
||
1006 | 997 | if ( ! is_php('5.4') && ! ini_get('short_open_tag') && config_item('rewrite_short_tags') === TRUE) |
1007 | 998 | { |
1008 | 999 | echo eval('?>'.preg_replace('/;*\s*\?>/', '; ?>', str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
1009 | - } |
|
1010 | - else |
|
1000 | + } else |
|
1011 | 1001 | { |
1012 | 1002 | include($_ci_path); // include() vs include_once() allows for multiple views with the same name |
1013 | 1003 | } |
@@ -1034,8 +1024,7 @@ discard block |
||
1034 | 1024 | if (ob_get_level() > $this->_ci_ob_level + 1) |
1035 | 1025 | { |
1036 | 1026 | ob_end_flush(); |
1037 | - } |
|
1038 | - else |
|
1027 | + } else |
|
1039 | 1028 | { |
1040 | 1029 | $_ci_CI->output->append_output(ob_get_contents()); |
1041 | 1030 | @ob_end_clean(); |
@@ -1075,8 +1064,7 @@ discard block |
||
1075 | 1064 | |
1076 | 1065 | // Get the filename from the path |
1077 | 1066 | $class = substr($class, $last_slash); |
1078 | - } |
|
1079 | - else |
|
1067 | + } else |
|
1080 | 1068 | { |
1081 | 1069 | $subdir = ''; |
1082 | 1070 | } |
@@ -1214,8 +1202,7 @@ discard block |
||
1214 | 1202 | if (file_exists(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php')) |
1215 | 1203 | { |
1216 | 1204 | include_once(CI_PHPUNIT_TESTPATH.'replacing/libraries/'.$file_path.$library_name.'.php'); |
1217 | - } |
|
1218 | - else |
|
1205 | + } else |
|
1219 | 1206 | { |
1220 | 1207 | include_once(BASEPATH.'libraries/'.$file_path.$library_name.'.php'); |
1221 | 1208 | } |
@@ -1279,8 +1266,7 @@ discard block |
||
1279 | 1266 | { |
1280 | 1267 | include($path.'config/'.strtolower($class).'.php'); |
1281 | 1268 | $found = TRUE; |
1282 | - } |
|
1283 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
1269 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
1284 | 1270 | { |
1285 | 1271 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
1286 | 1272 | $found = TRUE; |
@@ -1290,8 +1276,7 @@ discard block |
||
1290 | 1276 | { |
1291 | 1277 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
1292 | 1278 | $found = TRUE; |
1293 | - } |
|
1294 | - elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
1279 | + } elseif (file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
1295 | 1280 | { |
1296 | 1281 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
1297 | 1282 | $found = TRUE; |
@@ -200,29 +200,30 @@ discard block |
||
200 | 200 | if (isset($array[$index])) |
201 | 201 | { |
202 | 202 | $value = $array[$index]; |
203 | - } |
|
204 | - elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) // Does the index contain array notation |
|
203 | + } elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) { |
|
204 | + // Does the index contain array notation |
|
205 | 205 | { |
206 | 206 | $value = $array; |
207 | + } |
|
207 | 208 | for ($i = 0; $i < $count; $i++) |
208 | 209 | { |
209 | 210 | $key = trim($matches[0][$i], '[]'); |
210 | - if ($key === '') // Empty notation will return the value as array |
|
211 | + if ($key === '') { |
|
212 | + // Empty notation will return the value as array |
|
211 | 213 | { |
212 | 214 | break; |
213 | 215 | } |
216 | + } |
|
214 | 217 | |
215 | 218 | if (isset($value[$key])) |
216 | 219 | { |
217 | 220 | $value = $value[$key]; |
218 | - } |
|
219 | - else |
|
221 | + } else |
|
220 | 222 | { |
221 | 223 | return NULL; |
222 | 224 | } |
223 | 225 | } |
224 | - } |
|
225 | - else |
|
226 | + } else |
|
226 | 227 | { |
227 | 228 | return NULL; |
228 | 229 | } |
@@ -421,8 +422,7 @@ discard block |
||
421 | 422 | if ( ! is_numeric($expire)) |
422 | 423 | { |
423 | 424 | $expire = time() - 86500; |
424 | - } |
|
425 | - else |
|
425 | + } else |
|
426 | 426 | { |
427 | 427 | $expire = ($expire > 0) ? time() + $expire : 0; |
428 | 428 | } |
@@ -483,8 +483,7 @@ discard block |
||
483 | 483 | if ( ! $this->valid_ip($spoof)) |
484 | 484 | { |
485 | 485 | $spoof = NULL; |
486 | - } |
|
487 | - else |
|
486 | + } else |
|
488 | 487 | { |
489 | 488 | break; |
490 | 489 | } |
@@ -537,8 +536,7 @@ discard block |
||
537 | 536 | } |
538 | 537 | |
539 | 538 | $sprintf = '%016b%016b%016b%016b%016b%016b%016b%016b'; |
540 | - } |
|
541 | - else |
|
539 | + } else |
|
542 | 540 | { |
543 | 541 | $ip = explode('.', $this->ip_address); |
544 | 542 | $sprintf = '%08b%08b%08b%08b'; |
@@ -558,8 +556,7 @@ discard block |
||
558 | 556 | { |
559 | 557 | $netaddr[$j] = intval($netaddr[$j], 16); |
560 | 558 | } |
561 | - } |
|
562 | - else |
|
559 | + } else |
|
563 | 560 | { |
564 | 561 | $netaddr = explode('.', $netaddr); |
565 | 562 | } |
@@ -646,8 +643,7 @@ discard block |
||
646 | 643 | if ($this->_allow_get_array === FALSE) |
647 | 644 | { |
648 | 645 | $_GET = array(); |
649 | - } |
|
650 | - elseif (is_array($_GET)) |
|
646 | + } elseif (is_array($_GET)) |
|
651 | 647 | { |
652 | 648 | foreach ($_GET as $key => $val) |
653 | 649 | { |
@@ -683,8 +679,7 @@ discard block |
||
683 | 679 | if (($cookie_key = $this->_clean_input_keys($key)) !== FALSE) |
684 | 680 | { |
685 | 681 | $_COOKIE[$cookie_key] = $this->_clean_input_data($val); |
686 | - } |
|
687 | - else |
|
682 | + } else |
|
688 | 683 | { |
689 | 684 | unset($_COOKIE[$key]); |
690 | 685 | } |
@@ -774,8 +769,7 @@ discard block |
||
774 | 769 | if ($fatal === TRUE) |
775 | 770 | { |
776 | 771 | return FALSE; |
777 | - } |
|
778 | - else |
|
772 | + } else |
|
779 | 773 | { |
780 | 774 | set_status_header(503); |
781 | 775 | echo 'Disallowed Key Characters.'; |
@@ -814,8 +808,7 @@ discard block |
||
814 | 808 | if (function_exists('apache_request_headers')) |
815 | 809 | { |
816 | 810 | $this->headers = apache_request_headers(); |
817 | - } |
|
818 | - else |
|
811 | + } else |
|
819 | 812 | { |
820 | 813 | isset($_SERVER['CONTENT_TYPE']) && $this->headers['Content-Type'] = $_SERVER['CONTENT_TYPE']; |
821 | 814 | |
@@ -944,8 +937,7 @@ discard block |
||
944 | 937 | { |
945 | 938 | isset($this->_raw_input_stream) OR $this->_raw_input_stream = file_get_contents('php://input'); |
946 | 939 | return $this->_raw_input_stream; |
947 | - } |
|
948 | - elseif ($name === 'ip_address') |
|
940 | + } elseif ($name === 'ip_address') |
|
949 | 941 | { |
950 | 942 | return $this->ip_address; |
951 | 943 | } |
@@ -511,8 +511,7 @@ discard block |
||
511 | 511 | { |
512 | 512 | // header('Content-Encoding: gzip'); |
513 | 513 | // header('Content-Length: '.self::strlen($output)); |
514 | - } |
|
515 | - else |
|
514 | + } else |
|
516 | 515 | { |
517 | 516 | // User agent doesn't support gzip compression, |
518 | 517 | // so we'll have to decompress our cache |
@@ -552,8 +551,7 @@ discard block |
||
552 | 551 | if (method_exists($CI, '_output')) |
553 | 552 | { |
554 | 553 | $CI->_output($output); |
555 | - } |
|
556 | - else |
|
554 | + } else |
|
557 | 555 | { |
558 | 556 | echo $output; // Send it to the browser! |
559 | 557 | } |
@@ -591,8 +589,7 @@ discard block |
||
591 | 589 | if (is_array($cache_query_string)) |
592 | 590 | { |
593 | 591 | $uri .= '?'.http_build_query(array_intersect_key($_GET, array_flip($cache_query_string))); |
594 | - } |
|
595 | - else |
|
592 | + } else |
|
596 | 593 | { |
597 | 594 | $uri .= '?'.$_SERVER['QUERY_STRING']; |
598 | 595 | } |
@@ -685,8 +682,7 @@ discard block |
||
685 | 682 | if (is_array($cache_query_string)) |
686 | 683 | { |
687 | 684 | $uri .= '?'.http_build_query(array_intersect_key($_GET, array_flip($cache_query_string))); |
688 | - } |
|
689 | - else |
|
685 | + } else |
|
690 | 686 | { |
691 | 687 | $uri .= '?'.$_SERVER['QUERY_STRING']; |
692 | 688 | } |
@@ -773,8 +769,7 @@ discard block |
||
773 | 769 | if (is_array($cache_query_string)) |
774 | 770 | { |
775 | 771 | $uri .= '?'.http_build_query(array_intersect_key($_GET, array_flip($cache_query_string))); |
776 | - } |
|
777 | - else |
|
772 | + } else |
|
778 | 773 | { |
779 | 774 | $uri .= '?'.$_SERVER['QUERY_STRING']; |
780 | 775 | } |