The initial timestamp that was recently added to the tokens may
match the binary representation of a newline which kills the file
based token driver (which is line oriented).
Should fix the flaky token test.
$this->_connect();
/* Find already used IDs. */
+ $token = base64_encode($tokenID);
$fileContents = file($this->_params['token_dir'] . '/conn_' . $this->_encodeRemoteAddress());
if ($fileContents) {
for ($i = 0, $iMax = count($fileContents); $i < $iMax; ++$i) {
- if (chop($fileContents[$i]) == $tokenID) {
+ if (chop($fileContents[$i]) == $token) {
return true;
}
}
$this->_connect();
/* Write the entry. */
- fwrite($this->_fd, $tokenID . "\n");
+ $token = base64_encode($tokenID);
+ fwrite($this->_fd, $token . "\n");
$this->_disconnect();
}