call zidify_links() when formatting bbcode for internal consumption

This commit is contained in:
zotlabs 2016-12-19 16:06:49 -08:00
parent 1798ebd395
commit 231b70b987
12 changed files with 23 additions and 23 deletions

View File

@ -292,8 +292,8 @@ class Cal extends \Zotlabs\Web\Controller {
$title = strip_tags(html_entity_decode($title,ENT_QUOTES,'UTF-8')); $title = strip_tags(html_entity_decode($title,ENT_QUOTES,'UTF-8'));
} }
$html = format_event_html($rr); $html = format_event_html($rr);
$rr['desc'] = bbcode($rr['desc']); $rr['desc'] = zidify_links(smilies(bbcode($rr['desc'])));
$rr['location'] = bbcode($rr['location']); $rr['location'] = zidify_links(smilies(bbcode($rr['location'])));
$events[] = array( $events[] = array(
'id'=>$rr['id'], 'id'=>$rr['id'],
'hash' => $rr['event_hash'], 'hash' => $rr['event_hash'],

View File

@ -143,7 +143,7 @@ class Chatsvc extends \Zotlabs\Web\Controller {
'name' => $rr['xchan_name'], 'name' => $rr['xchan_name'],
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'), 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'r'), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'r'),
'text' => smilies(bbcode($rr['chat_text'])), 'text' => zidify_links(smilies(bbcode($rr['chat_text']))),
'self' => ((get_observer_hash() == $rr['chat_xchan']) ? 'self' : '') 'self' => ((get_observer_hash() == $rr['chat_xchan']) ? 'self' : '')
); );
} }

View File

