summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-08-21 17:02:25 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-08-21 17:02:25 +0200
commitc09370bebb08082ab0655a964a6e6e1331ed47fb (patch)
treefd94ba9616ccc4cfbdb3ecfddece0ce2fa1bba24 /system/libraries
parentd70e5f5c44762b758ba522832ed77e24d0de483e (diff)
parentd9489e0ca676905c16c7a8c0f03011cc12b634f9 (diff)
Merge commit 'v2.0.3' into working
Conflicts: .gitignore application/views/welcome_message.php user_guide/changelog.html user_guide/database/active_record.html user_guide/database/caching.html user_guide/database/call_function.html user_guide/database/configuration.html user_guide/database/connecting.html user_guide/database/examples.html user_guide/database/fields.html user_guide/database/forge.html user_guide/database/helpers.html user_guide/database/index.html user_guide/database/queries.html user_guide/database/results.html user_guide/database/table_data.html user_guide/database/transactions.html user_guide/database/utilities.html user_guide/doc_style/index.html user_guide/general/alternative_php.html user_guide/general/ancillary_classes.html user_guide/general/autoloader.html user_guide/general/caching.html user_guide/general/cli.html user_guide/general/common_functions.html user_guide/general/controllers.html user_guide/general/core_classes.html user_guide/general/creating_drivers.html user_guide/general/creating_libraries.html user_guide/general/credits.html user_guide/general/drivers.html user_guide/general/environments.html user_guide/general/errors.html user_guide/general/helpers.html user_guide/general/hooks.html user_guide/general/libraries.html user_guide/general/managing_apps.html user_guide/general/models.html user_guide/general/profiling.html user_guide/general/quick_reference.html user_guide/general/requirements.html user_guide/general/reserved_names.html user_guide/general/routing.html user_guide/general/security.html user_guide/general/styleguide.html user_guide/general/urls.html user_guide/general/views.html user_guide/helpers/array_helper.html user_guide/helpers/captcha_helper.html user_guide/helpers/cookie_helper.html user_guide/helpers/date_helper.html user_guide/helpers/directory_helper.html user_guide/helpers/download_helper.html user_guide/helpers/email_helper.html user_guide/helpers/file_helper.html user_guide/helpers/form_helper.html user_guide/helpers/html_helper.html user_guide/helpers/inflector_helper.html user_guide/helpers/language_helper.html user_guide/helpers/number_helper.html user_guide/helpers/path_helper.html user_guide/helpers/security_helper.html user_guide/helpers/smiley_helper.html user_guide/helpers/string_helper.html user_guide/helpers/text_helper.html user_guide/helpers/typography_helper.html user_guide/helpers/url_helper.html user_guide/helpers/xml_helper.html user_guide/index.html user_guide/installation/downloads.html user_guide/installation/index.html user_guide/installation/troubleshooting.html user_guide/installation/upgrade_120.html user_guide/installation/upgrade_130.html user_guide/installation/upgrade_131.html user_guide/installation/upgrade_132.html user_guide/installation/upgrade_133.html user_guide/installation/upgrade_140.html user_guide/installation/upgrade_141.html user_guide/installation/upgrade_150.html user_guide/installation/upgrade_152.html user_guide/installation/upgrade_153.html user_guide/installation/upgrade_154.html user_guide/installation/upgrade_160.html user_guide/installation/upgrade_161.html user_guide/installation/upgrade_162.html user_guide/installation/upgrade_163.html user_guide/installation/upgrade_170.html user_guide/installation/upgrade_171.html user_guide/installation/upgrade_172.html user_guide/installation/upgrade_200.html user_guide/installation/upgrade_201.html user_guide/installation/upgrade_202.html user_guide/installation/upgrade_b11.html user_guide/installation/upgrading.html user_guide/libraries/benchmark.html user_guide/libraries/caching.html user_guide/libraries/calendar.html user_guide/libraries/cart.html user_guide/libraries/config.html user_guide/libraries/email.html user_guide/libraries/encryption.html user_guide/libraries/file_uploading.html user_guide/libraries/form_validation.html user_guide/libraries/ftp.html user_guide/libraries/image_lib.html user_guide/libraries/input.html user_guide/libraries/javascript.html user_guide/libraries/language.html user_guide/libraries/loader.html user_guide/libraries/output.html user_guide/libraries/pagination.html user_guide/libraries/parser.html user_guide/libraries/security.html user_guide/libraries/sessions.html user_guide/libraries/table.html user_guide/libraries/trackback.html user_guide/libraries/typography.html user_guide/libraries/unit_testing.html user_guide/libraries/uri.html user_guide/libraries/user_agent.html user_guide/libraries/xmlrpc.html user_guide/libraries/zip.html user_guide/license.html user_guide/nav/nav.js user_guide/overview/appflow.html user_guide/overview/at_a_glance.html user_guide/overview/cheatsheets.html user_guide/overview/features.html user_guide/overview/getting_started.html user_guide/overview/goals.html user_guide/overview/index.html user_guide/overview/mvc.html user_guide/toc.html Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'system/libraries')
-rwxr-xr-xsystem/libraries/Cache/drivers/Cache_dummy.php24
-rwxr-xr-xsystem/libraries/Calendar.php2
-rwxr-xr-xsystem/libraries/Cart.php4
-rwxr-xr-xsystem/libraries/Driver.php12
-rwxr-xr-xsystem/libraries/Email.php46
-rwxr-xr-xsystem/libraries/Encrypt.php2
-rwxr-xr-xsystem/libraries/Form_validation.php6
-rwxr-xr-xsystem/libraries/Log.php2
-rwxr-xr-xsystem/libraries/Pagination.php2
-rwxr-xr-xsystem/libraries/Profiler.php78
-rwxr-xr-xsystem/libraries/Session.php8
-rwxr-xr-xsystem/libraries/Upload.php8
-rwxr-xr-xsystem/libraries/User_agent.php8
13 files changed, 132 insertions, 70 deletions
diff --git a/system/libraries/Cache/drivers/Cache_dummy.php b/system/libraries/Cache/drivers/Cache_dummy.php
index de47acb43..f96a68e27 100755
--- a/system/libraries/Cache/drivers/Cache_dummy.php
+++ b/system/libraries/Cache/drivers/Cache_dummy.php
@@ -10,29 +10,29 @@
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 2.0
- * @filesource
+ * @filesource
*/
// ------------------------------------------------------------------------
/**
- * CodeIgniter Dummy Caching Class
+ * CodeIgniter Dummy Caching Class
*
* @package CodeIgniter
* @subpackage Libraries
* @category Core
* @author ExpressionEngine Dev Team
- * @link
+ * @link
*/
class CI_Cache_dummy extends CI_Driver {
/**
- * Get
+ * Get
*
* Since this is the dummy class, it's always going to return FALSE.
*
- * @param string
+ * @param string
* @return Boolean FALSE
*/
public function get($id)
@@ -40,8 +40,8 @@ class CI_Cache_dummy extends CI_Driver {
return FALSE;
}
- // ------------------------------------------------------------------------
-
+ // ------------------------------------------------------------------------
+
/**
* Cache Save
*
@@ -55,7 +55,7 @@ class CI_Cache_dummy extends CI_Driver {
{
return TRUE;
}
-
+
// ------------------------------------------------------------------------
/**
@@ -112,7 +112,7 @@ class CI_Cache_dummy extends CI_Driver {
/**
* Is this caching driver supported on the system?
* Of course this one is.
- *
+ *
* @return TRUE;
*/
public function is_supported()
@@ -121,9 +121,9 @@ class CI_Cache_dummy extends CI_Driver {
}
// ------------------------------------------------------------------------
-
+
}
// End Class
-/* End of file Cache_apc.php */
-/* Location: ./system/libraries/Cache/drivers/Cache_apc.php */ \ No newline at end of file
+/* End of file Cache_dummy.php */
+/* Location: ./system/libraries/Cache/drivers/Cache_dummy.php */ \ No newline at end of file
diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php
index 72d228e73..df0fd6eeb 100755
--- a/system/libraries/Calendar.php
+++ b/system/libraries/Calendar.php
@@ -47,7 +47,7 @@ class CI_Calendar {
{
$this->CI =& get_instance();
- if ( ! in_array('calendar_lang'.EXT, $this->CI->lang->is_loaded, TRUE))
+ if ( ! in_array('calendar_lang.php', $this->CI->lang->is_loaded, TRUE))
{
$this->CI->lang->load('calendar');
}
diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php
index 7f65b48b9..b2eaa9ad7 100755
--- a/system/libraries/Cart.php
+++ b/system/libraries/Cart.php
@@ -374,6 +374,7 @@ class CI_Cart {
// Lets add up the individual prices and set the cart sub-total
$total = 0;
+ $items = 0;
foreach ($this->_cart_contents as $key => $val)
{
// We make sure the array contains the proper indexes
@@ -383,13 +384,14 @@ class CI_Cart {
}
$total += ($val['price'] * $val['qty']);
+ $items += $val['qty'];
// Set the subtotal
$this->_cart_contents[$key]['subtotal'] = ($this->_cart_contents[$key]['price'] * $this->_cart_contents[$key]['qty']);
}
// Set the cart total and total items.
- $this->_cart_contents['total_items'] = count($this->_cart_contents);
+ $this->_cart_contents['total_items'] = $items;
$this->_cart_contents['cart_total'] = $total;
// Is our cart empty? If so we delete it from the session
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index d1838f2c1..c32f2c1eb 100755
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -43,11 +43,11 @@ class CI_Driver_Library {
// The class will be prefixed with the parent lib
$child_class = $this->lib_name.'_'.$child;
-
+
// Remove the CI_ prefix and lowercase
- $lib_name = strtolower(preg_replace('/^CI_/', '', $this->lib_name));
- $driver_name = strtolower(preg_replace('/^CI_/', '', $child_class));
-
+ $lib_name = ucfirst(strtolower(str_replace('CI_', '', $this->lib_name)));
+ $driver_name = strtolower(str_replace('CI_', '', $child_class));
+
if (in_array($driver_name, array_map('strtolower', $this->valid_drivers)))
{
// check and see if the driver is in a separate file
@@ -59,7 +59,7 @@ class CI_Driver_Library {
// loves me some nesting!
foreach (array(ucfirst($driver_name), $driver_name) as $class)
{
- $filepath = $path.'libraries/'.$lib_name.'/drivers/'.$class.EXT;
+ $filepath = $path.'libraries/'.$lib_name.'/drivers/'.$class.'.php';
if (file_exists($filepath))
{
@@ -226,4 +226,4 @@ class CI_Driver {
// END CI_Driver CLASS
/* End of file Driver.php */
-/* Location: ./system/libraries/Driver.php */ \ No newline at end of file
+/* Location: ./system/libraries/Driver.php */
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 6c21f114d..03eccea09 100755
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -395,7 +395,7 @@ class CI_Email {
public function attach($filename, $disposition = 'attachment')
{
$this->_attach_name[] = $filename;
- $this->_attach_type[] = $this->_mime_types(next(explode('.', basename($filename))));
+ $this->_attach_type[] = $this->_mime_types(pathinfo($filename, PATHINFO_EXTENSION));
$this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters
return $this;
}
@@ -722,7 +722,7 @@ class CI_Email {
{
if ( ! is_array($email))
{
- $this->_set_error_message('email_must_be_array');
+ $this->_set_error_message('lang:email_must_be_array');
return FALSE;
}
@@ -730,7 +730,7 @@ class CI_Email {
{
if ( ! $this->valid_email($val))
{
- $this->_set_error_message('email_invalid_address', $val);
+ $this->_set_error_message('lang:email_invalid_address', $val);
return FALSE;
}
}
@@ -1131,7 +1131,7 @@ class CI_Email {
if ( ! file_exists($filename))
{
- $this->_set_error_message('email_attachment_missing', $filename);
+ $this->_set_error_message('lang:email_attachment_missing', $filename);
return FALSE;
}
@@ -1146,7 +1146,7 @@ class CI_Email {
if ( ! $fp = fopen($filename, FOPEN_READ))
{
- $this->_set_error_message('email_attachment_unreadable', $filename);
+ $this->_set_error_message('lang:email_attachment_unreadable', $filename);
return FALSE;
}
@@ -1353,7 +1353,7 @@ class CI_Email {
( ! isset($this->_bcc_array) AND ! isset($this->_headers['Bcc'])) AND
( ! isset($this->_headers['Cc'])))
{
- $this->_set_error_message('email_no_recipients');
+ $this->_set_error_message('lang:email_no_recipients');
return FALSE;
}
@@ -1484,7 +1484,7 @@ class CI_Email {
if ( ! $this->_send_with_mail())
{
- $this->_set_error_message('email_send_failure_phpmail');
+ $this->_set_error_message('lang:email_send_failure_phpmail');
return FALSE;
}
break;
@@ -1492,7 +1492,7 @@ class CI_Email {
if ( ! $this->_send_with_sendmail())
{
- $this->_set_error_message('email_send_failure_sendmail');
+ $this->_set_error_message('lang:email_send_failure_sendmail');
return FALSE;
}
break;
@@ -1500,14 +1500,14 @@ class CI_Email {
if ( ! $this->_send_with_smtp())
{
- $this->_set_error_message('email_send_failure_smtp');
+ $this->_set_error_message('lang:email_send_failure_smtp');
return FALSE;
}
break;
}
- $this->_set_error_message('email_sent', $this->_get_protocol());
+ $this->_set_error_message('lang:email_sent', $this->_get_protocol());
return TRUE;
}
@@ -1578,8 +1578,8 @@ class CI_Email {
if ($status != 0)
{
- $this->_set_error_message('email_exit_status', $status);
- $this->_set_error_message('email_no_socket');
+ $this->_set_error_message('lang:email_exit_status', $status);
+ $this->_set_error_message('lang:email_no_socket');
return FALSE;
}
@@ -1598,7 +1598,7 @@ class CI_Email {
{
if ($this->smtp_host == '')
{
- $this->_set_error_message('email_no_hostname');
+ $this->_set_error_message('lang:email_no_hostname');
return FALSE;
}
@@ -1647,7 +1647,7 @@ class CI_Email {
if (strncmp($reply, '250', 3) != 0)
{
- $this->_set_error_message('email_smtp_error', $reply);
+ $this->_set_error_message('lang:email_smtp_error', $reply);
return FALSE;
}
@@ -1674,7 +1674,7 @@ class CI_Email {
if ( ! is_resource($this->_smtp_connect))
{
- $this->_set_error_message('email_smtp_error', $errno." ".$errstr);
+ $this->_set_error_message('lang:email_smtp_error', $errno." ".$errstr);
return FALSE;
}
@@ -1737,7 +1737,7 @@ class CI_Email {
if (substr($reply, 0, 3) != $resp)
{
- $this->_set_error_message('email_smtp_error', $reply);
+ $this->_set_error_message('lang:email_smtp_error', $reply);
return FALSE;
}
@@ -1766,7 +1766,7 @@ class CI_Email {
if ($this->smtp_user == "" AND $this->smtp_pass == "")
{
- $this->_set_error_message('email_no_smtp_unpw');
+ $this->_set_error_message('lang:email_no_smtp_unpw');
return FALSE;
}
@@ -1776,7 +1776,7 @@ class CI_Email {
if (strncmp($reply, '334', 3) != 0)
{
- $this->_set_error_message('email_failed_smtp_login', $reply);
+ $this->_set_error_message('lang:email_failed_smtp_login', $reply);
return FALSE;
}
@@ -1786,7 +1786,7 @@ class CI_Email {
if (strncmp($reply, '334', 3) != 0)
{
- $this->_set_error_message('email_smtp_auth_un', $reply);
+ $this->_set_error_message('lang:email_smtp_auth_un', $reply);
return FALSE;
}
@@ -1796,7 +1796,7 @@ class CI_Email {
if (strncmp($reply, '235', 3) != 0)
{
- $this->_set_error_message('email_smtp_auth_pw', $reply);
+ $this->_set_error_message('lang:email_smtp_auth_pw', $reply);
return FALSE;
}
@@ -1815,7 +1815,7 @@ class CI_Email {
{
if ( ! fwrite($this->_smtp_connect, $data . $this->newline))
{
- $this->_set_error_message('email_smtp_data_failure', $data);
+ $this->_set_error_message('lang:email_smtp_data_failure', $data);
return FALSE;
}
else
@@ -1942,7 +1942,7 @@ class CI_Email {
$CI =& get_instance();
$CI->lang->load('email');
- if (FALSE === ($line = $CI->lang->line($msg)))
+ if (substr($msg, 0, 5) != 'lang:' || FALSE === ($line = $CI->lang->line(substr($msg, 5))))
{
$this->_debug_msg[] = str_replace('%s', $val, $msg)."<br />";
}
@@ -2059,4 +2059,4 @@ class CI_Email {
// END CI_Email class
/* End of file Email.php */
-/* Location: ./system/libraries/Email.php */ \ No newline at end of file
+/* Location: ./system/libraries/Email.php */
diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php
index e5f65878a..b30a8cf0b 100755
--- a/system/libraries/Encrypt.php
+++ b/system/libraries/Encrypt.php
@@ -524,7 +524,7 @@ class CI_Encrypt {
{
if ( ! function_exists('mhash'))
{
- require_once(BASEPATH.'libraries/Sha1'.EXT);
+ require_once(BASEPATH.'libraries/Sha1.php');
$SH = new CI_SHA;
return $SH->generate($str);
}
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index cfc02eda9..6f79a554a 100755
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -628,6 +628,10 @@ class CI_Form_validation {
$this->_field_data[$row['field']]['postdata'] = (is_bool($result)) ? $postdata : $result;
}
}
+ else
+ {
+ log_message('debug', "Unable to find validation rule: ".$rule);
+ }
continue;
}
@@ -1357,4 +1361,4 @@ class CI_Form_validation {
// END Form Validation Class
/* End of file Form_validation.php */
-/* Location: ./system/libraries/Form_validation.php */ \ No newline at end of file
+/* Location: ./system/libraries/Form_validation.php */
diff --git a/system/libraries/Log.php b/system/libraries/Log.php
index fb2c5a49b..9f1db76ba 100755
--- a/system/libraries/Log.php
+++ b/system/libraries/Log.php
@@ -83,7 +83,7 @@ class CI_Log {
return FALSE;
}
- $filepath = $this->_log_path.'log-'.date('Y-m-d').EXT;
+ $filepath = $this->_log_path.'log-'.date('Y-m-d').'.php';
$message = '';
if ( ! file_exists($filepath))
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index 1113f862f..cc62e660b 100755
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -30,7 +30,7 @@ class CI_Pagination {
var $prefix = ''; // A custom prefix added to the path.
var $suffix = ''; // A custom suffix added to the path.
- var $total_rows = ''; // Total number of items (database results)
+ var $total_rows = 0; // Total number of items (database results)
var $per_page = 10; // Max number of items you want shown per page
var $num_links = 2; // Number of "digit" links to show before/after the currently viewed page
var $cur_page = 0; // The current page being viewed
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php
index 8a1f18ced..082a5ee1d 100755
--- a/system/libraries/Profiler.php
+++ b/system/libraries/Profiler.php
@@ -32,8 +32,6 @@
*/
class CI_Profiler {
- var $CI;
-
protected $_available_sections = array(
'benchmarks',
'get',
@@ -43,14 +41,27 @@ class CI_Profiler {
'controller_info',
'queries',
'http_headers',
+ 'session_data',
'config'
);
+ protected $_query_toggle_count = 25;
+
+ protected $CI;
+
+ // --------------------------------------------------------------------
+
public function __construct($config = array())
{
$this->CI =& get_instance();
$this->CI->load->language('profiler');
+ if (isset($config['query_toggle_count']))
+ {
+ $this->_query_toggle_count = (int) $config['query_toggle_count'];
+ unset($config['query_toggle_count']);
+ }
+
// default all sections to display
foreach ($this->_available_sections as $section)
{
@@ -162,7 +173,7 @@ 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 style='border:none; width:100%'>\n";
+ $output .= "\n\n<table style='border:none; width:100%;'>\n";
$output .="<tr><td style='width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px'>".$this->CI->lang->line('profiler_no_db')."</td></tr>\n";
$output .= "</table>\n";
$output .= "</fieldset>";
@@ -178,13 +189,26 @@ class CI_Profiler {
$output = "\n\n";
+ $count = 0;
+
foreach ($dbs as $db)
{
+ $count++;
+
+ $hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : '';
+
+ $show_hide_js = '(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_queries_db_'.$count.'\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_hide').'\'?\''.$this->CI->lang->line('profiler_section_show').'\':\''.$this->CI->lang->line('profiler_section_hide').'\';">'.$this->CI->lang->line('profiler_section_hide').'</span>)';
+
+ if ($hide_queries != '')
+ {
+ $show_hide_js = '(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_queries_db_'.$count.'\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)';
+ }
+
$output .= '<fieldset style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$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($db->queries).'&nbsp;&nbsp;&nbsp;</legend>';
+ $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($db->queries).'&nbsp;&nbsp;'.$show_hide_js.'</legend>';
$output .= "\n";
- $output .= "\n\n<table style='width:100%;'>\n";
+ $output .= "\n\n<table style='width:100%;{$hide_queries}' id='ci_profiler_queries_db_{$count}'>\n";
if (count($db->queries) == 0)
{
@@ -388,7 +412,7 @@ class CI_Profiler {
}
else
{
- $output .= "<div style='color:#5a0099;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->lang->line('profiler_no_memory_usage')."</div>";
+ $output .= "<div style='color:#5a0099;font-weight:normal;padding:4px 0 4px 0'>".$this->CI->lang->line('profiler_no_memory')."</div>";
}
$output .= "</fieldset>";
@@ -410,10 +434,10 @@ class CI_Profiler {
$output = "\n\n";
$output .= '<fieldset id="ci_profiler_http_headers" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
- $output .= '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_headers').'&nbsp;&nbsp;</legend>';
+ $output .= '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_headers').'&nbsp;&nbsp;(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_httpheaders_table\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>';
$output .= "\n";
- $output .= "\n\n<table style='width:100%'>\n";
+ $output .= "\n\n<table style='width:100%;display:none' id='ci_profiler_httpheaders_table'>\n";
foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header)
{
@@ -441,10 +465,10 @@ class CI_Profiler {
$output = "\n\n";
$output .= '<fieldset id="ci_profiler_config" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
- $output .= '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_config').'&nbsp;&nbsp;</legend>';
+ $output .= '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_config').'&nbsp;&nbsp;(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_config_table\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>';
$output .= "\n";
- $output .= "\n\n<table style='width:100%'>\n";
+ $output .= "\n\n<table style='width:100%; display:none' id='ci_profiler_config_table'>\n";
foreach ($this->CI->config->config as $config=>$val)
{
@@ -465,6 +489,39 @@ class CI_Profiler {
// --------------------------------------------------------------------
/**
+ * Compile session userdata
+ *
+ * @return string
+ */
+ private function _compile_session_data()
+ {
+ if ( ! isset($this->CI->session))
+ {
+ return;
+ }
+
+ $output = '<fieldset id="ci_profiler_csession" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
+ $output .= '<legend style="color:#000;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_session_data').'&nbsp;&nbsp;(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_session_data\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>';
+ $output .= "<table style='width:100%;display:none' id='ci_profiler_session_data'>";
+
+ foreach ($this->CI->session->all_userdata() as $key => $val)
+ {
+ if (is_array($val))
+ {
+ $val = print_r($val, TRUE);
+ }
+
+ $output .= "<tr><td style='padding:5px; vertical-align: top;color:#900;background-color:#ddd;'>".$key."&nbsp;&nbsp;</td><td style='padding:5px; color:#000;background-color:#ddd;'>".htmlspecialchars($val)."</td></tr>\n";
+ }
+
+ $output .= '</table>';
+ $output .= "</fieldset>";
+ return $output;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Run the Profiler
*
* @return string
@@ -493,7 +550,6 @@ class CI_Profiler {
return $output;
}
-
}
// END CI_Profiler class
diff --git a/system/libraries/Session.php b/system/libraries/Session.php
index 182294059..2c8a80163 100755
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -189,7 +189,7 @@ class CI_Session {
}
// Does the User Agent Match?
- if ($this->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 50)))
+ if ($this->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 120)))
{
$this->sess_destroy();
return FALSE;
@@ -316,7 +316,7 @@ class CI_Session {
$this->userdata = array(
'session_id' => md5(uniqid($sessid, TRUE)),
'ip_address' => $this->CI->input->ip_address(),
- 'user_agent' => substr($this->CI->input->user_agent(), 0, 50),
+ 'user_agent' => substr($this->CI->input->user_agent(), 0, 120),
'last_activity' => $this->now
);
@@ -435,11 +435,11 @@ class CI_Session {
* Fetch all session data
*
* @access public
- * @return mixed
+ * @return array
*/
function all_userdata()
{
- return ( ! isset($this->userdata)) ? FALSE : $this->userdata;
+ return $this->userdata;
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index e80049fa4..3177424c4 100755
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -945,13 +945,13 @@ class CI_Upload {
if (count($this->mimes) == 0)
{
- if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
+ if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
{
- include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT);
+ include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
}
- elseif (is_file(APPPATH.'config/mimes'.EXT))
+ elseif (is_file(APPPATH.'config/mimes.php'))
{
- include(APPPATH.'config//mimes'.EXT);
+ include(APPPATH.'config//mimes.php');
}
else
{
diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php
index 04cda7312..016102a2a 100755
--- a/system/libraries/User_agent.php
+++ b/system/libraries/User_agent.php
@@ -84,13 +84,13 @@ class CI_User_agent {
*/
private function _load_agent_file()
{
- if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT))
+ if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php'))
{
- include(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT);
+ include(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php');
}
- elseif (is_file(APPPATH.'config/user_agents'.EXT))
+ elseif (is_file(APPPATH.'config/user_agents.php'))
{
- include(APPPATH.'config/user_agents'.EXT);
+ include(APPPATH.'config/user_agents.php');
}
else
{