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\101\123\105\x50\101\x54\110") or die("\116\x6f\x20\144\x69\162\145\x6..

Decoded Output download

<?php
 defined("BASEPATH") or die("No direct script access allowed"); class CI_Pagination { protected $base_url = ''; protected $prefix = ''; protected $suffix = ''; protected $total_rows = 0; protected $num_links = 2; public $per_page = 10; public $cur_page = 0; protected $use_page_numbers = FALSE; protected $first_link = "&lsaquo; First"; protected $next_link = "&gt;"; protected $prev_link = "&lt;"; protected $last_link = "Last &rsaquo;"; protected $uri_segment = 0; protected $full_tag_open = ''; protected $full_tag_close = ''; protected $first_tag_open = ''; protected $first_tag_close = ''; protected $last_tag_open = ''; protected $last_tag_close = ''; protected $first_url = ''; protected $cur_tag_open = "<strong>"; protected $cur_tag_close = "</strong>"; protected $next_tag_open = ''; protected $next_tag_close = ''; protected $prev_tag_open = ''; protected $prev_tag_close = ''; protected $num_tag_open = ''; protected $num_tag_close = ''; protected $page_query_string = FALSE; protected $query_string_segment = "per_page"; protected $display_pages = TRUE; protected $_attributes = ''; protected $_link_types = array(); protected $reuse_query_string = FALSE; protected $use_global_url_suffix = FALSE; protected $data_page_attr = "data-ci-pagination-page"; protected $CI; public function __construct($params = array()) { $this->CI =& get_instance(); $this->CI->load->language("pagination"); foreach (array("first_link", "next_link", "prev_link", "last_link") as $key) { if (($val = $this->CI->lang->line("pagination_" . $key)) !== FALSE) { $this->{$key} = $val; } } $this->initialize($params); log_message("info", "Pagination Class Initialized"); } public function initialize(array $params = array()) { isset($params["attributes"]) or $params["attributes"] = array(); if (is_array($params["attributes"])) { $this->_parse_attributes($params["attributes"]); unset($params["attributes"]); } if (isset($params["anchor_class"])) { empty($params["anchor_class"]) or $attributes["class"] = $params["anchor_class"]; unset($params["anchor_class"]); } foreach ($params as $key => $val) { if (property_exists($this, $key)) { $this->{$key} = $val; } } if ($this->CI->config->item("enable_query_strings") === TRUE) { $this->page_query_string = TRUE; } if ($this->use_global_url_suffix === TRUE) { $this->suffix = $this->CI->config->item("url_suffix"); } return $this; } public function create_links() { if ($this->total_rows == 0 or $this->per_page == 0) { return ''; } $num_pages = (int) ceil($this->total_rows / $this->per_page); if ($num_pages === 1) { return ''; } $this->num_links = (int) $this->num_links; if ($this->num_links < 0) { show_error("Your number of links must be a non-negative number."); } if ($this->reuse_query_string === TRUE) { $get = $this->CI->input->get(); unset($get["c"], $get["m"], $get[$this->query_string_segment]); } else { $get = array(); } $base_url = trim($this->base_url); $first_url = $this->first_url; $query_string = ''; $query_string_sep = strpos($base_url, "?") === FALSE ? "?" : "&amp;"; if ($this->page_query_string === TRUE) { if ($first_url === '') { $first_url = $base_url; if (!empty($get)) { $first_url .= $query_string_sep . http_build_query($get); } } $base_url .= $query_string_sep . http_build_query(array_merge($get, array($this->query_string_segment => ''))); } else { if (!empty($get)) { $query_string = $query_string_sep . http_build_query($get); $this->suffix .= $query_string; } if ($this->reuse_query_string === TRUE && ($base_query_pos = strpos($base_url, "?")) !== FALSE) { $base_url = substr($base_url, 0, $base_query_pos); } if ($first_url === '') { $first_url = $base_url . $query_string; } $base_url = rtrim($base_url, "/") . "/"; } $base_page = $this->use_page_numbers ? 1 : 0; if ($this->page_query_string === TRUE) { $this->cur_page = $this->CI->input->get($this->query_string_segment); } else { if ($this->uri_segment === 0) { $this->uri_segment = count($this->CI->uri->segment_array()); } $this->cur_page = $this->CI->uri->segment($this->uri_segment); if ($this->prefix !== '' or $this->suffix !== '') { $this->cur_page = str_replace(array($this->prefix, $this->suffix), '', $this->cur_page); } } if (!ctype_digit($this->cur_page) or $this->use_page_numbers && (int) $this->cur_page === 0) { $this->cur_page = $base_page; } else { $this->cur_page = (int) $this->cur_page; } if ($this->use_page_numbers) { if ($this->cur_page > $num_pages) { $this->cur_page = $num_pages; } } elseif ($this->cur_page > $this->total_rows) { $this->cur_page = ($num_pages - 1) * $this->per_page; } $uri_page_number = $this->cur_page; if (!$this->use_page_numbers) { $this->cur_page = (int) floor($this->cur_page / $this->per_page + 1); } $start = $this->cur_page - $this->num_links > 0 ? $this->cur_page - ($this->num_links - 1) : 1; $end = $this->cur_page + $this->num_links < $num_pages ? $this->cur_page + $this->num_links : $num_pages; $output = ''; if ($this->first_link !== FALSE && $this->cur_page > $this->num_links + 1 + !$this->num_links) { $attributes = sprintf("%s %s="%d"", $this->_attributes, $this->data_page_attr, 1); $output .= $this->first_tag_open . "<a href="" . $first_url . """ . $attributes . $this->_attr_rel("start") . ">" . $this->first_link . "</a>" . $this->first_tag_close; } if ($this->prev_link !== FALSE && $this->cur_page !== 1) { $i = $this->use_page_numbers ? $uri_page_number - 1 : $uri_page_number - $this->per_page; $attributes = sprintf("%s %s="%d"", $this->_attributes, $this->data_page_attr, $this->cur_page - 1); if ($i === $base_page) { $output .= $this->prev_tag_open . "<a href="" . $first_url . """ . $attributes . $this->_attr_rel("prev") . ">" . $this->prev_link . "</a>" . $this->prev_tag_close; } else { $append = $this->prefix . $i . $this->suffix; $output .= $this->prev_tag_open . "<a href="" . $base_url . $append . """ . $attributes . $this->_attr_rel("prev") . ">" . $this->prev_link . "</a>" . $this->prev_tag_close; } } if ($this->display_pages !== FALSE) { for ($loop = $start - 1; $loop <= $end; $loop++) { $i = $this->use_page_numbers ? $loop : $loop * $this->per_page - $this->per_page; $attributes = sprintf("%s %s="%d"", $this->_attributes, $this->data_page_attr, $loop); if ($i >= $base_page) { if ($this->cur_page === $loop) { $output .= $this->cur_tag_open . $loop . $this->cur_tag_close; } elseif ($i === $base_page) { $output .= $this->num_tag_open . "<a href="" . $first_url . """ . $attributes . $this->_attr_rel("start") . ">" . $loop . "</a>" . $this->num_tag_close; } else { $append = $this->prefix . $i . $this->suffix; $output .= $this->num_tag_open . "<a href="" . $base_url . $append . """ . $attributes . ">" . $loop . "</a>" . $this->num_tag_close; } } } } if ($this->next_link !== FALSE && $this->cur_page < $num_pages) { $i = $this->use_page_numbers ? $this->cur_page + 1 : $this->cur_page * $this->per_page; $attributes = sprintf("%s %s="%d"", $this->_attributes, $this->data_page_attr, $this->cur_page + 1); $output .= $this->next_tag_open . "<a href="" . $base_url . $this->prefix . $i . $this->suffix . """ . $attributes . $this->_attr_rel("next") . ">" . $this->next_link . "</a>" . $this->next_tag_close; } if ($this->last_link !== FALSE && $this->cur_page + $this->num_links + !$this->num_links < $num_pages) { $i = $this->use_page_numbers ? $num_pages : $num_pages * $this->per_page - $this->per_page; $attributes = sprintf("%s %s="%d"", $this->_attributes, $this->data_page_attr, $num_pages); $output .= $this->last_tag_open . "<a href="" . $base_url . $this->prefix . $i . $this->suffix . """ . $attributes . ">" . $this->last_link . "</a>" . $this->last_tag_close; } $output = preg_replace("#([^:"])//+#", "/", $output); return $this->full_tag_open . $output . $this->full_tag_close; } protected function _parse_attributes($attributes) { isset($attributes["rel"]) or $attributes["rel"] = TRUE; $this->_link_types = $attributes["rel"] ? array("start" => "start", "prev" => "prev", "next" => "next") : array(); unset($attributes["rel"]); $this->_attributes = ''; foreach ($attributes as $key => $value) { $this->_attributes .= " " . $key . "="" . $value . """; } } protected function _attr_rel($type) { if (isset($this->_link_types[$type])) { unset($this->_link_types[$type]); return " rel="" . $type . """; } return ''; } } ?>

Did this file decode correctly?

Original Code

<?php
 defined("\x42\101\123\105\x50\101\x54\110") or die("\116\x6f\x20\144\x69\162\145\x63\x74\x20\x73\x63\x72\x69\x70\x74\x20\x61\143\x63\145\163\163\40\141\154\154\x6f\x77\x65\144"); class CI_Pagination { protected $base_url = ''; protected $prefix = ''; protected $suffix = ''; protected $total_rows = 0; protected $num_links = 2; public $per_page = 10; public $cur_page = 0; protected $use_page_numbers = FALSE; protected $first_link = "\46\154\163\141\x71\165\157\73\40\106\151\x72\163\164"; protected $next_link = "\x26\x67\164\73"; protected $prev_link = "\x26\x6c\164\73"; protected $last_link = "\114\141\x73\164\40\46\x72\x73\x61\x71\x75\157\73"; protected $uri_segment = 0; protected $full_tag_open = ''; protected $full_tag_close = ''; protected $first_tag_open = ''; protected $first_tag_close = ''; protected $last_tag_open = ''; protected $last_tag_close = ''; protected $first_url = ''; protected $cur_tag_open = "\74\x73\x74\162\x6f\156\x67\76"; protected $cur_tag_close = "\74\x2f\x73\164\x72\x6f\156\x67\x3e"; protected $next_tag_open = ''; protected $next_tag_close = ''; protected $prev_tag_open = ''; protected $prev_tag_close = ''; protected $num_tag_open = ''; protected $num_tag_close = ''; protected $page_query_string = FALSE; protected $query_string_segment = "\x70\x65\162\137\x70\141\147\x65"; protected $display_pages = TRUE; protected $_attributes = ''; protected $_link_types = array(); protected $reuse_query_string = FALSE; protected $use_global_url_suffix = FALSE; protected $data_page_attr = "\144\x61\x74\141\55\x63\151\55\160\141\x67\x69\156\141\x74\151\x6f\x6e\x2d\x70\x61\x67\145"; protected $CI; public function __construct($params = array()) { $this->CI =& get_instance(); $this->CI->load->language("\160\141\147\x69\x6e\141\164\151\x6f\x6e"); foreach (array("\x66\x69\x72\163\x74\x5f\154\x69\156\x6b", "\x6e\145\x78\164\137\x6c\151\156\153", "\160\162\x65\166\137\x6c\151\156\x6b", "\154\x61\x73\164\137\154\x69\156\153") as $key) { if (($val = $this->CI->lang->line("\160\x61\147\x69\156\x61\x74\x69\157\156\137" . $key)) !== FALSE) { $this->{$key} = $val; } } $this->initialize($params); log_message("\x69\156\x66\x6f", "\120\x61\x67\x69\156\141\x74\151\x6f\x6e\x20\x43\x6c\141\x73\163\40\x49\x6e\x69\x74\x69\141\x6c\151\x7a\x65\144"); } public function initialize(array $params = array()) { isset($params["\x61\164\164\162\x69\142\x75\164\145\x73"]) or $params["\x61\x74\164\162\x69\x62\x75\164\145\x73"] = array(); if (is_array($params["\x61\x74\x74\x72\151\x62\165\164\145\163"])) { $this->_parse_attributes($params["\141\x74\x74\162\151\x62\165\x74\x65\x73"]); unset($params["\x61\164\164\x72\151\142\x75\x74\x65\163"]); } if (isset($params["\x61\156\143\x68\x6f\162\x5f\143\154\141\x73\163"])) { empty($params["\x61\156\x63\x68\x6f\162\x5f\143\154\141\163\163"]) or $attributes["\143\154\x61\163\x73"] = $params["\141\156\x63\x68\157\x72\x5f\143\154\x61\x73\x73"]; unset($params["\x61\x6e\x63\150\x6f\x72\x5f\143\154\141\x73\163"]); } foreach ($params as $key => $val) { if (property_exists($this, $key)) { $this->{$key} = $val; } } if ($this->CI->config->item("\145\x6e\x61\142\154\145\137\x71\165\x65\x72\171\137\163\164\162\151\156\147\163") === TRUE) { $this->page_query_string = TRUE; } if ($this->use_global_url_suffix === TRUE) { $this->suffix = $this->CI->config->item("\165\x72\x6c\x5f\163\165\146\x66\x69\x78"); } return $this; } public function create_links() { if ($this->total_rows == 0 or $this->per_page == 0) { return ''; } $num_pages = (int) ceil($this->total_rows / $this->per_page); if ($num_pages === 1) { return ''; } $this->num_links = (int) $this->num_links; if ($this->num_links < 0) { show_error("\131\x6f\x75\162\x20\156\165\155\x62\x65\x72\x20\157\x66\x20\x6c\151\156\153\x73\40\155\165\163\164\40\x62\x65\40\x61\x20\x6e\157\x6e\x2d\x6e\x65\147\141\164\x69\x76\x65\x20\x6e\x75\155\x62\145\162\x2e"); } if ($this->reuse_query_string === TRUE) { $get = $this->CI->input->get(); unset($get["\x63"], $get["\x6d"], $get[$this->query_string_segment]); } else { $get = array(); } $base_url = trim($this->base_url); $first_url = $this->first_url; $query_string = ''; $query_string_sep = strpos($base_url, "\x3f") === FALSE ? "\x3f" : "\x26\x61\x6d\x70\73"; if ($this->page_query_string === TRUE) { if ($first_url === '') { $first_url = $base_url; if (!empty($get)) { $first_url .= $query_string_sep . http_build_query($get); } } $base_url .= $query_string_sep . http_build_query(array_merge($get, array($this->query_string_segment => ''))); } else { if (!empty($get)) { $query_string = $query_string_sep . http_build_query($get); $this->suffix .= $query_string; } if ($this->reuse_query_string === TRUE && ($base_query_pos = strpos($base_url, "\77")) !== FALSE) { $base_url = substr($base_url, 0, $base_query_pos); } if ($first_url === '') { $first_url = $base_url . $query_string; } $base_url = rtrim($base_url, "\57") . "\57"; } $base_page = $this->use_page_numbers ? 1 : 0; if ($this->page_query_string === TRUE) { $this->cur_page = $this->CI->input->get($this->query_string_segment); } else { if ($this->uri_segment === 0) { $this->uri_segment = count($this->CI->uri->segment_array()); } $this->cur_page = $this->CI->uri->segment($this->uri_segment); if ($this->prefix !== '' or $this->suffix !== '') { $this->cur_page = str_replace(array($this->prefix, $this->suffix), '', $this->cur_page); } } if (!ctype_digit($this->cur_page) or $this->use_page_numbers && (int) $this->cur_page === 0) { $this->cur_page = $base_page; } else { $this->cur_page = (int) $this->cur_page; } if ($this->use_page_numbers) { if ($this->cur_page > $num_pages) { $this->cur_page = $num_pages; } } elseif ($this->cur_page > $this->total_rows) { $this->cur_page = ($num_pages - 1) * $this->per_page; } $uri_page_number = $this->cur_page; if (!$this->use_page_numbers) { $this->cur_page = (int) floor($this->cur_page / $this->per_page + 1); } $start = $this->cur_page - $this->num_links > 0 ? $this->cur_page - ($this->num_links - 1) : 1; $end = $this->cur_page + $this->num_links < $num_pages ? $this->cur_page + $this->num_links : $num_pages; $output = ''; if ($this->first_link !== FALSE && $this->cur_page > $this->num_links + 1 + !$this->num_links) { $attributes = sprintf("\45\x73\x20\x25\163\75\x22\x25\x64\42", $this->_attributes, $this->data_page_attr, 1); $output .= $this->first_tag_open . "\74\141\x20\150\162\x65\146\75\x22" . $first_url . "\42" . $attributes . $this->_attr_rel("\163\x74\141\x72\164") . "\76" . $this->first_link . "\74\x2f\x61\x3e" . $this->first_tag_close; } if ($this->prev_link !== FALSE && $this->cur_page !== 1) { $i = $this->use_page_numbers ? $uri_page_number - 1 : $uri_page_number - $this->per_page; $attributes = sprintf("\x25\x73\x20\x25\x73\75\42\45\144\x22", $this->_attributes, $this->data_page_attr, $this->cur_page - 1); if ($i === $base_page) { $output .= $this->prev_tag_open . "\74\x61\40\150\x72\x65\x66\75\x22" . $first_url . "\42" . $attributes . $this->_attr_rel("\x70\x72\x65\x76") . "\x3e" . $this->prev_link . "\74\x2f\141\x3e" . $this->prev_tag_close; } else { $append = $this->prefix . $i . $this->suffix; $output .= $this->prev_tag_open . "\x3c\141\x20\150\x72\x65\x66\x3d\x22" . $base_url . $append . "\x22" . $attributes . $this->_attr_rel("\160\x72\x65\166") . "\76" . $this->prev_link . "\74\57\x61\x3e" . $this->prev_tag_close; } } if ($this->display_pages !== FALSE) { for ($loop = $start - 1; $loop <= $end; $loop++) { $i = $this->use_page_numbers ? $loop : $loop * $this->per_page - $this->per_page; $attributes = sprintf("\45\163\x20\x25\x73\75\42\45\144\42", $this->_attributes, $this->data_page_attr, $loop); if ($i >= $base_page) { if ($this->cur_page === $loop) { $output .= $this->cur_tag_open . $loop . $this->cur_tag_close; } elseif ($i === $base_page) { $output .= $this->num_tag_open . "\x3c\x61\40\x68\x72\145\146\x3d\42" . $first_url . "\42" . $attributes . $this->_attr_rel("\163\164\141\x72\x74") . "\76" . $loop . "\x3c\57\x61\x3e" . $this->num_tag_close; } else { $append = $this->prefix . $i . $this->suffix; $output .= $this->num_tag_open . "\x3c\x61\x20\x68\x72\x65\x66\75\x22" . $base_url . $append . "\42" . $attributes . "\x3e" . $loop . "\74\57\141\76" . $this->num_tag_close; } } } } if ($this->next_link !== FALSE && $this->cur_page < $num_pages) { $i = $this->use_page_numbers ? $this->cur_page + 1 : $this->cur_page * $this->per_page; $attributes = sprintf("\x25\163\40\x25\x73\x3d\x22\45\144\42", $this->_attributes, $this->data_page_attr, $this->cur_page + 1); $output .= $this->next_tag_open . "\74\141\40\x68\162\x65\x66\75\x22" . $base_url . $this->prefix . $i . $this->suffix . "\x22" . $attributes . $this->_attr_rel("\x6e\x65\x78\x74") . "\x3e" . $this->next_link . "\74\x2f\x61\76" . $this->next_tag_close; } if ($this->last_link !== FALSE && $this->cur_page + $this->num_links + !$this->num_links < $num_pages) { $i = $this->use_page_numbers ? $num_pages : $num_pages * $this->per_page - $this->per_page; $attributes = sprintf("\x25\x73\x20\x25\x73\x3d\x22\45\144\42", $this->_attributes, $this->data_page_attr, $num_pages); $output .= $this->last_tag_open . "\x3c\x61\x20\150\162\145\146\x3d\x22" . $base_url . $this->prefix . $i . $this->suffix . "\x22" . $attributes . "\76" . $this->last_link . "\x3c\x2f\141\76" . $this->last_tag_close; } $output = preg_replace("\x23\50\x5b\x5e\72\42\135\x29\57\57\53\43", "\134\61\x2f", $output); return $this->full_tag_open . $output . $this->full_tag_close; } protected function _parse_attributes($attributes) { isset($attributes["\162\x65\154"]) or $attributes["\162\x65\154"] = TRUE; $this->_link_types = $attributes["\x72\x65\x6c"] ? array("\x73\x74\141\x72\164" => "\x73\x74\141\162\x74", "\160\162\145\x76" => "\160\x72\x65\166", "\x6e\x65\170\x74" => "\x6e\x65\170\164") : array(); unset($attributes["\x72\145\154"]); $this->_attributes = ''; foreach ($attributes as $key => $value) { $this->_attributes .= "\x20" . $key . "\x3d\x22" . $value . "\x22"; } } protected function _attr_rel($type) { if (isset($this->_link_types[$type])) { unset($this->_link_types[$type]); return "\40\162\145\x6c\x3d\42" . $type . "\42"; } return ''; } }

Function Calls

None

Variables

None

Stats

MD5 e362e456b89cf312b7d05ba4b7a2ae00
Eval Count 0
Decode Time 109 ms