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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 04:01:32 2024 UTC