aboutsummaryrefslogtreecommitdiffstats
path: root/include/salmon.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-02-01 05:10:04 -0800
committerFriendika <info@friendika.com>2011-02-01 05:10:04 -0800
commit8acc76a3c6fa3fe5401811fcd90a20a69388a850 (patch)
tree30314c4d46e6910fe2848153eb9c9cd6467620f5 /include/salmon.php
parent89313235d26569df5cbdabb1f85871f10056e41f (diff)
downloadvolse-hubzilla-8acc76a3c6fa3fe5401811fcd90a20a69388a850.tar.gz
volse-hubzilla-8acc76a3c6fa3fe5401811fcd90a20a69388a850.tar.bz2
volse-hubzilla-8acc76a3c6fa3fe5401811fcd90a20a69388a850.zip
provide ability to survive transport mangling when travelling through html networks
Diffstat (limited to 'include/salmon.php')
-rw-r--r--include/salmon.php14
1 files changed, 6 insertions, 8 deletions
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;
}