diff options
author | friendica <info@friendica.com> | 2013-10-30 14:50:12 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-10-30 14:50:12 -0700 |
commit | 1ec35447d31a78051269a7280a9e455e6262e8fd (patch) | |
tree | beeaafcfc46b198e72d71ea92242424b973b567c /include/bbcode.php | |
parent | 8da4da37ccbcc6921f97eeb0c9cd3c23567bd761 (diff) | |
parent | 4cae5249d4e037459838c16ba3d81aa99a2bc52c (diff) | |
download | volse-hubzilla-1ec35447d31a78051269a7280a9e455e6262e8fd.tar.gz volse-hubzilla-1ec35447d31a78051269a7280a9e455e6262e8fd.tar.bz2 volse-hubzilla-1ec35447d31a78051269a7280a9e455e6262e8fd.zip |
Merge pull request #187 from zzottel/master
Allow setting of title in rpost tag with [rpost=title]body[/rpost]
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index de8a34b80..48e13b06f 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -179,7 +179,11 @@ function bb_ShareAttributesSimple($match) { } function rpost_callback($match) { - return str_replace($match[0],get_rpost_path(get_app()->get_observer()) . '&body=' . urlencode($match[1]),$match[0]); + if (count($match) == 3) { + return str_replace($match[0],get_rpost_path(get_app()->get_observer()) . '&title=' . urlencode($match[1]) . '&body=' . urlencode($match[2]),$match[0]); + } else { + return str_replace($match[0],get_rpost_path(get_app()->get_observer()) . '&body=' . urlencode($match[1]),$match[0]); + } } @@ -230,6 +234,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $Text = preg_replace("/\[observer\=1\](.*?)\[\/observer\]/ism", '$1', $Text); $Text = preg_replace("/\[observer\=0\].*?\[\/observer\]/ism", '', $Text); $Text = preg_replace_callback("/\[rpost\](.*?)\[\/rpost\]/ism", 'rpost_callback', $Text); + $Text = preg_replace_callback("/\[rpost\=(.*?)\](.*?)\[\/rpost\]/ism", 'rpost_callback', $Text); } else { $Text = preg_replace("/\[observer\=1\].*?\[\/observer\]/ism", '', $Text); $Text = preg_replace("/\[observer\=0\](.*?)\[\/observer\]/ism", '$1', $Text); |