Bug #64020 [Opn->Csd]: bug.php.net - mysql error - begin
| From: | tyrael@php.net | Date: | Fri, 18 Jan 2013 14:31:11 +0000 |
| Subject: | Bug #64020 [Opn->Csd]: bug.php.net - mysql error - begin | ||
| References: | 1 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-15340@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64020&edit=1
ID: 64020
Updated by: tyrael@php.net
Reported by: mateusz dot goik at aliantsoft dot pl
Summary: bug.php.net - mysql error - begin
-Status: Open
+Status: Closed
Type: Bug
Package: Website problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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)
Previous Comments:
------------------------------------------------------------------------
[2013-01-18 13:16:38] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64020&edit=1