aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2020-08-20 22:47:33 +0200
committerMario Vavti <mario@mariovavti.com>2020-08-20 22:47:33 +0200
commitc4c47f777724937746c99c064e65f52723443e59 (patch)
treec12ed23f32e394af6aa419b5f7e77badf772d431 /include/bbcode.php
parente55a1a6aa8fe55d20b588f0223a15018053bfd48 (diff)
downloadvolse-hubzilla-c4c47f777724937746c99c064e65f52723443e59.tar.gz
volse-hubzilla-c4c47f777724937746c99c064e65f52723443e59.tar.bz2
volse-hubzilla-c4c47f777724937746c99c064e65f52723443e59.zip
first cut on implementing additional encryption with the SJCL library. aes only and no backward compatibility.
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index b195701dc..ea04eb470 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -257,7 +257,9 @@ function bb_parse_crypt($match) {
$x = random_string();
- $Text = '<br /><div id="' . $x . '"><img class="cursor-pointer" src="' . z_root() . '/images/lock_icon.svg" onclick="red_decrypt(\'' . $algorithm . '\',\'' . $hint . '\',\'' . $match[2] . '\',\'#' . $x . '\');" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /></div><br />';
+ $f = ((in_array($algorithm, ['AES-256', 'rot13', 'triple-rot13'])) ? 'hz_decrypt' : 'red_decrypt');
+
+ $Text = '<br /><div id="' . $x . '"><img class="cursor-pointer" src="' . z_root() . '/images/lock_icon.svg" onclick="' . $f . '(\'' . $algorithm . '\',\'' . $hint . '\',\'' . $match[2] . '\',\'#' . $x . '\');" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /></div><br />';
return $Text;
}