php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64020 bug.php.net - mysql error - begin
Submitted: 2013-01-18 13:16 UTC Modified: 2013-01-18 14:33 UTC
From: mateusz dot goik at aliantsoft dot pl Assigned: tyrael (profile)
Status: Closed Package: Website problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mateusz dot goik at aliantsoft dot pl
New email:
PHP Version: OS:

 

 [2013-01-18 13:16 UTC] mateusz dot goik at aliantsoft dot pl
Description:
------------
Hi,

https://bugs.php.net/search.php?cmd=display&begin=1 -> OK
https://bugs.php.net/search.php?cmd=display&begin=-1 -> ERROR

File:
https://svn.php.net/viewvc/web/php-bugs/trunk/include/query.php?view=markup

................
38 	$begin = (int) (!empty($_GET['begin']) ? $_GET['begin'] : 0);
................
240 	if ($limit != 'All' && $limit > 0) {
241 	$query .= " LIMIT $begin, $limit";
242 	}
................

Fix: $begin >= 0

mysql example:
select 1 limit 0,1 -> OK
select 1 limit -1,1 -> ERROR




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-18 14:31 UTC] tyrael@php.net
Automatic comment on behalf of tyra3l@gmail.com
Revision: http://git.php.net/?p=web/bugs.git;a=commit;h=dcc9d0e39e2356cc69b29d73a2cb05468da0b951
Log: Fixed bug #64020 (reject negative values for the limit value)
 [2013-01-18 14:31 UTC] tyrael@php.net
-Status: Open +Status: Closed
 [2013-01-18 14:33 UTC] tyrael@php.net
I've commited a fix, it should be updated on the server soon.
 [2013-01-18 14:33 UTC] tyrael@php.net
-Assigned To: +Assigned To: tyrael
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 20:01:30 2025 UTC