aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-11 00:21:00 -0800
committerfriendica <info@friendica.com>2013-11-11 00:21:00 -0800
commit435e2dae0e9204afd7288c14748e88f680276969 (patch)
tree23b1cbdbd8f2bc42ffc2243a0be95797b63b8ce5 /include
parent0adf31eef240c8d58ba6fc471892189a69d0696b (diff)
downloadvolse-hubzilla-435e2dae0e9204afd7288c14748e88f680276969.tar.gz
volse-hubzilla-435e2dae0e9204afd7288c14748e88f680276969.tar.bz2
volse-hubzilla-435e2dae0e9204afd7288c14748e88f680276969.zip
display encrypted text inline
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index de71eb4e3..271cace73 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -121,7 +121,9 @@ function bb_parse_crypt($match) {
if ($matches[1] != "")
$hint = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
- $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 />';
+ $x = random_string();
+
+ $Text = '<br/><div id="' . $x . '"><img src="' . z_root() . '/images/lock_icon.gif" onclick="red_decrypt(\'' . $algorithm . '\',\'' . $hint . '\',\'' . $match[2] . '\',\'#' . $x . '\');" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /></div><br />';
return $Text;
@@ -496,7 +498,8 @@ 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" onclick="red_decrypt(\'rot13\',\'\',\'$1\');" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />', $Text);
+ $x = random_string();
+ $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism",'<br/><div id="' . $x . '"><img src="' .$a->get_baseurl() . '/images/lock_icon.gif" onclick="red_decrypt(\'rot13\',\'\',\'$1\',\'#' . $x . '\');" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br /></div>', $Text);
$Text = preg_replace_callback("/\[crypt (.*?)\](.*?)\[\/crypt\]/ism", 'bb_parse_crypt', $Text);
}
// Try to Oembed