Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page function in Record.php has a bug that cause offset with a negative number #184

Closed
JihanZhuang opened this issue Nov 21, 2016 · 1 comment

Comments

@JihanZhuang
Copy link

JihanZhuang commented Nov 21, 2016

if page = 984851907999915581,limit=10,($page - 1) * $limit cause it to be a float.so after (int)offset,it change to a negative number;
I have change it like this:

public function offset($offset)
{
$offset=(int)$offset;
$offset < 0 && $offset = 0;
return $this->add('offset', $offset);
}

@JihanZhuang JihanZhuang changed the title offset function in Record.php has a bug that cause offset with a negative number page function in Record.php has a bug that cause offset with a negative number Nov 21, 2016
@twinh
Copy link
Owner

twinh commented Nov 22, 2016

fixed, thank you!

@twinh twinh closed this as completed Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants