diff --git a/source/changelog.rst b/source/changelog.rst index 5fead8c..eb4c12d 100644 --- a/source/changelog.rst +++ b/source/changelog.rst @@ -2,6 +2,61 @@ 更新紀錄 ######## +Version 3.1.7 +============= + +發布日期:Jan 13, 2018 + +- 一般性變更 + + - Updated :doc:`Form Validation Library ` rule ``valid_email`` to use ``INTL_IDNA_VARIANT_UTS46`` for non-ASCII domain names. + - Updated :doc:`Email Library ` to use ``INTL_IDNA_VARIANT_UTS46`` for non-ASCII domain names. + - Updated :doc:`Loader Library ` method ``model()`` to log both ``CI_Model`` class loading and individual models' initialization. + - Updated :doc:`Pagination Library ` to preserve previously set attributes while calling ``initialize()``. + - Updated :doc:`Cache Library ` to automatically add items to cache on ``increment()``, ``decrement()`` calls for missing keys. + - Deprecated usage of :doc:`CAPTCHA Helper ` function :php:func:`create_captcha()` with parameters other than ``$data``. + +3.1.7 錯誤修正 +-------------- + +- Fixed a regression (#5276) - :doc:`Database Utilities ` method ``backup()`` generated incorrect ``INSERT`` statements with the 'mysqli' driver. +- Fixed a regression where :doc:`Database Results ` method ``field_data()`` returned incorrect type names. +- 錯誤修正(編號 5278) - :doc:`URL Helper ` function :php:func:`auto_link()` didn't detect trailing slashes in URLs. +- Fixed a regression (#5282) - :doc:`Query Builder ` method ``count_all_results()`` breaks ``ORDER BY`` clauses for subsequent queries. +- 錯誤修正(編號 5279) - :doc:`Query Builder ` didn't account for already escaped identifiers while applying database name prefixes. +- 錯誤修正(編號 5331) - :doc:`URL Helper ` function :php:func:`auto_link()` converted e-mail addresses starting with 'www.' to both "url" and "email" links. +- Fixed a bug where ``$config['allow_get_array']`` defaulted to ``FALSE`` if it didn't exist in the config file. +- 錯誤修正(編號 5379) - :doc:`Session Library ` would incorrectly fail to obtain a lock that it already has on PHP 7 with the 'memcached' driver. + +Version 3.1.6 +============= + +發布日期:Sep 25, 2017 + +- **安全性** + + - Fixed a potential object injection in :doc:`Cache Library ` 'apc' driver when ``save()`` is used with ``$raw = TRUE`` (thanks to Tomas Bortoli). + +- 一般性變更 + + - Deprecated :doc:`Cache Library Library ` driver 'apc'. + - Updated the :doc:`Session Library ` 'redis', 'memcached' drivers to reduce the potential of a locking race conditions. + + +3.1.6 錯誤修正 +-------------- + +- 錯誤修正(編號 5164) - :doc:`Loader Library ` method ``library()`` ignored requests to load libraries previously assigned to super-object properties named differently than the library name. +- 錯誤修正(編號 5168) - :doc:`Query Builder ` method ``count_all_results()`` produced erroneous queries on Microsoft SQL Server when ``ORDER BY`` clauses are cached. +- 錯誤修正(編號 5128) - :doc:`Profiler ` didn't wrap ``$_SESSION`` and configuration arrays in ``
`` tags.
+-  錯誤修正(編號 5183) - :doc:`Database Library ` method ``is_write_type()`` didn't return TRUE for ``MERGE`` statements.
+-  Fixed a bug where :doc:`Image Manipulation Library ` didn't escape image source paths passed to NetPBM as shell arguments.
+-  錯誤修正(編號 5236) - :doc:`Query Builder ` methods ``limit()``, ``offset()`` break SQL Server 2005, 2008 queries with ``"".*`` in the ``SELECT`` clause.
+-  錯誤修正(編號 5243) - :doc:`Database Library ` method ``version()`` didn't work with the 'pdo/dblib' driver.
+-  錯誤修正(編號 5246) - :doc:`Database transactions ` status wasn't reset unless ``trans_complete()`` was called.
+-  錯誤修正(編號 5260) - :doc:`Database Utilities ` method ``backup()`` generated incorrect ``INSERT`` statements with the 'mysqli' driver.
+-  Fixed a bug where :doc:`Database Results ` method ``field_data()`` didn't parse field types with the 'mysqli' driver.
+
 Version 3.1.5
 =============
 
