Code Duplication    Length = 8-8 lines in 3 locations

system/libraries/Input.php 3 locations

@@ 93-100 (lines=8) @@
90
                Kohana::log('debug', 'Disable register_globals! It is evil and deprecated: http://php.net/register_globals');
91
            }
92
93
            if (is_array($_GET)) {
94
                foreach ($_GET as $key => $val) {
95
                    // Sanitize $_GET
96
                    $_GET[$this->clean_input_keys($key)] = $this->clean_input_data($val);
97
                }
98
            } else {
99
                $_GET = array();
100
            }
101
102
            if (is_array($_POST)) {
103
                foreach ($_POST as $key => $val) {
@@ 102-109 (lines=8) @@
99
                $_GET = array();
100
            }
101
102
            if (is_array($_POST)) {
103
                foreach ($_POST as $key => $val) {
104
                    // Sanitize $_POST
105
                    $_POST[$this->clean_input_keys($key)] = $this->clean_input_data($val);
106
                }
107
            } else {
108
                $_POST = array();
109
            }
110
111
            if (is_array($_COOKIE)) {
112
                foreach ($_COOKIE as $key => $val) {
@@ 394-401 (lines=8) @@
391
     */
392
    public function clean_input_data($str)
393
    {
394
        if (is_array($str)) {
395
            $new_array = array();
396
            foreach ($str as $key => $val) {
397
                // Recursion!
398
                $new_array[$this->clean_input_keys($key)] = $this->clean_input_data($val);
399
            }
400
            return $new_array;
401
        }
402
403
        if ($this->magic_quotes_gpc === true) {
404
            // Remove annoying magic quotes