aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-21 17:36:01 -0800
committerFriendika <info@friendika.com>2010-11-21 17:36:01 -0800
commit72fd6eec4b3722aa8cb44f76dae9b8737f732287 (patch)
tree483fba1245822351e0f6ed1687bcedbf44aa9d21 /include
parent6a3815e751b013d2fba1e1de6df89566f971e39c (diff)
downloadvolse-hubzilla-72fd6eec4b3722aa8cb44f76dae9b8737f732287.tar.gz
volse-hubzilla-72fd6eec4b3722aa8cb44f76dae9b8737f732287.tar.bz2
volse-hubzilla-72fd6eec4b3722aa8cb44f76dae9b8737f732287.zip
make sure to use local avatar if we have one
Diffstat (limited to 'include')
-rw-r--r--include/salmon.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/salmon.php b/include/salmon.php
index 2838f2cbb..a12b7391e 100644
--- a/include/salmon.php
+++ b/include/salmon.php
@@ -19,10 +19,35 @@ function salmon_key($pubkey) {
function base64url_encode($s) {
- return strtr(base64_encode($s),'+/','-_');
+ $s = strtr(base64_encode($s),'+/','-_');
+/*
+ * // placeholder for un-padded base64url_encode
+ * // per latest salmon rev
+ *
+ * $s = str_replace('=','',$s);
+ *
+ */
+ return $s;
}
function base64url_decode($s) {
+
+/*
+ * // Placeholder for new rev of salmon which strips base64 padding.
+ * // PHP base64_decode handles the un-padded input without requiring this step
+ * // Uncomment if you find you need it.
+ *
+ * $l = strlen($s);
+ * if(! strpos($s,'=')) {
+ * $m = $l % 4;
+ * if($m == 2)
+ * $s .= '==';
+ * if($m == 3)
+ * $s .= '=';
+ * }
+ *
+ */
+
return base64_decode(strtr($s,'-_','+/'));
}