diff --git a/source/conf.py b/source/conf.py
index da9766f..48d7f2e 100644
--- a/source/conf.py
+++ b/source/conf.py
@@ -41,16 +41,16 @@
 
 # General information about the project.
 project = u'CodeIgniter'
-copyright = u'2014 - 2017, British Columbia Institute of Technology'
+copyright = u'2014 - 2018, British Columbia Institute of Technology'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
 # The short X.Y version.
-version = '3.1.5'
+version = '3.1.7'
 # The full version, including alpha/beta/rc tags.
-release = '3.1.5'
+release = '3.1.7'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -229,7 +229,7 @@
 epub_title = u'CodeIgniter'
 epub_author = u'British Columbia Institute of Technology'
 epub_publisher = u'British Columbia Institute of Technology'
-epub_copyright = u'2014 - 2016, British Columbia Institute of Technology'
+epub_copyright = u'2014 - 2018, British Columbia Institute of Technology'
 
 # The language of the text. It defaults to the language option
 # or en if the language is not set.
diff --git a/source/database/configuration.rst b/source/database/configuration.rst
index d2eee25..43649d0 100644
--- a/source/database/configuration.rst
+++ b/source/database/configuration.rst
@@ -25,7 +25,6 @@ CodeIgniter 提供一個設定檔讓您設定資料庫連線資料(使用者帳
 		'char_set' => 'utf8',
 		'dbcollat' => 'utf8_general_ci',
 		'swap_pre' => '',
-		'autoinit' => TRUE,
 		'encrypt' => FALSE,
 		'compress' => FALSE,
 		'stricton' => FALSE,
@@ -33,7 +32,7 @@ CodeIgniter 提供一個設定檔讓您設定資料庫連線資料(使用者帳
 	);
 
 某些 資料庫drivers (例如 PDO、PostgreSQL、Oracle、ODBC) 可能需要提供完整的 DSN 字串。
-在這些案例當中中,你需要使用 'dsn' 設定參數,因為你使用的 driver's 是基於 php 原生 extension,例如:
+在這些案例當中,你需要使用 'dsn' 設定參數,因為你使用的 driver's 是基於 php 原生 extension,例如:
 
 ::
 
@@ -67,7 +66,6 @@ CodeIgniter 提供一個設定檔讓您設定資料庫連線資料(使用者帳
 				'char_set' => 'utf8',
 				'dbcollat' => 'utf8_general_ci',
 				'swap_pre' => '',
-				'autoinit' => TRUE,
 				'encrypt' => FALSE,
 				'compress' => FALSE,
 				'stricton' => FALSE
@@ -86,7 +84,6 @@ CodeIgniter 提供一個設定檔讓您設定資料庫連線資料(使用者帳
 				'char_set' => 'utf8',
 				'dbcollat' => 'utf8_general_ci',
 				'swap_pre' => '',
-				'autoinit' => TRUE,
 				'encrypt' => FALSE,
 				'compress' => FALSE,
 				'stricton' => FALSE
@@ -116,7 +113,6 @@ CodeIgniter 提供一個設定檔讓您設定資料庫連線資料(使用者帳
 		'char_set' => 'utf8',
 		'dbcollat' => 'utf8_general_ci',
 		'swap_pre' => '',
-		'autoinit' => TRUE,
 		'compress' => FALSE,
 		'encrypt' => FALSE,
 		'stricton' => FALSE,
@@ -171,10 +167,19 @@ CodeIgniter 提供一個設定檔讓您設定資料庫連線資料(使用者帳
 
 **swap_pre**	用來被 dbprefix 交換的預設的資料表前綴。
 				當你可能需要使用手寫的查詢在一個分散式程式設計中是十分有用的,所需要使用的前綴依然可以由終端用戶來決定。
-**autoinit**	是否需要在類別被載入的時候自動的進行資料庫連線。
-				如果設為 false,連線將會在執行第一個查詢之前進行。
 **schema**		資料庫的 schema,預設為 "public"。被 PostgreSQL 和 ODBC 類型使用。
 **encrypt**		是否進行加密的連線。
+
+			  - 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
+			  - 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
+			  
+			    - 'ssl_key'    - Path to the private key file
+			    - 'ssl_cert'   - Path to the public key certificate file
+			    - 'ssl_ca'     - Path to the certificate authority file
+			    - 'ssl_capath' - Path to a directory containing trusted CA certificates in PEM format
+			    - 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
+			    - 'ssl_verify' - TRUE/FALSE; Whether to verify the server certificate or not ('mysqli' only)
+
 **compress**	是否進行壓縮的客戶端(MySQL 專用)。
 **stricton**	TRUE/FALSE (boolean) - 是否使用 "Strict Mode" 連線,使用嚴格的 SQL 對開發中的應用程式是件好事。
 **port**		資料庫 port 編號。為了使用本設定你需要於資料庫設定參數陣列當中加入。
diff --git a/source/database/query_builder.rst b/source/database/query_builder.rst
index 84b18fc..22dce1a 100644
--- a/source/database/query_builder.rst
+++ b/source/database/query_builder.rst
@@ -105,7 +105,7 @@
 
 ::
 
-	$this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE);
+	$this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4) AS amount_paid', FALSE);
 	$query = $this->db->get('mytable');
 
 **$this->db->select_max()**
diff --git a/source/general/core_classes.rst b/source/general/core_classes.rst
index 484d40e..2e65f5f 100644
--- a/source/general/core_classes.rst
+++ b/source/general/core_classes.rst
@@ -68,6 +68,7 @@
 			public function __construct()
 			{
 				parent::__construct();
+				// Your own constructor code
 			}
 		}
 
@@ -79,12 +80,6 @@
 
 	class Welcome extends MY_Controller {
 
-		public function __construct()
-		{
-			parent::__construct();
-			// Your own constructor code
-		}
-
 		public function index()
 		{
 			$this->load->view('welcome_message');
diff --git a/source/general/creating_libraries.rst b/source/general/creating_libraries.rst
index 1f81a44..bfc0fbf 100644
--- a/source/general/creating_libraries.rst
+++ b/source/general/creating_libraries.rst
@@ -181,6 +181,7 @@ Note 大多數的原生類別名稱都使用 CI\_ 做為前置字串。
 		public function __construct($config = array())
 		{
 			parent::__construct($config);
+			// Your own constructor code
 		}
 
 	}
diff --git a/source/general/models.rst b/source/general/models.rst
index 684bc1d..1a55083 100644
--- a/source/general/models.rst
+++ b/source/general/models.rst
@@ -17,12 +17,6 @@ Models 是 PHP 類別,它是被設計來存取資料庫用的。比如說,
 		public $content;
 		public $date;
 
-		public function __construct()
-		{
-			parent::__construct();
-			// Your own constructor code
-		}
-
 		public function get_last_ten_entries()
 		{
 			$query = $this->db->get('entries', 10);
@@ -62,11 +56,6 @@ Model 類別是儲存在 **application/models/** 目錄。 它們可以巢狀的
 
 	class Model_name extends CI_Model {
 
-		public function __construct()
-		{
-			parent::__construct();
-		}
-
 	}
 
 這個 **Model_name** 是你的類別名稱。 類別名稱 **一定要** 第一個字母大寫的,其餘部分小寫的。請確認你的類別擴展基本的 Model 類別。
@@ -75,11 +64,6 @@ Model 類別是儲存在 **application/models/** 目錄。 它們可以巢狀的
 
 	class User_model extends CI_Model {
 
-		public function __construct()
-		{
-			parent::__construct();
-		}
-
 	}
 
 你的檔案目錄會長這樣: ::
diff --git a/source/general/urls.rst b/source/general/urls.rst
index 41b3bdd..f51205e 100644
--- a/source/general/urls.rst
+++ b/source/general/urls.rst
@@ -34,7 +34,9 @@ URI 區段
 如果你的 Apache server 有啟動 **mod_rewrite** ,你可以很簡單的移除掉這個字串,使用簡單的規則通過修改 .htaccess 即可達成。這裡有簡單的範例檔案,使用”原生“方法,來重導向所有請求,除了指定的項目之外:
 
 ::
-	
+
+.. code-block:: apache
+
 	RewriteEngine On
 	RewriteCond %{REQUEST_FILENAME} !-f
 	RewriteCond %{REQUEST_FILENAME} !-d
@@ -45,6 +47,8 @@ URI 區段
 
 ::
 
+.. code-block:: apache
+
 	RewriteEngine on
 	RewriteBase /CI
 	RewriteCond $1 !^(index\.php|images|robots\.txt|$)
diff --git a/source/helpers/captcha_helper.rst b/source/helpers/captcha_helper.rst
index 1d291ed..18ed2ed 100644
--- a/source/helpers/captcha_helper.rst
+++ b/source/helpers/captcha_helper.rst
@@ -128,9 +128,9 @@ CAPTCHA 輔助函式的載入語法如下:
 .. php:function:: create_captcha([$data = ''[, $img_path = ''[, $img_url = ''[, $font_path = '']]]])
 
 	:param	array	$data: 存有驗證碼資訊的陣列
-	:param	string	$img_path: 建立驗證碼圖示的路徑
-	:param	string	$img_url: 驗證碼圖示資料夾的 URL
-	:param	string	$font_path: 字型檔的伺服器路徑
+	:param	string	$img_path: 建立驗證碼圖示的路徑 (DEPRECATED)
+	:param	string	$img_url: 驗證碼圖示資料夾的 URL (DEPRECATED)
+	:param	string	$font_path: 字型檔的伺服器路徑 (DEPRECATED)
 	:returns:	array('word' => $word, 'time' => $now, 'image' => $img)
 	:rtype:	陣列
 
@@ -152,3 +152,7 @@ CAPTCHA 輔助函式的載入語法如下:
 	回傳的 **time** 是被用來當作圖片檔名(沒有副檔名)的時間戳記,就像是這樣的數字:1139612155.3422
 
 	回傳的 **word** 是出現在驗證碼圖示中的文字,如果沒有指定特定字串給函式的話將會隨機挑選一個字串。
+
+	.. note:: Usage of the ``$img_path``, ``$img_url`` and ``$font_path``
+		parameters is DEPRECATED. Provide them in the ``$data`` array
+		instead.
diff --git a/source/installation/downloads.rst b/source/installation/downloads.rst
index 0e536e6..adbf3a6 100644
--- a/source/installation/downloads.rst
+++ b/source/installation/downloads.rst
@@ -2,7 +2,9 @@
 下載 CodeIgniter
 #######################
 
--  `CodeIgniter v3.1.5 (目前版本) `_
+-  `CodeIgniter v3.1.7 (目前版本) `_
+-  `CodeIgniter v3.1.6 `_
+-  `CodeIgniter v3.1.5 `_
 -  `CodeIgniter v3.1.4 `_
 -  `CodeIgniter v3.1.3 `_
 -  `CodeIgniter v3.1.2 `_
diff --git a/source/installation/upgrade_316.rst b/source/installation/upgrade_316.rst
new file mode 100644
index 0000000..242a0ec
--- /dev/null
+++ b/source/installation/upgrade_316.rst
@@ -0,0 +1,26 @@
+#####################
+從 3.1.5 升級到 3.1.6
+#####################
+
+在執行升級之前,你應該更換 index.php 為靜態檔案,將網站導向此靜態網頁。
+
+步驟 1:更新網站 CodeIgniter 檔案
+=================================
+
+取代 *system/* 目錄打下的所有目錄與檔案
+
+.. 提醒:: 假如您有修改此目錄底下的檔案,麻煩請先複製備份。
+
+步驟 2: Remove usage of the APC Cache driver (deprecation)
+==========================================================
+
+The :doc:`Cache Library <../libraries/caching>` APC driver is now
+deprecated, as the APC extension is effectively dead, as explained in its
+`PHP Manual page `_.
+
+If your application happens to be using it, you can switch to another
+cache driver, as APC support will be removed in a future CodeIgniter
+version.
+
+.. 提醒:: The driver is still available, but you're strongly encouraged
+	to remove its usage sooner rather than later.
diff --git a/source/installation/upgrade_317.rst b/source/installation/upgrade_317.rst
new file mode 100644
index 0000000..add21e3
--- /dev/null
+++ b/source/installation/upgrade_317.rst
@@ -0,0 +1,25 @@
+#####################
+從 3.1.6 升級到 3.1.7
+#####################
+
+在執行升級之前,你應該更換 index.php 為靜態檔案,將網站導向此靜態網頁。
+
+步驟 1:更新網站 CodeIgniter 檔案
+=================================
+
+取代 *system/* 目錄打下的所有目錄與檔案
+
+.. 提醒:: 假如您有修改此目錄底下的檔案,麻煩請先複製備份。
+
+步驟 2:Remove usage of CAPTCHA helper extra parameters (deprecation)
+=====================================================================
+
+The :doc:`CAPTCHA Helper <../helpers/captcha_helper>` function
+:php:func:`create_captcha()` allows passing of its ``img_path``, ``img_url``
+and ``font_path`` options as the 2nd, 3rd and 4th parameters respectively.
+
+This kind of usage is now deprecated and you should just pass the options
+in question as part of the first parameter array.
+
+.. 提醒:: The functionality in question is still available, but you're
+	strongly encouraged to remove its usage sooner rather than later.
diff --git a/source/installation/upgrading.rst b/source/installation/upgrading.rst
index b8e61bf..cdba3c9 100644
--- a/source/installation/upgrading.rst
+++ b/source/installation/upgrading.rst
@@ -7,6 +7,8 @@
 .. toctree::
 	:titlesonly:
 
+	從 3.1.6 升級到 3.1.7 
+	從 3.1.5 升級到 3.1.6 
 	從 3.1.4 升級到 3.1.5 
 	從 3.1.3 升級到 3.1.4 
 	從 3.1.2 升級到 3.1.3 
diff --git a/source/libraries/input.rst b/source/libraries/input.rst
index e7107fa..300f471 100644
--- a/source/libraries/input.rst
+++ b/source/libraries/input.rst
@@ -245,7 +245,7 @@ Class Reference
 		data::
 
 			$this->input->cookie('some_cookie');
-			$this->input->cookie('some_cookie, TRUE); // with XSS filter
+			$this->input->cookie('some_cookie', TRUE); // with XSS filter
 
 		To return an array of multiple cookie values, pass all the required keys
 		as an array.
diff --git a/source/libraries/loader.rst b/source/libraries/loader.rst
index 8a8cdcd..8125e4e 100644
--- a/source/libraries/loader.rst
+++ b/source/libraries/loader.rst
@@ -125,7 +125,7 @@ Class Reference
 
 			$config = array (
 				'mailtype' => 'html',
-				'charset'  => 'utf-8,
+				'charset'  => 'utf-8',
 				'priority' => '1'
 			);
 
diff --git a/source/libraries/pagination.rst b/source/libraries/pagination.rst
index 6fdda40..fbc75ea 100644
--- a/source/libraries/pagination.rst
+++ b/source/libraries/pagination.rst
@@ -128,7 +128,7 @@ the offset segment.
 
 **$config['suffix'] = '';**
 
-A custom suffix added to the path. The sufix value will be right after
+A custom suffix added to the path. The suffix value will be right after
 the offset segment.
 
 **$config['use_global_url_suffix'] = FALSE;**
diff --git a/source/libraries/security.rst b/source/libraries/security.rst
index 4dd3473..26081d7 100644
--- a/source/libraries/security.rst
+++ b/source/libraries/security.rst
@@ -107,7 +107,7 @@ Class Reference
 		If the optional second parameter is set to true, it will return boolean TRUE if
 		the image is safe to use and FALSE if malicious data was detected in it.
 
-		.. important:: This method is not suitable for filtering HTML attribute vales!
+		.. important:: This method is not suitable for filtering HTML attribute values!
 			Use :php:func:`html_escape()` for that instead.
 
 	.. php:method:: sanitize_filename($str[, $relative_path = FALSE])
diff --git a/source/libraries/sessions.rst b/source/libraries/sessions.rst
index b1f658d..994dc2e 100644
--- a/source/libraries/sessions.rst
+++ b/source/libraries/sessions.rst
@@ -757,8 +757,8 @@ when creating a session driver for CodeIgniter:
     `_ interface.
 
     .. note:: You may notice that ``SessionHandlerInterface`` is provided
-    	by PHP since version 5.4.0. CodeIgniter will automatically declare
-    	the same interface if you're running an older PHP version.
+        by PHP since version 5.4.0. CodeIgniter will automatically declare
+        the same interface if you're running an older PHP version.
 
     The link will explain why and how.
 
diff --git a/source/license.rst b/source/license.rst
index a6d2a1c..747c65d 100644
--- a/source/license.rst
+++ b/source/license.rst
@@ -2,7 +2,7 @@
 The MIT License (MIT)
 #####################
 
-Copyright (c) 2014 - 2017, British Columbia Institute of Technology
+Copyright (c) 2014 - 2018, British Columbia Institute of Technology
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal