summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/core/Config.php1
-rw-r--r--system/core/Input.php85
-rw-r--r--system/database/drivers/mssql/mssql_driver.php2
-rw-r--r--system/libraries/Calendar.php12
-rw-r--r--system/libraries/Email.php2
-rw-r--r--system/libraries/Form_validation.php7
-rw-r--r--system/libraries/Javascript.php1
-rw-r--r--system/libraries/Pagination.php4
-rw-r--r--system/libraries/Table.php72
9 files changed, 78 insertions, 108 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index a0e830abe..93c950e2e 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -332,6 +332,7 @@ class CI_Config {
/**
* System URL
*
+ * @deprecated 3.0.0 Encourages insecure practices
* @return string
*/
public function system_url()
diff --git a/system/core/Input.php b/system/core/Input.php
index ccb70daec..35ce5f12f 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -152,8 +152,20 @@ class CI_Input {
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/
- protected function _fetch_from_array(&$array, $index = '', $xss_clean = NULL)
+ protected function _fetch_from_array(&$array, $index = NULL, $xss_clean = NULL)
{
+ // If $index is NULL, it means that the whole $array is requested
+ if ($index === NULL)
+ {
+ $output = array();
+ foreach (array_keys($array) as $key)
+ {
+ $output[$key] = $this->_fetch_from_array($array, $key, $xss_clean);
+ }
+
+ return $output;
+ }
+
is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
if (isset($array[$index]))
@@ -202,26 +214,6 @@ class CI_Input {
*/
public function get($index = NULL, $xss_clean = NULL)
{
- is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
-
- // Check if a field has been provided
- if ($index === NULL)
- {
- if (empty($_GET))
- {
- return array();
- }
-
- $get = array();
-
- // loop through the full _GET array
- foreach (array_keys($_GET) as $key)
- {
- $get[$key] = $this->_fetch_from_array($_GET, $key, $xss_clean);
- }
- return $get;
- }
-
return $this->_fetch_from_array($_GET, $index, $xss_clean);
}
@@ -236,26 +228,6 @@ class CI_Input {
*/
public function post($index = NULL, $xss_clean = NULL)
{
- is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
-
- // Check if a field has been provided
- if ($index === NULL)
- {
- if (empty($_POST))
- {
- return array();
- }
-
- $post = array();
-
- // Loop through the full _POST array and return it
- foreach (array_keys($_POST) as $key)
- {
- $post[$key] = $this->_fetch_from_array($_POST, $key, $xss_clean);
- }
- return $post;
- }
-
return $this->_fetch_from_array($_POST, $index, $xss_clean);
}
@@ -268,10 +240,8 @@ class CI_Input {
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/
- public function post_get($index = '', $xss_clean = NULL)
+ public function post_get($index, $xss_clean = NULL)
{
- is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
-
return isset($_POST[$index])
? $this->post($index, $xss_clean)
: $this->get($index, $xss_clean);
@@ -286,10 +256,8 @@ class CI_Input {
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/
- public function get_post($index = '', $xss_clean = NULL)
+ public function get_post($index, $xss_clean = NULL)
{
- is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
-
return isset($_GET[$index])
? $this->get($index, $xss_clean)
: $this->post($index, $xss_clean);
@@ -304,10 +272,8 @@ class CI_Input {
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/
- public function cookie($index = '', $xss_clean = NULL)
+ public function cookie($index = NULL, $xss_clean = NULL)
{
- is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
-
return $this->_fetch_from_array($_COOKIE, $index, $xss_clean);
}
@@ -320,10 +286,8 @@ class CI_Input {
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/
- public function server($index = '', $xss_clean = NULL)
+ public function server($index, $xss_clean = NULL)
{
- is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
-
return $this->_fetch_from_array($_SERVER, $index, $xss_clean);
}
@@ -338,23 +302,14 @@ class CI_Input {
* @param bool $xss_clean Whether to apply XSS filtering
* @return mixed
*/
- public function input_stream($index = '', $xss_clean = NULL)
+ public function input_stream($index = NULL, $xss_clean = NULL)
{
- is_bool($xss_clean) OR $xss_clean = $this->_enable_xss;
-
// The input stream can only be read once, so we'll need to check
// if we have already done that first.
- if (is_array($this->_input_stream))
- {
- return $this->_fetch_from_array($this->_input_stream, $index, $xss_clean);
- }
-
- // Parse the input stream in our cache var
- parse_str(file_get_contents('php://input'), $this->_input_stream);
if ( ! is_array($this->_input_stream))
{
- $this->_input_stream = array();
- return NULL;
+ parse_str(file_get_contents('php://input'), $this->_input_stream);
+ is_array($this->_input_stream) OR $this->_input_stream = array();
}
return $this->_fetch_from_array($this->_input_stream, $index, $xss_clean);
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index 0836fa802..49711fec9 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -311,7 +311,7 @@ class CI_DB_mssql_driver extends CI_DB {
.' FROM '.$this->escape_identifiers('sysobjects')
.' WHERE '.$this->escape_identifiers('type')." = 'U'";
- if ($prefix_limit !== FALSE AND $this->dbprefix !== '')
+ if ($prefix_limit !== FALSE && $this->dbprefix !== '')
{
$sql .= ' AND '.$this->escape_identifiers('name')." LIKE '".$this->escape_like_str($this->dbprefix)."%' "
.sprintf($this->_like_escape_str, $this->_like_escape_chr);
diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php
index 711d23bec..610b427cf 100644
--- a/system/libraries/Calendar.php
+++ b/system/libraries/Calendar.php
@@ -139,7 +139,7 @@ class CI_Calendar {
* Accepts an associative array as input, containing display preferences
*
* @param array config preferences
- * @return void
+ * @return CI_Calendar
*/
public function initialize($config = array())
{
@@ -156,6 +156,8 @@ class CI_Calendar {
{
$this->next_prev_url = $this->CI->config->site_url($this->CI->router->class.'/'.$this->CI->router->method);
}
+
+ return $this;
}
// --------------------------------------------------------------------
@@ -362,7 +364,7 @@ class CI_Calendar {
* Get Day Names
*
* Returns an array of day names (Sunday, Monday, etc.) based
- * on the type. Options: long, short, abrev
+ * on the type. Options: long, short, abr
*
* @param string
* @return array
@@ -513,7 +515,7 @@ class CI_Calendar {
* Harvests the data within the template {pseudo-variables}
* used to display the calendar
*
- * @return void
+ * @return CI_Calendar
*/
public function parse_template()
{
@@ -521,7 +523,7 @@ class CI_Calendar {
if ($this->template === '')
{
- return;
+ return $this;
}
$today = array('cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today');
@@ -537,6 +539,8 @@ class CI_Calendar {
$this->temp[$val] = $this->temp[substr($val, 0, -6)];
}
}
+
+ return $this;
}
}
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index f4efff882..88925e03f 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -822,7 +822,7 @@ class CI_Email {
* @param string
* @return CI_Email
*/
- public function set_alt_message($str = '')
+ public function set_alt_message($str)
{
$this->alt_message = (string) $str;
return $this;
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 58485916c..7c441409f 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -252,7 +252,7 @@ class CI_Form_validation {
* each array due to the limitations of CI's singleton
*
* @param array $data
- * @return void
+ * @return CI_Form_validation
*/
public function set_data(array $data)
{
@@ -260,6 +260,8 @@ class CI_Form_validation {
{
$this->validation_data = $data;
}
+
+ return $this;
}
// --------------------------------------------------------------------
@@ -1536,7 +1538,7 @@ class CI_Form_validation {
* Prevents subsequent validation routines from being affected by the
* results of any previous validation routine due to the CI singleton.
*
- * @return void
+ * @return CI_Form_validation
*/
public function reset_validation()
{
@@ -1545,6 +1547,7 @@ class CI_Form_validation {
$this->_error_array = array();
$this->_error_messages = array();
$this->error_string = '';
+ return $this;
}
}
diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php
index 26a16850c..34a216c22 100644
--- a/system/libraries/Javascript.php
+++ b/system/libraries/Javascript.php
@@ -34,6 +34,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @category Javascript
* @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/javascript.html
+ * @deprecated 3.0.0 This was never a good idea in the first place.
*/
class CI_Javascript {
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index c6ffd03d4..f67cb47f8 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -314,7 +314,7 @@ class CI_Pagination {
* Initialize Preferences
*
* @param array $params Initialization parameters
- * @return void
+ * @return CI_Pagination
*/
public function initialize($params = array())
{
@@ -342,6 +342,8 @@ class CI_Pagination {
}
}
}
+
+ return $this;
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Table.php b/system/libraries/Table.php
index b77fcf19d..1d4320855 100644
--- a/system/libraries/Table.php
+++ b/system/libraries/Table.php
@@ -117,7 +117,7 @@ class CI_Table {
/**
* Set the template
*
- * @param array
+ * @param array $template
* @return bool
*/
public function set_template($template)
@@ -139,12 +139,13 @@ class CI_Table {
* Can be passed as an array or discreet params
*
* @param mixed
- * @return void
+ * @return CI_Table
*/
public function set_heading($args = array())
{
$args = func_get_args();
$this->heading = $this->_prep_args($args);
+ return $this;
}
// --------------------------------------------------------------------
@@ -155,9 +156,9 @@ class CI_Table {
* columns. This allows a single array with many elements to be
* displayed in a table that has a fixed column count.
*
- * @param array
- * @param int
- * @return void
+ * @param array $array
+ * @param int $col_limit
+ * @return array
*/
public function make_columns($array = array(), $col_limit = 0)
{
@@ -202,12 +203,13 @@ class CI_Table {
*
* Can be passed as an array or discreet params
*
- * @param mixed
- * @return void
+ * @param mixed $value
+ * @return CI_Table
*/
public function set_empty($value)
{
$this->empty_cells = $value;
+ return $this;
}
// --------------------------------------------------------------------
@@ -218,12 +220,13 @@ class CI_Table {
* Can be passed as an array or discreet params
*
* @param mixed
- * @return void
+ * @return CI_Table
*/
public function add_row($args = array())
{
$args = func_get_args();
$this->rows[] = $this->_prep_args($args);
+ return $this;
}
// --------------------------------------------------------------------
@@ -271,8 +274,8 @@ class CI_Table {
/**
* Add a table caption
*
- * @param string
- * @return void
+ * @param string $caption
+ * @return CI_Table
*/
public function set_caption($caption)
{
@@ -284,7 +287,7 @@ class CI_Table {
/**
* Generate the table
*
- * @param mixed
+ * @param mixed $table_data
* @return string
*/
public function generate($table_data = NULL)
@@ -417,13 +420,14 @@ class CI_Table {
/**
* Clears the table arrays. Useful if multiple tables are being generated
*
- * @return void
+ * @return CI_Table
*/
public function clear()
{
- $this->rows = array();
- $this->heading = array();
- $this->auto_heading = TRUE;
+ $this->rows = array();
+ $this->heading = array();
+ $this->auto_heading = TRUE;
+ return $this;
}
// --------------------------------------------------------------------
@@ -528,31 +532,31 @@ class CI_Table {
protected function _default_template()
{
return array(
- 'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',
+ 'table_open' => '<table border="0" cellpadding="4" cellspacing="0">',
- 'thead_open' => '<thead>',
- 'thead_close' => '</thead>',
+ 'thead_open' => '<thead>',
+ 'thead_close' => '</thead>',
- 'heading_row_start' => '<tr>',
- 'heading_row_end' => '</tr>',
- 'heading_cell_start' => '<th>',
- 'heading_cell_end' => '</th>',
+ 'heading_row_start' => '<tr>',
+ 'heading_row_end' => '</tr>',
+ 'heading_cell_start' => '<th>',
+ 'heading_cell_end' => '</th>',
- 'tbody_open' => '<tbody>',
- 'tbody_close' => '</tbody>',
+ 'tbody_open' => '<tbody>',
+ 'tbody_close' => '</tbody>',
- 'row_start' => '<tr>',
- 'row_end' => '</tr>',
- 'cell_start' => '<td>',
- 'cell_end' => '</td>',
+ 'row_start' => '<tr>',
+ 'row_end' => '</tr>',
+ 'cell_start' => '<td>',
+ 'cell_end' => '</td>',
- 'row_alt_start' => '<tr>',
- 'row_alt_end' => '</tr>',
- 'cell_alt_start' => '<td>',
- 'cell_alt_end' => '</td>',
+ 'row_alt_start' => '<tr>',
+ 'row_alt_end' => '</tr>',
+ 'cell_alt_start' => '<td>',
+ 'cell_alt_end' => '</td>',
- 'table_close' => '</table>'
- );
+ 'table_close' => '</table>'
+ );
}
}