48 Commits

Author SHA1 Message Date
Kevin Reinders
2e6915b67d Fix #80550: bug search: Nonsensical "the following words were ignored:" w/ trailing space
We `trim()` that input.

Closes GH-88.
2020-12-28 14:33:04 +01:00
Christoph M. Becker
257c114b05 Fix #78558: Information Exposure Through an Error Message
We certainly should not display these details to anybody.  It would
make sense to show that during development, and maybe to developers.
2019-09-18 13:26:20 +02:00
Rasmus Lerdorf
ce9c82af40 Check for passed in arrays 2019-09-18 13:11:38 +02:00
Peter Kokot
9d47b05f2d Convert all tabs to spaces 2019-05-22 02:41:51 +02:00
Peter Kokot
35463d9fa3 Fix #77971: Can't access other than 1st page of advanced bug search 2019-05-05 05:42:22 +02:00
Peter Kokot
5cd2630a86 Add dependency injection container
This patch introduces a dependency injection container for the PHP bug
tracker application. Container deals with the creation of all service
classes and additionally provides retrieving of configuration parameters.
Service classes are used everywhere in the app - from accessing database
to uploading files. Configuration parameters include infrastructure
configuration (database credentials...) and application level
configuration (directories locations...).

Container is compatible with the PSR-11 container interface defined
so it is simple to quickly understand its usage. Advanced features
such as autowiring are not included in this phase.
2019-01-28 00:47:18 +01:00
Peter Kokot
14f8c07aec Refactor PDO wrapper
Some considerations were raised on the mailing list that this PHP
application doesn't need a PDO wrapper at all.

Changes:
- ::fetchRow() method removed in favor of the vanilla PDOStatement::fetch()
- ::fetchAll() override removed in favor of the vanilla
  PDOStatement::fetchAll()
- ::fetchCol() removed since it is not used and is only a wrapper for
  the PDOStatement::fetchColumn()
- PDO fetch_style synced accross the app. When no fetch style is passed
  the default PDO::FETCH_ASSOC is used as set when connecting to db.
- Remove Database::escape() method
  The custom ::escape() method is a wrapper around PDO::quote() which
  additionally trims leading and trailing quotes from the string. All
  this should ideally be done via prepared statements only, except where
  we can and need to use PDO::quote() this step can be done on the given
  string or variable at hand directly.
- Remove escapeSQL() function
  The escapeSQL function is a wrapper around the PDO::quote() and is
  using $dbh from the global scope which is not testable nor good practice
  further on. Removed and refactored into only PDO::quote() usages on
  required places.
- Remove ::fetchOne() method
  The fetchOne() method is a simple wrapper around the PDOStatement::fetch()
  method with very minor tweaks so the usage can be simplified even more.
  The PDOStatement::fetch(\PDO::FETCH_NUM)[0] will always return either a
  result from the database column or when row is empty a null.
- Probably this should be refactored to the database tables respected
  repositories further on.
- Remove PDO wrapper
  The app's current goal is to lean on a vanilla PDO wrapper only.
  Current set of features also don't require additional functionality
  and extending PDO to a wrapper or create a database abstraction layer
  yet.
2018-12-17 22:46:55 +01:00
Peter Kokot
bae5fa6c44 Trim trailing whitespaces 2018-12-14 15:20:09 +01:00
Peter Kokot
9b248f9ed6 Refactor get_pseudo_packages() to repository class
Changes:
- get_pseudo_packages() function is moved to its own repository class.
- Database::queryAll() removed since it is not used and the method
  arguments don't match the number of used arguments anymore
- Project types configuration is moved to repository class for now.
- Some unused items removed
- Some template changes and show_project_options() helper function
  integrated in the view layer directly since it is used in a simplified
  way.
