|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44166 Parameter handling flaw in PDO::getAvailableDrivers()
Submitted: 2008-02-19 13:00 UTC Modified: 2008-03-03 21:14 UTC
From: uwendel at mysql dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5.3CVS-2008-02-19 (CVS) OS: Linux
Private report: No CVE-ID: None
 [2008-02-19 13:00 UTC] uwendel at mysql dot com
There's a little parameter handling flaw in PDO::getAvailableDrivers(). The function expects no parameter to be passed. If you pass some, it does not bail like most other functions do which do not expect any parameter.

nixnutz@ulflinux:~/php53> sapi/cli/php -r 'var_dump(PDO::getAvailableDrivers("too many", "args")); var_dump(get_include_path("too many", "args"));'
array(4) {
  string(7) "sqlite2"
  string(6) "sqlite"
  string(5) "pgsql"
  string(5) "mysql"

Warning: get_include_path() expects exactly 0 parameters, 2 given in Command line code on line 1

Reproduce code:
nixnutz@ulflinux:~/php53> sapi/cli/php -r 'var_dump(PDO::getAvailableDrivers("too many", "args"));'

Expected result:
Warning: PDO::getAvailableDrivers() expects exactly 0 parameters, 2 given in Command line code on line %d

Actual result:
No warning, array returned


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-19 13:18 UTC] uwendel at mysql dot com

 [2008-02-19 13:19 UTC] uwendel at mysql dot com
Oh, well forgot to say that for using the test you also have to decide on #44155.
 [2008-03-03 21:14 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC