From 2eaa4074ea007cec58a802f591b4641b043213d1 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 21 Dec 2010 11:44:08 -0600 Subject: Moving system/{logs,cache} to the application directory. --- system/libraries/Log.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Log.php b/system/libraries/Log.php index 6d44cfa4b..cb160a934 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -26,11 +26,11 @@ */ class CI_Log { - var $log_path; - var $_threshold = 1; - var $_date_fmt = 'Y-m-d H:i:s'; - var $_enabled = TRUE; - var $_levels = array('ERROR' => '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4'); + protected $_log_path; + protected $_threshold = 1; + protected $_date_fmt = 'Y-m-d H:i:s'; + protected $_enabled = TRUE; + protected $_levels = array('ERROR' => '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4'); /** * Constructor @@ -39,9 +39,9 @@ class CI_Log { { $config =& get_config(); - $this->log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/'; + $this->_log_path = ($config['log_path'] != '') ? $config['log_path'] : APPPATH.'logs/'; - if ( ! is_dir($this->log_path) OR ! is_really_writable($this->log_path)) + if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path)) { $this->_enabled = FALSE; } @@ -64,13 +64,12 @@ class CI_Log { * * Generally this function will be called using the global log_message() function * - * @access public * @param string the error level * @param string the error message * @param bool whether the error is a native PHP error * @return bool */ - function write_log($level = 'error', $msg, $php_error = FALSE) + public function write_log($level = 'error', $msg, $php_error = FALSE) { if ($this->_enabled === FALSE) { @@ -84,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').EXT; $message = ''; if ( ! file_exists($filepath)) -- cgit v1.2.3-24-g4f1b From ccbfbf60b6b1433dbc7d533443cdb433f837da8b Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 21 Dec 2010 13:49:33 -0600 Subject: Fix #85 error in db queries in the output profiler. --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index e7d88b665..8dca22174 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -182,7 +182,7 @@ class CI_Profiler { { $output .= '
'; $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($this->CI->db->queries).'   '; + $output .= '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'   '; $output .= "\n"; $output .= "\n\n\n"; -- cgit v1.2.3-24-g4f1b From 0711dc87d98ce20d3a87f7ac43d78af8fba1dca7 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 5 Jan 2011 10:49:40 -0600 Subject: Hey look, it's 2011 --- system/libraries/Calendar.php | 2 +- system/libraries/Email.php | 2 +- system/libraries/Encrypt.php | 2 +- system/libraries/Form_validation.php | 2 +- system/libraries/Ftp.php | 2 +- system/libraries/Image_lib.php | 2 +- system/libraries/Javascript.php | 2 +- system/libraries/Log.php | 2 +- system/libraries/Pagination.php | 2 +- system/libraries/Parser.php | 2 +- system/libraries/Profiler.php | 2 +- system/libraries/Security.php | 2 +- system/libraries/Session.php | 2 +- system/libraries/Sha1.php | 2 +- system/libraries/Table.php | 2 +- system/libraries/Trackback.php | 2 +- system/libraries/Typography.php | 2 +- system/libraries/Unit_test.php | 2 +- system/libraries/Upload.php | 2 +- system/libraries/User_agent.php | 2 +- system/libraries/Xmlrpc.php | 2 +- system/libraries/Xmlrpcs.php | 2 +- system/libraries/Zip.php | 2 +- system/libraries/javascript/Jquery.php | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index 59025cf55..72d228e73 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 0a0d6c287..c6d8944df 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 7682f21e4..e5f65878a 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index bf3689058..cbefca104 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index 6ffbef177..d7a8b3b02 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 84c41c4ee..41f9ad393 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php index 6fe365f05..167859abd 100644 --- a/system/libraries/Javascript.php +++ b/system/libraries/Javascript.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Log.php b/system/libraries/Log.php index cb160a934..fb2c5a49b 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 47b718bd2..1113f862f 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index 4cac7394a..d223da020 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 8dca22174..6587eae0b 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Security.php b/system/libraries/Security.php index d2638560c..018001ac8 100644 --- a/system/libraries/Security.php +++ b/system/libraries/Security.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 4dccc46c9..53ff4f5d3 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php index a5addd00c..ad747a001 100644 --- a/system/libraries/Sha1.php +++ b/system/libraries/Sha1.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Table.php b/system/libraries/Table.php index a57781c29..207ccc21d 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.3.1 diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index 79f512b26..e29b35c7a 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 2ea25e48b..734cec104 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php index a57934cd2..5bd7e801a 100644 --- a/system/libraries/Unit_test.php +++ b/system/libraries/Unit_test.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.3.1 diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 4ccbdde90..4ccc032e9 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index c1fb0231a..863faba52 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 3ae5bad45..9cf307cc0 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 555ec7495..6bedfe324 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 94da4b3b8..80633c708 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/javascript/Jquery.php b/system/libraries/javascript/Jquery.php index 91148dca5..0fbb52696 100644 --- a/system/libraries/javascript/Jquery.php +++ b/system/libraries/javascript/Jquery.php @@ -7,7 +7,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://www.codeigniter.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 9805ecce97dbd3f60891c19f27111f75851bd666 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 16 Jan 2011 23:35:16 -0500 Subject: Added access scope to security library and added config options for csrf protection --- system/libraries/Security.php | 67 +++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 31 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Security.php b/system/libraries/Security.php index d2638560c..b022947a0 100644 --- a/system/libraries/Security.php +++ b/system/libraries/Security.php @@ -25,14 +25,15 @@ * @link http://codeigniter.com/user_guide/libraries/sessions.html */ class CI_Security { - var $xss_hash = ''; - var $csrf_hash = ''; - var $csrf_expire = 7200; // Two hours (in seconds) - var $csrf_token_name = 'ci_csrf_token'; - var $csrf_cookie_name = 'ci_csrf_token'; + + public $xss_hash = ''; + public $csrf_hash = ''; + public $csrf_expire = 7200; // Two hours (in seconds) + public $csrf_token_name = 'ci_csrf_token'; + public $csrf_cookie_name = 'ci_csrf_token'; /* never allowed, string replacement */ - var $never_allowed_str = array( + public $never_allowed_str = array( 'document.cookie' => '[removed]', 'document.write' => '[removed]', '.parentNode' => '[removed]', @@ -44,7 +45,7 @@ class CI_Security { ' '<![CDATA[' ); /* never allowed, regex replacement */ - var $never_allowed_regex = array( + public $never_allowed_regex = array( "javascript\s*:" => '[removed]', "expression\s*(\(|&\#40;)" => '[removed]', // CSS and IE "vbscript\s*:" => '[removed]', // IE, surprise! @@ -53,6 +54,10 @@ class CI_Security { public function __construct() { + $this->csrf_token_name = (config_item('csrf_token_name')) ? config_item('csrf_token_name') : 'csrf_token_name'; + $this->csrf_cookie_name = (config_item('csrf_cookie_name')) ? config_item('csrf_cookie_name') : 'csrf_cookie_name'; + $this->csrf_expire = (config_item('csrf_expire')) ? config_item('csrf_expire') : 7200; + // Append application specific cookie prefix to token name $this->csrf_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->csrf_token_name : $this->csrf_token_name; @@ -70,7 +75,7 @@ class CI_Security { * @access public * @return null */ - function csrf_verify() + public function csrf_verify() { // If no POST data exists we will set the CSRF cookie if (count($_POST) == 0) @@ -109,7 +114,7 @@ class CI_Security { * @access public * @return null */ - function csrf_set_cookie() + public function csrf_set_cookie() { $expire = time() + $this->csrf_expire; @@ -123,10 +128,10 @@ class CI_Security { /** * Set Cross Site Request Forgery Protection Cookie * - * @access public + * @access private * @return null */ - function _csrf_set_hash() + private function _csrf_set_hash() { if ($this->csrf_hash == '') { @@ -153,7 +158,7 @@ class CI_Security { * @access public * @return null */ - function csrf_show_error() + public function csrf_show_error() { show_error('The action you have requested is not allowed.'); } @@ -186,7 +191,7 @@ class CI_Security { * @param mixed string or array * @return string */ - function xss_clean($str, $is_image = FALSE) + public function xss_clean($str, $is_image = FALSE) { /* * Is the string an array? @@ -210,9 +215,9 @@ class CI_Security { /* * Protect GET variables in URLs */ - + // 901119URL5918AMP18930PROTECT8198 - + $str = preg_replace('|\&([a-z\_0-9\-]+)\=([a-z\_0-9\-]+)|i', $this->xss_hash()."\\1=\\2", $str); /* @@ -259,7 +264,7 @@ class CI_Security { */ $str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str); - + $str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_decode_entity'), $str); /* @@ -470,7 +475,7 @@ class CI_Security { * @access public * @return string */ - function xss_hash() + public function xss_hash() { if ($this->xss_hash == '') { @@ -493,11 +498,11 @@ class CI_Security { * Callback function for xss_clean() to remove whitespace from * things like j a v a s c r i p t * - * @access public + * @access private * @param type * @return type */ - function _compact_exploded_words($matches) + private function _compact_exploded_words($matches) { return preg_replace('/\s+/s', '', $matches[1]).$matches[2]; } @@ -513,7 +518,7 @@ class CI_Security { * @param array * @return string */ - function _sanitize_naughty_html($matches) + private function _sanitize_naughty_html($matches) { // encode opening brace $str = '<'.$matches[1].$matches[2].$matches[3]; @@ -538,7 +543,7 @@ class CI_Security { * @param array * @return string */ - function _js_link_removal($match) + private function _js_link_removal($match) { $attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1])); return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|_filter_attributes(str_replace(array('<', '>'), '', $match[1])); return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|', '<', '\\'), array('>', '<', '\\\\'), $match[0]); } @@ -585,11 +590,11 @@ class CI_Security { * * Filters tag attributes for consistency and safety * - * @access public + * @access private * @param string * @return string */ - function _filter_attributes($str) + private function _filter_attributes($str) { $out = ''; @@ -611,11 +616,11 @@ class CI_Security { * * Used as a callback for XSS Clean * - * @access public + * @access private * @param array * @return string */ - function _decode_entity($match) + private function _decode_entity($match) { return $this->entity_decode($match[0], strtoupper(config_item('charset'))); } @@ -641,7 +646,7 @@ class CI_Security { * @param string * @return string */ - function entity_decode($str, $charset='UTF-8') + public function entity_decode($str, $charset='UTF-8') { if (stristr($str, '&') === FALSE) return $str; @@ -680,7 +685,7 @@ class CI_Security { * @param string * @return string */ - function sanitize_filename($str, $relative_path = FALSE) + public function sanitize_filename($str, $relative_path = FALSE) { $bad = array( "../", @@ -715,7 +720,7 @@ class CI_Security { "%3b", // ; "%3d" // = ); - + if ( ! $relative_path) { $bad[] = './'; -- cgit v1.2.3-24-g4f1b From c3828718925a0f1660cddadc95b63e14f7189faa Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 19 Jan 2011 12:31:47 +0000 Subject: Reverted regex validation while we re-think the implementation, and added ->input->is_cli_request(); --- system/libraries/Form_validation.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index f45760024..9fe76b5f2 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -171,7 +171,7 @@ class CI_Form_validation { } $this->_error_messages = array_merge($this->_error_messages, $lang); - + return $this; } @@ -191,7 +191,7 @@ class CI_Form_validation { { $this->_error_prefix = $prefix; $this->_error_suffix = $suffix; - + return $this; } @@ -339,13 +339,7 @@ class CI_Form_validation { } } - preg_match_all('/([a-zA-Z_-]*(\[.*\])?)\|?/i', $row['rules'], $matches); - - $rules = $matches[1]; - array_pop($rules); - unset($matches); - - $this->_execute($row, $rules, $this->_field_data[$field]['postdata']); + $this->_execute($row, explode('|', $row['rules']), $this->_field_data[$field]['postdata']); } // Did we end up with any errors? @@ -742,7 +736,7 @@ class CI_Form_validation { { return array_shift($this->_field_data[$field]['postdata']); } - + return $this->_field_data[$field]['postdata']; } -- cgit v1.2.3-24-g4f1b From 700205ad5cb6c00596ad82d5ed282f516add5481 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 28 Jan 2011 07:44:28 -0600 Subject: updating copyrights to 2011 --- system/libraries/Cache/Cache.php | 2 +- system/libraries/Cache/drivers/Cache_apc.php | 2 +- system/libraries/Cache/drivers/Cache_dummy.php | 2 +- system/libraries/Cache/drivers/Cache_file.php | 2 +- system/libraries/Cache/drivers/Cache_memcached.php | 2 +- system/libraries/Cart.php | 2 +- system/libraries/Driver.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php index ea3194237..d3f6105ea 100644 --- a/system/libraries/Cache/Cache.php +++ b/system/libraries/Cache/Cache.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php index 9c716a971..e82e8e1f5 100644 --- a/system/libraries/Cache/drivers/Cache_apc.php +++ b/system/libraries/Cache/drivers/Cache_apc.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 diff --git a/system/libraries/Cache/drivers/Cache_dummy.php b/system/libraries/Cache/drivers/Cache_dummy.php index 13c1f5cde..74f689241 100644 --- a/system/libraries/Cache/drivers/Cache_dummy.php +++ b/system/libraries/Cache/drivers/Cache_dummy.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 diff --git a/system/libraries/Cache/drivers/Cache_file.php b/system/libraries/Cache/drivers/Cache_file.php index bedbfaff8..3ed357f2f 100644 --- a/system/libraries/Cache/drivers/Cache_file.php +++ b/system/libraries/Cache/drivers/Cache_file.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php index adc7fbf44..a7efdc5de 100644 --- a/system/libraries/Cache/drivers/Cache_memcached.php +++ b/system/libraries/Cache/drivers/Cache_memcached.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index 5d3f91d43..7f65b48b9 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index 8579a6023..15fc3da26 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2006 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 9d3ad267e8e8f2972ceea05c4281b0234ed3efb4 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 28 Jan 2011 14:06:58 -0600 Subject: some cleanup for the javascript class docs --- system/libraries/javascript/Jquery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/javascript/Jquery.php b/system/libraries/javascript/Jquery.php index 0fbb52696..baab83d25 100644 --- a/system/libraries/javascript/Jquery.php +++ b/system/libraries/javascript/Jquery.php @@ -21,7 +21,7 @@ * @subpackage Libraries * @author ExpressionEngine Dev Team * @category Loader - * @link http://www.codeigniter.com/user_guide/libraries/jquery.html + * @link http://www.codeigniter.com/user_guide/libraries/javascript.html */ class CI_Jquery extends CI_Javascript { -- cgit v1.2.3-24-g4f1b From 999e7472aa094dac056494ff41772f9204da04b2 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sat, 29 Jan 2011 16:16:58 -0600 Subject: Fix #21 - Typo in get_metadata() function of apc and memcached cache drivers. --- system/libraries/Cache/drivers/Cache_apc.php | 2 +- system/libraries/Cache/drivers/Cache_memcached.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php index e82e8e1f5..4b995c793 100644 --- a/system/libraries/Cache/drivers/Cache_apc.php +++ b/system/libraries/Cache/drivers/Cache_apc.php @@ -114,7 +114,7 @@ class Cache_apc extends CI_Driver { return FALSE; } - list($value, $time, $ttl) = $stored; + list($data, $time, $ttl) = $stored; return array( 'expire' => $time + $ttl, diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php index a7efdc5de..5f5a31591 100644 --- a/system/libraries/Cache/drivers/Cache_memcached.php +++ b/system/libraries/Cache/drivers/Cache_memcached.php @@ -122,7 +122,7 @@ class Cache_memcached extends CI_Driver { return FALSE; } - list($value, $time, $ttl) = $stored; + list($data, $time, $ttl) = $stored; return array( 'expire' => $time + $ttl, -- cgit v1.2.3-24-g4f1b