2018-12-11 02:05:22 +01:00
Peter Kokot
a06f85b0c3 Refactor long array() syntax to short []
Since site is using PHP 5.4+ already, the longer `array()` syntax can be
refactored to shorter `[]`. Also code is already using short array
syntax on some places.
2018-10-24 20:27:59 +02:00
Peter Kokot
180dccfe9d Trim trailing whitespace 2018-10-17 15:41:36 +02:00
Rasmus Lerdorf
23298a1236 New bugs.php.net code 2018-07-17 19:53:03 -04:00
Andreas Heigl
e0bb3932d6 Fixes an issue with a missing whitespace
As @johannes spotted the query didn't add a whitespace so that it might
get added right to the preceding one without ans whitespace.
2017-07-24 21:24:19 +02:00
Andreas Heigl
6c3fa2f4e6 Adds possibility to search for commenter-email
THis commit enables us to search for bugs that have been commented using
a certain email-address
2015-05-09 08:18:31 +02:00
Johannes Schlüter
5719e9e815 Fix bug search 2013-02-13 21:40:25 +01:00
Johannes Schlüter
6710f40dbe Rename table, a bit more consistent 2013-02-13 02:55:06 +01:00
Johannes Schlüter
7da3ecbd76 Improce patch/pull search 2013-02-13 01:05:13 +01:00
Johannes Schlüter
1cc2e658ae Add search suppot or bugs with pull requets
Searching for bugs with patch OR pull request currently isn't
possible, aöö searches use AND.
2013-02-08 04:53:22 +01:00
Ferenc Kovacs
dcc9d0e39e Fixed bug #64020 (reject negative values for the limit value) 2013-01-18 15:31:04 +01:00
Ferenc Kovacs
8e3acb14ef adding random sort order option 2012-07-28 21:06:16 +02:00
Jakub Vrana
4e4fb08f7e Allow ' at ' in author e-mail, return empty result for invalid e-mails 2012-02-03 21:21:27 -08:00
Rasmus Lerdorf
c3110c33dc - The end of an era - switch "Bogus" to "Not a bug" by popular demand
- Switch back to master
- Add site_method to make it easier to install on non-ssl test sites
2012-01-27 11:48:04 -08:00
Felipe Pena
17cd25011e - Missing project type information 2011-10-12 18:16:06 +00:00
Felipe Pena
cc16c49444 - Added option to search for project (php, pecl)
- Restored behavior to send mail to package maintainers instead of pecl lists
2011-10-12 17:48:44 +00:00
Hannes Magnusson
9e3082dcb5 There is no such status anymore, its a bug type 2011-08-30 14:17:02 +00:00
Felipe Pena
88a4cb9c1a - Fix warning 2011-06-30 02:38:22 +00:00
Felipe Pena
6ab9545b7d - Added option to search for bugs marked as private 2010-12-12 21:40:17 +00:00
Felipe Pena
6d6742cb38 - Fixed search by status "To be documented" 2010-12-12 18:27:59 +00:00
Felipe Pena
59cfcda20f - Woops, fix condition :) 2010-12-12 17:07:36 +00:00
Felipe Pena
15bd8e47fc - Added NOT option to CVE-ID bug search 2010-12-12 17:06:00 +00:00
Felipe Pena
998ecc697d - Added list of security developers
- Changed bugs_authenticate function
  new prototype: (&$user, &$pw, &$logged_in, &$user_flags)

$user_flags:
  define('BUGS_NORMAL_USER',  1<<0);
  define('BUGS_DEV_USER',     1<<1);
  define('BUGS_TRUSTED_DEV',  1<<2);
  define('BUGS_SECURITY_DEV', 1<<3);
2010-12-12 13:45:58 +00:00
Felipe Pena
e073c2dc4b - Updated the search part 2010-11-19 14:46:56 +00:00
Felipe Pena
3f640e56a9 - Added field to CVE-ID
- Added support to private report
  (When setting the package name to 'Security related', it will turns automatically a private report)

private report: Only the original reporter and people behind security@php will can see/edit/comment it.

When the report is ok to be public, anyone from security@php can turn it public.

# Initial commit... :P
2010-11-15 20:22:55 +00:00
Adam Harvey
47b5807b4a Fix bug #52472 (Bug tracker relevance sort doesn't work). Based (loosely) on a
patch by Ben Schmidt.
2010-11-10 10:31:03 +00:00
Felipe Pena
0d2e0b678e - Fix code, cannot change $order_by because it used in the pagination :P 2010-08-14 18:15:31 +00:00
Felipe Pena
31662ab153 - Added order by number of votes 2010-08-14 16:50:28 +00:00
Felipe Pena
ee84c818ed - Err, missing NULL check 2010-08-14 15:45:03 +00:00
Felipe Pena
adf592bd07 - Fix GROUP BY 2010-08-14 15:44:06 +00:00
Felipe Pena
dc4f1bb4d2 - Added order by avg. vote scores 2010-08-14 15:43:14 +00:00
Felipe Pena
beffeedd80 - Added possibility to search only for bugs with patch attached 2010-06-20 16:46:05 +00:00
Derick Rethans
99ced3cd59 - Fixed bug #51722. 2010-05-02 22:12:49 +00:00
Jani Taskinen
7df4a0def0 - When sorting by "last modified", show results in descenting order by default as that is the most common case 2010-03-16 13:17:33 +00:00
Jani Taskinen
9926d38aae - Fix some RSS/RDF issues (rss feeds actually validate now, search feeds can be found too..) 2010-03-09 19:00:00 +00:00
Jani Taskinen
bab479126c - More totally unnecessary whitespace changes. 2009-08-25 15:44:45 +00:00
Jani Taskinen
c6ca5e8219 - First part of getting rid of crap 2009-08-11 14:00:13 +00:00
Jani Taskinen
a81420ec8a - Added "Re-Opened" status. Merged "To be documented" status from php-bugs-web 2009-07-29 19:07:33 +00:00
Jani Taskinen
3c5bba60fb - Fix include/require paths to follow new structure 2009-07-22 11:15:01 +00:00
Jani Taskinen
1364fc2475 - Move rest of library files out of public site 2009-07-22 10:23:01 +00:00