Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php defined("\x42\x41\x53\105\x50\101\x54\110") or die("\116\157\x20\x64\151\162\145\14..

Decoded Output download

<?php
 defined("BASEPATH") or die("No direct script access allowed"); class CI_DB_oci8_driver extends CI_DB { public $dbdriver = "oci8"; public $commit_mode = OCI_COMMIT_ON_SUCCESS; public $limit_used = FALSE; protected $_error = FALSE; protected $_affected_rows = FALSE; protected $_reserved_identifiers = array("*", "rownum"); protected $_random_keyword = array("ASC", "ASC"); protected $_count_string = "SELECT COUNT(1) AS "; public function __construct($params) { parent::__construct($params); $valid_dsns = array("tns" => "/^\(DESCRIPTION=(\(.+\)){2,}\)$/", "ec" => "/^(\/\/)?[a-z0-9.:_-]+(:[1-9][0-9]{0,4})?(\/[a-z0-9$_]+)?(:[^\/])?(\/[a-z0-9$_]+)?$/i", "in" => "/^[a-z0-9$_]+$/i"); $this->dsn = str_replace(array("
", "\xd", "\x9", " "), '', $this->dsn); if ($this->dsn !== '') { foreach ($valid_dsns as $regexp) { if (preg_match($regexp, $this->dsn)) { return; } } } $this->hostname = str_replace(array("\xa", "\xd", "\x9", " "), '', $this->hostname); if (preg_match($valid_dsns["tns"], $this->hostname)) { $this->dsn = $this->hostname; return; } elseif ($this->hostname !== '' && strpos($this->hostname, "/") === FALSE && strpos($this->hostname, ":") === FALSE && (!empty($this->port) && ctype_digit($this->port) or $this->database !== '')) { $this->dsn = $this->hostname . (!empty($this->port) && ctype_digit($this->port) ? ":" . $this->port : '') . ($this->database !== '' ? "/" . ltrim($this->database, "/") : ''); if (preg_match($valid_dsns["ec"], $this->dsn)) { return; } } if (preg_match($valid_dsns["ec"], $this->hostname) or preg_match($valid_dsns["in"], $this->hostname)) { $this->dsn = $this->hostname; return; } $this->database = str_replace(array("\xa", "
", "\x9", " "), '', $this->database); foreach ($valid_dsns as $regexp) { if (preg_match($regexp, $this->database)) { return; } } $this->dsn = ''; } public function db_connect($persistent = FALSE) { $func = $persistent === TRUE ? "oci_pconnect" : "oci_connect"; return empty($this->char_set) ? $func($this->username, $this->password, $this->dsn) : $func($this->username, $this->password, $this->dsn, $this->char_set); } public function version() { if (isset($this->data_cache["version"])) { return $this->data_cache["version"]; } if (!$this->conn_id or ($version_string = oci_server_version($this->conn_id)) === FALSE) { return FALSE; } elseif (preg_match("#Release\s(\d+(?:\.\d+)+)#", $version_string, $match)) { return $this->data_cache["version"] = $match[1]; } return FALSE; } protected function _execute($sql) { $this->result_id = oci_parse($this->conn_id, $sql); oci_set_prefetch($this->result_id, 1000); $result = oci_execute($this->result_id, $this->commit_mode); $this->_error = oci_error($this->result_id); $this->is_write_type($sql) && ($this->_affected_rows = oci_num_rows($this->result_id)); if ($this->is_write_type($sql) or $result === FALSE) { oci_free_statement($this->result_id); return $result; } return $this->result_id; } protected function _trans_begin() { $this->commit_mode = OCI_NO_AUTO_COMMIT; return TRUE; } protected function _trans_commit() { $this->commit_mode = OCI_COMMIT_ON_SUCCESS; return oci_commit($this->conn_id); } protected function _trans_rollback() { $this->commit_mode = OCI_COMMIT_ON_SUCCESS; return oci_rollback($this->conn_id); } public function affected_rows() { return $this->_affected_rows; } public function insert_id() { return $this->display_error("db_unsupported_function"); } protected function _list_tables($prefix_limit = FALSE) { $sql = "SELECT "TABLE_NAME" FROM "ALL_TABLES""; if ($prefix_limit !== FALSE && $this->dbprefix !== '') { return $sql . " WHERE "TABLE_NAME" LIKE '" . $this->escape_like_str($this->dbprefix) . "%' " . sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; } protected function _list_columns($table = '') { if (strpos($table, ".") !== FALSE) { sscanf($table, "%[^.].%s", $owner, $table); } else { $owner = $this->username; } return "SELECT COLUMN_NAME FROM ALL_TAB_COLUMNS\xa		\x9WHERE UPPER(OWNER) = " . $this->escape(strtoupper($owner)) . "
\x9			AND UPPER(TABLE_NAME) = " . $this->escape(strtoupper($table)); } public function field_data($table) { if (strpos($table, ".") !== FALSE) { sscanf($table, "%[^.].%s", $owner, $table); } else { $owner = $this->username; } $sql = "SELECT COLUMN_NAME, DATA_TYPE, CHAR_LENGTH, DATA_PRECISION, DATA_LENGTH, DATA_DEFAULT, NULLABLE
\x9		FROM ALL_TAB_COLUMNS\xa\x9		WHERE UPPER(OWNER) = " . $this->escape(strtoupper($owner)) . "
	\x9		AND UPPER(TABLE_NAME) = " . $this->escape(strtoupper($table)); if (($query = $this->query($sql)) === FALSE) { return FALSE; } $query = $query->result_object(); $retval = array(); for ($i = 0, $c = count($query); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $query[$i]->COLUMN_NAME; $retval[$i]->type = $query[$i]->DATA_TYPE; $length = $query[$i]->CHAR_LENGTH > 0 ? $query[$i]->CHAR_LENGTH : $query[$i]->DATA_PRECISION; if ($length === NULL) { $length = $query[$i]->DATA_LENGTH; } $retval[$i]->max_length = $length; $default = $query[$i]->DATA_DEFAULT; if ($default === NULL && $query[$i]->NULLABLE === "N") { $default = ''; } $retval[$i]->default = $default; } return $retval; } public function error() { if (!empty($this->_error)) { return $this->_error; } if (is_resource($this->conn_id)) { $error = oci_error($this->conn_id); } else { $error = oci_error(); } return is_array($error) ? $error : array("code" => '', "message" => ''); } protected function _insert_batch($table, $keys, $values) { $keys = implode(", ", $keys); $sql = "INSERT ALL
"; for ($i = 0, $c = count($values); $i < $c; $i++) { $sql .= "\x9INTO " . $table . " (" . $keys . ") VALUES " . $values[$i] . "\xa"; } return $sql . "SELECT * FROM dual"; } protected function _truncate($table) { return "TRUNCATE TABLE " . $table; } protected function _delete($table) { if ($this->qb_limit) { $this->where("rownum <= ", $this->qb_limit, FALSE); $this->qb_limit = FALSE; } return parent::_delete($table); } protected function _limit($sql) { if (version_compare($this->version(), "12.1", ">=")) { empty($this->qb_orderby) && ($sql .= " ORDER BY 1"); return $sql . " OFFSET " . (int) $this->qb_offset . " ROWS FETCH NEXT " . $this->qb_limit . " ROWS ONLY"; } $this->limit_used = TRUE; return "SELECT * FROM (SELECT inner_query.*, rownum rnum FROM (" . $sql . ") inner_query WHERE rownum < " . ($this->qb_offset + $this->qb_limit + 1) . ")" . ($this->qb_offset ? " WHERE rnum >= " . ($this->qb_offset + 1) : ''); } protected function _close() { if (is_resource($this->result_id)) { oci_free_statement($this->result_id); } oci_close($this->conn_id); } protected function _reset_select() { $this->limit_used = FALSE; parent::_reset_select(); } } ?>

Did this file decode correctly?

Original Code

<?php
 defined("\x42\x41\x53\105\x50\101\x54\110") or die("\116\157\x20\x64\151\162\145\143\164\x20\x73\143\x72\x69\x70\x74\x20\x61\143\x63\145\x73\x73\40\141\154\154\157\167\145\x64"); class CI_DB_oci8_driver extends CI_DB { public $dbdriver = "\x6f\x63\151\70"; public $commit_mode = OCI_COMMIT_ON_SUCCESS; public $limit_used = FALSE; protected $_error = FALSE; protected $_affected_rows = FALSE; protected $_reserved_identifiers = array("\x2a", "\x72\157\167\156\165\x6d"); protected $_random_keyword = array("\x41\123\x43", "\x41\x53\x43"); protected $_count_string = "\123\x45\114\x45\103\x54\40\103\x4f\125\x4e\x54\x28\x31\x29\40\101\123\40"; public function __construct($params) { parent::__construct($params); $valid_dsns = array("\x74\156\163" => "\x2f\x5e\134\50\x44\105\123\x43\x52\111\120\124\x49\117\x4e\x3d\x28\134\50\56\53\x5c\51\51\x7b\x32\x2c\175\x5c\x29\x24\57", "\x65\x63" => "\x2f\136\50\x5c\x2f\134\57\51\x3f\x5b\141\x2d\172\60\x2d\71\56\72\137\55\x5d\x2b\x28\72\x5b\x31\55\71\x5d\x5b\x30\55\x39\x5d\173\x30\x2c\x34\175\x29\x3f\x28\x5c\x2f\133\141\55\x7a\60\x2d\x39\44\137\135\53\x29\77\x28\72\x5b\136\x5c\57\135\51\x3f\50\x5c\57\x5b\141\55\172\60\55\71\x24\137\x5d\x2b\51\77\x24\x2f\151", "\151\x6e" => "\x2f\136\133\141\55\172\60\x2d\x39\x24\x5f\135\x2b\44\x2f\151"); $this->dsn = str_replace(array("\12", "\xd", "\x9", "\x20"), '', $this->dsn); if ($this->dsn !== '') { foreach ($valid_dsns as $regexp) { if (preg_match($regexp, $this->dsn)) { return; } } } $this->hostname = str_replace(array("\xa", "\xd", "\x9", "\x20"), '', $this->hostname); if (preg_match($valid_dsns["\164\x6e\163"], $this->hostname)) { $this->dsn = $this->hostname; return; } elseif ($this->hostname !== '' && strpos($this->hostname, "\x2f") === FALSE && strpos($this->hostname, "\x3a") === FALSE && (!empty($this->port) && ctype_digit($this->port) or $this->database !== '')) { $this->dsn = $this->hostname . (!empty($this->port) && ctype_digit($this->port) ? "\x3a" . $this->port : '') . ($this->database !== '' ? "\57" . ltrim($this->database, "\x2f") : ''); if (preg_match($valid_dsns["\145\143"], $this->dsn)) { return; } } if (preg_match($valid_dsns["\145\143"], $this->hostname) or preg_match($valid_dsns["\151\x6e"], $this->hostname)) { $this->dsn = $this->hostname; return; } $this->database = str_replace(array("\xa", "\15", "\x9", "\40"), '', $this->database); foreach ($valid_dsns as $regexp) { if (preg_match($regexp, $this->database)) { return; } } $this->dsn = ''; } public function db_connect($persistent = FALSE) { $func = $persistent === TRUE ? "\157\143\151\137\x70\143\x6f\x6e\x6e\145\143\x74" : "\x6f\143\x69\137\x63\157\x6e\x6e\145\143\164"; return empty($this->char_set) ? $func($this->username, $this->password, $this->dsn) : $func($this->username, $this->password, $this->dsn, $this->char_set); } public function version() { if (isset($this->data_cache["\x76\x65\162\163\x69\x6f\x6e"])) { return $this->data_cache["\166\x65\162\163\x69\157\x6e"]; } if (!$this->conn_id or ($version_string = oci_server_version($this->conn_id)) === FALSE) { return FALSE; } elseif (preg_match("\x23\122\x65\154\x65\x61\163\x65\x5c\x73\x28\134\x64\53\x28\x3f\72\x5c\x2e\x5c\x64\53\x29\53\x29\x23", $version_string, $match)) { return $this->data_cache["\166\x65\x72\163\x69\157\156"] = $match[1]; } return FALSE; } protected function _execute($sql) { $this->result_id = oci_parse($this->conn_id, $sql); oci_set_prefetch($this->result_id, 1000); $result = oci_execute($this->result_id, $this->commit_mode); $this->_error = oci_error($this->result_id); $this->is_write_type($sql) && ($this->_affected_rows = oci_num_rows($this->result_id)); if ($this->is_write_type($sql) or $result === FALSE) { oci_free_statement($this->result_id); return $result; } return $this->result_id; } protected function _trans_begin() { $this->commit_mode = OCI_NO_AUTO_COMMIT; return TRUE; } protected function _trans_commit() { $this->commit_mode = OCI_COMMIT_ON_SUCCESS; return oci_commit($this->conn_id); } protected function _trans_rollback() { $this->commit_mode = OCI_COMMIT_ON_SUCCESS; return oci_rollback($this->conn_id); } public function affected_rows() { return $this->_affected_rows; } public function insert_id() { return $this->display_error("\144\142\x5f\x75\156\x73\x75\x70\x70\x6f\x72\164\x65\144\137\146\x75\x6e\x63\x74\151\x6f\156"); } protected function _list_tables($prefix_limit = FALSE) { $sql = "\x53\105\114\105\103\x54\x20\x22\124\101\x42\114\105\137\x4e\101\115\x45\42\x20\106\x52\x4f\x4d\x20\42\101\114\114\x5f\124\101\102\114\105\123\42"; if ($prefix_limit !== FALSE && $this->dbprefix !== '') { return $sql . "\x20\x57\110\105\122\105\40\42\124\x41\x42\114\x45\x5f\x4e\101\x4d\x45\42\40\x4c\x49\113\x45\x20\47" . $this->escape_like_str($this->dbprefix) . "\x25\x27\x20" . sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; } protected function _list_columns($table = '') { if (strpos($table, "\x2e") !== FALSE) { sscanf($table, "\45\133\136\56\x5d\56\45\x73", $owner, $table); } else { $owner = $this->username; } return "\x53\x45\x4c\105\103\x54\40\103\x4f\x4c\x55\x4d\x4e\137\116\x41\x4d\x45\x20\106\x52\117\x4d\x20\x41\x4c\x4c\137\124\x41\x42\x5f\103\117\x4c\125\115\116\x53\xa\11\11\x9\x57\110\105\122\x45\40\x55\120\x50\x45\x52\x28\117\127\116\105\x52\51\40\x3d\x20" . $this->escape(strtoupper($owner)) . "\12\x9\11\11\11\101\116\x44\40\125\x50\x50\105\x52\x28\x54\101\x42\x4c\x45\x5f\116\x41\x4d\x45\x29\40\75\x20" . $this->escape(strtoupper($table)); } public function field_data($table) { if (strpos($table, "\x2e") !== FALSE) { sscanf($table, "\x25\133\136\56\x5d\x2e\x25\x73", $owner, $table); } else { $owner = $this->username; } $sql = "\123\105\x4c\x45\103\x54\x20\103\x4f\114\x55\x4d\x4e\x5f\x4e\x41\115\x45\x2c\x20\x44\101\x54\101\137\x54\x59\x50\x45\54\40\x43\x48\x41\x52\137\114\105\116\x47\x54\110\x2c\40\104\x41\x54\101\137\x50\122\105\103\x49\123\x49\x4f\x4e\x2c\40\x44\101\x54\x41\137\114\105\x4e\x47\x54\110\54\x20\x44\x41\x54\101\137\x44\x45\x46\101\125\x4c\x54\x2c\40\116\x55\114\x4c\x41\x42\114\x45\12\x9\11\11\106\122\x4f\115\x20\101\114\114\137\x54\x41\102\137\x43\x4f\114\125\115\116\x53\xa\x9\11\11\x57\x48\105\x52\x45\x20\125\120\120\x45\122\x28\x4f\x57\116\105\x52\x29\x20\75\40" . $this->escape(strtoupper($owner)) . "\12\11\x9\11\11\x41\116\104\x20\x55\x50\x50\x45\122\x28\124\101\x42\114\x45\137\116\x41\x4d\x45\x29\40\x3d\40" . $this->escape(strtoupper($table)); if (($query = $this->query($sql)) === FALSE) { return FALSE; } $query = $query->result_object(); $retval = array(); for ($i = 0, $c = count($query); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = $query[$i]->COLUMN_NAME; $retval[$i]->type = $query[$i]->DATA_TYPE; $length = $query[$i]->CHAR_LENGTH > 0 ? $query[$i]->CHAR_LENGTH : $query[$i]->DATA_PRECISION; if ($length === NULL) { $length = $query[$i]->DATA_LENGTH; } $retval[$i]->max_length = $length; $default = $query[$i]->DATA_DEFAULT; if ($default === NULL && $query[$i]->NULLABLE === "\116") { $default = ''; } $retval[$i]->default = $default; } return $retval; } public function error() { if (!empty($this->_error)) { return $this->_error; } if (is_resource($this->conn_id)) { $error = oci_error($this->conn_id); } else { $error = oci_error(); } return is_array($error) ? $error : array("\x63\x6f\144\x65" => '', "\x6d\x65\x73\x73\141\147\145" => ''); } protected function _insert_batch($table, $keys, $values) { $keys = implode("\x2c\x20", $keys); $sql = "\x49\x4e\x53\105\122\x54\40\x41\x4c\114\12"; for ($i = 0, $c = count($values); $i < $c; $i++) { $sql .= "\x9\x49\x4e\124\x4f\40" . $table . "\40\x28" . $keys . "\x29\40\x56\101\114\x55\105\123\40" . $values[$i] . "\xa"; } return $sql . "\123\x45\x4c\105\x43\124\40\52\x20\x46\122\117\115\40\x64\x75\x61\154"; } protected function _truncate($table) { return "\x54\x52\x55\x4e\103\101\124\105\40\124\x41\x42\114\105\x20" . $table; } protected function _delete($table) { if ($this->qb_limit) { $this->where("\x72\x6f\x77\156\165\155\x20\x3c\75\x20", $this->qb_limit, FALSE); $this->qb_limit = FALSE; } return parent::_delete($table); } protected function _limit($sql) { if (version_compare($this->version(), "\61\x32\x2e\x31", "\76\x3d")) { empty($this->qb_orderby) && ($sql .= "\x20\117\122\104\105\122\40\102\131\x20\61"); return $sql . "\40\x4f\x46\x46\x53\x45\124\40" . (int) $this->qb_offset . "\x20\x52\117\127\123\x20\x46\105\x54\x43\x48\40\116\x45\130\x54\x20" . $this->qb_limit . "\40\x52\x4f\127\123\40\117\x4e\114\x59"; } $this->limit_used = TRUE; return "\x53\105\114\x45\103\x54\x20\x2a\40\x46\122\117\115\40\x28\x53\105\x4c\105\103\124\x20\151\x6e\156\145\162\x5f\x71\x75\145\162\x79\56\x2a\x2c\40\x72\x6f\167\156\165\x6d\40\x72\x6e\x75\155\40\x46\122\x4f\115\40\x28" . $sql . "\x29\40\x69\x6e\156\145\162\x5f\161\x75\145\162\171\x20\127\110\x45\x52\105\x20\162\157\167\x6e\x75\x6d\40\x3c\x20" . ($this->qb_offset + $this->qb_limit + 1) . "\51" . ($this->qb_offset ? "\x20\127\110\105\x52\105\x20\x72\156\165\x6d\x20\x3e\x3d\x20" . ($this->qb_offset + 1) : ''); } protected function _close() { if (is_resource($this->result_id)) { oci_free_statement($this->result_id); } oci_close($this->conn_id); } protected function _reset_select() { $this->limit_used = FALSE; parent::_reset_select(); } }

Function Calls

None

Variables

None

Stats

MD5 a95319d6633af6e463eb6492e012b12b
Eval Count 0
Decode Time 99 ms