mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-17 17:13:02 +00:00
* Tabs -> Spaces. Yep.
This commit is contained in:
@@ -6,20 +6,20 @@ abstract class BaseHTTPQRCodeProvider implements IQRCodeProvider
|
||||
{
|
||||
protected $verifyssl;
|
||||
|
||||
protected function getContent($url)
|
||||
protected function getContent($url)
|
||||
{
|
||||
$ch = curl_init();
|
||||
|
||||
curl_setopt_array($ch, array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_MAXREDIRS => 3,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_CONNECTTIMEOUT => 10,
|
||||
CURLOPT_DNS_CACHE_TIMEOUT => 10,
|
||||
CURLOPT_TIMEOUT => 10,
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_MAXREDIRS => 3,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_CONNECTTIMEOUT => 10,
|
||||
CURLOPT_DNS_CACHE_TIMEOUT => 10,
|
||||
CURLOPT_TIMEOUT => 10,
|
||||
CURLOPT_SSL_VERIFYPEER => $this->verifyssl,
|
||||
CURLOPT_USERAGENT => 'TwoFactorAuth'
|
||||
CURLOPT_USERAGENT => 'TwoFactorAuth'
|
||||
));
|
||||
$data = curl_exec($ch);
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@ namespace RobThree\Auth\Providers\Qr;
|
||||
|
||||
interface IQRCodeProvider
|
||||
{
|
||||
public function getQRCodeImage($qrtext, $size);
|
||||
public function getQRCodeImage($qrtext, $size);
|
||||
public function getMimeType();
|
||||
}
|
||||
@@ -160,10 +160,10 @@ class TwoFactorAuth
|
||||
$l = strlen($s);
|
||||
$r = trim(chunk_split(substr($s, 0, $l - ($l % 8)), 8, ' '));
|
||||
|
||||
$o = '';
|
||||
foreach (explode(' ', $r) as $b)
|
||||
$o = '';
|
||||
foreach (explode(' ', $r) as $b)
|
||||
$o .= chr(bindec(str_pad($b, 8, 0, STR_PAD_RIGHT)));
|
||||
|
||||
return $o;
|
||||
return $o;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user