From b0eae5f81a4cb92911bb215ad814ae5caef4f61d Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 10 Aug 2011 09:00:52 -0600 Subject: Typecast limit and offset in the Database Driver to integers. Fixes https://bitbucket.org/ellislab/codeigniter-reactor/issue/341/active-record-limit-function-have-sql#comment-597403 --- system/database/DB_active_rec.php | 4 ++-- user_guide/changelog.html | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 0238c7348..7bab729f5 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -870,11 +870,11 @@ class CI_DB_active_record extends CI_DB_driver { */ public function limit($value, $offset = '') { - $this->ar_limit = $value; + $this->ar_limit = (int) $value; if ($offset != '') { - $this->ar_offset = $offset; + $this->ar_offset = (int) $offset; } return $this; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 7b74be0d9..9fbadbf2f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -77,6 +77,7 @@ Change Log
  • Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
  • Callback validation rules can now accept parameters like any other validation rule.
  • Added "application/x-csv" to mimes.php.
  • +
  • Typecast limit and offset in the Database Driver to integers.
  • Helpers -- cgit v1.2.3-24-g4f1b