aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-10 01:44:21 -0800
committerfriendica <info@friendica.com>2014-02-10 01:44:21 -0800
commita7fa14800d083249539e884b8e9791de7a5cf1e3 (patch)
tree050bf25ee52b442aa0cbde6606b421bc99b8b551 /mod/item.php
parenta76c53657bca9ea6aa2246535f117f7043bb5205 (diff)
downloadvolse-hubzilla-a7fa14800d083249539e884b8e9791de7a5cf1e3.tar.gz
volse-hubzilla-a7fa14800d083249539e884b8e9791de7a5cf1e3.tar.bz2
volse-hubzilla-a7fa14800d083249539e884b8e9791de7a5cf1e3.zip
better bookmark escaping
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/mod/item.php b/mod/item.php
index 784ee31b4..a9c0d80d3 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -429,13 +429,18 @@ function item_post(&$a) {
* otherwise http://elsewhere.com becomes #^[url=http://elsewhere.com]http://elsewhere.com[/url]
*/
- $body = preg_replace_callback('/\[code\](.*?)\[\/code\]/ism','red_escape_codeblock',$body);
+ $body = preg_replace_callback('/\[code(.*?)\[\/(code)\]/ism','red_escape_codeblock',$body);
+ $body = preg_replace_callback('/\[url(.*?)\[\/(url)\]/ism','red_escape_codeblock',$body);
+ $body = preg_replace_callback('/\[zrl(.*?)\[\/(zrl)\]/ism','red_escape_codeblock',$body);
- $body = preg_replace_callback('/\[([uz])rl(.*?)\](.*?)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)(.*?)\[\/([uz])rl\]/ism','red_escape_zrl_callback',$body);
+// no longer needed
+// $body = preg_replace_callback('/\[([uz])rl(.*?)\](.*?)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)(.*?)\[\/([uz])rl\]/ism','red_escape_zrl_callback',$body);
$body = preg_replace_callback("/([^\]\='".'"'."]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)/ism", 'red_zrl_callback', $body);
- $body = preg_replace_callback('/\[code\](.*?)\[\/code\]/ism','red_unescape_codeblock',$body);
+ $body = preg_replace_callback('/\[\$b64zrl(.*?)\[\/(zrl)\]/ism','red_unescape_codeblock',$body);
+ $body = preg_replace_callback('/\[\$b64url(.*?)\[\/(url)\]/ism','red_unescape_codeblock',$body);
+ $body = preg_replace_callback('/\[\$b64code(.*?)\[\/(code)\]/ism','red_unescape_codeblock',$body);
/**