diff options
author | Josh Hoyt <josh@janrain.com> | 2006-09-19 21:00:12 +0000 |
---|---|---|
committer | Josh Hoyt <josh@janrain.com> | 2006-09-19 21:00:12 +0000 |
commit | f7eae66274c576a8b043a908a27f5a223437cc49 (patch) | |
tree | da9318d8e947d9228e2020469fd768547b49fd62 /Auth/OpenID/SQLiteStore.php | |
parent | 6ed25d3c24454fbb526b59867e3d25098eb50c66 (diff) | |
download | php-openid-f7eae66274c576a8b043a908a27f5a223437cc49.zip php-openid-f7eae66274c576a8b043a908a27f5a223437cc49.tar.gz php-openid-f7eae66274c576a8b043a908a27f5a223437cc49.tar.bz2 |
[project @ Fix PECL sqlite_escape_string w/ empty string bug]
Diffstat (limited to 'Auth/OpenID/SQLiteStore.php')
-rw-r--r-- | Auth/OpenID/SQLiteStore.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Auth/OpenID/SQLiteStore.php b/Auth/OpenID/SQLiteStore.php index 18da516..a8ccf90 100644 --- a/Auth/OpenID/SQLiteStore.php +++ b/Auth/OpenID/SQLiteStore.php @@ -54,9 +54,16 @@ class Auth_OpenID_SQLiteStore extends Auth_OpenID_SQLStore { $this->sql['add_nonce'] = "INSERT INTO %s (server_url, timestamp, salt) VALUES (?, ?, ?)"; + } - $this->sql['get_nonce'] = - "SELECT * FROM %s WHERE nonce = ?"; + function _add_nonce($server_url, $timestamp, $salt) + { + // PECL SQLite extensions 1.0.3 and older (1.0.3 is the + // current release at the time of this writing) have a broken + // sqlite_escape_string function that breaks when passed the + // empty string. Prefixing all strings with one character + // keeps them unique and avoids this bug. + return parent::_add_nonce('x' . $server_url, $timestamp, $salt); } } |