aboutsummaryrefslogtreecommitdiffstats
path: root/include/salmon.php
diff options
context:
space:
mode:
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;
}