From 7c26fab4a3db098ef5c4264c33cd4792c2b7a621 Mon Sep 17 00:00:00 2001 From: Mike Funk Date: Fri, 24 Feb 2012 09:45:02 -0500 Subject: updated changelog and user guide. --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/libraries/sessions.rst | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 00d70f323..fd67ac233 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -71,6 +71,7 @@ Release Date: Not Released - Minor speed optimizations and method & property visibility declarations in the Calendar Library. - Removed SHA1 function in the :doc:`Encryption Library `. - Added $config['csrf_regeneration'] to the CSRF protection in the :doc:`Security library `, which makes token regeneration optional. + - Added all_flashdata method to session class. Returns an associative array of only flashdata. - Core diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index ef32f5d71..e8332ee97 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -209,6 +209,10 @@ set_userdata(). To read a flashdata variable:: $this->session->flashdata('item'); + +An array of all flashdata can be retrieved as follows:: + + $this->session->all_flashdata(); If you find that you need to preserve a flashdata variable through an -- cgit v1.2.3-24-g4f1b From b81f909f8aaa3bedc3820c0d4c9056b57113b46e Mon Sep 17 00:00:00 2001 From: Roger Herbert Date: Mon, 12 Mar 2012 12:46:02 +0000 Subject: updated docs & changelog --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/helpers/date_helper.rst | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 8579218b0..469461e43 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -43,6 +43,7 @@ Release Date: Not Released - Changed humanize to include a second param for the separator. - Refactored ``plural()`` and ``singular()`` to avoid double pluralization and support more words. - Added an optional third parameter to ``force_download()`` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default). + - Added an optional third parameter to ``timespan()`` that constrains the number of time units displayed. - Database diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst index ad06dd628..b21d147bd 100644 --- a/user_guide_src/source/helpers/date_helper.rst +++ b/user_guide_src/source/helpers/date_helper.rst @@ -255,14 +255,16 @@ Formats a unix timestamp so that is appears similar to this The first parameter must contain a Unix timestamp. The second parameter must contain a timestamp that is greater that the first timestamp. If -the second parameter empty, the current time will be used. The most -common purpose for this function is to show how much time has elapsed -from some point in time in the past to now. +the second parameter empty, the current time will be used. The third +parameter is optional and limits the number of time units to display. +The most common purpose for this function is to show how much time has +elapsed from some point in time in the past to now. -.. php:method:: timespan($seconds = 1, $time = '') +.. php:method:: timespan($seconds = 1, $time = '', $units = '') :param integer $seconds: a number of seconds :param string $time: Unix timestamp + :param integer $units: a number of time units to display :returns: string Example @@ -271,7 +273,8 @@ Example $post_date = '1079621429'; $now = time(); - echo timespan($post_date, $now); + $units = 2; + echo timespan($post_date, $now, $units); .. note:: The text generated by this function is found in the following language file: language//date_lang.php -- cgit v1.2.3-24-g4f1b From 89338828264a6b50e0eb63c449a96f14f0f84076 Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Mon, 12 Mar 2012 21:03:37 +0700 Subject: Path helper improvement --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/helpers/path_helper.rst | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index f462e1b11..6900279ec 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -45,6 +45,7 @@ Release Date: Not Released - Added an optional third parameter to ``force_download()`` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default). - Added a work-around in force_download() for a bug Android <= 2.1, where the filename extension needs to be in uppercase. - form_dropdown() will now also take an array for unity with other form helpers. + - set_realpath() improvement. - Database diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 1a70af458..6efd93cc1 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -28,10 +28,13 @@ cannot be resolved. :: + $file = '/etc/php5/apache2/php.ini'; + echo set_realpath($file); // returns "/etc/php5/apache2/php.ini" + $non_existent_file = '/path/to/non-exist-file.txt'; + echo set_realpath($non_existent_file, TRUE); // returns an error, as the path could not be resolved + echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" $directory = '/etc/passwd'; - echo set_realpath($directory); // returns "/etc/passwd" + echo set_realpath($directory); // returns "/etc/passwd/" $non_existent_directory = '/path/to/nowhere'; echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved - echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" - - + echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 311b230cf32dda94102866e56e8dd1ef81b5685b Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Mon, 12 Mar 2012 21:49:55 +0700 Subject: Doc --- user_guide_src/source/helpers/path_helper.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 6efd93cc1..4a2252834 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -33,8 +33,8 @@ cannot be resolved. $non_existent_file = '/path/to/non-exist-file.txt'; echo set_realpath($non_existent_file, TRUE); // returns an error, as the path could not be resolved echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" - $directory = '/etc/passwd'; - echo set_realpath($directory); // returns "/etc/passwd/" + $directory = '/etc/php5'; + echo set_realpath($directory); // returns "/etc/php5/" $non_existent_directory = '/path/to/nowhere'; echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" \ No newline at end of file -- cgit v1.2.3-24-g4f1b From f2915f2787170d681a50db39a6650f48eefc8d7b Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Wed, 14 Mar 2012 00:02:39 +0700 Subject: New line and changelog correction --- user_guide_src/source/changelog.rst | 2 +- user_guide_src/source/helpers/path_helper.rst | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 6900279ec..e01cdf391 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -45,7 +45,7 @@ Release Date: Not Released - Added an optional third parameter to ``force_download()`` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default). - Added a work-around in force_download() for a bug Android <= 2.1, where the filename extension needs to be in uppercase. - form_dropdown() will now also take an array for unity with other form helpers. - - set_realpath() improvement. + - set_realpath() can now also handle file paths as opposed to just directories. - Database diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 4a2252834..43caffec2 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -30,11 +30,14 @@ cannot be resolved. $file = '/etc/php5/apache2/php.ini'; echo set_realpath($file); // returns "/etc/php5/apache2/php.ini" + $non_existent_file = '/path/to/non-exist-file.txt'; echo set_realpath($non_existent_file, TRUE); // returns an error, as the path could not be resolved echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" + $directory = '/etc/php5'; echo set_realpath($directory); // returns "/etc/php5/" + $non_existent_directory = '/path/to/nowhere'; echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" \ No newline at end of file -- cgit v1.2.3-24-g4f1b From e464b39b8594ef317cf5b47b4e130ee9f63e7bd5 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 13 Mar 2012 14:09:31 -0400 Subject: Active Record documentation cleanup --- user_guide_src/source/database/active_record.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/database/active_record.rst b/user_guide_src/source/database/active_record.rst index c04e67d2a..e328c11e2 100644 --- a/user_guide_src/source/database/active_record.rst +++ b/user_guide_src/source/database/active_record.rst @@ -68,7 +68,7 @@ Example:: // Produces string: SELECT * FROM mytable The second parameter enables you to set whether or not the active record query -will be reset (by default it will be—just like `$this->db->get()`):: +will be reset (by default it will be just like `$this->db->get()`):: echo $this->db->limit(10,20)->get_compiled_select('mytable', FALSE); // Produces string: SELECT * FROM mytable LIMIT 20, 10 @@ -533,7 +533,7 @@ Query grouping ************** Query grouping allows you to create groups of WHERE clauses by enclosing them in parentheses. This will allow -you to create queries with complex WHERE clauses. Nested groups are supported. Example: +you to create queries with complex WHERE clauses. Nested groups are supported. Example:: $this->db->select('*')->from('my_table') ->group_start() @@ -921,9 +921,9 @@ Method chaining allows you to simplify your syntax by connecting multiple functions. Consider this example:: $query = $this->db->select('title') - ->where('id', $id) - ->limit(10, 20) - ->get('mytable'); + ->where('id', $id) + ->limit(10, 20) + ->get('mytable'); .. _ar-caching: -- cgit v1.2.3-24-g4f1b From ce707b4cafd64b95031690cf927584b1d60c7ad7 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 14 Mar 2012 10:26:08 +0200 Subject: Further improve the path helper --- user_guide_src/source/helpers/path_helper.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 43caffec2..847f5a08b 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -28,16 +28,16 @@ cannot be resolved. :: - $file = '/etc/php5/apache2/php.ini'; - echo set_realpath($file); // returns "/etc/php5/apache2/php.ini" + $file = '/etc/php5/apache2/php.ini'; + echo set_realpath($file); // returns "/etc/php5/apache2/php.ini" - $non_existent_file = '/path/to/non-exist-file.txt'; - echo set_realpath($non_existent_file, TRUE); // returns an error, as the path could not be resolved - echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" + $non_existent_file = '/path/to/non-exist-file.txt'; + echo set_realpath($non_existent_file, TRUE); // shows an error, as the path cannot be resolved + echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" - $directory = '/etc/php5'; - echo set_realpath($directory); // returns "/etc/php5/" + $directory = '/etc/php5'; + echo set_realpath($directory); // returns "/etc/php5/" - $non_existent_directory = '/path/to/nowhere'; - echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved - echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" \ No newline at end of file + $non_existent_directory = '/path/to/nowhere'; + echo set_realpath($non_existent_directory, TRUE); // shows an error, as the path cannot be resolved + echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" -- cgit v1.2.3-24-g4f1b From dd1cabd0eec66ad494d5d7780dadaf23ec0b2216 Mon Sep 17 00:00:00 2001 From: tiyowan Date: Wed, 14 Mar 2012 22:37:43 +0400 Subject: Fix form_input() associative array example to match actual return --- user_guide_src/source/helpers/form_helper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst index 4cb0cfd38..62579ca18 100644 --- a/user_guide_src/source/helpers/form_helper.rst +++ b/user_guide_src/source/helpers/form_helper.rst @@ -177,7 +177,7 @@ form to contain /* Would produce: - + */ If you would like your form to contain some additional data, like -- cgit v1.2.3-24-g4f1b From 5511fbfd8f3054049037124059487096c9c9dde9 Mon Sep 17 00:00:00 2001 From: tiyowan Date: Thu, 15 Mar 2012 21:53:07 +0400 Subject: Add strip_slashes() to string helper documentation --- user_guide_src/source/helpers/string_helper.rst | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst index dc70e461a..2d23fb00c 100644 --- a/user_guide_src/source/helpers/string_helper.rst +++ b/user_guide_src/source/helpers/string_helper.rst @@ -108,6 +108,36 @@ found in http://. Example $string = "http://example.com//index.php"; echo reduce_double_slashes($string); // results in "http://example.com/index.php" +strip_slashes() +=============== + +Removes any slashes from a string. Example + +:: + + $str = "Is your name O\'reilly?"; + echo strip_slashes($str); // results in Is your name O'reilly? + +You can also use an array. Example + +:: + + $str = array( + 'question'  => 'Is your name O\'reilly?', + 'answer' => 'No, my name is O\'connor.' + ); + + $str = strip_slashes($str); + +The above will return the following array: + +:: + + array( + 'question'  => "Is your name O'reilly?", + 'answer' => "No, my name is O'connor." + ); + trim_slashes() ============== -- cgit v1.2.3-24-g4f1b From e538e2ce1b853a8a246c691cbcac37842395c624 Mon Sep 17 00:00:00 2001 From: tiyowan Date: Fri, 16 Mar 2012 20:38:13 +0400 Subject: Fix form_fieldset_close() example to match actual return --- user_guide_src/source/helpers/form_helper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst index 62579ca18..a110f3c14 100644 --- a/user_guide_src/source/helpers/form_helper.rst +++ b/user_guide_src/source/helpers/form_helper.rst @@ -325,7 +325,7 @@ the tag. For example $string = ""; echo form_fieldset_close($string); - // Would produce: + // Would produce: form_checkbox() =============== -- cgit v1.2.3-24-g4f1b From 4ad0fd86e8dc6dba74305dbb0c88c593b46a19a2 Mon Sep 17 00:00:00 2001 From: freewil Date: Tue, 13 Mar 2012 22:37:42 -0400 Subject: add support for httponly cookies --- user_guide_src/source/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index f9e742264..de0eb84c2 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -35,6 +35,8 @@ Release Date: Not Released - Removed previously deprecated SHA1 Library. - Removed previously deprecated use of ``$autoload['core']`` in application/config/autoload.php. Only entries in ``$autoload['libraries']`` are auto-loaded now. + - Added support for HttpOnly cookies with new config option ``cookie_httponly`` (Off by default). + This affects session and CSRF cookies, as well as the behavior of set_cookie() in the Input library and cookie helper. - Helpers -- cgit v1.2.3-24-g4f1b From 8840c96cc0608859ad4b5341c31db9bb1f833792 Mon Sep 17 00:00:00 2001 From: freewil Date: Sun, 18 Mar 2012 15:23:09 -0400 Subject: use php's hash() function for do_hash() helper --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/helpers/security_helper.rst | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 274026481..45bd41beb 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -47,6 +47,7 @@ Release Date: Not Released - Added a work-around in force_download() for a bug Android <= 2.1, where the filename extension needs to be in uppercase. - form_dropdown() will now also take an array for unity with other form helpers. - set_realpath() can now also handle file paths as opposed to just directories. + - do_hash() now uses PHP's native hash() function, supporting more algorithms. - Database diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst index 01018c61a..b1bcf2b4a 100644 --- a/user_guide_src/source/helpers/security_helper.rst +++ b/user_guide_src/source/helpers/security_helper.rst @@ -34,8 +34,9 @@ More info can be found there. do_hash() ========= -Permits you to create SHA1 or MD5 one way hashes suitable for encrypting -passwords. Will create SHA1 by default. Examples +Permits you to create one way hashes suitable for encrypting +passwords. Will create SHA1 by default. See `hash_algos() `_ +for a full list of supported algorithms. :: @@ -43,7 +44,7 @@ passwords. Will create SHA1 by default. Examples $str = do_hash($str, 'md5'); // MD5 .. note:: This function was formerly named dohash(), which has been - deprecated in favor of `do_hash()`. + removed in favor of `do_hash()`. strip_image_tags() ================== -- cgit v1.2.3-24-g4f1b From 50bff7c06c177f580db956ef5df9a490141de5f6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 19 Mar 2012 12:16:38 +0200 Subject: Fix possible error messages with do_hash() and alter a changelog entry --- user_guide_src/source/changelog.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 1c709d4d5..5dcf54dd9 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -35,8 +35,6 @@ Release Date: Not Released - Removed previously deprecated SHA1 Library. - Removed previously deprecated use of ``$autoload['core']`` in application/config/autoload.php. Only entries in ``$autoload['libraries']`` are auto-loaded now. - - Added support for HttpOnly cookies with new config option ``cookie_httponly`` (Off by default). - This affects session and CSRF cookies, as well as the behavior of set_cookie() in the Input library and cookie helper. - Helpers @@ -111,6 +109,7 @@ Release Date: Not Released - $config['rewrite_short_tags'] now has no effect when using PHP 5.4 as *`. + - Added support for HTTP-Only cookies with new config option ``cookie_httponly`` (default FALSE). Bug fixes for 3.0 ------------------ -- cgit v1.2.3-24-g4f1b From 55201acd0692f02eb5927f412db73b925b6ba738 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:20:39 +0200 Subject: Fixed an issue with PostgreSQL's escape_str() --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src/source') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 6d596a4a1..ed0b710c3 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -162,6 +162,7 @@ Bug fixes for 3.0 - Fixed a bug in the :doc:`Session Library ` where a PHP E_NOTICE error was triggered by _unserialize() due to results from databases such as MSSQL and Oracle being space-padded on the right. - Fixed a bug (#501) - set_rules() to check if the request method is not 'POST' before aborting, instead of depending on count($_POST) in the :doc:`Form Validation Library `. - Fixed a bug (#940) - csrf_verify() used to set the CSRF cookie while processing a POST request with no actual POST data, which resulted in validating a request that should be considered invalid. +- Fixed a bug in PostgreSQL's escape_str() where it didn't properly escape LIKE wild characters. Version 2.1.1 ============= -- cgit v1.2.3-24-g4f1b