diff options
author | Andrey Andreev <narf@devilix.net> | 2014-10-05 23:04:19 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-10-05 23:04:19 +0200 |
commit | 4a485a73d64a8bebc7625aabc5fdc361d5e7dc56 (patch) | |
tree | cb18690c4de1c6ca008227260f9dd0cd2b9279d2 /user_guide_src/source/libraries/security.rst | |
parent | 39ec29585b7cdca7edc1a0757c913a13a2ee4f85 (diff) | |
parent | d444d445ed0458a352ecb9ff79ffd158677ee805 (diff) |
Merge branch 'develop' into feature/session
Diffstat (limited to 'user_guide_src/source/libraries/security.rst')
-rw-r--r-- | user_guide_src/source/libraries/security.rst | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/user_guide_src/source/libraries/security.rst b/user_guide_src/source/libraries/security.rst index fb875a0d9..0c51e342b 100644 --- a/user_guide_src/source/libraries/security.rst +++ b/user_guide_src/source/libraries/security.rst @@ -97,6 +97,13 @@ by editing the 'csrf_exclude_uris' config parameter:: $config['csrf_exclude_uris'] = array('api/person/add'); +Regular expressions are also supported (case-insensitive):: + + $config['csrf_exclude_uris'] = array( + 'api/record/[0-9]+', + 'api/title/[a-z]+' + ); + *************** Class Reference *************** @@ -156,4 +163,19 @@ Class Reference This method acts a lot like PHP's own native ``html_entity_decode()`` function in ENT_COMPAT mode, only it tries to detect HTML entities that don't end in a semicolon because some browsers allow that. - If the ``$charset`` parameter is left empty, then your configured ``$config['charset']`` value will be used.
\ No newline at end of file + If the ``$charset`` parameter is left empty, then your configured ``$config['charset']`` value will be used. + + .. method:: get_random_bytes($length) + + :param int $length: Output length + :returns: A binary stream of random bytes or FALSE on failure + :rtype: string + + A convenience method for getting proper random bytes via ``mcrypt_create_iv()``, + ``/dev/urandom`` or ``openssl_random_pseudo_bytes()`` (in that order), if one + of them is available. + + Used for generating CSRF and XSS tokens. + + .. note:: The output is NOT guaranteed to be cryptographically secure, + just the best attempt at that.
\ No newline at end of file |