Changeset 816
- Timestamp:
- 10/13/2007 04:45:08 PM (14 months ago)
- Location:
- trunk/system
- Files:
-
- 1 added
- 26 modified
-
core/Kohana.php (modified) (3 diffs)
-
i18n/en_US/database.php (modified) (1 diff)
-
libraries/Cache.php (added)
-
libraries/Calendar.php (modified) (2 diffs)
-
libraries/Controller.php (modified) (3 diffs)
-
libraries/Database.php (modified) (1 diff)
-
libraries/Encrypt.php (modified) (4 diffs)
-
libraries/Ftp.php (modified) (1 diff)
-
libraries/Image_lib.php (modified) (1 diff)
-
libraries/Input.php (modified) (2 diffs)
-
libraries/Loader.php (modified) (6 diffs)
-
libraries/Model.php (modified) (1 diff)
-
libraries/Pagination.php (modified) (1 diff)
-
libraries/Profiler.php (modified) (1 diff)
-
libraries/Router.php (modified) (3 diffs)
-
libraries/Session.php (modified) (1 diff)
-
libraries/URI.php (modified) (3 diffs)
-
libraries/Upload.php (modified) (2 diffs)
-
libraries/User_agent.php (modified) (1 diff)
-
libraries/Validation.php (modified) (1 diff)
-
libraries/View.php (modified) (7 diffs)
-
libraries/drivers/Database_Driver.php (modified) (2 diffs)
-
libraries/drivers/Database_Mysql.php (modified) (3 diffs)
-
libraries/drivers/Database_Pgsql.php (modified) (1 diff)
-
libraries/drivers/Session_Cookie.php (modified) (1 diff)
-
libraries/drivers/Session_Database.php (modified) (2 diffs)
-
libraries/drivers/Session_Driver.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/core/Kohana.php
r812 r816 916 916 917 917 // The name of the file to search for 918 $filename = Config::item('core.locale').'/'.$ type;918 $filename = Config::item('core.locale').'/'.$group; 919 919 920 920 // Loop through the files and include each one, so SYSPATH files … … 935 935 936 936 // Cache the type 937 $language[$ type] = $messages;937 $language[$group] = $messages; 938 938 } 939 939 … … 945 945 if (is_string($line) AND func_num_args() > 1) 946 946 { 947 $line = vsprintf($line, array_slice(func_get_args(), 1)); 947 $args = func_get_args(); 948 $args = array_slice($args, 1); 949 950 // Add the arguments into the line 951 $line = vsprintf($line, is_array($args[0]) ? $args[0] : $args); 948 952 } 949 953 -
trunk/system/i18n/en_US/database.php
r718 r816 4 4 ( 5 5 'undefined_group' => 'The %s group is not defined in your configuration.', 6 'error' => 'There was an SQL error: %s',7 'connection' => 'There was an error connecting to the database: %s',8 'driver_not_supported' => 'The driver is not supported: %s',9 'invalid_dsn' => 'The DSN you supplied is not vailid: %s'6 'error' => 'There was an SQL error: %s', 7 'connection' => 'There was an error connecting to the database: %s', 8 'driver_not_supported' => 'The driver is not supported: %s', 9 'invalid_dsn' => 'The DSN you supplied is not vailid: %s' 10 10 ); -
trunk/system/libraries/Calendar.php
r700 r816 1 1 <?php defined('SYSPATH') or die('No direct script access.'); 2 2 /** 3 * Kohana 3 * Kohana: The swift, small, and secure PHP5 framework 4 4 * 5 * An open source application development framework for PHP 4.3.2 or newer 5 * @package Kohana 6 * @author Kohana Team 7 * @copyright Copyright (c) 2007 Kohana Team 8 * @link http://kohanaphp.com 9 * @license http://kohanaphp.com/license.html 10 * @since Version 2.0 11 * @filesource 12 * $Id$ 13 */ 14 15 /** 16 * Calendar Class 6 17 * 7 * NOTE: This file has been modified from the original CodeIgniter version for 8 * the Kohana framework by the Kohana Development Team. 9 * 10 * @package Kohana 11 * @author Kohana Development Team 12 * @copyright Copyright (c) 2007, Kohana Framework Team 13 * @link http://kohanaphp.com 14 * @license http://kohanaphp.com/user_guide/license.html 15 * @since Version 1.0 16 * @orig_package CodeIgniter 17 * @orig_author Rick Ellis 18 * @orig_copyright Copyright (c) 2006, EllisLab, Inc. 19 * @orig_license http://www.codeigniter.com/user_guide/license.html 20 * @filesource 21 */ 22 23 // ------------------------------------------------------------------------ 24 25 /** 26 * Kohana Calendar Class 27 * 28 * This class enables the creation of calendars 29 * 30 * @package Kohana 31 * @subpackage Libraries 32 * @category Libraries 33 * @author Rick Ellis, Kohana Team 34 * @link http://kohanaphp.com/user_guide/libraries/calendar.html 18 * @category Libraries 19 * @author Rick Ellis, Kohana Team 20 * @copyright Copyright (c) 2006, EllisLab, Inc. 21 * @license http://www.codeigniter.com/user_guide/license.html 22 * @link http://kohanaphp.com/user_guide/en/libraries/calendar.html 35 23 */ 36 24 class Calendar_Core { … … 38 26 private $lang; 39 27 private $local_time; 40 private $template = '';41 private $start_day = 'sunday';42 private $month_type = 'long';43 private $day_type = 'abr';44 private $show_next_prev = FALSE;45 private $next_prev_url = '';28 private $template = ''; 29 private $start_day = 'sunday'; 30 private $month_type = 'long'; 31 private $day_type = 'abr'; 32 private $show_next_prev = FALSE; 33 private $next_prev_url = ''; 46 34 47 35 /** -
trunk/system/libraries/Controller.php
r754 r816 1 1 <?php defined('SYSPATH') or die('No direct script access.'); 2 2 /** 3 * Kohana: The s mall, swift, and secure PHP5 framework3 * Kohana: The swift, small, and secure PHP5 framework 4 4 * 5 5 * @package Kohana … … 16 16 * Controller Class 17 17 * 18 * @category Libraries19 * @author Kohana Team20 * @link http://kohanaphp.com/user_guide/en/general/controllers.html18 * @category Libraries 19 * @author Kohana Team 20 * @link http://kohanaphp.com/user_guide/en/general/controllers.html 21 21 */ 22 22 class Controller_Core extends Kohana { 23 23 24 /** 25 * Constructor 26 */ 24 27 public function __construct() 25 28 { … … 37 40 } 38 41 42 /** 43 * Includes a View within the controller scope 44 * 45 * @access public 46 * @param string 47 * @param array 48 * @return string 49 */ 39 50 public function kohana_include_view($kohana_view_filename, $kohana_input_data) 40 51 { 41 if ($kohana_view_filename == '') return; 52 if ($kohana_view_filename == '') 53 return; 42 54 43 55 // Buffering on -
trunk/system/libraries/Database.php
r795 r816 1 1 <?php defined('SYSPATH') or die('No direct script access.'); 2 2 /** 3 * Kohana: The s mall, swift, and secure PHP5 framework3 * Kohana: The swift, small, and secure PHP5 framework 4 4 * 5 * @package Kohana 6 * @author Kohana Team 7 * @copyright Copyright (c) 2007 Kohana Team 8 * @link http://kohanaphp.com 9 * @license http://kohanaphp.com/user_guide/kohana/license.html 10 * @since Version 1.0 11 * @orig_package CodeIgniter 12 * @orig_author Rick Ellis 13 * @orig_copyright Copyright (c) 2006, EllisLab, Inc. 14 * @orig_license http://www.codeigniter.com/user_guide/license.html 5 * @package Kohana 6 * @author Kohana Team 7 * @copyright Copyright (c) 2007 Kohana Team 8 * @link http://kohanaphp.com 9 * @license http://kohanaphp.com/license.html 10 * @since Version 2.0 15 11 * @filesource 12 * $Id$ 16 13 */ 17 18 // ------------------------------------------------------------------------19 14 20 15 /** 21 16 * Database Class 22 17 * 23 * $Id$ 24 * 25 * @package Kohana 26 * @subpackage Libraries 27 * @category Database 18 * @category Libraries 28 19 * @author Rick Ellis, Kohana Team 20 * @copyright Copyright (c) 2006, EllisLab, Inc. 21 * @license http://www.codeigniter.com/user_guide/license.html 22 * @link http://kohanaphp.com/user_guide/en/general/database.html 29 23 */ 30 24 class Database_Core { -
trunk/system/libraries/Encrypt.php
r712 r816 1 1 <?php defined('SYSPATH') or die('No direct script access.'); 2 2 /** 3 * Kohana: The s mall, swift, and secure PHP5 framework3 * Kohana: The swift, small, and secure PHP5 framework 4 4 * 5 * @package Kohana 6 * @author Kohana Team 7 * @copyright Copyright (c) 2007 Kohana Team 8 * @link http://kohanaphp.com 9 * @license http://kohanaphp.com/user_guide/kohana/license.html 10 * @since Version 1.0 11 * @orig_package CodeIgniter 12 * @orig_author Rick Ellis 13 * @orig_copyright Copyright (c) 2006, EllisLab, Inc. 14 * @orig_license http://www.codeigniter.com/user_guide/license.html 5 * @package Kohana 6 * @author Kohana Team 7 * @copyright Copyright (c) 2007 Kohana Team 8 * @link http://kohanaphp.com 9 * @license http://kohanaphp.com/license.html 10 * @since Version 2.0 15 11 * @filesource 12 * $Id$ 16 13 */ 17 14 18 // ------------------------------------------------------------------------19 20 15 /** 21 * Encrypt ionClass16 * Encrypt Class 22 17 * 23 * $Id$ 24 * 25 * @package Kohana 26 * @subpackage Libraries 27 * @category Encryption 28 * @author Rick Ellis, Kohana Team 29 * @link http://kohanaphp.com/user_guide/libraries/encryption.html 18 * @category Libraries 19 * @author Rick Ellis, Kohana Team 20 * @copyright Copyright (c) 2006, EllisLab, Inc. 21 * @license http://www.codeigniter.com/user_guide/license.html 22 * @link http://kohanaphp.com/user_guide/en/libraries/encrypt.html 30 23 */ 31 24 class Encrypt_Core { 32 25 33 pr ivate$encryption_key = '';34 pr ivate$hash_type = 'sha1';35 pr ivate$mcrypt_exists = FALSE;36 pr ivate$mcrypt_cipher = '';37 pr ivate$mcrypt_mode = '';26 protected $encryption_key = ''; 27 protected $hash_type = 'sha1'; 28 protected $mcrypt_exists = FALSE; 29 protected $mcrypt_cipher = ''; 30 protected $mcrypt_mode = ''; 38 31 39 32 /** … … 146 139 * encoded bit-string using XOR 147 140 * 148 * @access pr ivate149 * @param string 150 * @param string 151 * @return string 152 */ 153 pr ivatefunction xor_encode($string, $key)141 * @access protected 142 * @param string 143 * @param string 144 * @return string 145 */ 146 protected function xor_encode($string, $key) 154 147 { 155 148 $rand = ''; … … 177 170 * plain-text original message 178 171 * 179 * @access private180 * @param string181 * @param string182 * @return string183 */ 184 pr ivatefunction xor_decode($string, $key)172 * @access protected 173 * @param string 174 * @param string 175 * @return string 176 */ 177 protected function xor_decode($string, $key) 185 178 { 186 179 $string = $this->xor_merge($string, $key); … … 200 193 * Takes a string and key as input and computes the difference using XOR 201 194 * 202 * @access pr ivate203 * @param string 204 * @param string 205 * @return string 206 */ 207 pr ivatefunction xor_merge($string, $key)195 * @access protected 196 * @param string 197 * @param string 198 * @return string 199 */ 200 protected function xor_merge($string, $key) 208 201 { 209 202 $hash = $this->hash($key); -
trunk/system/libraries/Ftp.php
r712 r816 1 1 <?php defined('SYSPATH') or die('No direct script access.'); 2 2 /** 3 * Kohana 3 * Kohana: The swift, small, and secure PHP5 framework 4 4 * 5 * An open source application development framework for PHP 4.3.2 or newer 6 * 7 * NOTE: This file has been modified from the original CodeIgniter version for 8 * the Kohana framework by the Kohana Development Team. 9 * 10 * @package Kohana 11 * @author Kohana Development Team 12 * @copyright Copyright (c) 2007, Kohana Framework Team 13 * @link http://kohanaphp.com 14 * @license http://kohanaphp.com/user_guide/license.html 15 * @since Version 1.0 16 * @orig_package CodeIgniter 17 * @orig_author Rick Ellis 18 * @orig_copyright Copyright (c) 2006, EllisLab, Inc. 19 * @orig_license http://www.codeigniter.com/user_guide/license.html 5 * @package Kohana 6 * @author Kohana Team 7 * @copyright Copyright (c) 2007 Kohana Team 8 * @link http://kohanaphp.com 9 * @license http://kohanaphp.com/license.html 10 * @since Version 2.0 20 11 * @filesource 12 * $Id$ 21 13 */ 22 23 // ------------------------------------------------------------------------24 14 25 15 /** 26 16 * FTP Class 27 17 * 28 * @ package Kohana29 * @ subpackage Libraries30 * @c ategory Libraries31 * @ author Rick Ellis, Kohana Team32 * @link http://kohanaphp.com/user_guide/libraries/ftp.html18 * @category Libraries 19 * @author Rick Ellis, Kohana Team 20 * @copyright Copyright (c) 2006, EllisLab, Inc. 21 * @license http://www.codeigniter.com/user_guide/license.html 22 * @link http://kohanaphp.com/user_guide/en/libraries/ftp.html 33 23 */ 34 24 class FTP_Core { -
trunk/system/libraries/Image_lib.php
r807 r816 1 1 <?php defined('SYSPATH') or die('No direct script access.'); 2 2 /** 3 * Kohana 3 * Kohana: The swift, small, and secure PHP5 framework 4 4 * 5 * An open source application development framework for PHP 4.3.2 or newer 5 * @package Kohana 6 * @author Kohana Team 7 * @copyright Copyright (c) 2007 Kohana Team 8 * @link http://kohanaphp.com 9 * @license http://kohanaphp.com/license.html 10 * @since Version 2.0 11 * @filesource 12 * $Id$ 13 */ 14 15 /** 16 * Image_lib Class 6 17 * 7 * NOTE: This file has been modified from the original CodeIgniter version for 8 * the Kohana framework by the Kohana Development Team. 9 * 10 * @package Kohana 11 * @author Kohana Development Team 12 * @copyright Copyright (c) 2007, Kohana Framework Team 13 * @link http://kohanaphp.com 14 * @license http://kohanaphp.com/user_guide/license.html 15 * @since Version 1.0 16 * @orig_package CodeIgniter 17 * @orig_author Rick Ellis 18 * @orig_copyright Copyright (c) 2006, EllisLab, Inc. 19 * @orig_license http://www.codeigniter.com/user_guide/license.html 20 * @filesource 21 */ 22 23 // ------------------------------------------------------------------------ 24 25 /** 26 * Image Manipulation class 27 * 28 * @package Kohana 29 * @subpackage Libraries 30 * @category Image_lib 31 * @author Rick Ellis 32 * @link http://kohanaphp.com/user_guide/libraries/image_lib.html 18 * @category Libraries 19 * @author Rick Ellis, Kohana Team 20 * @copyright Copyright (c) 2006, EllisLab, Inc. 21 * @license http://www.codeigniter.com/user_guide/license.html 22 * @link http://kohanaphp.com/user_guide/en/libraries/image_lib.html 33 23 */ 34 24 class Image_lib_Core { -
trunk/system/libraries/Input.php
r804 r816 1 1 <?php defined('SYSPATH') or die('No direct script access.'); 2 2 /** 3 * Kohana 3 * Kohana: The swift, small, and secure PHP5 framework 4 4 * 5 * An open source application development framework for PHP 4.3.2 or newer 6 * 7 * NOTE: This file has been modified from the original CodeIgniter version for 8 * the Kohana framework by the Kohana Team. 9 * 10 * @package Kohana 11 * @author Kohana Team 12 * @copyright Copyright (c) 2007 Kohana Team 13 * @link http://kohanaphp.com 14 * @license http://kohanaphp.com/user_guide/kohana/license.html 15 * @since Version 1.0 16 * @orig_package CodeIgniter 17 * @orig_author Rick Ellis 18 * @orig_copyright Copyright (c) 2006, EllisLab, Inc. 19 * @orig_license http://www.codeigniter.com/user_guide/license.html 5 * @package Kohana 6 * @author Kohana Team 7 * @copyright Copyright (c) 2007 Kohana Team 8 * @link http://kohanaphp.com 9 * @license http://kohanaphp.com/license.html 10 * @since Version 2.0 20 11 * @filesource 21 *22 12 * $Id$ 23 13 */ 24 25 // ------------------------------------------------------------------------26 14 27 15 /** 28 16 * Input Class 29 17 * 30 * Pre-processes global input data for security 31 * 32 * @package Kohana 33 * @subpackage Libraries 34 * @category Input 35 * @author Rick Ellis 36 * @link http://kohanaphp.com/user_guide/libraries/input.html 18 * @category Libraries 19 * @author Rick Ellis, Kohana Team 20 * @copyright Copyright (c) 2006, EllisLab, Inc. 21 * @license http://www.codeigniter.com/user_guide/license.html 22 * @link http://kohanaphp.com/user_guide/en/libraries/input.html 37 23 */ 38 24 class Input_Core { 39 25 40 protected $use_xss_clean = FALSE; 26 protected static $instances = 0; 27 28 protected $use_xss_clean = FALSE; 41 29 42 30 public $ip_address = FALSE; … … 54 42 public function __construct() 55 43 { 56 // Unset globals. This is effectively the same as register_globals = off 57 foreach (array($_GET, $_POST, $_COOKIE) as $global) 58 { 59 if ( ! is_array($global)) 60 { 61 global $global; 62 $$global = NULL; 44 if (self::$instances === 0) 45 { 46 // Clean $_GET data 47 if (is_array($_GET) AND count($_GET) > 0) 48 { 49 foreach($_GET as $key => $val) 50 { 51 // Unset the global string 52 if (isset($GLOBALS[$str])) 53 { 54 global $$key; 55 $$key = NULL; 56 } 57 58 $_GET[$this->clean_input_keys($key)] = $this->clean_input_data($val); 59 } 63 60 } 64 61 else 65 62 { 66 foreach ($global as $key => $val) 63 $_GET = array(); 64 } 65 66 // Clean $_POST data 67 if (is_array($_POST) AND count($_POST) > 0) 68 { 69 foreach($_POST as $key => $val) 67 70 { 68 global $$key; 69 $$key = NULL; 71 if (isset($GLOBALS[$str])) 72 { 73 global $$key; 74 $$key = NULL; 75 } 76 77 $_POST[$this->clean_input_keys($key)] = $this->clean_input_data($val); 70 78 } 71 79 } 72 } 73 74 // Clean $_GET data 75 if (is_array($_GET) AND count($_GET) > 0) 76 { 77 foreach($_GET as $key => $val) 78 { 79 $_GET[$this->clean_input_keys($key)] = $this->clean_input_data($val); 80 } 81 } 82 83 // Clean $_POST data 84 if (is_array($_POST) AND count($_POST) > 0) 85 { 86 foreach($_POST as $key => $val) 87 { 88 $_POST[$this->clean_input_keys($key)] = $this->clean_input_data($val); 89 } 90 } 91 92 // Clean $_COOKIE data 93 if (is_array($_COOKIE) AND count($_COOKIE) > 0) 94 { 95 foreach($_COOKIE as $key => $val) 96 { 97 $_COOKIE[$this->clean_input_keys($key)] = $this->clean_input_data($val); 98 } 99 } 100 101 Log::add('debug', 'Global POST and COOKIE data sanitized'); 80 else 81 { 82 $_POST = array(); 83 } 84 85 // Clean $_COOKIE data 86 if (is_array($_COOKIE) AND count($_COOKIE) > 0) 87 { 88 foreach($_COOKIE as $key => $val) 89 { 90 if (isset($GLOBALS[$str])) 91 { 92 global $$key; 93
