diff options
author | Andrey Andreev <narf@bofh.bg> | 2013-03-04 06:38:16 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2013-03-04 06:38:16 +0100 |
commit | 5780d8b2078126f8eb5738658fceadd38c66fe5b (patch) | |
tree | 1d64a828213580691b7163e997cac26538268032 | |
parent | c59498655bd9e919812ad4da8e7c7be1e0e73100 (diff) |
Fix #2298
-rw-r--r-- | system/database/DB_result.php | 9 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 |
2 files changed, 4 insertions, 6 deletions
diff --git a/system/database/DB_result.php b/system/database/DB_result.php index a044fd5dc..41a851777 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -478,12 +478,9 @@ class CI_DB_result { return NULL; } - if (isset($result[$this->current_row + 1])) - { - ++$this->current_row; - } - - return $result[$this->current_row]; + return isset($result[$this->current_row + 1]) + ? $result[++$this->current_row] + : NULL; } // -------------------------------------------------------------------- diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 216bf80bc..07dae1fdc 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -487,6 +487,7 @@ Bug fixes for 3.0 - Fixed a bug (#2255) - :doc:`Email Library <libraries/email>` didn't apply ``smtp_timeout``to socket reads and writes. - Fixed a bug (#2239) - :doc:`Email Library <libraries/email>` improperly handled the Subject when used with ``bcc_batch_mode`` resulting in E_WARNING messages and an empty Subject. - Fixed a bug (#2234) - :doc:`Query Builder <database/query_builder>` didn't reset JOIN cache for write-type queries. +- Fixed a bug (#2298) - :doc:`Database Results <database/results>` method `next_row()` kept returning the last row, allowing for infinite loops. Version 2.1.3 ============= |