com web/bugs: Fixes #66865 bugs.php.net/random may result in a private bug: www/index.php
| From: | sobak@php.net | Date: | Sun, 16 Mar 2014 19:57:56 +0000 |
| Subject: | com web/bugs: Fixes #66865 bugs.php.net/random may result in a private bug: www/index.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-18518@lists.php.net to get a copy of this message | ||
Commit: 2ef720dbb8a74ed412e0861f1c728b8186283f50
Author: Sobak <msobaczewski@gmail.com> Sun, 16 Mar 2014 20:57:56 +0100
Parents: 1e236800a8acf606e850c503bb9bf23110b1775d
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=2ef720dbb8a74ed412e0861f1c728b8186283f50
Log:
Fixes #66865 bugs.php.net/random may result in a private bug
Bugs:
https://bugs.php.net/66865
Changed paths:
M www/index.php
Diff:
diff --git a/www/index.php b/www/index.php
index 720d689..78cacff 100644
--- a/www/index.php
+++ b/www/index.php
@@ -15,7 +15,7 @@ if ($id) {
}
if($_SERVER['REQUEST_URI'] == '/random') {
- $query = "select id from bugdb where status!='Closed' and status!='Not a
bug' and status!='Duplicate' and status!='Spam' and status!='Wont
fix' and status!='No Feedback' order by rand() limit 1";
+ $query = "SELECT id FROM bugdb WHERE status NOT IN('Closed', 'Not a
bug', 'Duplicate', 'Spam', 'Wont fix', 'No Feedback')
AND private = 'N' ORDER BY RAND() LIMIT 1";
$result = $dbh->prepare($query)->execute();
$id = $result->fetchRow();