From 4d7346825a8c97f4598f42c2cd9471e3a38e31d4 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 14 Sep 2007 23:07:23 +0000 Subject: [PATCH] mlanthaler: Bugfix: Fixed small bug. Also notified the OpenID library maintainer so that they fix the library itself. (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41811 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- _config.php | 5 ++++- core/model/DB.php | 6 ++++-- security/Auth/OpenID/SQLStore.php | 5 +++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/_config.php b/_config.php index 0116509ee..9c4fe5e76 100644 --- a/_config.php +++ b/_config.php @@ -1,9 +1,12 @@ \ No newline at end of file diff --git a/core/model/DB.php b/core/model/DB.php index 88997cf0b..87ae40323 100755 --- a/core/model/DB.php +++ b/core/model/DB.php @@ -47,8 +47,10 @@ class DB { * @param array $database A map of options. The 'type' is the name of the subclass of Database to use. For the rest of the options, see the specific class. */ static function connect($databaseConfig) { - if(!$databaseConfig['type']) user_error("DB::connect: Not passed a valid database config", E_USER_ERROR); - if ($databaseConfig['pdo']) { // TODO:pkrenn_remove + if(!isset($databaseConfig['type']) || empty($databaseConfig['type'])) { + user_error("DB::connect: Not passed a valid database config", E_USER_ERROR); + } + if (isset($databaseConfig['pdo']) && $databaseConfig['pdo']) { // TODO:pkrenn_remove $conn = new PDODatabase($databaseConfig); } else { // TODO:pkrenn_remove begin $dbClass = $databaseConfig['type']; diff --git a/security/Auth/OpenID/SQLStore.php b/security/Auth/OpenID/SQLStore.php index b71729dca..bd99dd250 100644 --- a/security/Auth/OpenID/SQLStore.php +++ b/security/Auth/OpenID/SQLStore.php @@ -161,8 +161,9 @@ class Auth_OpenID_SQLStore extends Auth_OpenID_OpenIDStore { function tableExists($table_name) { return !$this->isError( - $this->connection->query("SELECT * FROM %s LIMIT 0", - $table_name)); + $this->connection->query( + sprintf("SELECT * FROM %s LIMIT 0", + $table_name))); } /**