Home » Authentication » Auth_HTTP » Bug #2380
Error when usind a DSN which is not an array
Details
| Submitted | 2004-09-23 13:27 UTC |
|---|---|
| From | cmoehrke at netviser dot de |
| Assigned | hirokawa |
| Status | Closed |
| Package | Auth_HTTP |
| PHP Version | 4.3.3 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-09-23 13:27 UTC] cmoehrke at netviser dot de
Description:
------------
If u try to use a DSN which is not
an array, e.g. something like
$dsn = "mysql://netviser:geheim@localhost/netviser";
$my_auth = new Auth_HTTP("DB", $dsn);
it will result in an error (File HTTP.PHP, line 191).
The problem is that there is no check if $options is an array. An additional
if (is_array($options))
should fix it.
Cheers
Reproduce code:
---------------
require_once("PEAR.php");
require_once("Auth/HTTP.php");
$dsn = "mysql://netviser:geheim@localhost/netviser";
$my_auth = new Auth_HTTP("DB", $dsn);
$my_auth->setRealm('Interner Bereich');
$my_auth->setCancelText('<h2>Error</h2>');
$my_auth->start();
Actual result:
--------------
Warning: Invalid argument supplied for foreach() in /usr/share/php/Auth/HTTP.php on line 191