From 4e0fc81e5dfaad3c3ed47a02df4589f5b25a88be Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 22 Aug 2020 22:14:29 +0200 Subject: move cryptojs to addon --- include/bbcode.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index 535e4ac33..e5b2a068a 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -233,7 +233,7 @@ function bb_replace_images($body, $images) { */ function bb_parse_crypt($match) { - $matches = array(); + $matches = []; $attributes = $match[1]; $algorithm = ""; @@ -257,9 +257,17 @@ function bb_parse_crypt($match) { $x = random_string(); - $f = ((in_array($algorithm, ['AES-128-CCM', 'rot13', 'triple-rot13'])) ? 'hz_decrypt' : 'red_decrypt'); + $f = 'hz_decrypt'; + + //legacy cryptojs support + if(plugin_is_installed('cryptojs')) { + $f = ((in_array($algorithm, ['AES-128-CCM', 'rot13', 'triple-rot13'])) ? 'hz_decrypt' : 'red_decrypt'); + } + + $onclick = 'onclick="' . $f . '(\'' . $algorithm . '\',\'' . $hint . '\',\'' . $match[2] . '\',\'#' . $x . '\');"'; + $label = t('Encrypted content'); - $Text = '
' . t('Encrypted content') . '

'; + $Text = '
' . $label . '

'; return $Text; } -- cgit v1.2.3