@ -262,7 +262,7 @@ class Directory extends \Zotlabs\Web\Controller {
$hometown = ((x($profile,'hometown') == 1) ? $profile['hometown'] : False); $hometown = ((x($profile,'hometown') == 1) ? $profile['hometown'] : False);
$about = ((x($profile,'about') == 1) ? bbcode($profile['about']) : False); $about = ((x($profile,'about') == 1) ? zidify_links(bbcode($profile['about'])) : False);
$keywords = ((x($profile,'keywords')) ? $profile['keywords'] : ''); $keywords = ((x($profile,'keywords')) ? $profile['keywords'] : '');

View File

@ -625,14 +625,14 @@ class Events extends \Zotlabs\Web\Controller {
$drop = array(z_root().'/events/drop/'.$rr['event_hash'],t('Delete event'),'',''); $drop = array(z_root().'/events/drop/'.$rr['event_hash'],t('Delete event'),'','');
$title = strip_tags(html_entity_decode(bbcode($rr['summary']),ENT_QUOTES,'UTF-8')); $title = strip_tags(html_entity_decode(zidify_links(bbcode($rr['summary'])),ENT_QUOTES,'UTF-8'));
if(! $title) { if(! $title) {
list($title, $_trash) = explode("<br",bbcode($rr['desc']),2); list($title, $_trash) = explode("<br",bbcode($rr['desc']),2);
$title = strip_tags(html_entity_decode($title,ENT_QUOTES,'UTF-8')); $title = strip_tags(html_entity_decode($title,ENT_QUOTES,'UTF-8'));
} }
$html = format_event_html($rr); $html = format_event_html($rr);
$rr['desc'] = bbcode($rr['desc']); $rr['desc'] = zidify_links(smilies(bbcode($rr['desc'])));
$rr['location'] = bbcode($rr['location']); $rr['location'] = zidify_links(smilies(bbcode($rr['location'])));
$events[] = array( $events[] = array(
'id'=>$rr['id'], 'id'=>$rr['id'],
'hash' => $rr['event_hash'], 'hash' => $rr['event_hash'],

View File

@ -79,7 +79,7 @@ class Message extends \Zotlabs\Web\Controller {
'to_photo' => $rr['to']['xchan_photo_s'], 'to_photo' => $rr['to']['xchan_photo_s'],
'subject' => (($rr['seen']) ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>'), 'subject' => (($rr['seen']) ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>'),
'delete' => t('Delete conversation'), 'delete' => t('Delete conversation'),
'body' => smilies(bbcode($rr['body'])), 'body' => zidify_links(smilies(bbcode($rr['body']))),
'date' => datetime_convert('UTC',date_default_timezone_get(),$rr['created'], t('D, d M Y - g:i A')), 'date' => datetime_convert('UTC',date_default_timezone_get(),$rr['created'], t('D, d M Y - g:i A')),
'seen' => $rr['seen'] 'seen' => $rr['seen']
); );

View File

@ -211,7 +211,7 @@ class Search extends \Zotlabs\Web\Controller {
$result = array(); $result = array();
require_once('include/conversation.php'); require_once('include/conversation.php');
foreach($items as $item) { foreach($items as $item) {
$item['html'] = bbcode($item['body']); $item['html'] = zidify_links(bbcode($item['body']));
$x = encode_item($item); $x = encode_item($item);
$x['html'] = prepare_text($item['body'],$item['mimetype']); $x['html'] = prepare_text($item['body'],$item['mimetype']);
$result[] = $x; $result[] = $x;

View File

@ -215,7 +215,7 @@ class Wiki extends \Zotlabs\Web\Controller {
$content = ($p['content'] !== '' ? $rawContent : '"# New page\n"'); $content = ($p['content'] !== '' ? $rawContent : '"# New page\n"');
// Render the Markdown-formatted page content in HTML // Render the Markdown-formatted page content in HTML
if($mimeType == 'text/bbcode') { if($mimeType == 'text/bbcode') {
$renderedContent = wiki_convert_links(bbcode($content),argv(0).'/'.argv(1).'/'.$wikiUrlName); $renderedContent = wiki_convert_links(zidify_links(smilies(bbcode($content))),argv(0).'/'.argv(1).'/'.$wikiUrlName);
} }
else { else {
require_once('library/markdown.php'); require_once('library/markdown.php');
@ -299,7 +299,7 @@ class Wiki extends \Zotlabs\Web\Controller {
$mimeType = $w['mimeType']; $mimeType = $w['mimeType'];
if($mimeType == 'text/bbcode') { if($mimeType == 'text/bbcode') {
$html = wiki_convert_links(bbcode($content),$wikiURL); $html = wiki_convert_links(zidify_links(smilies(bbcode($content))),$wikiURL);
} }
else { else {
require_once('library/markdown.php'); require_once('library/markdown.php');

View File

@ -1218,7 +1218,7 @@ function advanced_profile(&$a) {
$profile['marital'] = array( t('Status:'), App::$profile['marital']); $profile['marital'] = array( t('Status:'), App::$profile['marital']);
if(App::$profile['partner']) if(App::$profile['partner'])
$profile['marital']['partner'] = bbcode(App::$profile['partner']); $profile['marital']['partner'] = zidify_links(bbcode(App::$profile['partner']));
if(strlen(App::$profile['howlong']) && App::$profile['howlong'] > NULL_DATE) { if(strlen(App::$profile['howlong']) && App::$profile['howlong'] > NULL_DATE) {
$profile['howlong'] = relative_date(App::$profile['howlong'], t('for %1$d %2$s')); $profile['howlong'] = relative_date(App::$profile['howlong'], t('for %1$d %2$s'));

View File

@ -1564,7 +1564,7 @@ function format_location($item) {
if(strpos($item['location'],'#') === 0) { if(strpos($item['location'],'#') === 0) {
$location = substr($item['location'],1); $location = substr($item['location'],1);
$location = ((strpos($location,'[') !== false) ? bbcode($location) : $location); $location = ((strpos($location,'[') !== false) ? zidify_links(bbcode($location)) : $location);
} }
else { else {
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
@ -1616,7 +1616,7 @@ function prepare_page($item) {
'$author' => (($naked) ? '' : $item['author']['xchan_name']), '$author' => (($naked) ? '' : $item['author']['xchan_name']),
'$auth_url' => (($naked) ? '' : zid($item['author']['xchan_url'])), '$auth_url' => (($naked) ? '' : zid($item['author']['xchan_url'])),
'$date' => (($naked) ? '' : datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'Y-m-d H:i')), '$date' => (($naked) ? '' : datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'Y-m-d H:i')),
'$title' => smilies(bbcode($item['title'])), '$title' => zidify_links(smilies(bbcode($item['title']))),
'$body' => $body['html'], '$body' => $body['html'],
'$preview' => $preview, '$preview' => $preview,
'$link' => $link, '$link' => $link,

View File

@ -25,7 +25,7 @@ function format_event_html($ev) {
$o = '<div class="vevent">' . "\r\n"; $o = '<div class="vevent">' . "\r\n";
$o .= '<div class="event-title"><h3><i class="fa fa-calendar"></i>&nbsp;' . bbcode($ev['summary']) . '</h3></div>' . "\r\n"; $o .= '<div class="event-title"><h3><i class="fa fa-calendar"></i>&nbsp;' . zidify_links(smilies(bbcode($ev['summary']))) . '</h3></div>' . "\r\n";
$o .= '<div class="event-start"><span class="event-label">' . t('Starts:') . '</span>&nbsp;<span class="dtstart" title="' $o .= '<div class="event-start"><span class="event-label">' . t('Starts:') . '</span>&nbsp;<span class="dtstart" title="'
. datetime_convert('UTC', 'UTC', $ev['dtstart'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )) . datetime_convert('UTC', 'UTC', $ev['dtstart'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' ))
@ -46,11 +46,11 @@ function format_event_html($ev) {
$ev['dtend'] , $bd_format ))) $ev['dtend'] , $bd_format )))
. '</span></div>' . "\r\n"; . '</span></div>' . "\r\n";
$o .= '<div class="event-description">' . bbcode($ev['description']) . '</div>' . "\r\n"; $o .= '<div class="event-description">' . zidify_links(smilies(bbcode($ev['description']))) . '</div>' . "\r\n";
if(strlen($ev['location'])) if(strlen($ev['location']))
$o .= '<div class="event-location"><span class="event-label"> ' . t('Location:') . '</span>&nbsp;<span class="location">' $o .= '<div class="event-location"><span class="event-label"> ' . t('Location:') . '</span>&nbsp;<span class="location">'
. bbcode($ev['location']) . zidify_links(smilies(bbcode($ev['location'])))
. '</span></div>' . "\r\n"; . '</span></div>' . "\r\n";
$o .= '</div>' . "\r\n"; $o .= '</div>' . "\r\n";
@ -69,7 +69,7 @@ function format_event_obj($jobject) {
$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
$event['header'] = replace_macros(get_markup_template('event_item_header.tpl'),array( $event['header'] = replace_macros(get_markup_template('event_item_header.tpl'),array(
'$title' => bbcode($object['title']), '$title' => zidify_links(smilies(bbcode($object['title']))),
'$dtstart_label' => t('Starts:'), '$dtstart_label' => t('Starts:'),
'$dtstart_title' => datetime_convert('UTC', 'UTC', $object['dtstart'], (($object['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )), '$dtstart_title' => datetime_convert('UTC', 'UTC', $object['dtstart'], (($object['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )),
'$dtstart_dt' => (($object['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $object['dtstart'] , $bd_format )) : day_translate(datetime_convert('UTC', 'UTC', $object['dtstart'] , $bd_format))), '$dtstart_dt' => (($object['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $object['dtstart'] , $bd_format )) : day_translate(datetime_convert('UTC', 'UTC', $object['dtstart'] , $bd_format))),
@ -80,9 +80,9 @@ function format_event_obj($jobject) {
)); ));
$event['content'] = replace_macros(get_markup_template('event_item_content.tpl'),array( $event['content'] = replace_macros(get_markup_template('event_item_content.tpl'),array(
'$description' => bbcode($object['description']), '$description' => zidify_links(smilies(bbcode($object['description']))),
'$location_label' => t('Location:'), '$location_label' => t('Location:'),
'$location' => bbcode($object['location']) '$location' => zidify_links(smilies(bbcode($object['location'])))
)); ));
} }

View File

@ -79,7 +79,7 @@ function get_help_content($tocpath = false) {
} }
if($doctype === 'bbcode') { if($doctype === 'bbcode') {
require_once('include/bbcode.php'); require_once('include/bbcode.php');
$content = bbcode($text); $content = zidify_links(bbcode($text));
// bbcode retargets external content to new windows. This content is internal. // bbcode retargets external content to new windows. This content is internal.
$content = str_replace(' target="_blank"', '', $content); $content = str_replace(' target="_blank"', '', $content);
} }
@ -95,7 +95,7 @@ function preg_callback_help_include($matches) {
$include = str_replace($matches[0],load_doc_file($matches[1]),$matches[0]); $include = str_replace($matches[0],load_doc_file($matches[1]),$matches[0]);
if(preg_match('/\.bb$/', $matches[1]) || preg_match('/\.txt$/', $matches[1])) { if(preg_match('/\.bb$/', $matches[1]) || preg_match('/\.txt$/', $matches[1])) {
require_once('include/bbcode.php'); require_once('include/bbcode.php');
$include = bbcode($include); $include = zidify_links(bbcode($include));
$include = str_replace(' target="_blank"','',$include); $include = str_replace(' target="_blank"','',$include);
} }
elseif(preg_match('/\.md$/', $matches[1])) { elseif(preg_match('/\.md$/', $matches[1])) {

View File

@ -102,7 +102,7 @@ function menu_render($menu, $class='', $edit = false, $var = array()) {
if($menu['items'][$x]['mitem_flags'] & MENU_ITEM_NEWWIN) if($menu['items'][$x]['mitem_flags'] & MENU_ITEM_NEWWIN)
$menu['items'][$x]['newwin'] = '1'; $menu['items'][$x]['newwin'] = '1';
$menu['items'][$x]['mitem_desc'] = bbcode($menu['items'][$x]['mitem_desc']); $menu['items'][$x]['mitem_desc'] = zidify_links(smilies(bbcode($menu['items'][$x]['mitem_desc'])));
} }
$wrap = (($var['wrap'] === 'none') ? false : true); $wrap = (($var['wrap'] === 'none') ? false : true);