aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-06-26 22:31:15 -0400
committerSimon L'nu <simon.lnu@gmail.com>2012-06-26 22:31:15 -0400
commit5b35a02d260d1f2573895c29f4710b08348ee8ba (patch)
treec59dc06ec20ae59b3f0f0b0f17bff2477ae0e2a4 /include/bbcode.php
parentf04647ca4bba6302f344bd16ba037cde89cf9ae5 (diff)
parentb02c7339671179aa7f4644bbde804791d8fefa25 (diff)
downloadvolse-hubzilla-5b35a02d260d1f2573895c29f4710b08348ee8ba.tar.gz
volse-hubzilla-5b35a02d260d1f2573895c29f4710b08348ee8ba.tar.bz2
volse-hubzilla-5b35a02d260d1f2573895c29f4710b08348ee8ba.zip
Merge remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master: service class restrict the email connector stray s typos add event titles to discovered birthday events change required doco change event behaviour so that title is required but description is not event summary/title propagate remote deletes remove possibly unnecessary checks for likes or comments created by Diaspora users store signature info for remote users too was passing the wrong arguments to the signature storage function add some debug logging revert extra Diaspora disabling changes to try to eliminate Mustard double-posting Clean up the Diaspora connectivity: improve remote delete forwarding typos in bbcode, add service class restrictions to jot uploads rev update
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 36d480a17..ee31b4a1a 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -162,7 +162,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// handle nested lists
$endlessloop = 0;
- while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list]") !== false) &&
+
+ while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) &&
(strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) &&
(strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && (++$endlessloop < 20)) {
$Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text);
@@ -296,12 +297,16 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$Text = oembed_bbcode2html($Text);
// If we found an event earlier, strip out all the event code and replace with a reformatted version.
+ // Replace the event-start section with the entire formatted event. The other bbcode is stripped.
+ // Summary (e.g. title) is required, earlier revisions only required description (in addition to
+ // start which is always required). Allow desc with a missing summary for compatibility.
- if(x($ev,'desc') && x($ev,'start')) {
+ if((x($ev,'desc') || x($ev,'summary')) && x($ev,'start')) {
$sub = format_event_html($ev);
- $Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/ism",$sub,$Text);
- $Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/ism",'',$Text);
+ $Text = preg_replace("/\[event\-summary\](.*?)\[\/event\-summary\]/ism",'',$Text);
+ $Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/ism",'',$Text);
+ $Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/ism",$sub,$Text);
$Text = preg_replace("/\[event\-finish\](.*?)\[\/event\-finish\]/ism",'',$Text);
$Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/ism",'',$Text);
$Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text);