Welcome Guest, Not a member yet? Register   Sign In
CI2.1.3 Limit bug?
#1

[eluser]ladooboy[/eluser]
I've upgraded from CI2.0.2 to CI2.1.3 and noticed that all queries with an EMPTY string or FALSE value for limit would get a "limit 0" on the end of every query.

Code:
public function limit($value, $offset = '')
{
  $this->ar_limit = (int) $value;

  if ($offset != '')
  {
   $this->ar_offset = (int) $offset;
  }

  return $this;
}

The reason is this line
Code:
$this->ar_limit = (int) $value;

If you pass FALSE or EMPTY STRING it will convert the $value to a 0 and limit every query to zero results. Same problem for offset.

I've removed the (int) conversion for LIMIT and OFFSET for now, which has fixed the issue.


Messages In This Thread
CI2.1.3 Limit bug? - by El Forum - 12-12-2012, 01:21 PM
CI2.1.3 Limit bug? - by El Forum - 12-12-2012, 01:40 PM
CI2.1.3 Limit bug? - by El Forum - 12-12-2012, 02:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB