Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.1.8

Bug #2380 Error when usind a DSN which is not an array
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)    
Subscription  
Comments Add Comment Add patch


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 : 7 - 4 = ?

 
 [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

Comments

 [2004-12-23 00:53 UTC] hirokawa
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.