provide ability to survive transport mangling when travelling through html networks
This commit is contained in:
parent
89313235d2
commit
8acc76a3c6
2 changed files with 36 additions and 18 deletions
|
|
@ -18,15 +18,13 @@ function salmon_key($pubkey) {
|
|||
}
|
||||
|
||||
|
||||
function base64url_encode($s) {
|
||||
function base64url_encode($s, $strip_padding = false) {
|
||||
|
||||
$s = strtr(base64_encode($s),'+/','-_');
|
||||
/*
|
||||
* // placeholder for un-padded base64url_encode
|
||||
* // per latest salmon rev
|
||||
*
|
||||
* $s = str_replace('=','',$s);
|
||||
*
|
||||
*/
|
||||
|
||||
if($strip_padding)
|
||||
$s = str_replace('=','',$s);
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue