Skip to content

Commit 9187ed3

Browse files
committed
[ci skip] Formally deprecate 'global_xss_filtering'
1 parent 52caf59 commit 9187ed3

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

application/config/config.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@
404404
| Determines whether the XSS filter is always active when GET, POST or
405405
| COOKIE data is encountered
406406
|
407+
| WARNING: This feature is DEPRECATED and currently available only
408+
| for backwards compatibility purposes!
409+
|
407410
*/
408411
$config['global_xss_filtering'] = FALSE;
409412

user_guide_src/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ Release Date: Not Released
480480

481481
- :doc:`Input Library <libraries/input>` changes include:
482482

483+
- Deprecated the ``$config['global_xss_filtering']`` setting.
483484
- Added ``method()`` to retrieve ``$_SERVER['REQUEST_METHOD']``.
484485
- Added support for arrays and network addresses (e.g. 192.168.1.1/24) for use with the *proxy_ips* setting.
485486
- Added method ``input_stream()`` to aid in using **php://input** stream data such as one passed via PUT, DELETE and PATCH requests.

user_guide_src/source/installation/upgrade_300.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,22 @@ PHP's native ``hash()`` function. It is deprecated and scheduled for removal in
551551
.. note:: This function is still available, but you're strongly encouraged to remove its usage sooner
552552
rather than later.
553553

554+
The $config['global_xss_filtering'] setting
555+
===========================================
556+
557+
As already explained above, XSS filtering should not be done on input data,
558+
but on output instead. Therefore, the ``$config['global_xss_filtering']``,
559+
which automatically filters *input* data, is considered a bad practice and
560+
is now deprecated.
561+
562+
Instead, you should manually escape any user-provided data via the
563+
:php:func:`xss_clean()` function when you need to output it, or use a
564+
library like `HTML Purifier <http://htmlpurifier.org/>`_ that does that
565+
for you.
566+
567+
.. note:: The setting is still available, but you're strongly encouraged to
568+
remove its usage sooner rather than later.
569+
554570
File helper read_file()
555571
=======================
556572

user_guide_src/source/libraries/input.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ this::
5353
Please refer to the :doc:`Security class <security>` documentation for
5454
information on using XSS Filtering in your application.
5555

56+
.. important:: The 'global_xss_filtering' setting is DEPRECATED and kept
57+
solely for backwards-compatibility purposes. XSS escaping should
58+
be performed on *output*, not *input*!
59+
5660
*******************
5761
Accessing form data
5862
*******************

0 commit comments

Comments
 (0)