diff --git a/.travis.yml b/.travis.yml index 3fe4492..e4983eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,11 @@ language: php +dist: trusty +matrix: + include: + - php: 5.3 + dist: precise + php: - 5.3 - 5.4 diff --git a/lib/Providers/Time/ConvertUnixTimeDotComTimeProvider.php b/lib/Providers/Time/ConvertUnixTimeDotComTimeProvider.php index 4939f0d..9a775fc 100644 --- a/lib/Providers/Time/ConvertUnixTimeDotComTimeProvider.php +++ b/lib/Providers/Time/ConvertUnixTimeDotComTimeProvider.php @@ -6,7 +6,7 @@ class ConvertUnixTimeDotComTimeProvider implements ITimeProvider { public function getTime() { $json = @json_decode( - @file_get_contents('http://www.convert-unix-time.com/api?timestamp=now') + @file_get_contents('http://www.convert-unix-time.com/api?timestamp=now&r=' . uniqid(null, true)) ); if ($json === null || !is_int($json->timestamp)) throw new \TimeException('Unable to retrieve time from convert-unix-time.com'); diff --git a/lib/Providers/Time/HttpTimeProvider.php b/lib/Providers/Time/HttpTimeProvider.php index c761bd9..8e7806e 100644 --- a/lib/Providers/Time/HttpTimeProvider.php +++ b/lib/Providers/Time/HttpTimeProvider.php @@ -26,7 +26,8 @@ class HttpTimeProvider implements ITimeProvider 'request_fulluri' => true, 'header' => array( 'Connection: close', - 'User-agent: TwoFactorAuth HttpTimeProvider (https://github.com/RobThree/TwoFactorAuth)' + 'User-agent: TwoFactorAuth HttpTimeProvider (https://github.com/RobThree/TwoFactorAuth)', + 'Cache-Control: no-cache' ) ) );