From 8acc76a3c6fa3fe5401811fcd90a20a69388a850 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 1 Feb 2011 05:10:04 -0800 Subject: provide ability to survive transport mangling when travelling through html networks --- include/salmon.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'include/salmon.php') diff --git a/include/salmon.php b/include/salmon.php index 49384efea..8a56882ad 100644 --- a/include/salmon.php +++ b/include/salmon.php @@ -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; } -- cgit v1.2.3