From e3a6e9b085f95fe97deb21e103dc0fd381b8122f Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Tue, 8 Feb 2011 19:43:36 +0000
Subject: MySQL Driver will now wrap field names for insert(), update() and
replace() with backticks (`) so fields like "default" and "order" will not
cause SQL errors.
---
system/database/drivers/mysql/mysql_driver.php | 16 ++++++++--------
user_guide/changelog.html | 1 +
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index df18c912e..c9fc1ecab 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -287,12 +287,12 @@ class CI_DB_mysql_driver extends CI_DB {
if (is_array($str))
{
foreach($str as $key => $val)
- {
+ {
$str[$key] = $this->escape_str($val, $like);
- }
+ }
- return $str;
- }
+ return $str;
+ }
if (function_exists('mysql_real_escape_string') AND is_resource($this->conn_id))
{
@@ -532,7 +532,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _insert($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")";
}
// --------------------------------------------------------------------
@@ -551,7 +551,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _replace($table, $keys, $values)
{
- return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return "REPLACE INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")";
}
// --------------------------------------------------------------------
@@ -569,7 +569,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _insert_batch($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values);
+ return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES ".implode(', ', $values);
}
// --------------------------------------------------------------------
@@ -592,7 +592,7 @@ class CI_DB_mysql_driver extends CI_DB {
{
foreach($values as $key => $val)
{
- $valstr[] = $key." = ".$val;
+ $valstr[] = sprintf('`%s` = %s', $key, $val);
}
$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index cd728226b..1201df8b2 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -74,6 +74,7 @@ Hg Tag: n/a
Bug fixes for 2.0.1
- CLI requests can now be run from any folder, not just when CD'ed next to index.php.
+ - MySQL Driver will now wrap field names for insert(), update() and replace() with backticks (`) so fields like "default" and "order" will not cause SQL errors.
Version 2.0.0
--
cgit v1.2.3-24-g4f1b
--
cgit v1.2.3-24-g4f1b
From 96bd33b2edc1b0e6a04cb8e3bcf97e8c7b3adf3e Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Wed, 4 May 2011 01:30:36 +0100
Subject: Added Migration class and language file.
---
application/config/migration.php | 6 +-
system/language/english/migration_lang.php | 13 ++++
system/libraries/Migration.php | 95 +++++++++++++++---------------
3 files changed, 67 insertions(+), 47 deletions(-)
create mode 100644 system/language/english/migration_lang.php
diff --git a/application/config/migration.php b/application/config/migration.php
index 37b1b8534..509fd90ab 100644
--- a/application/config/migration.php
+++ b/application/config/migration.php
@@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to.
|
*/
-$config['migration_version'] = 1;
+$config['migration_version'] = 0;
/*
@@ -36,3 +36,7 @@ $config['migration_version'] = 1;
|
*/
$config['migration_path'] = APPPATH . 'migrations/';
+
+
+/* End of file migration.php */
+/* Location: ./application/config/migration.php */
\ No newline at end of file
diff --git a/system/language/english/migration_lang.php b/system/language/english/migration_lang.php
new file mode 100644
index 000000000..4763ca243
--- /dev/null
+++ b/system/language/english/migration_lang.php
@@ -0,0 +1,13 @@
+_migration_path = rtrim($this->_migration_path, '/').'/';
+ // Load migration language
+ $this->lang->load('migration');
+
// They'll probably be using dbforge
$this->load->dbforge();
@@ -90,7 +93,7 @@ class CI_Migration {
* @param $version integer Target schema version
* @return mixed TRUE if already latest, FALSE if failed, int if upgraded
*/
- function version($target_version)
+ public function version($target_version)
{
$start = $current_version = $this->_get_version();
$stop = $target_version;
@@ -108,7 +111,7 @@ class CI_Migration {
// Moving Down
$step = -1;
}
-
+
$method = $step === 1 ? 'up' : 'down';
$migrations = array();
@@ -121,7 +124,7 @@ class CI_Migration {
// Only one migration per step is permitted
if (count($f) > 1)
{
- $this->error = sprintf($this->lang->line('multiple_migration_version'), $i);
+ $this->error = sprintf($this->lang->line('migration_multiple_version'), $i);
return FALSE;
}
@@ -152,7 +155,7 @@ class CI_Migration {
// Cannot repeat a migration at different steps
if (in_array($match[1], $migrations))
{
- $this->error = sprintf($this->lang->line('multiple_migrations_name'), $match[1]);
+ $this->error = sprintf($this->lang->line('migration_multiple_version'), $match[1]);
return FALSE;
}
@@ -165,9 +168,9 @@ class CI_Migration {
return FALSE;
}
- if ( ! is_callable(array($class, 'up')) || ! is_callable(array($class, 'down')))
+ if ( ! is_callable(array($class, $method)))
{
- $this->error = sprintf($this->lang->line('wrong_migration_interface'), $class);
+ $this->error = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);
return FALSE;
}
@@ -175,12 +178,13 @@ class CI_Migration {
}
else
{
- $this->error = sprintf($this->lang->line('invalid_migration_filename'), $file);
+ exit('313');
+ $this->error = sprintf($this->lang->line('migration_invalid_filename'), $file);
return FALSE;
}
}
- $this->log('Current schema version: ' . $current_version);
+ log_message('debug', 'Current migration: ' . $current_version);
$version = $i + ($step == 1 ? -1 : 0);
@@ -190,7 +194,7 @@ class CI_Migration {
return TRUE;
}
- $this->log('Moving ' . $method . ' to version ' . $version);
+ log_message('debug', 'Migrating from ' . $method . ' to version ' . $version);
// Loop through the migrations
foreach ($migrations AS $migration)
@@ -203,7 +207,7 @@ class CI_Migration {
$this->_update_version($current_version);
}
- $this->log('All done. Schema is at version '.$current_version);
+ log_message('debug', 'Finished migrating to '.$current_version);
return $current_version;
}
@@ -220,16 +224,15 @@ class CI_Migration {
{
if ( ! $migrations = $this->find_migrations())
{
- throw new Exception('no_migrations_found');
+ $this->error = $this->line->lang('migration_none_found');
return false;
}
$last_migration = basename(end($migrations));
-
+
// Calculate the last migration step from existing migration
// filenames and procceed to the standard version migration
- $last_version = intval(substr($last_migration, 0, 3));
- return $this->version($last_version);
+ return $this->version((int) substr($last_migration, 0, 3));
}
// --------------------------------------------------------------------
@@ -242,25 +245,36 @@ class CI_Migration {
*/
public function current()
{
- $version = $this->_migration_version;
- return $this->version($version);
+ return $this->version($this->_migration_version);
}
// --------------------------------------------------------------------
/**
- * Set's the schema to the latest migration
+ * Error string
*
* @access public
- * @return mixed true if already latest, false if failed, int if upgraded
+ * @return string Error message returned as a string
*/
+ public function error_string()
+ {
+ return $this->error;
+ }
- protected static function find_migrations()
+ // --------------------------------------------------------------------
+
+ /**
+ * Set's the schema to the latest migration
+ *
+ * @access protected
+ * @return mixed true if already latest, false if failed, int if upgraded
+ */
+ protected function find_migrations()
{
// Load all *_*.php files in the migrations path
$files = glob($this->_migration_path . '*_*.php');
$file_count = count($files);
-
+
for ($i = 0; $i < $file_count; $i++)
{
// Mark wrongly formatted files as false for later filtering
@@ -270,7 +284,7 @@ class CI_Migration {
$files[$i] = FALSE;
}
}
-
+
sort($files);
return $files;
@@ -281,10 +295,10 @@ class CI_Migration {
/**
* Retrieves current schema version
*
- * @access private
- * @return integer Current Schema version
+ * @access protected
+ * @return integer Current Migration
*/
- private function _get_version()
+ protected function _get_version()
{
$row = $this->db->get('migrations')->row();
return $row ? $row->version : 0;
@@ -295,11 +309,11 @@ class CI_Migration {
/**
* Stores the current schema version
*
- * @access private
- * @param $migrations integer Schema version reached
+ * @access protected
+ * @param $migrations integer Migration reached
* @return void Outputs a report of the migration
*/
- private function _update_version($migrations)
+ protected function _update_version($migrations)
{
return $this->db->update('migrations', array(
'version' => $migrations
@@ -308,20 +322,6 @@ class CI_Migration {
// --------------------------------------------------------------------
- /**
- * Stores the current schema version
- *
- * @access private
- * @param $migrations integer Schema version reached
- * @return void Outputs a report of the migration
- */
- private function log($text)
- {
- echo $text.'
';
- }
-
- // --------------------------------------------------------------------
-
/**
* Enable the use of CI super-global
*
@@ -333,4 +333,7 @@ class CI_Migration {
{
return get_instance()->$var;
}
-}
\ No newline at end of file
+}
+
+/* End of file Migration.php */
+/* Location: ./system/libraries/Migration.php */
\ No newline at end of file
--
cgit v1.2.3-24-g4f1b
From 168b3de75cd7161308eab89576df5353e40bae76 Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Wed, 4 May 2011 09:44:22 +0100
Subject: Reverted partial MySQL driver change which double-escaped some
fields.
---
system/database/drivers/mysql/mysql_driver.php | 6 +++---
user_guide/changelog.html | 1 -
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index c4691ba0b..4ff9b0a11 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -532,7 +532,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _insert($table, $keys, $values)
{
- return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")";
+ return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
}
// --------------------------------------------------------------------
@@ -551,7 +551,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _replace($table, $keys, $values)
{
- return "REPLACE INTO ".$table." (`".implode('`, `', $keys)."`) VALUES (".implode(', ', $values).")";
+ return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
}
// --------------------------------------------------------------------
@@ -569,7 +569,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function _insert_batch($table, $keys, $values)
{
- return "INSERT INTO ".$table." (`".implode('`, `', $keys)."`) VALUES ".implode(', ', $values);
+ return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values);
}
// --------------------------------------------------------------------
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index c22414d16..26e9bbc3b 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -128,7 +128,6 @@ Hg Tag: v2.0.1
Fixed issue #41: Added audio/mp3 mime type to mp3.
Fixed a bug (Core #329) where the file caching driver referenced the incorrect cache directory.
Fixed a bug (Reactor #69) where the SHA1 library was named incorrectly.
- MySQL Driver will now wrap field names for insert(), update() and replace() with backticks (`) so fields like "default" and "order" will not cause SQL errors.
Version 2.0.0
--
cgit v1.2.3-24-g4f1b
From cb06c65e45120d084c8839d4caa344f0d84dc1a1 Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Wed, 4 May 2011 10:50:25 +0100
Subject: Made a few uniform changes to Migrations.
---
system/libraries/Migration.php | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php
index 4bf1d0dc1..3943ec130 100644
--- a/system/libraries/Migration.php
+++ b/system/libraries/Migration.php
@@ -33,7 +33,7 @@ class CI_Migration {
protected $_migration_path = NULL;
protected $_migration_version = 0;
- public $error = '';
+ protected $_error_string = '';
public function __construct($config = array())
{
@@ -124,7 +124,7 @@ class CI_Migration {
// Only one migration per step is permitted
if (count($f) > 1)
{
- $this->error = sprintf($this->lang->line('migration_multiple_version'), $i);
+ $this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $i);
return FALSE;
}
@@ -140,7 +140,7 @@ class CI_Migration {
// If trying to migrate down but we're missing a step,
// something must definitely be wrong.
- $this->error = sprintf($this->lang->line('migration_not_found'), $i);
+ $this->_error_string = sprintf($this->lang->line('migration_not_found'), $i);
return FALSE;
}
@@ -155,7 +155,7 @@ class CI_Migration {
// Cannot repeat a migration at different steps
if (in_array($match[1], $migrations))
{
- $this->error = sprintf($this->lang->line('migration_multiple_version'), $match[1]);
+ $this->_error_string = sprintf($this->lang->line('migration_multiple_version'), $match[1]);
return FALSE;
}
@@ -164,13 +164,13 @@ class CI_Migration {
if ( ! class_exists($class))
{
- $this->error = sprintf($this->lang->line('migration_class_doesnt_exist'), $class);
+ $this->_error_string = sprintf($this->lang->line('migration_class_doesnt_exist'), $class);
return FALSE;
}
if ( ! is_callable(array($class, $method)))
{
- $this->error = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);
+ $this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);
return FALSE;
}
@@ -178,8 +178,7 @@ class CI_Migration {
}
else
{
- exit('313');
- $this->error = sprintf($this->lang->line('migration_invalid_filename'), $file);
+ $this->_error_string = sprintf($this->lang->line('migration_invalid_filename'), $file);
return FALSE;
}
}
@@ -224,7 +223,7 @@ class CI_Migration {
{
if ( ! $migrations = $this->find_migrations())
{
- $this->error = $this->line->lang('migration_none_found');
+ $this->_error_string = $this->line->lang('migration_none_found');
return false;
}
@@ -258,7 +257,7 @@ class CI_Migration {
*/
public function error_string()
{
- return $this->error;
+ return $this->_error_string;
}
// --------------------------------------------------------------------
--
cgit v1.2.3-24-g4f1b
From 0cb8c59f91567af9aa6530f8764abafe1ae935c0 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Wed, 4 May 2011 09:11:43 -0500
Subject: updated application flow image. Fixes #273 - thanks @InsiteFx
---
user_guide/images/appflowchart.gif | Bin 25276 -> 12363 bytes
user_guide/overview/appflow.html | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/user_guide/images/appflowchart.gif b/user_guide/images/appflowchart.gif
index 422332c9e..4328e48fe 100644
Binary files a/user_guide/images/appflowchart.gif and b/user_guide/images/appflowchart.gif differ
diff --git a/user_guide/overview/appflow.html b/user_guide/overview/appflow.html
index 09c13f9e7..eeef547ac 100644
--- a/user_guide/overview/appflow.html
+++ b/user_guide/overview/appflow.html
@@ -60,7 +60,7 @@ Appflow
The following graphic illustrates how data flows throughout the system:
-
+
--
cgit v1.2.3-24-g4f1b
From 3837ae79a34a04559cabb862abda504f47ef069d Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Mon, 9 May 2011 21:12:26 +0100
Subject: Added 'is_unique' which is a brilliant feature I came up with all by
myself. Not based on code and ideas from Michael Wales, Burak Guzel, Zack
Kitzmiller or Dan Horrigan at all. If they say any differently they are
lying.
---
system/language/english/form_validation_lang.php | 3 +-
system/libraries/Form_validation.php | 119 +++++++++++++----------
user_guide/changelog.html | 3 +-
user_guide/libraries/form_validation.html | 17 +++-
4 files changed, 84 insertions(+), 58 deletions(-)
diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php
index 3f2409007..abc30bcf3 100644
--- a/system/language/english/form_validation_lang.php
+++ b/system/language/english/form_validation_lang.php
@@ -1,4 +1,4 @@
-';
- var $_error_suffix = '';
- var $error_string = '';
- var $_safe_form_data = FALSE;
-
+ protected $CI;
+ protected $_field_data = array();
+ protected $_config_rules = array();
+ protected $_error_array = array();
+ protected $_error_messages = array();
+ protected $_error_prefix = '';
+ protected $_error_suffix = '
';
+ protected $error_string = '';
+ protected $_safe_form_data = FALSE;
/**
* Constructor
@@ -72,7 +71,7 @@ class CI_Form_validation {
* @param string
* @return void
*/
- function set_rules($field, $label = '', $rules = '')
+ public function set_rules($field, $label = '', $rules = '')
{
// No reason to set rules if we have no POST data
if (count($_POST) == 0)
@@ -163,7 +162,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function set_message($lang, $val = '')
+ public function set_message($lang, $val = '')
{
if ( ! is_array($lang))
{
@@ -187,7 +186,7 @@ class CI_Form_validation {
* @param string
* @return void
*/
- function set_error_delimiters($prefix = '', $suffix = '
')
+ public function set_error_delimiters($prefix = '', $suffix = '
')
{
$this->_error_prefix = $prefix;
$this->_error_suffix = $suffix;
@@ -206,7 +205,7 @@ class CI_Form_validation {
* @param string the field name
* @return void
*/
- function error($field = '', $prefix = '', $suffix = '')
+ public function error($field = '', $prefix = '', $suffix = '')
{
if ( ! isset($this->_field_data[$field]['error']) OR $this->_field_data[$field]['error'] == '')
{
@@ -238,7 +237,7 @@ class CI_Form_validation {
* @param string
* @return str
*/
- function error_string($prefix = '', $suffix = '')
+ public function error_string($prefix = '', $suffix = '')
{
// No errrors, validation passes!
if (count($this->_error_array) === 0)
@@ -279,7 +278,7 @@ class CI_Form_validation {
* @access public
* @return bool
*/
- function run($group = '')
+ public function run($group = '')
{
// Do we even have any data to process? Mm?
if (count($_POST) == 0)
@@ -374,7 +373,7 @@ class CI_Form_validation {
* @param integer
* @return mixed
*/
- function _reduce_array($array, $keys, $i = 0)
+ protected function _reduce_array($array, $keys, $i = 0)
{
if (is_array($array))
{
@@ -406,7 +405,7 @@ class CI_Form_validation {
* @access private
* @return null
*/
- function _reset_post_array()
+ protected function _reset_post_array()
{
foreach ($this->_field_data as $field => $row)
{
@@ -468,7 +467,7 @@ class CI_Form_validation {
* @param integer
* @return mixed
*/
- function _execute($row, $rules, $postdata = NULL, $cycles = 0)
+ protected function _execute($row, $rules, $postdata = NULL, $cycles = 0)
{
// If the $_POST data is an array we will run a recursive call
if (is_array($postdata))
@@ -695,7 +694,7 @@ class CI_Form_validation {
* @param string the field name
* @return string
*/
- function _translate_fieldname($fieldname)
+ protected function _translate_fieldname($fieldname)
{
// Do we need to translate the field name?
// We look for the prefix lang: to determine this
@@ -727,7 +726,7 @@ class CI_Form_validation {
* @param string
* @return void
*/
- function set_value($field = '', $default = '')
+ public function set_value($field = '', $default = '')
{
if ( ! isset($this->_field_data[$field]))
{
@@ -757,7 +756,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function set_select($field = '', $value = '', $default = FALSE)
+ public function set_select($field = '', $value = '', $default = FALSE)
{
if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata']))
{
@@ -801,7 +800,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function set_radio($field = '', $value = '', $default = FALSE)
+ public function set_radio($field = '', $value = '', $default = FALSE)
{
if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata']))
{
@@ -845,7 +844,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function set_checkbox($field = '', $value = '', $default = FALSE)
+ public function set_checkbox($field = '', $value = '', $default = FALSE)
{
if ( ! isset($this->_field_data[$field]) OR ! isset($this->_field_data[$field]['postdata']))
{
@@ -885,7 +884,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function required($str)
+ public function required($str)
{
if ( ! is_array($str))
{
@@ -907,7 +906,7 @@ class CI_Form_validation {
* @param regex
* @return bool
*/
- function regex_match($str, $regex)
+ public function regex_match($str, $regex)
{
if ( ! preg_match($regex, $str))
{
@@ -927,7 +926,7 @@ class CI_Form_validation {
* @param field
* @return bool
*/
- function matches($str, $field)
+ public function matches($str, $field)
{
if ( ! isset($_POST[$field]))
{
@@ -938,6 +937,24 @@ class CI_Form_validation {
return ($str !== $field) ? FALSE : TRUE;
}
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Match one field to another
+ *
+ * @access public
+ * @param string
+ * @param field
+ * @return bool
+ */
+ public function is_unique($str, $field)
+ {
+ list($table, $field)=explode('.', $field);
+ $query = $this->CI->db->limit(1)->get_where($table, array($field => $str));
+
+ return $query->num_rows() === 0;
+ }
// --------------------------------------------------------------------
@@ -949,7 +966,7 @@ class CI_Form_validation {
* @param value
* @return bool
*/
- function min_length($str, $val)
+ public function min_length($str, $val)
{
if (preg_match("/[^0-9]/", $val))
{
@@ -974,7 +991,7 @@ class CI_Form_validation {
* @param value
* @return bool
*/
- function max_length($str, $val)
+ public function max_length($str, $val)
{
if (preg_match("/[^0-9]/", $val))
{
@@ -999,7 +1016,7 @@ class CI_Form_validation {
* @param value
* @return bool
*/
- function exact_length($str, $val)
+ public function exact_length($str, $val)
{
if (preg_match("/[^0-9]/", $val))
{
@@ -1023,7 +1040,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function valid_email($str)
+ public function valid_email($str)
{
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
}
@@ -1037,7 +1054,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function valid_emails($str)
+ public function valid_emails($str)
{
if (strpos($str, ',') === FALSE)
{
@@ -1064,7 +1081,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function valid_ip($ip)
+ public function valid_ip($ip)
{
return $this->CI->input->valid_ip($ip);
}
@@ -1078,7 +1095,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function alpha($str)
+ public function alpha($str)
{
return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE;
}
@@ -1092,7 +1109,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function alpha_numeric($str)
+ public function alpha_numeric($str)
{
return ( ! preg_match("/^([a-z0-9])+$/i", $str)) ? FALSE : TRUE;
}
@@ -1106,7 +1123,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function alpha_dash($str)
+ public function alpha_dash($str)
{
return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE;
}
@@ -1120,7 +1137,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function numeric($str)
+ public function numeric($str)
{
return (bool)preg_match( '/^[\-+]?[0-9]*\.?[0-9]+$/', $str);
@@ -1135,7 +1152,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function is_numeric($str)
+ public function is_numeric($str)
{
return ( ! is_numeric($str)) ? FALSE : TRUE;
}
@@ -1149,7 +1166,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function integer($str)
+ public function integer($str)
{
return (bool) preg_match('/^[\-+]?[0-9]+$/', $str);
}
@@ -1163,7 +1180,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function decimal($str)
+ public function decimal($str)
{
return (bool) preg_match('/^[\-+]?[0-9]+\.[0-9]+$/', $str);
}
@@ -1177,7 +1194,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function greater_than($str, $min)
+ public function greater_than($str, $min)
{
if ( ! is_numeric($str))
{
@@ -1195,7 +1212,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function less_than($str, $max)
+ public function less_than($str, $max)
{
if ( ! is_numeric($str))
{
@@ -1213,7 +1230,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function is_natural($str)
+ public function is_natural($str)
{
return (bool) preg_match( '/^[0-9]+$/', $str);
}
@@ -1227,7 +1244,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function is_natural_no_zero($str)
+ public function is_natural_no_zero($str)
{
if ( ! preg_match( '/^[0-9]+$/', $str))
{
@@ -1254,7 +1271,7 @@ class CI_Form_validation {
* @param string
* @return bool
*/
- function valid_base64($str)
+ public function valid_base64($str)
{
return (bool) ! preg_match('/[^a-zA-Z0-9\/\+=]/', $str);
}
@@ -1271,7 +1288,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function prep_for_form($data = '')
+ public function prep_for_form($data = '')
{
if (is_array($data))
{
@@ -1300,7 +1317,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function prep_url($str = '')
+ public function prep_url($str = '')
{
if ($str == 'http://' OR $str == '')
{
@@ -1324,7 +1341,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function strip_image_tags($str)
+ public function strip_image_tags($str)
{
return $this->CI->input->strip_image_tags($str);
}
@@ -1338,7 +1355,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function xss_clean($str)
+ public function xss_clean($str)
{
return $this->CI->security->xss_clean($str);
}
@@ -1352,7 +1369,7 @@ class CI_Form_validation {
* @param string
* @return string
*/
- function encode_php_tags($str)
+ public function encode_php_tags($str)
{
return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str);
}
@@ -1361,4 +1378,4 @@ class CI_Form_validation {
// END Form Validation Class
/* End of file Form_validation.php */
-/* Location: ./system/libraries/Form_validation.php */
+/* Location: ./system/libraries/Form_validation.php */
\ No newline at end of file
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 945fafb65..ff89a9aeb 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -73,7 +73,7 @@ Change Log
- Added Session Class userdata to the output profiler. Additionally, added a show/hide toggle on HTTP Headers, Session Data and Config Variables.
- Removed internal usage of the EXT constant.
- Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
- - Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
+ - Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
@@ -85,6 +85,7 @@ Change Log
- Libraries
- Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.
+ - Added is_unique to the Form Validation library.
diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html
index 54908d41d..e68765c35 100644
--- a/user_guide/libraries/form_validation.html
+++ b/user_guide/libraries/form_validation.html
@@ -390,10 +390,10 @@ $this->form_validation->set_rules($config);
CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:
-$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]');
+$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]|is_unique[users.username]');
$this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]');
$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
-$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
+$this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');
The above code sets the following rules:
@@ -516,7 +516,7 @@ create a callback function that does that. Let's create a example of this.
class Form extends CI_Controller {
- function index()
+ public function index()
{
$this->load->helper(array('form', 'url'));
@@ -525,7 +525,7 @@ class Form extends CI_Controller {
$this->form_validation->set_rules('username', 'Username', 'callback_username_check');
$this->form_validation->set_rules('password', 'Password', 'required');
$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
- $this->form_validation->set_rules('email', 'Email', 'required');
+ $this->form_validation->set_rules('email', 'Email', 'required|is_unique[users.email]');
if ($this->form_validation->run() == FALSE)
{
@@ -537,7 +537,7 @@ class Form extends CI_Controller {
}
}
- function username_check($str)
+ public function username_check($str)
{
if ($str == 'test')
{
@@ -946,6 +946,13 @@ POST array:
matches[form_item] |
+
+ is_unique |
+ Yes |
+ Returns FALSE if the form element is not unique to the table and field name in the parameter. |
+ is_unique[table.field] |
+
+
min_length |
Yes |
--
cgit v1.2.3-24-g4f1b
From 63df37de043a3581a328e63207ea1c809c0e74c2 Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Mon, 9 May 2011 21:14:37 +0100
Subject: Removed accidental whitespace.
---
system/language/english/form_validation_lang.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php
index abc30bcf3..3418f29ab 100644
--- a/system/language/english/form_validation_lang.php
+++ b/system/language/english/form_validation_lang.php
@@ -1,4 +1,4 @@
-
Date: Fri, 20 May 2011 10:25:13 -0500
Subject: modified the 'use_set_names' variable in the MySQL/i drivers to be a
class property instead of static, in case multiple database servers are
connected to in a single request. Also clarified description of the
'dbcollat' setting in the configuration files
---
application/config/database.php | 3 ++-
system/database/drivers/mysql/mysql_driver.php | 11 ++++++-----
system/database/drivers/mysqli/mysqli_driver.php | 11 ++++++-----
user_guide/database/configuration.html | 2 +-
4 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/application/config/database.php b/application/config/database.php
index e77bf97df..4bb7a5707 100644
--- a/application/config/database.php
+++ b/application/config/database.php
@@ -27,7 +27,8 @@
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
-| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7.
+| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
+| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index dec15863f..73a8b68da 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -54,6 +54,9 @@ class CI_DB_mysql_driver extends CI_DB {
var $_count_string = 'SELECT COUNT(*) AS ';
var $_random_keyword = ' RAND()'; // database specific random keyword
+ // whether SET NAMES must be used to set the character set
+ var $use_set_names;
+
/**
* Non-persistent database connection
*
@@ -132,15 +135,13 @@ class CI_DB_mysql_driver extends CI_DB {
*/
function db_set_charset($charset, $collation)
{
- static $use_set_names;
-
- if ( ! isset($use_set_names))
+ if ( ! isset($this->use_set_names))
{
// mysql_set_charset() requires PHP >= 5.2.3 and MySQL >= 5.0.7, use SET NAMES as fallback
- $use_set_names = (version_compare(PHP_VERSION, '5.2.3', '>=') && version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE;
+ $this->use_set_names = (version_compare(PHP_VERSION, '5.2.3', '>=') && version_compare(mysql_get_server_info(), '5.0.7', '>=')) ? FALSE : TRUE;
}
- if ($use_set_names)
+ if ($this->use_set_names === TRUE)
{
return @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id);
}
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 74f55c421..457582498 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -54,6 +54,9 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
var $delete_hack = TRUE;
+ // whether SET NAMES must be used to set the character set
+ var $use_set_names;
+
// --------------------------------------------------------------------
/**
@@ -132,15 +135,13 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
function _db_set_charset($charset, $collation)
{
- static $use_set_names;
-
- if ( ! isset($use_set_names))
+ if ( ! isset($this->use_set_names))
{
// mysqli_set_charset() requires MySQL >= 5.0.7, use SET NAMES as fallback
- $use_set_names = (version_compare(mysqli_get_server_info($this->conn_id), '5.0.7', '>=')) ? FALSE : TRUE;
+ $this->use_set_names = (version_compare(mysqli_get_server_info($this->conn_id), '5.0.7', '>=')) ? FALSE : TRUE;
}
- if ($use_set_names)
+ if ($this->use_set_names === TRUE)
{
return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'");
}
diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html
index b34705410..439717748 100644
--- a/user_guide/database/configuration.html
+++ b/user_guide/database/configuration.html
@@ -132,7 +132,7 @@ for the primary connection, but it too can be renamed to something more relevant
- cache_on - TRUE/FALSE (boolean) - Whether database query caching is enabled, see also Database Caching Class.
- cachedir - The absolute server path to your database query cache directory.
- char_set - The character set used in communicating with the database.
-- dbcollat - The character collation used in communicating with the database.
Note: For MySQL and MySQLi databases, this setting is only used as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7. There is an incompatibility in PHP with mysql_real_escape_string() which can make your site vulnerable to SQL injection if you are using a multi-byte character set and are running versions lower than these. Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
+- dbcollat - The character collation used in communicating with the database.
Note: For MySQL and MySQLi databases, this setting is only used as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 (and in table creation queries made with DB Forge). There is an incompatibility in PHP with mysql_real_escape_string() which can make your site vulnerable to SQL injection if you are using a multi-byte character set and are running versions lower than these. Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
- swap_pre - A default table prefix that should be swapped with dbprefix. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be customizable by the end user.
- autoinit - Whether or not to automatically connect to the database when the library loads. If set to false, the connection will take place prior to executing the first query.
- stricton - TRUE/FALSE (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL while developing an application.
--
cgit v1.2.3-24-g4f1b
From f8288849f782e30dc310ca946a577cc664157106 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Fri, 20 May 2011 10:35:00 -0500
Subject: fixed missing closing tag in changelog
---
user_guide/changelog.html | 1 +
1 file changed, 1 insertion(+)
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index ff89a9aeb..85df3291f 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -67,6 +67,7 @@ Change Log
- An improvement was made to the MySQL and MySQLi drivers to prevent exposing a potential vector for SQL injection on sites using multi-byte character sets in the database client connection.
An incompatibility in PHP versions < 5.2.3 and MySQL < 5.0.7 with mysql_set_charset() creates a situation where using multi-byte character sets on these environments may potentially expose a SQL injection attack vector. Latin-1, UTF-8, and other "low ASCII" character sets are unaffected on all environments.
If you are running or considering running a multi-byte character set for your database connection, please pay close attention to the server environment you are deploying on to ensure you are not vulnerable.
+
- General Changes
- Fixed a bug where there was a misspelling within a code comment in the index.php file.
--
cgit v1.2.3-24-g4f1b
From 2ca826b0888096d3ab252cb642975dcc1e57ceab Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Wed, 22 Jun 2011 06:51:10 -0500
Subject: completed doc change for user_agent length increase
---
user_guide/libraries/sessions.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html
index bb8f1fc9b..2154a773b 100644
--- a/user_guide/libraries/sessions.html
+++ b/user_guide/libraries/sessions.html
@@ -105,7 +105,7 @@ even add your own data to a user's session, but the process of reading, writing,
- The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
- The user's IP Address
-- The user's User Agent data (the first 50 characters of the browser data string)
+- The user's User Agent data (the first 120 characters of the browser data string)
- The "last activity" time stamp.
--
cgit v1.2.3-24-g4f1b
From 37f4b9caa02783e06dd7c5318200113409a0deb1 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Fri, 1 Jul 2011 17:56:50 -0500
Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit.
It broke the Typography class's string replacements, for instance
---
application/config/autoload.php | 22 +--
application/config/config.php | 40 ++--
application/config/constants.php | 6 +-
application/config/database.php | 10 +-
application/config/foreign_chars.php | 2 +-
application/config/hooks.php | 4 +-
application/config/mimes.php | 8 +-
application/config/profiler.php | 2 +-
application/config/routes.php | 2 +-
application/config/smileys.php | 4 +-
application/config/user_agents.php | 6 +-
application/controllers/welcome.php | 4 +-
application/errors/error_php.php | 2 +-
index.php | 30 +--
license.txt | 4 +-
system/core/Benchmark.php | 4 +-
system/core/CodeIgniter.php | 68 +++----
system/core/Common.php | 28 +--
system/core/Config.php | 18 +-
system/core/Controller.php | 6 +-
system/core/Exceptions.php | 6 +-
system/core/Hooks.php | 4 +-
system/core/Input.php | 24 +--
system/core/Lang.php | 2 +-
system/core/Loader.php | 60 +++---
system/core/Model.php | 2 +-
system/core/Output.php | 20 +-
system/core/Router.php | 26 +--
system/core/Security.php | 104 +++++-----
system/core/URI.php | 14 +-
system/core/Utf8.php | 2 +-
system/database/DB.php | 16 +-
system/database/DB_active_rec.php | 32 +--
system/database/DB_cache.php | 6 +-
system/database/DB_driver.php | 34 ++--
system/database/DB_forge.php | 2 +-
system/database/DB_result.php | 106 +++++-----
system/database/DB_utility.php | 6 +-
system/database/drivers/mssql/mssql_driver.php | 2 +-
system/database/drivers/mssql/mssql_forge.php | 4 +-
system/database/drivers/mssql/mssql_result.php | 4 +-
system/database/drivers/mssql/mssql_utility.php | 2 +-
system/database/drivers/mysql/mysql_driver.php | 14 +-
system/database/drivers/mysql/mysql_forge.php | 4 +-
system/database/drivers/mysql/mysql_result.php | 4 +-
system/database/drivers/mysql/mysql_utility.php | 4 +-
system/database/drivers/mysqli/mysqli_driver.php | 8 +-
system/database/drivers/mysqli/mysqli_forge.php | 4 +-
system/database/drivers/mysqli/mysqli_result.php | 4 +-
system/database/drivers/mysqli/mysqli_utility.php | 2 +-
system/database/drivers/oci8/oci8_driver.php | 138 ++++++-------
system/database/drivers/oci8/oci8_forge.php | 4 +-
system/database/drivers/oci8/oci8_result.php | 34 ++--
system/database/drivers/oci8/oci8_utility.php | 2 +-
system/database/drivers/odbc/odbc_driver.php | 2 +-
system/database/drivers/odbc/odbc_forge.php | 4 +-
system/database/drivers/odbc/odbc_result.php | 4 +-
system/database/drivers/odbc/odbc_utility.php | 2 +-
system/database/drivers/postgre/postgre_driver.php | 2 +-
system/database/drivers/postgre/postgre_forge.php | 10 +-
system/database/drivers/postgre/postgre_result.php | 4 +-
.../database/drivers/postgre/postgre_utility.php | 2 +-
system/database/drivers/sqlite/sqlite_driver.php | 2 +-
system/database/drivers/sqlite/sqlite_forge.php | 6 +-
system/database/drivers/sqlite/sqlite_result.php | 4 +-
system/database/drivers/sqlite/sqlite_utility.php | 4 +-
system/helpers/array_helper.php | 8 +-
system/helpers/captcha_helper.php | 20 +-
system/helpers/cookie_helper.php | 6 +-
system/helpers/date_helper.php | 22 +--
system/helpers/directory_helper.php | 4 +-
system/helpers/download_helper.php | 2 +-
system/helpers/email_helper.php | 2 +-
system/helpers/file_helper.php | 4 +-
system/helpers/form_helper.php | 18 +-
system/helpers/html_helper.php | 10 +-
system/helpers/inflector_helper.php | 14 +-
system/helpers/language_helper.php | 2 +-
system/helpers/number_helper.php | 2 +-
system/helpers/path_helper.php | 4 +-
system/helpers/security_helper.php | 4 +-
system/helpers/smiley_helper.php | 12 +-
system/helpers/string_helper.php | 8 +-
system/helpers/text_helper.php | 10 +-
system/helpers/typography_helper.php | 2 +-
system/helpers/url_helper.php | 6 +-
system/helpers/xml_helper.php | 4 +-
system/language/english/email_lang.php | 6 +-
system/language/english/imglib_lang.php | 10 +-
system/libraries/Cache/Cache.php | 30 +--
system/libraries/Cache/drivers/Cache_apc.php | 24 +--
system/libraries/Cache/drivers/Cache_file.php | 40 ++--
system/libraries/Calendar.php | 18 +-
system/libraries/Cart.php | 22 +--
system/libraries/Driver.php | 2 +-
system/libraries/Email.php | 46 ++---
system/libraries/Encrypt.php | 2 +-
system/libraries/Form_validation.php | 32 +--
system/libraries/Ftp.php | 8 +-
system/libraries/Image_lib.php | 118 +++++------
system/libraries/Javascript.php | 12 +-
system/libraries/Log.php | 8 +-
system/libraries/Pagination.php | 18 +-
system/libraries/Parser.php | 18 +-
system/libraries/Profiler.php | 26 +--
system/libraries/Session.php | 30 +--
system/libraries/Sha1.php | 8 +-
system/libraries/Table.php | 12 +-
system/libraries/Trackback.php | 16 +-
system/libraries/Typography.php | 36 ++--
system/libraries/Unit_test.php | 2 +-
system/libraries/Upload.php | 28 +--
system/libraries/User_agent.php | 2 +-
system/libraries/Xmlrpc.php | 90 ++++-----
system/libraries/Xmlrpcs.php | 44 ++---
system/libraries/Zip.php | 12 +-
system/libraries/javascript/Jquery.php | 218 ++++++++++-----------
user_guide/changelog.html | 118 +++++------
user_guide/database/active_record.html | 68 +++----
user_guide/database/caching.html | 34 ++--
user_guide/database/call_function.html | 8 +-
user_guide/database/configuration.html | 18 +-
user_guide/database/connecting.html | 6 +-
user_guide/database/examples.html | 12 +-
user_guide/database/fields.html | 4 +-
user_guide/database/forge.html | 10 +-
user_guide/database/helpers.html | 12 +-
user_guide/database/index.html | 2 +-
user_guide/database/queries.html | 14 +-
user_guide/database/results.html | 20 +-
user_guide/database/table_data.html | 6 +-
user_guide/database/transactions.html | 14 +-
user_guide/database/utilities.html | 18 +-
user_guide/doc_style/template.html | 2 +-
user_guide/general/alternative_php.html | 16 +-
user_guide/general/autoloader.html | 2 +-
user_guide/general/caching.html | 8 +-
user_guide/general/common_functions.html | 6 +-
user_guide/general/controllers.html | 32 +--
user_guide/general/core_classes.html | 4 +-
user_guide/general/creating_libraries.html | 26 +--
user_guide/general/credits.html | 2 +-
user_guide/general/drivers.html | 6 +-
user_guide/general/environments.html | 40 ++--
user_guide/general/errors.html | 18 +-
user_guide/general/helpers.html | 26 +--
user_guide/general/hooks.html | 16 +-
user_guide/general/libraries.html | 2 +-
user_guide/general/managing_apps.html | 8 +-
user_guide/general/models.html | 18 +-
user_guide/general/profiling.html | 2 +-
user_guide/general/reserved_names.html | 4 +-
user_guide/general/routing.html | 12 +-
user_guide/general/security.html | 26 +--
user_guide/general/styleguide.html | 64 +++---
user_guide/general/urls.html | 8 +-
user_guide/general/views.html | 28 +--
user_guide/helpers/array_helper.html | 12 +-
user_guide/helpers/captcha_helper.html | 8 +-
user_guide/helpers/cookie_helper.html | 8 +-
user_guide/helpers/date_helper.html | 32 +--
user_guide/helpers/directory_helper.html | 4 +-
user_guide/helpers/file_helper.html | 16 +-
user_guide/helpers/form_helper.html | 54 ++---
user_guide/helpers/html_helper.html | 24 +--
user_guide/helpers/inflector_helper.html | 10 +-
user_guide/helpers/language_helper.html | 2 +-
user_guide/helpers/number_helper.html | 2 +-
user_guide/helpers/security_helper.html | 14 +-
user_guide/helpers/smiley_helper.html | 8 +-
user_guide/helpers/string_helper.html | 6 +-
user_guide/helpers/text_helper.html | 30 +--
user_guide/helpers/typography_helper.html | 2 +-
user_guide/helpers/url_helper.html | 48 ++---
user_guide/helpers/xml_helper.html | 2 +-
user_guide/installation/index.html | 16 +-
user_guide/installation/troubleshooting.html | 4 +-
user_guide/installation/upgrade_130.html | 8 +-
user_guide/installation/upgrade_131.html | 2 +-
user_guide/installation/upgrade_132.html | 2 +-
user_guide/installation/upgrade_133.html | 8 +-
user_guide/installation/upgrade_140.html | 6 +-
user_guide/installation/upgrade_141.html | 10 +-
user_guide/installation/upgrade_150.html | 8 +-
user_guide/installation/upgrade_152.html | 2 +-
user_guide/installation/upgrade_160.html | 6 +-
user_guide/installation/upgrade_170.html | 8 +-
user_guide/installation/upgrade_200.html | 10 +-
user_guide/installation/upgrade_202.html | 2 +-
user_guide/installation/upgrade_203.html | 12 +-
user_guide/installation/upgrade_b11.html | 6 +-
user_guide/libraries/benchmark.html | 8 +-
user_guide/libraries/caching.html | 16 +-
user_guide/libraries/calendar.html | 12 +-
user_guide/libraries/cart.html | 46 ++---
user_guide/libraries/config.html | 40 ++--
user_guide/libraries/email.html | 24 +--
user_guide/libraries/encryption.html | 34 ++--
user_guide/libraries/file_uploading.html | 58 +++---
user_guide/libraries/form_validation.html | 94 ++++-----
user_guide/libraries/ftp.html | 36 ++--
user_guide/libraries/image_lib.html | 64 +++---
user_guide/libraries/input.html | 32 +--
user_guide/libraries/javascript.html | 26 +--
user_guide/libraries/language.html | 22 +--
user_guide/libraries/loader.html | 40 ++--
user_guide/libraries/output.html | 20 +-
user_guide/libraries/pagination.html | 20 +-
user_guide/libraries/parser.html | 16 +-
user_guide/libraries/security.html | 8 +-
user_guide/libraries/sessions.html | 42 ++--
user_guide/libraries/table.html | 28 +--
user_guide/libraries/trackback.html | 26 +--
user_guide/libraries/typography.html | 4 +-
user_guide/libraries/unit_testing.html | 16 +-
user_guide/libraries/uri.html | 14 +-
user_guide/libraries/user_agent.html | 10 +-
user_guide/libraries/xmlrpc.html | 46 ++---
user_guide/libraries/zip.html | 32 +--
user_guide/license.html | 2 +-
user_guide/nav/hacks.txt | 2 +-
user_guide/nav/moo.fx.js | 4 +-
user_guide/nav/prototype.lite.js | 92 ++++-----
user_guide/overview/appflow.html | 2 +-
user_guide/overview/at_a_glance.html | 12 +-
user_guide/overview/features.html | 6 +-
user_guide/overview/getting_started.html | 2 +-
user_guide/overview/goals.html | 6 +-
user_guide/overview/mvc.html | 6 +-
user_guide/userguide.css | 2 +-
230 files changed, 2110 insertions(+), 2110 deletions(-)
diff --git a/application/config/autoload.php b/application/config/autoload.php
index 1c492a20d..53129c9c6 100644
--- a/application/config/autoload.php
+++ b/application/config/autoload.php
@@ -1,4 +1,4 @@
- 'application/mac-binhex40',
'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
- 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'),
+ 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
@@ -71,7 +71,7 @@ $mimes = array( 'hqx' => 'application/mac-binhex40',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
- 'png' => array('image/png', 'image/x-png'),
+ 'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => 'text/css',
diff --git a/application/config/profiler.php b/application/config/profiler.php
index b0f43b1d8..f8a5b1a1e 100644
--- a/application/config/profiler.php
+++ b/application/config/profiler.php
@@ -1,4 +1,4 @@
-A PHP Error was encountered
Severity:
-Message:
+Message:
Filename:
Line Number:
diff --git a/index.php b/index.php
index e56de13ed..f4ac11a72 100644
--- a/index.php
+++ b/index.php
@@ -11,9 +11,9 @@
*
* This can be set to anything, but default usage is:
*
- * development
- * testing
- * production
+ * development
+ * testing
+ * production
*
* NOTE: If you change these, also change the error_reporting() code below
*
@@ -35,7 +35,7 @@ if (defined('ENVIRONMENT'))
case 'development':
error_reporting(E_ALL);
break;
-
+
case 'testing':
case 'production':
error_reporting(0);
@@ -52,7 +52,7 @@ if (defined('ENVIRONMENT'))
*---------------------------------------------------------------
*
* This variable must contain the name of your "system" folder.
- * Include the path if the folder is not in the same directory
+ * Include the path if the folder is not in the same directory
* as this file.
*
*/
@@ -65,7 +65,7 @@ if (defined('ENVIRONMENT'))
*
* If you want this front controller to use a different "application"
* folder then the default one you can set its name here. The folder
- * can also be renamed or relocated anywhere on your server. If
+ * can also be renamed or relocated anywhere on your server. If
* you do, use a full server path. For more info please see the user guide:
* http://codeigniter.com/user_guide/general/managing_apps.html
*
@@ -81,24 +81,24 @@ if (defined('ENVIRONMENT'))
*
* Normally you will set your default controller in the routes.php file.
* You can, however, force a custom routing by hard-coding a
- * specific controller class/function here. For most applications, you
+ * specific controller class/function here. For most applications, you
* WILL NOT set your routing here, but it's an option for those
* special instances where you might want to override the standard
* routing in a specific front controller that shares a common CI installation.
*
- * IMPORTANT: If you set the routing here, NO OTHER controller will be
+ * IMPORTANT: If you set the routing here, NO OTHER controller will be
* callable. In essence, this preference limits your application to ONE
- * specific controller. Leave the function name blank if you need
+ * specific controller. Leave the function name blank if you need
* to call functions dynamically via the URI.
*
* Un-comment the $routing array below to use this feature
*
*/
- // The directory name, relative to the "controllers" folder. Leave blank
+ // The directory name, relative to the "controllers" folder. Leave blank
// if your controller is not in a sub-folder within the "controllers" folder
// $routing['directory'] = '';
- // The controller class file name. Example: Mycontroller
+ // The controller class file name. Example: Mycontroller
// $routing['controller'] = '';
// The controller function you wish to be called.
@@ -107,7 +107,7 @@ if (defined('ENVIRONMENT'))
/*
* -------------------------------------------------------------------
- * CUSTOM CONFIG VALUES
+ * CUSTOM CONFIG VALUES
* -------------------------------------------------------------------
*
* The $assign_to_config array below will be passed dynamically to the
@@ -125,12 +125,12 @@ if (defined('ENVIRONMENT'))
// --------------------------------------------------------------------
-// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
+// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
// --------------------------------------------------------------------
/*
* ---------------------------------------------------------------
- * Resolve the system path for increased reliability
+ * Resolve the system path for increased reliability
* ---------------------------------------------------------------
*/
@@ -156,7 +156,7 @@ if (defined('ENVIRONMENT'))
/*
* -------------------------------------------------------------------
- * Now that we know the path, set the main path constants
+ * Now that we know the path, set the main path constants
* -------------------------------------------------------------------
*/
// The name of THIS file
diff --git a/license.txt b/license.txt
index 4809e8ca4..061cdb9db 100644
--- a/license.txt
+++ b/license.txt
@@ -2,7 +2,7 @@ Copyright (c) 2008 - 2011, EllisLab, Inc.
All rights reserved.
This license is a legal agreement between you and EllisLab Inc. for the use
-of CodeIgniter Software (the "Software"). By obtaining the Software you
+of CodeIgniter Software (the "Software"). By obtaining the Software you
agree to comply with the terms and conditions of this license.
PERMITTED USE
@@ -48,4 +48,4 @@ FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION
WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR DETERMINING THE
APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE, INCLUDING
BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF
-DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS.
\ No newline at end of file
+DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS.
diff --git a/system/core/Benchmark.php b/system/core/Benchmark.php
index 3686c2d73..515550e9f 100644
--- a/system/core/Benchmark.php
+++ b/system/core/Benchmark.php
@@ -1,4 +1,4 @@
-_call_hook('pre_system');
/*
* ------------------------------------------------------
- * Instantiate the config class
+ * Instantiate the config class
* ------------------------------------------------------
*/
$CFG =& load_class('Config', 'core');
@@ -143,7 +143,7 @@
/*
* ------------------------------------------------------
- * Instantiate the UTF-8 class
+ * Instantiate the UTF-8 class
* ------------------------------------------------------
*
* Note: Order here is rather important as the UTF-8
@@ -157,14 +157,14 @@
/*
* ------------------------------------------------------
- * Instantiate the URI class
+ * Instantiate the URI class
* ------------------------------------------------------
*/
$URI =& load_class('URI', 'core');
/*
* ------------------------------------------------------
- * Instantiate the routing class and set the routing
+ * Instantiate the routing class and set the routing
* ------------------------------------------------------
*/
$RTR =& load_class('Router', 'core');
@@ -178,14 +178,14 @@
/*
* ------------------------------------------------------
- * Instantiate the output class
+ * Instantiate the output class
* ------------------------------------------------------
*/
$OUT =& load_class('Output', 'core');
/*
* ------------------------------------------------------
- * Is there a valid cache file? If so, we're done...
+ * Is there a valid cache file? If so, we're done...
* ------------------------------------------------------
*/
if ($EXT->_call_hook('cache_override') === FALSE)
@@ -205,21 +205,21 @@
/*
* ------------------------------------------------------
- * Load the Input class and sanitize globals
+ * Load the Input class and sanitize globals
* ------------------------------------------------------
*/
$IN =& load_class('Input', 'core');
/*
* ------------------------------------------------------
- * Load the Language class
+ * Load the Language class
* ------------------------------------------------------
*/
$LANG =& load_class('Lang', 'core');
/*
* ------------------------------------------------------
- * Load the app controller and local controller
+ * Load the app controller and local controller
* ------------------------------------------------------
*
*/
@@ -252,14 +252,14 @@
/*
* ------------------------------------------------------
- * Security check
+ * Security check
* ------------------------------------------------------
*
- * None of the functions in the app controller or the
- * loader class can be called via the URI, nor can
- * controller functions that begin with an underscore
+ * None of the functions in the app controller or the
+ * loader class can be called via the URI, nor can
+ * controller functions that begin with an underscore
*/
- $class = $RTR->fetch_class();
+ $class = $RTR->fetch_class();
$method = $RTR->fetch_method();
if ( ! class_exists($class)
@@ -272,14 +272,14 @@
/*
* ------------------------------------------------------
- * Is there a "pre_controller" hook?
+ * Is there a "pre_controller" hook?
* ------------------------------------------------------
*/
$EXT->_call_hook('pre_controller');
/*
* ------------------------------------------------------
- * Instantiate the requested controller
+ * Instantiate the requested controller
* ------------------------------------------------------
*/
// Mark a start point so we can benchmark the controller
@@ -289,14 +289,14 @@
/*
* ------------------------------------------------------
- * Is there a "post_controller_constructor" hook?
+ * Is there a "post_controller_constructor" hook?
* ------------------------------------------------------
*/
$EXT->_call_hook('post_controller_constructor');
/*
* ------------------------------------------------------
- * Call the requested method
+ * Call the requested method
* ------------------------------------------------------
*/
// Is there a "remap" function? If so, we call it instead
@@ -345,14 +345,14 @@
/*
* ------------------------------------------------------
- * Is there a "post_controller" hook?
+ * Is there a "post_controller" hook?
* ------------------------------------------------------
*/
$EXT->_call_hook('post_controller');
/*
* ------------------------------------------------------
- * Send the final rendered output to the browser
+ * Send the final rendered output to the browser
* ------------------------------------------------------
*/
if ($EXT->_call_hook('display_override') === FALSE)
@@ -362,14 +362,14 @@
/*
* ------------------------------------------------------
- * Is there a "post_system" hook?
+ * Is there a "post_system" hook?
* ------------------------------------------------------
*/
$EXT->_call_hook('post_system');
/*
* ------------------------------------------------------
- * Close the DB connection if one exists
+ * Close the DB connection if one exists
* ------------------------------------------------------
*/
if (class_exists('CI_DB') AND isset($CI->db))
diff --git a/system/core/Common.php b/system/core/Common.php
index eb9e14425..d1e8e77e9 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -1,4 +1,4 @@
-show_php_error($severity, $message, $filepath, $line);
}
- // Should we log the error? No? We're done...
+ // Should we log the error? No? We're done...
if (config_item('log_threshold') == 0)
{
return;
@@ -479,16 +479,16 @@
function remove_invisible_characters($str, $url_encoded = TRUE)
{
$non_displayables = array();
-
+
// every control character except newline (dec 10)
// carriage return (dec 13), and horizontal tab (dec 09)
-
+
if ($url_encoded)
{
$non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15
$non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31
}
-
+
$non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127
do
diff --git a/system/core/Config.php b/system/core/Config.php
index fa71f4d3d..1096a9ea6 100644
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -1,4 +1,4 @@
-load =& load_class('Loader', 'core');
$this->load->set_base_classes()->ci_autoloader();
-
+
log_message('debug', "Controller Class Initialized");
}
diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php
index 2503c907f..bff86a92f 100644
--- a/system/core/Exceptions.php
+++ b/system/core/Exceptions.php
@@ -1,4 +1,4 @@
-ob_level = ob_get_level();
- // Note: Do not log messages from this constructor.
+ // Note: Do not log messages from this constructor.
}
// --------------------------------------------------------------------
@@ -75,7 +75,7 @@ class CI_Exceptions {
{
$severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
- log_message('error', 'Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE);
+ log_message('error', 'Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE);
}
// --------------------------------------------------------------------
diff --git a/system/core/Hooks.php b/system/core/Hooks.php
index ffb3258d8..fd6380f0a 100644
--- a/system/core/Hooks.php
+++ b/system/core/Hooks.php
@@ -1,4 +1,4 @@
-_fetch_from_array($_POST, $index, $xss_clean);
}
@@ -201,7 +201,7 @@ class CI_Input {
* @param mixed
* @param string the value of the cookie
* @param string the number of seconds until expiration
- * @param string the cookie domain. Usually: .yourdomain.com
+ * @param string the cookie domain. Usually: .yourdomain.com
* @param string the cookie path
* @param string the cookie prefix
* @param bool true makes the cookie secure
@@ -402,9 +402,9 @@ class CI_Input {
function _sanitize_globals()
{
// It would be "wrong" to unset any of these GLOBALS.
- $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST',
+ $protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST',
'_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA',
- 'system_folder', 'application_folder', 'BM', 'EXT',
+ 'system_folder', 'application_folder', 'BM', 'EXT',
'CFG', 'URI', 'RTR', 'OUT', 'IN');
// Unset globals for securiy.
@@ -523,7 +523,7 @@ class CI_Input {
{
$str = $this->uni->clean_string($str);
}
-
+
// Remove control characters
$str = remove_invisible_characters($str);
@@ -579,7 +579,7 @@ class CI_Input {
/**
* Request Headers
*
- * In Apache, you can simply call apache_request_headers(), however for
+ * In Apache, you can simply call apache_request_headers(), however for
* people running other webservers the function is undefined.
*
* @return array
@@ -609,10 +609,10 @@ class CI_Input {
{
$key = str_replace('_', ' ', strtolower($key));
$key = str_replace(' ', '-', ucwords($key));
-
+
$this->headers[$key] = $val;
}
-
+
return $this->headers;
}
@@ -633,7 +633,7 @@ class CI_Input {
{
$this->request_headers();
}
-
+
if ( ! isset($this->headers[$index]))
{
return FALSE;
@@ -644,7 +644,7 @@ class CI_Input {
return $this->security->xss_clean($this->headers[$index]);
}
- return $this->headers[$index];
+ return $this->headers[$index];
}
// --------------------------------------------------------------------
diff --git a/system/core/Lang.php b/system/core/Lang.php
index 79eb443a0..170e6c725 100644
--- a/system/core/Lang.php
+++ b/system/core/Lang.php
@@ -1,4 +1,4 @@
- 'unit',
+ protected $_ci_varmap = array('unit_test' => 'unit',
'user_agent' => 'agent');
/**
@@ -50,29 +50,29 @@ class CI_Loader {
*/
public function __construct()
{
- $this->_ci_ob_level = ob_get_level();
+ $this->_ci_ob_level = ob_get_level();
$this->_ci_library_paths = array(APPPATH, BASEPATH);
$this->_ci_helper_paths = array(APPPATH, BASEPATH);
$this->_ci_model_paths = array(APPPATH);
$this->_ci_view_paths = array(APPPATH.'views/' => TRUE);
-
+
log_message('debug', "Loader Class Initialized");
}
// --------------------------------------------------------------------
-
+
/**
* Set _base_classes variable
*
* This method is called once in CI_Controller.
*
- * @param array
+ * @param array
* @return object
*/
public function set_base_classes()
{
$this->_base_classes =& is_loaded();
-
+
return $this;
}
@@ -96,7 +96,7 @@ class CI_Loader {
{
return $this->_ci_classes[$class];
}
-
+
return FALSE;
}
@@ -260,7 +260,7 @@ class CI_Loader {
return DB($params, $active_record);
}
- // Initialize the db variable. Needed to prevent
+ // Initialize the db variable. Needed to prevent
// reference errors with some configurations
$CI->db = '';
@@ -323,11 +323,11 @@ class CI_Loader {
/**
* Load View
*
- * This function is used to load a "view" file. It has three parameters:
+ * This function is used to load a "view" file. It has three parameters:
*
* 1. The name of the "view" file to be included.
* 2. An associative array of data to be extracted for use in the view.
- * 3. TRUE/FALSE - whether to return the data or load it. In
+ * 3. TRUE/FALSE - whether to return the data or load it. In
* some cases it's advantageous to be able to return data so that
* a developer can process it in some way.
*
@@ -538,13 +538,13 @@ class CI_Loader {
* Prepends a parent path to the library, model, helper, and config path arrays
*
* @param string
- * @param boolean
+ * @param boolean
* @return void
*/
public function add_package_path($path, $view_cascade=TRUE)
{
$path = rtrim($path, '/').'/';
-
+
array_unshift($this->_ci_library_paths, $path);
array_unshift($this->_ci_model_paths, $path);
array_unshift($this->_ci_helper_paths, $path);
@@ -604,7 +604,7 @@ class CI_Loader {
unset($this->{$var}[$key]);
}
}
-
+
if (isset($this->_ci_view_paths[$path.'views/']))
{
unset($this->_ci_view_paths[$path.'views/']);
@@ -643,7 +643,7 @@ class CI_Loader {
{
$$_ci_val = ( ! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val];
}
-
+
$file_exists = FALSE;
// Set the path to the requested file
@@ -665,11 +665,11 @@ class CI_Loader {
$file_exists = TRUE;
break;
}
-
+
if ( ! $cascade)
{
break;
- }
+ }
}
}
@@ -710,9 +710,9 @@ class CI_Loader {
* We buffer the output for two reasons:
* 1. Speed. You get a significant speed boost.
* 2. So that the final rendered template can be
- * post-processed by the output class. Why do we
- * need post processing? For one thing, in order to
- * show the elapsed page load time. Unless we
+ * post-processed by the output class. Why do we
+ * need post processing? For one thing, in order to
+ * show the elapsed page load time. Unless we
* can intercept the content right before it's sent to
* the browser and then stop the timer it won't be accurate.
*/
@@ -809,11 +809,11 @@ class CI_Loader {
show_error("Unable to load the requested class: ".$class);
}
- // Safety: Was the class already loaded by a previous call?
+ // Safety: Was the class already loaded by a previous call?
if (in_array($subclass, $this->_ci_loaded_files))
{
// Before we deem this to be a duplicate request, let's see
- // if a custom object name is being supplied. If so, we'll
+ // if a custom object name is being supplied. If so, we'll
// return a new instance of the object
if ( ! is_null($object_name))
{
@@ -842,17 +842,17 @@ class CI_Loader {
{
$filepath = $path.'libraries/'.$subdir.$class.'.php';
- // Does the file exist? No? Bummer...
+ // Does the file exist? No? Bummer...
if ( ! file_exists($filepath))
{
continue;
}
- // Safety: Was the class already loaded by a previous call?
+ // Safety: Was the class already loaded by a previous call?
if (in_array($filepath, $this->_ci_loaded_files))
{
// Before we deem this to be a duplicate request, let's see
- // if a custom object name is being supplied. If so, we'll
+ // if a custom object name is being supplied. If so, we'll
// return a new instance of the object
if ( ! is_null($object_name))
{
@@ -875,7 +875,7 @@ class CI_Loader {
} // END FOREACH
- // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified?
+ // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified?
if ($subdir == '')
{
$path = strtolower($class).'/'.$class;
@@ -903,7 +903,7 @@ class CI_Loader {
*/
protected function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL)
{
- // Is there an associated config file for this class? Note: these should always be lowercase
+ // Is there an associated config file for this class? Note: these should always be lowercase
if ($config === NULL)
{
// Fetch the config paths containing any package paths
@@ -970,7 +970,7 @@ class CI_Loader {
}
// Set the variable name we will assign the class to
- // Was a custom class name supplied? If so we'll use it
+ // Was a custom class name supplied? If so we'll use it
$class = strtolower($class);
if (is_null($object_name))
@@ -1005,7 +1005,7 @@ class CI_Loader {
* The config/autoload.php file contains an array that permits sub-systems,
* libraries, and helpers to be loaded automatically.
*
- * This function is public, as it's used in the CI_Controller class.
+ * This function is public, as it's used in the CI_Controller class.
* However, there is no reason you should ever needs to use it.
*
* @param array
@@ -1021,7 +1021,7 @@ class CI_Loader {
{
include_once(APPPATH.'config/autoload.php');
}
-
+
if ( ! isset($autoload))
{
diff --git a/system/core/Model.php b/system/core/Model.php
index 61c71b672..8566a0b66 100644
--- a/system/core/Model.php
+++ b/system/core/Model.php
@@ -1,4 +1,4 @@
-final_output
*
* This function sends the finalized output data to the browser along
- * with any server headers and profile data. It also stops the
+ * with any server headers and profile data. It also stops the
* benchmark timer so the page rendering speed and memory usage can be shown.
*
* @access public
@@ -269,7 +269,7 @@ class CI_Output {
*/
function _display($output = '')
{
- // Note: We use globals because we can't use $CI =& get_instance()
+ // Note: We use globals because we can't use $CI =& get_instance()
// since this function is sometimes called by the caching mechanism,
// which happens before the CI super object is available.
global $BM, $CFG;
@@ -290,7 +290,7 @@ class CI_Output {
// --------------------------------------------------------------------
- // Do we need to write a cache file? Only if the controller does not have its
+ // Do we need to write a cache file? Only if the controller does not have its
// own _output() method and we are not dealing with a cache file, which we
// can determine by the existence of the $CI object above
if ($this->cache_expiration > 0 && isset($CI) && ! method_exists($CI, '_output'))
@@ -368,7 +368,7 @@ class CI_Output {
// we will remove them and add them back after we insert the profile data
if (preg_match("|