aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-23 15:13:09 -0800
committerfriendica <info@friendica.com>2013-12-23 15:13:09 -0800
commit63a42480c7eb36bdc8b63b31b2a4d222ba5751cd (patch)
treeb0bd80b8f114e2711152ce0374783a7106e068b1 /include
parent4517bdcff1aa75c5389f9fb29947012fca5df4e1 (diff)
downloadvolse-hubzilla-63a42480c7eb36bdc8b63b31b2a4d222ba5751cd.tar.gz
volse-hubzilla-63a42480c7eb36bdc8b63b31b2a4d222ba5751cd.tar.bz2
volse-hubzilla-63a42480c7eb36bdc8b63b31b2a4d222ba5751cd.zip
add account_level, is_foreigner and is_member functions; convert all e2ee user input and prompts to hex to avoid javascipt's lame handling of quotes. !!This breaks all prior encrypted posts.!!
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php11
-rw-r--r--include/identity.php32
2 files changed, 39 insertions, 4 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 271cace73..6374675f1 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -105,21 +105,24 @@ function bb_parse_crypt($match) {
$attributes = $match[1];
$algorithm = "";
+
preg_match("/alg='(.*?)'/ism", $attributes, $matches);
if ($matches[1] != "")
- $algorithm = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
+ $algorithm = $matches[1];
preg_match("/alg=\&quot\;(.*?)\&quot\;/ism", $attributes, $matches);
if ($matches[1] != "")
- $algorithm = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
+ $algorithm = $matches[1];
$hint = "";
+
+
preg_match("/hint='(.*?)'/ism", $attributes, $matches);
if ($matches[1] != "")
- $hint = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
+ $hint = $matches[1];
preg_match("/hint=\&quot\;(.*?)\&quot\;/ism", $attributes, $matches);
if ($matches[1] != "")
- $hint = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
+ $hint = $matches[1];
$x = random_string();
diff --git a/include/identity.php b/include/identity.php
index be4e4be93..63b05f4bb 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -1138,3 +1138,35 @@ function get_default_profile_photo($size = 175) {
$scheme = 'rainbow_man';
return 'images/default_profile_photos/' . $scheme . '/' . $size . '.jpg';
}
+
+
+/**
+ *
+ * @function is_foreigner($s)
+ * Test whether a given identity is NOT a member of the Red Matrix
+ * @param string $s;
+ * xchan_hash of the identity in question
+ *
+ * @returns boolean true or false
+ *
+ */
+
+function is_foreigner($s) {
+ return((strpbrk($s,':@')) ? true : false);
+}
+
+
+/**
+ *
+ * @function is_member($s)
+ * Test whether a given identity is a member of the Red Matrix
+ * @param string $s;
+ * xchan_hash of the identity in question
+ *
+ * @returns boolean true or false
+ *
+ */
+
+function is_member($s) {
+ return((is_foreigner($s)) ? false : true);
+} \ No newline at end of file