summaryrefslogtreecommitdiffstats
path: root/Auth
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-09-24 19:47:38 +0000
committertailor <cygnus@janrain.com>2007-09-24 19:47:38 +0000
commitc8fa9a83ac19f9864663fe6f98b74a69da2274ce (patch)
tree3dd2267bd6c8e5cd60183af816285b546de185fc /Auth
parent9c10aca3928e8f0559ed982c370fb8427759fb9d (diff)
downloadphp-openid-c8fa9a83ac19f9864663fe6f98b74a69da2274ce.zip
php-openid-c8fa9a83ac19f9864663fe6f98b74a69da2274ce.tar.gz
php-openid-c8fa9a83ac19f9864663fe6f98b74a69da2274ce.tar.bz2
[project @ Include full path in filestore paths]
Diffstat (limited to 'Auth')
-rw-r--r--Auth/OpenID/FileStore.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/Auth/OpenID/FileStore.php b/Auth/OpenID/FileStore.php
index 50dca78..b53b7d2 100644
--- a/Auth/OpenID/FileStore.php
+++ b/Auth/OpenID/FileStore.php
@@ -126,13 +126,12 @@ class Auth_OpenID_FileStore extends Auth_OpenID_OpenIDStore {
$removed = 0;
// Check all nonces for expiry
foreach ($nonces as $nonce_fname) {
- $parts = explode('-', $nonce_fname, 2);
+ $base = basename($nonce_fname);
+ $parts = explode('-', $base, 2);
$timestamp = $parts[0];
$timestamp = intval($timestamp, 16);
if (abs($timestamp - $now) > $Auth_OpenID_SKEW) {
- $filename = $this->nonce_dir . DIRECTORY_SEPARATOR .
- $nonce_fname;
- Auth_OpenID_FileStore::_removeIfPresent($filename);
+ Auth_OpenID_FileStore::_removeIfPresent($nonce_fname);
$removed += 1;
}
}
@@ -255,16 +254,15 @@ class Auth_OpenID_FileStore extends Auth_OpenID_OpenIDStore {
// strip off the path to do the comparison
$name = basename($filename);
foreach ($association_files as $association_file) {
- if (strpos($association_file, $name) === 0) {
+ $base = basename($association_file);
+ if (strpos($base, $name) === 0) {
$matching_files[] = $association_file;
}
}
$matching_associations = array();
// read the matching files and sort by time issued
- foreach ($matching_files as $name) {
- $full_name = $this->association_dir . DIRECTORY_SEPARATOR .
- $name;
+ foreach ($matching_files as $full_name) {
$association = $this->_getAssociation($full_name);
if ($association !== null) {
$matching_associations[] = array($association->issued,
@@ -556,7 +554,7 @@ class Auth_OpenID_FileStore extends Auth_OpenID_OpenIDStore {
$files = array();
while (false !== ($filename = readdir($handle))) {
if (!in_array($filename, array('.', '..'))) {
- $files[] = $filename;
+ $files[] = $dir . DIRECTORY_SEPARATOR . $filename;
}
}
return $files;