aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-10 19:58:08 -0800
committerfriendica <info@friendica.com>2013-11-10 19:58:08 -0800
commit3a10e698c9932df64c6e4fa9e0785efaf4357362 (patch)
treec4408c1521d11b6dbbdbfcbbec4a06a35b13d704 /include/bbcode.php
parenteffb1a0534aae40a1b2a0e396de09d1b0d06bb44 (diff)
downloadvolse-hubzilla-3a10e698c9932df64c6e4fa9e0785efaf4357362.tar.gz
volse-hubzilla-3a10e698c9932df64c6e4fa9e0785efaf4357362.tar.bz2
volse-hubzilla-3a10e698c9932df64c6e4fa9e0785efaf4357362.zip
Didn't finish it. Gotta' pee.
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php11
1 files changed, 2 insertions, 9 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 14d0ce14a..de71eb4e3 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -121,14 +121,7 @@ function bb_parse_crypt($match) {
if ($matches[1] != "")
$hint = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
- // Next we really should link to a JS routine based on the algorithm which prompts for a key
- // something like zdecrypt_{algorithm}, which will be a no-op if the decryption algorithm is not present
- // We can either pass the text or pass a message ID and let the decryption module call /viewsrc or something
- // to get the text. The text might be large so the message ID might be preferable. But if we pass the
- // text directly we won't have to do a network fetch; and can potentially display the results in a popup.
-
-
- $Text = '<br/><img src="' . z_root() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />' . t('Algorithm: ') . $algorithm . '<br />' . t('Key hint: ') . $hint . '<br />';
+ $Text = '<br/><img src="' . z_root() . '/images/lock_icon.gif" onclick="red_decrypt(\'' . $algorithm . '\',\'' . $hint . '\',\'' . $match[2] . '\');" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />';
return $Text;
@@ -503,7 +496,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
}
if (strpos($Text,'[/crypt]') !== false) {
- $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism",'<br/><img src="' .$a->get_baseurl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />', $Text);
+ $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism",'<br/><img src="' .$a->get_baseurl() . '/images/lock_icon.gif" onclick="red_decrypt(\'rot13\',\'\',\'$1\');" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />', $Text);
$Text = preg_replace_callback("/\[crypt (.*?)\](.*?)\[\/crypt\]/ism", 'bb_parse_crypt', $Text);
}
// Try to Oembed