public function __construct($type, $quote = false) { if ($type === 'get') { foreach ((array) $_GET as $key => $value) { if (!preg_match('#[^0-9a-zA-Z_]#', $key)) { if ($quote) { $this->_data[$key] = APP::db()->quote($value); } else { $this->_data[$key] = $value; } } } } elseif ($type === 'post') { foreach ((array) $_POST as $key => $value) { if (!preg_match('#[^0-9a-zA-Z_]#', $key)) { if ($quote) { $this->_data[$key] = APP::db()->quote($value); } else { $this->_data[$key] = $value; } } } } }