php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56105 Unapproved packages show in package browser
Submitted: 2004-06-19 06:38 UTC Modified: 2004-06-20 10:43 UTC
From: demenev at on-line dot jar dot ru Assigned: danielc (profile)
Status: Closed Package: PECL website (PECL)
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 + 2 = ?
Subscribe to this entry?

 
 [2004-06-19 06:38 UTC] demenev at on-line dot jar dot ru
Description:
------------
Package browser ( http://pear.php.net/packages.php ) shows packages which are not yet approved. Provided patch fixes it

Reproduce code:
---------------
Index: packages.php
===================================================================
RCS file: /repository/pearweb/public_html/packages.php,v
retrieving revision 1.44
diff -u -r1.44 packages.php
--- packages.php    9 Jun 2004 06:14:02 -0000   1.44
+++ packages.php    19 Jun 2004 10:44:43 -0000
@@ -103,7 +103,7 @@
 
 // 1) Show categories of this level
 $sth = $dbh->query("SELECT c.*, COUNT(p.id) AS npackages FROM categories c LEFT JOIN packages p ON p.category = c.id ".
-                    "WHERE p.package_type = 'pear' AND c.parent $category_where ".
+                    "WHERE p.package_type = 'pear' AND p.approved = 1 AND c.parent $category_where ".
                     "GROUP BY c.id ORDER BY name");
 
 $table   = new HTML_Table('border="0" cellpadding="6" cellspacing="2" width="100%"');
@@ -122,6 +122,7 @@
                           "  FROM packages p, categories c".
                           " WHERE c.parent $category_where ".
                           "   AND p.package_type = 'pear' ".
+                          "   AND p.approved = 1 ".
                           "   AND p.category = c.id ORDER BY p.name",
                           false, null, DB_FETCHMODE_ASSOC, true);
 



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-20 10:43 UTC] danielc at analysisandsolutions dot com
Thanks so much.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC