escape $ in events
This commit is contained in:
parent
4c6368d075
commit
acc9a8e43b
@ -926,14 +926,21 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true) {
|
|||||||
// start which is always required). Allow desc with a missing summary for compatibility.
|
// start which is always required). Allow desc with a missing summary for compatibility.
|
||||||
|
|
||||||
if ((x($ev,'desc') || x($ev,'summary')) && x($ev,'start')) {
|
if ((x($ev,'desc') || x($ev,'summary')) && x($ev,'start')) {
|
||||||
|
|
||||||
$sub = format_event_html($ev);
|
$sub = format_event_html($ev);
|
||||||
|
|
||||||
|
$sub = str_replace('$',"\0",$sub);
|
||||||
|
|
||||||
|
$Text = preg_replace("/\[event\-start\](.*?)\[\/event\-start\]/ism",$sub,$Text);
|
||||||
|
|
||||||
$Text = preg_replace("/\[event\-summary\](.*?)\[\/event\-summary\]/ism",'',$Text);
|
$Text = preg_replace("/\[event\-summary\](.*?)\[\/event\-summary\]/ism",'',$Text);
|
||||||
$Text = preg_replace("/\[event\-description\](.*?)\[\/event\-description\]/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\-finish\](.*?)\[\/event\-finish\]/ism",'',$Text);
|
||||||
$Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/ism",'',$Text);
|
$Text = preg_replace("/\[event\-location\](.*?)\[\/event\-location\]/ism",'',$Text);
|
||||||
$Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text);
|
$Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text);
|
||||||
|
|
||||||
|
$Text = str_replace("\0",'$',$Text);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unhide all [noparse] contained bbtags unspacefying them
|
// Unhide all [noparse] contained bbtags unspacefying them
|
||||||
|
@ -18,6 +18,7 @@ function format_event_html($ev) {
|
|||||||
if(! ((is_array($ev)) && count($ev)))
|
if(! ((is_array($ev)) && count($ev)))
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
|
|
||||||
$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8:01 AM
|
$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8:01 AM
|
||||||
|
|
||||||
$o = '<div class="vevent">' . "\r\n";
|
$o = '<div class="vevent">' . "\r\n";
|
||||||
@ -165,7 +166,12 @@ function bbtoevent($s) {
|
|||||||
$match = '';
|
$match = '';
|
||||||
if(preg_match("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",$s,$match))
|
if(preg_match("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",$s,$match))
|
||||||
$ev['adjust'] = $match[1];
|
$ev['adjust'] = $match[1];
|
||||||
$ev['nofinish'] = (((x($ev, 'start') && $ev['start']) && (!x($ev, 'finish') || !$ev['finish'])) ? 1 : 0);
|
if(array_key_exists('start',$ev)) {
|
||||||
|
if(array_key_exists('finish',$ev) && (! $ev['finish']))
|
||||||
|
$ev['nofinish'] = 0;
|
||||||
|
else
|
||||||
|
$ev['nofinish'] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
return $ev;
|
return $ev;
|
||||||
}
|
}
|
||||||
@ -483,7 +489,7 @@ function event_import_ical($ical, $uid) {
|
|||||||
$ev['private'] = 1;
|
$ev['private'] = 1;
|
||||||
$ev['allow_cid'] = '<' . $channel['channel_hash'] . '>';
|
$ev['allow_cid'] = '<' . $channel['channel_hash'] . '>';
|
||||||
|
|
||||||
// logger('storing event: ' . print_r($ev,true), LOGGER_ALL);
|
logger('storing event: ' . print_r($ev,true), LOGGER_ALL);
|
||||||
$event = event_store_event($ev);
|
$event = event_store_event($ev);
|
||||||
if($event) {
|
if($event) {
|
||||||
$item_id = event_store_item($ev,$event);
|
$item_id = event_store_item($ev,$event);
|
||||||
|
Reference in New Issue
Block a user