Skip to content

更新 3.1.7 #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,61 @@
更新紀錄
########

Version 3.1.7
=============

發布日期:Jan 13, 2018

- 一般性變更

- Updated :doc:`Form Validation Library <libraries/form_validation>` rule ``valid_email`` to use ``INTL_IDNA_VARIANT_UTS46`` for non-ASCII domain names.
- Updated :doc:`Email Library <libraries/email>` to use ``INTL_IDNA_VARIANT_UTS46`` for non-ASCII domain names.
- Updated :doc:`Loader Library <libraries/loader>` method ``model()`` to log both ``CI_Model`` class loading and individual models' initialization.
- Updated :doc:`Pagination Library <libraries/pagination>` to preserve previously set attributes while calling ``initialize()``.
- Updated :doc:`Cache Library <libraries/caching>` to automatically add items to cache on ``increment()``, ``decrement()`` calls for missing keys.
- Deprecated usage of :doc:`CAPTCHA Helper <helpers/captcha_helper>` function :php:func:`create_captcha()` with parameters other than ``$data``.

3.1.7 錯誤修正
--------------

- Fixed a regression (#5276) - :doc:`Database Utilities <database/utilities>` method ``backup()`` generated incorrect ``INSERT`` statements with the 'mysqli' driver.
- Fixed a regression where :doc:`Database Results <database/results>` method ``field_data()`` returned incorrect type names.
- 錯誤修正(編號 5278) - :doc:`URL Helper <helpers/url_helper>` function :php:func:`auto_link()` didn't detect trailing slashes in URLs.
- Fixed a regression (#5282) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` breaks ``ORDER BY`` clauses for subsequent queries.
- 錯誤修正(編號 5279) - :doc:`Query Builder <database/query_builder>` didn't account for already escaped identifiers while applying database name prefixes.
- 錯誤修正(編號 5331) - :doc:`URL Helper <helpers/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 <libraries/sessions>` 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 <libraries/caching>` 'apc' driver when ``save()`` is used with ``$raw = TRUE`` (thanks to Tomas Bortoli).

- 一般性變更

- Deprecated :doc:`Cache Library Library <libraries/caching>` driver 'apc'.
- Updated the :doc:`Session Library <libraries/sessions>` 'redis', 'memcached' drivers to reduce the potential of a locking race conditions.


3.1.6 錯誤修正
--------------

- 錯誤修正(編號 5164) - :doc:`Loader Library <libraries/loader>` method ``library()`` ignored requests to load libraries previously assigned to super-object properties named differently than the library name.
- 錯誤修正(編號 5168) - :doc:`Query Builder <database/query_builder>` method ``count_all_results()`` produced erroneous queries on Microsoft SQL Server when ``ORDER BY`` clauses are cached.
- 錯誤修正(編號 5128) - :doc:`Profiler <general/profiling>` didn't wrap ``$_SESSION`` and configuration arrays in ``<pre>`` tags.
- 錯誤修正(編號 5183) - :doc:`Database Library <database/index>` method ``is_write_type()`` didn't return TRUE for ``MERGE`` statements.
- Fixed a bug where :doc:`Image Manipulation Library <libraries/image_lib>` didn't escape image source paths passed to NetPBM as shell arguments.
- 錯誤修正(編號 5236) - :doc:`Query Builder <database/query_builder>` methods ``limit()``, ``offset()`` break SQL Server 2005, 2008 queries with ``"<tablename>".*`` in the ``SELECT`` clause.
- 錯誤修正(編號 5243) - :doc:`Database Library <database/index>` method ``version()`` didn't work with the 'pdo/dblib' driver.
- 錯誤修正(編號 5246) - :doc:`Database transactions <database/transactions>` status wasn't reset unless ``trans_complete()`` was called.
- 錯誤修正(編號 5260) - :doc:`Database Utilities <database/utilities>` method ``backup()`` generated incorrect ``INSERT`` statements with the 'mysqli' driver.
- Fixed a bug where :doc:`Database Results <database/results>` method ``field_data()`` didn't parse field types with the 'mysqli' driver.

Version 3.1.5
=============

Expand Down
8 changes: 4 additions & 4 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
19 changes: 12 additions & 7 deletions source/database/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ CodeIgniter 提供一個設定檔讓您設定資料庫連線資料(使用者帳
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'autoinit' => TRUE,
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array()
);

某些 資料庫drivers (例如 PDO、PostgreSQL、Oracle、ODBC) 可能需要提供完整的 DSN 字串。
在這些案例當中中,你需要使用 'dsn' 設定參數,因為你使用的 driver's 是基於 php 原生 extension,例如:
在這些案例當中,你需要使用 'dsn' 設定參數,因為你使用的 driver's 是基於 php 原生 extension,例如:

::

Expand Down Expand Up @@ -67,7 +66,6 @@ CodeIgniter 提供一個設定檔讓您設定資料庫連線資料(使用者帳
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'autoinit' => TRUE,
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE
Expand All @@ -86,7 +84,6 @@ CodeIgniter 提供一個設定檔讓您設定資料庫連線資料(使用者帳
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'autoinit' => TRUE,
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE
Expand Down Expand Up @@ -116,7 +113,6 @@ CodeIgniter 提供一個設定檔讓您設定資料庫連線資料(使用者帳
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'autoinit' => TRUE,
'compress' => FALSE,
'encrypt' => FALSE,
'stricton' => FALSE,
Expand Down Expand Up @@ -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 編號。為了使用本設定你需要於資料庫設定參數陣列當中加入。
Expand Down
2 changes: 1 addition & 1 deletion source/database/query_builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()**
Expand Down
7 changes: 1 addition & 6 deletions source/general/core_classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
public function __construct()
{
parent::__construct();
// Your own constructor code
}
}

Expand All @@ -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');
Expand Down
1 change: 1 addition & 0 deletions source/general/creating_libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ Note 大多數的原生類別名稱都使用 CI\_ 做為前置字串。
public function __construct($config = array())
{
parent::__construct($config);
// Your own constructor code
}

}
Expand Down
16 changes: 0 additions & 16 deletions source/general/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -62,11 +56,6 @@ Model 類別是儲存在 **application/models/** 目錄。 它們可以巢狀的

class Model_name extends CI_Model {

public function __construct()
{
parent::__construct();
}

}

這個 **Model_name** 是你的類別名稱。 類別名稱 **一定要** 第一個字母大寫的,其餘部分小寫的。請確認你的類別擴展基本的 Model 類別。
Expand All @@ -75,11 +64,6 @@ Model 類別是儲存在 **application/models/** 目錄。 它們可以巢狀的

class User_model extends CI_Model {

public function __construct()
{
parent::__construct();
}

}

你的檔案目錄會長這樣: ::
Expand Down
6 changes: 5 additions & 1 deletion source/general/urls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ URI 區段
如果你的 Apache server 有啟動 **mod_rewrite** ,你可以很簡單的移除掉這個字串,使用簡單的規則通過修改 .htaccess 即可達成。這裡有簡單的範例檔案,使用”原生“方法,來重導向所有請求,除了指定的項目之外:

::


.. code-block:: apache

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Expand All @@ -45,6 +47,8 @@ URI 區段

::

.. code-block:: apache

RewriteEngine on
RewriteBase /CI
RewriteCond $1 !^(index\.php|images|robots\.txt|$)
Expand Down
10 changes: 7 additions & 3 deletions source/helpers/captcha_helper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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: 陣列

Expand All @@ -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.
4 changes: 3 additions & 1 deletion source/installation/downloads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
下載 CodeIgniter
#######################

- `CodeIgniter v3.1.5 (目前版本) <http://codeigniter.org.tw/downloads/file/CodeIgniter_3.1.5>`_
- `CodeIgniter v3.1.7 (目前版本) <http://codeigniter.org.tw/downloads/file/CodeIgniter_3.1.7>`_
- `CodeIgniter v3.1.6 <http://codeigniter.org.tw/downloads/file/CodeIgniter_3.1.6>`_
- `CodeIgniter v3.1.5 <http://codeigniter.org.tw/downloads/file/CodeIgniter_3.1.5>`_
- `CodeIgniter v3.1.4 <http://codeigniter.org.tw/downloads/file/CodeIgniter_3.1.4>`_
- `CodeIgniter v3.1.3 <http://codeigniter.org.tw/downloads/file/CodeIgniter_3.1.3>`_
- `CodeIgniter v3.1.2 <http://codeigniter.org.tw/downloads/file/CodeIgniter_3.1.2>`_
Expand Down
26 changes: 26 additions & 0 deletions source/installation/upgrade_316.rst
Original file line number Diff line number Diff line change
@@ -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 <https://secure.php.net/manual/en/intro.apc.php>`_.

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.
25 changes: 25 additions & 0 deletions source/installation/upgrade_317.rst
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions source/installation/upgrading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
.. toctree::
:titlesonly:

從 3.1.6 升級到 3.1.7 <upgrade_317>
從 3.1.5 升級到 3.1.6 <upgrade_316>
從 3.1.4 升級到 3.1.5 <upgrade_315>
從 3.1.3 升級到 3.1.4 <upgrade_314>
從 3.1.2 升級到 3.1.3 <upgrade_313>
Expand Down
2 changes: 1 addition & 1 deletion source/libraries/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion source/libraries/loader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Class Reference

$config = array (
'mailtype' => 'html',
'charset' => 'utf-8,
'charset' => 'utf-8',
'priority' => '1'
);

Expand Down
2 changes: 1 addition & 1 deletion source/libraries/pagination.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;**
Expand Down
2 changes: 1 addition & 1 deletion source/libraries/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
4 changes: 2 additions & 2 deletions source/libraries/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,8 @@ when creating a session driver for CodeIgniter:
<http://php.net/sessionhandlerinterface>`_ 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.

Expand Down
2 changes: 1 addition & 1 deletion source/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down