Merge branch 'master' into tres

This commit is contained in:
friendica 2015-05-01 13:19:19 -07:00
commit b467dc4f00
5 changed files with 37 additions and 3 deletions

View File

@ -88,6 +88,10 @@ This places the menu called "mymenu" at this location on the page, which must be
This places a block named "contributors" in this region. This places a block named "contributors" in this region.
[block][var=wrap]none[/var]contributors[/block]
The variable [var=wrap]none[/var] in a block removes the wrapping div element from the block.
**Widgets** **Widgets**

View File

@ -108,6 +108,10 @@ This places the menu called "mymenu" at this location on the page, whi
[/code] [/code]
This places a block named "contributors" in this region. This places a block named "contributors" in this region.
[code]
[block][var=wrap]none[/var]contributors[/block]
[/code]
The variable [var=wrap]none[/var] in a block removes the wrapping div element from the block.
[b]Widgets[/b] [b]Widgets[/b]

View File

@ -420,7 +420,11 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true) {
// process [observer] tags before we do anything else because we might // process [observer] tags before we do anything else because we might
// be stripping away stuff that then doesn't need to be worked on anymore // be stripping away stuff that then doesn't need to be worked on anymore
$observer = $a->get_observer(); if(get_config('system','item_cache'))
$observer = false;
else
$observer = $a->get_observer();
if ((strpos($Text,'[/observer]') !== false) || (strpos($Text,'[/rpost]') !== false)) { if ((strpos($Text,'[/observer]') !== false) || (strpos($Text,'[/rpost]') !== false)) {
if ($observer) { if ($observer) {
$Text = preg_replace("/\[observer\=1\](.*?)\[\/observer\]/ism", '$1', $Text); $Text = preg_replace("/\[observer\=1\](.*?)\[\/observer\]/ism", '$1', $Text);
@ -433,7 +437,11 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true) {
} }
} }
$channel = $a->get_channel(); if(get_config('system','item_cache'))
$channel = false;
else
$channel = $a->get_channel();
if (strpos($Text,'[/channel]') !== false) { if (strpos($Text,'[/channel]') !== false) {
if ($channel) { if ($channel) {
$Text = preg_replace("/\[channel\=1\](.*?)\[\/channel\]/ism", '$1', $Text); $Text = preg_replace("/\[channel\=1\](.*?)\[\/channel\]/ism", '$1', $Text);

View File

@ -1185,6 +1185,14 @@ function unobscure(&$item) {
$item['title'] = crypto_unencapsulate(json_decode_plus($item['title']),$key); $item['title'] = crypto_unencapsulate(json_decode_plus($item['title']),$key);
if($item['body']) if($item['body'])
$item['body'] = crypto_unencapsulate(json_decode_plus($item['body']),$key); $item['body'] = crypto_unencapsulate(json_decode_plus($item['body']),$key);
if(get_config('system','item_cache')) {
q("update item set title = '%s', body = '%s', item_flags = %d where id = %d",
dbesc($item['title']),
dbesc($item['body']),
intval($item['item_flags'] - ITEM_OBSCURED),
intval($item['id'])
);
}
} }
} }
@ -1371,8 +1379,12 @@ function generate_named_map($location) {
function prepare_body(&$item,$attach = false) { function prepare_body(&$item,$attach = false) {
if(get_config('system','item_cache') && $item['html'])
return $item['html'];
call_hooks('prepare_body_init', $item); call_hooks('prepare_body_init', $item);
unobscure($item); unobscure($item);
$s = prepare_text($item['body'],$item['mimetype']); $s = prepare_text($item['body'],$item['mimetype']);
@ -1440,6 +1452,12 @@ function prepare_body(&$item,$attach = false) {
$prep_arr = array('item' => $item, 'html' => $s); $prep_arr = array('item' => $item, 'html' => $s);
call_hooks('prepare_body_final', $prep_arr); call_hooks('prepare_body_final', $prep_arr);
if(get_config('system','item_cache'))
q("update item set html = '%s' where id = %d",
dbesc($prep_arr['html']),
intval($item['id'])
);
return $prep_arr['html']; return $prep_arr['html'];
} }

View File

@ -1 +1 @@
2015-04-28.1016 2015-04-30.1018