Skip to content

Commit a7f0fb9

Browse files
author
Martin Brecht-Precht
committedFeb 1, 2017
Fixed some url encoding issues.
1 parent ffac304 commit a7f0fb9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

‎src/SecretSharing/SharedSecretUrlEncoder/HotpSharedSecretUrlEncoder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function encode($keyName, $sharedSecret, $issuer = null)
2121
$sharedSecret = bin2hex($sharedSecret);
2222
$encoded = 'otpauth://hotp/' . rawurlencode($keyName) . '?secret=' . $sharedSecret;
2323
if (!is_null($issuer)) {
24-
$encoded .= '&issuer=' . $issuer;
24+
$encoded .= '&issuer=' . rawurlencode($issuer);
2525
}
2626
return $encoded;
2727
}

‎src/SecretSharing/SharedSecretUrlEncoder/TotpBase32SharedSecretUrlEncoder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function encode($keyName, $sharedSecret, $issuer = null)
2424
$sharedSecret = Base32::encodeByteStr($sharedSecret, true);
2525
$encoded = 'otpauth://totp/' . rawurlencode($keyName) . '?secret=' . $sharedSecret;
2626
if (!is_null($issuer)) {
27-
$encoded .= '&issuer=' . $issuer;
27+
$encoded .= '&issuer=' . rawurlencode($issuer);
2828
}
2929
return $encoded;
3030
}

‎src/SecretSharing/SharedSecretUrlEncoder/TotpSharedSecretUrlEncoder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function encode($keyName, $sharedSecret, $issuer = null)
2121
$sharedSecret = bin2hex($sharedSecret);
2222
$encoded = 'otpauth://totp/' . rawurlencode($keyName) . '?secret=' . $sharedSecret;
2323
if (!is_null($issuer)) {
24-
$encoded .= '&issuer=' . $issuer;
24+
$encoded .= '&issuer=' . rawurlencode($issuer);
2525
}
2626
return $encoded;
2727
}

0 commit comments

Comments
 (0)
Please sign in to comment.