summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/core/Output.php1
-rw-r--r--system/database/DB_active_rec.php6
-rw-r--r--system/helpers/form_helper.php10
-rw-r--r--system/helpers/url_helper.php4
-rw-r--r--system/libraries/Profiler.php14
-rw-r--r--user_guide/changelog.html2
-rw-r--r--user_guide/general/models.html12
-rw-r--r--user_guide/libraries/config.html2
8 files changed, 29 insertions, 22 deletions
diff --git a/system/core/Output.php b/system/core/Output.php
index e25e62197..7d3e2e180 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -346,6 +346,7 @@ class CI_Output {
if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path))
{
+ log_message('error', "Unable to write cache file: ".$cache_path);
return;
}
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index 953cc9548..25645a050 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -36,6 +36,7 @@ class CI_DB_active_record extends CI_DB_driver {
var $ar_like = array();
var $ar_groupby = array();
var $ar_having = array();
+ var $ar_keys = array();
var $ar_limit = FALSE;
var $ar_offset = FALSE;
var $ar_order = FALSE;
@@ -2045,7 +2046,7 @@ class CI_DB_active_record extends CI_DB_driver {
/**
* Resets the active record "write" values.
*
- * Called by the insert() update() and delete() functions
+ * Called by the insert() update() insert_batch() update_batch() and delete() functions
*
* @access private
* @return void
@@ -2057,7 +2058,8 @@ class CI_DB_active_record extends CI_DB_driver {
'ar_from' => array(),
'ar_where' => array(),
'ar_like' => array(),
- 'ar_orderby' => array(),
+ 'ar_orderby' => array(),
+ 'ar_keys' => array(),
'ar_limit' => FALSE,
'ar_order' => FALSE
);
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 632f94505..42355df42 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -57,15 +57,15 @@ if ( ! function_exists('form_open'))
$form .= '>';
- if (is_array($hidden) AND count($hidden) > 0)
+ // CSRF
+ if ($CI->config->item('csrf_protection') === TRUE)
{
- $form .= form_hidden($hidden);
+ $hidden[$CI->security->csrf_token_name] = $CI->security->csrf_hash;
}
- // CSRF
- if ($CI->config->item('csrf_protection') === TRUE)
+ if (is_array($hidden) AND count($hidden) > 0)
{
- $form .= form_hidden($CI->security->csrf_token_name, $CI->security->csrf_hash);
+ $form .= sprintf("\n<div class=\"hidden\">%s</div>", form_hidden($hidden));
}
return $form;
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index 7707d6854..dad761145 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -446,7 +446,9 @@ if ( ! function_exists('prep_url'))
return '';
}
- if ( ! parse_url($str, PHP_URL_SCHEME))
+ $url = parse_url($str);
+
+ if ( ! $url OR ! isset($url['scheme']))
{
$str = 'http://'.$str;
}
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php
index 0900a300d..db179976b 100644
--- a/system/libraries/Profiler.php
+++ b/system/libraries/Profiler.php
@@ -128,7 +128,7 @@ class CI_Profiler {
foreach ($profile as $key => $val)
{
$key = ucwords(str_replace(array('_', '-'), ' ', $key));
- $output .= "<tr><td width='50%' style='color:#000;font-weight:bold;background-color:#ddd;'>".$key."&nbsp;&nbsp;</td><td width='50%' style='color:#900;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n";
+ $output .= "<tr><td style='width:50%;color:#000;font-weight:bold;background-color:#ddd;'>".$key."&nbsp;&nbsp;</td><td style='width:50%;color:#900;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n";
}
$output .= "</table>\n";
@@ -165,8 +165,8 @@ class CI_Profiler {
$output .= "\n";
$output .= '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').'&nbsp;&nbsp;</legend>';
$output .= "\n";
- $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n";
- $output .="<tr><td width='100%' style='color:#0000FF;font-weight:normal;background-color:#eee;'>".$this->CI->lang->line('profiler_no_db')."</td></tr>\n";
+ $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' style='width:100%'>\n";
+ $output .="<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;'>".$this->CI->lang->line('profiler_no_db')."</td></tr>\n";
$output .= "</table>\n";
$output .= "</fieldset>";
@@ -177,7 +177,7 @@ class CI_Profiler {
$this->CI->load->helper('text');
// Key words we want bolded
- $highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT&nbsp;JOIN', 'ORDER&nbsp;BY', 'GROUP&nbsp;BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR', 'HAVING', 'OFFSET', 'NOT&nbsp;IN', 'IN', 'LIKE', 'NOT&nbsp;LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')');
+ $highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT&nbsp;JOIN', 'ORDER&nbsp;BY', 'GROUP&nbsp;BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR&nbsp;', 'HAVING', 'OFFSET', 'NOT&nbsp;IN', 'IN', 'LIKE', 'NOT&nbsp;LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')');
$output = "\n\n";
@@ -187,11 +187,11 @@ class CI_Profiler {
$output .= "\n";
$output .= '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database').':&nbsp; '.$db->database.'&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').': '.count($this->CI->db->queries).'&nbsp;&nbsp;&nbsp;</legend>';
$output .= "\n";
- $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n";
+ $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' style='width:100%;'>\n";
if (count($db->queries) == 0)
{
- $output .= "<tr><td width='100%' style='color:#0000FF;font-weight:normal;background-color:#eee;'>".$this->CI->lang->line('profiler_no_queries')."</td></tr>\n";
+ $output .= "<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;'>".$this->CI->lang->line('profiler_no_queries')."</td></tr>\n";
}
else
{
@@ -206,7 +206,7 @@ class CI_Profiler {
$val = str_replace($bold, '<strong>'.$bold.'</strong>', $val);
}
- $output .= "<tr><td width='1%' valign='top' style='color:#900;font-weight:normal;background-color:#ddd;'>".$time."&nbsp;&nbsp;</td><td style='color:#000;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n";
+ $output .= "<tr><td valign='top' style='width:1%;color:#900;font-weight:normal;background-color:#ddd;'>".$time."&nbsp;&nbsp;</td><td style='color:#000;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n";
}
}
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 5740f7397..fb533b082 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -184,6 +184,8 @@ Hg Tag: </p>
<li>Fixed a bug where getimagesize() was being needlessly checked on non-image files in is_allowed_type().</li>
<li>Fixed a bug in the Encryption library where an empty key was not triggering an error.</li>
<li>Fixed a bug in the Email library where CC and BCC recipients were not reset when using the clear() method (#109).</li>
+ <li>Fixed a bug in the URL Helper where prep_url() could cause a PHP error on PHP versions &lt; 5.1.2.</li>
+ <li>Added a log message in core/output if the cache directory config value was not found.</li>
</ul>
<h2>Version 1.7.2</h2>
diff --git a/user_guide/general/models.html b/user_guide/general/models.html
index e04fdf996..e405dd1b6 100644
--- a/user_guide/general/models.html
+++ b/user_guide/general/models.html
@@ -77,7 +77,7 @@ you use CodeIgniter to manage a blog. You might have a model class that contain
retrieve your blog data. Here is an example of what such a model class might look like:</p>
<code>
-class&nbsp;Blogmodel&nbsp;extends&nbsp;Model&nbsp;{<br />
+class&nbsp;Blogmodel&nbsp;extends&nbsp;CI_Model&nbsp;{<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;var $title&nbsp;&nbsp; = '';<br />
&nbsp;&nbsp;&nbsp;&nbsp;var $content = '';<br />
@@ -86,7 +86,7 @@ class&nbsp;Blogmodel&nbsp;extends&nbsp;Model&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Blogmodel()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Call the Model constructor<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::Model();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::CI_Model();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;get_last_ten_entries()<br />
@@ -126,11 +126,11 @@ want this type of organization.</p>
<code>
-class&nbsp;<var>Model_name</var>&nbsp;extends&nbsp;Model&nbsp;{<br />
+class&nbsp;<var>Model_name</var>&nbsp;extends&nbsp;CI_Model&nbsp;{<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;<var>Model_name</var>()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::Model();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::CI_Model();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code>
@@ -140,11 +140,11 @@ Make sure your class extends the base Model class.</p>
<p>The file name will be a lower case version of your class name. For example, if your class is this:</p>
<code>
-class&nbsp;<var>User_model</var>&nbsp;extends&nbsp;Model&nbsp;{<br />
+class&nbsp;<var>User_model</var>&nbsp;extends&nbsp;CI_Model&nbsp;{<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;<var>User_model</var>()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::Model();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::CI_Model();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</code>
diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html
index 6367e2e8e..bfb679457 100644
--- a/user_guide/libraries/config.html
+++ b/user_guide/libraries/config.html
@@ -66,7 +66,7 @@ come from the default config file (<samp>application/config/config.php</samp>) o
<h2>Anatomy of a Config File</h2>
-<p>By default, CodeIgniter has a one primary config file, located at <samp>application/config/config.php</samp>. If you open the file using
+<p>By default, CodeIgniter has one primary config file, located at <samp>application/config/config.php</samp>. If you open the file using
your text editor you'll see that config items are stored in an array called <var>$config</var>.</p>
<p>You can add your own config items to