aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/bbcode.php7
-rw-r--r--include/conversation.php63
-rw-r--r--include/identity.php8
-rwxr-xr-xinclude/items.php1
-rwxr-xr-xinclude/oembed.php5
-rw-r--r--include/poller.php2
-rwxr-xr-xinclude/text.php18
-rw-r--r--mod/admin.php6
-rw-r--r--mod/network.php2
-rw-r--r--version.inc2
-rwxr-xr-xview/tpl/admin_site.tpl2
-rw-r--r--view/tpl/notes.tpl2
12 files changed, 76 insertions, 42 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index c8d1ab425..96242fdac 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -230,11 +230,10 @@ function bb_location($match) {
function bbiframe($match) {
$a = get_app();
- // use sandbox mode to prevent malicious goings on rather than host restriction
- // if(strpos($match[1],get_app()->get_hostname()))
- // return '<a href="' . $match[1] . '">' . $match[1] . '</a>';
- return '<iframe sandbox="allow-same-origin allow-top-navigation" src="' . $match[1] . '" width="' . $a->videowidth . '" height="' . $a->videoheight . '"><a href="' . $match[1] . '">' . $match[1] . '</a></iframe>';
+ $sandbox = ((strpos($match[1],get_app()->get_hostname())) ? ' sandbox="allow-scripts" ' : '');
+
+ return '<iframe ' . $sandbox . ' src="' . $match[1] . '" width="' . $a->videowidth . '" height="' . $a->videoheight . '"><a href="' . $match[1] . '">' . $match[1] . '</a></iframe>';
}
function bb_ShareAttributesSimple($match) {
diff --git a/include/conversation.php b/include/conversation.php
index 342392398..af41e8fa7 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1384,58 +1384,65 @@ function network_tabs() {
// tabs
$tabs = array();
- if(get_config('system','discover_tab'))
+ if(! get_config('system','disable_discover_tab')) {
$tabs[] = array(
- 'label' => t('Discover'),
- 'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&fh=1' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
- 'sel'=> $public_active,
- 'title'=> t('Imported public streams'),
- );
+ 'label' => t('Discover'),
+ 'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&fh=1' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
+ 'sel'=> $public_active,
+ 'title'=> t('Imported public streams'),
+ );
+ }
- array_push($tabs,
- array(
- 'label' => t('Commented Order'),
- 'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
- 'sel'=>$all_active,
- 'title'=> t('Sort by Comment Date'),
- ),
- array(
- 'label' => t('Posted Order'),
- 'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
- 'sel'=>$postord_active,
- 'title' => t('Sort by Post Date'),
- ),
- array(
+ $tabs[] = array(
+ 'label' => t('Commented Order'),
+ 'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
+ 'sel'=>$all_active,
+ 'title'=> t('Sort by Comment Date'),
+ );
+
+ $tabs[] = array(
+ 'label' => t('Posted Order'),
+ 'url'=>$a->get_baseurl(true) . '/' . $cmd . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
+ 'sel'=>$postord_active,
+ 'title' => t('Sort by Post Date'),
+ );
+
+ if(feature_enabled(local_user(),'personal_tab')) {
+ $tabs[] = array(
'label' => t('Personal'),
'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&conv=1',
'sel' => $conv_active,
'title' => t('Posts that mention or involve you'),
- ),
- array(
+ );
+ }
+
+ if(feature_enabled(local_user(),'new_tab')) {
+ $tabs[] = array(
'label' => t('New'),
'url' => $a->get_baseurl(true) . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''),
'sel' => $new_active,
'title' => t('Activity Stream - by date'),
- )
- );
+ );
+ }
- if(feature_enabled(local_user(),'star_posts'))
+ if(feature_enabled(local_user(),'star_posts')) {
$tabs[] = array(
'label' => t('Starred'),
'url'=>$a->get_baseurl(true) . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1',
'sel'=>$starred_active,
'title' => t('Favourite Posts'),
);
-
+ }
// Not yet implemented
- if(feature_enabled(local_user(),'spam_filter'))
+ if(feature_enabled(local_user(),'spam_filter')) {
$tabs[] = array(
'label' => t('Spam'),
'url'=>$a->get_baseurl(true) . '/network?f=&spam=1',
'sel'=> $spam_active,
'title' => t('Posts flagged as SPAM'),
- );
+ );
+ }
$arr = array('tabs' => $tabs);
call_hooks('network_tabs', $arr);
diff --git a/include/identity.php b/include/identity.php
index 97c29516c..eb0ba230b 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -547,12 +547,20 @@ function profile_load(&$a, $nickname, $profile = '') {
);
}
+
if(! $p) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice( t('Requested profile is not available.') . EOL );
$a->error = 404;
return;
}
+
+ $z = q("select xchan_photo_date from xchan where xchan_hash = '%s' limit 1",
+ dbesc($p[0]['channel_hash'])
+ );
+ if($z)
+ $p[0]['picdate'] = $z[0]['xchan_photo_date'];
+
// fetch user tags if this isn't the default profile
diff --git a/include/items.php b/include/items.php
index 3c7732b28..ec324b6a3 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2326,6 +2326,7 @@ function tag_deliver($uid,$item_id) {
logger('tag_deliver: community tag activity received');
if(($item['owner_xchan'] === $u[0]['channel_hash']) && (! get_pconfig($u[0]['channel_id'],'system','blocktags'))) {
+ logger('tag_deliver: community tag recipient: ' . $u[0]['channel_name']);
$j_tgt = json_decode_plus($item['target']);
if($j_tgt && $j_tgt['id']) {
$p = q("select * from item where mid = '%s' and uid = %d limit 1",
diff --git a/include/oembed.php b/include/oembed.php
index 46b1d72c4..42a9881ed 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -164,8 +164,11 @@ function oembed_iframe($src,$width,$height) {
$a = get_app();
+ $sandbox = ((strpos($src,get_app()->get_hostname())) ? ' sandbox="allow-scripts" ' : '');
+
$s = $a->get_baseurl()."/oembed/".base64url_encode($src);
- return '<iframe sandbox="allow-same-origin allow-top-navigation" height="' . $height . '" width="' . $width . '" src="' . $s . '" frameborder="no" >' . t('Embedded content') . '</iframe>';
+
+ return '<iframe ' . $sandbox . ' height="' . $height . '" width="' . $width . '" src="' . $s . '" frameborder="no" >' . t('Embedded content') . '</iframe>';
}
diff --git a/include/poller.php b/include/poller.php
index 0eb161862..9592c29e4 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -169,7 +169,7 @@ function poller_run($argv, $argc){
// pull in some public posts
- if(get_config('system','discover_tab'))
+ if(! get_config('system','disable_discover_tab'))
proc_run('php','include/externals.php');
diff --git a/include/text.php b/include/text.php
index e3b1f1c4e..d549f206e 100755
--- a/include/text.php
+++ b/include/text.php
@@ -619,12 +619,28 @@ function get_tags($s) {
}
}
+ // make sure the longer tags are returned first so that if two or more have common substrings
+ // we'll replace the longest ones first. Otherwise the common substring would be found in
+ // both strings and the string replacement would link both to the shorter strings and
+ // fail to link the longer string. RedMatrix github issue #378
+
+ usort($ret,'tag_sort_length');
- // logger('get_tags: ' . print_r($ret,true));
+
+ //logger('get_tags: ' . print_r($ret,true));
return $ret;
}
+function tag_sort_length($a,$b) {
+ if(mb_strlen($a) == mb_strlen($b))
+ return 0;
+ return((mb_strlen($b) < mb_strlen($a)) ? (-1) : 1);
+}
+
+
+
+
function strip_zids($s) {
return preg_replace('/[\?&]zid=(.*?)(&|$)/ism','$2',$s);
diff --git a/mod/admin.php b/mod/admin.php
index b57ef1a8b..3655bd09a 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -244,7 +244,7 @@ function admin_page_site_post(&$a){
$allowed_email = ((x($_POST,'allowed_email')) ? notags(trim($_POST['allowed_email'])) : '');
$block_public = ((x($_POST,'block_public')) ? True : False);
$force_publish = ((x($_POST,'publish_all')) ? True : False);
- $discover_tab = ((x($_POST,'discover_tab')) ? True : False);
+ $disable_discover_tab = ((x($_POST,'disable_discover_tab')) ? True : False);
$no_login_on_homepage = ((x($_POST,'no_login_on_homepage')) ? True : False);
$global_directory = ((x($_POST,'directory_submit_url')) ? notags(trim($_POST['directory_submit_url'])) : '');
$no_community_page = !((x($_POST,'no_community_page')) ? True : False);
@@ -342,7 +342,7 @@ function admin_page_site_post(&$a){
set_config('system','allowed_email', $allowed_email);
set_config('system','block_public', $block_public);
set_config('system','publish_all', $force_publish);
- set_config('system','discover_tab', $discover_tab);
+ set_config('system','disable_discover_tab', $disable_discover_tab);
if($global_directory=="") {
del_config('system','directory_submit_url');
}
@@ -464,7 +464,7 @@ function admin_page_site(&$a) {
'$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")),
'$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")),
'$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
- '$discover_tab' => array('discover_tab', t("Discovery tab"), get_config('system','discover_tab'), t("Display a tab in the network view with public content pulled from sources chosen for this site.")),
+ '$disable_discover_tab' => array('disable_discover_tab', t("Disable discovery tab"), get_config('system','disable_discover_tab'), t("Remove the tab in the network view with public content pulled from sources chosen for this site.")),
'$no_login_on_homepage' => array('no_login_on_homepage', t("No login on Homepage"), get_config('system','no_login_on_homepage'), t("Check to hide the login form from your sites homepage when visitors arrive who are not logged in (e.g. when you put the content of the homepage in via the site channel).")),
'$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""),
diff --git a/mod/network.php b/mod/network.php
index 09098946f..8a05a5eaa 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -319,7 +319,7 @@ function network_content(&$a, $update = 0, $load = false) {
}
- if($firehose && get_config('system','discover_tab')) {
+ if($firehose && (! get_config('system','disable_discover_tab'))) {
require_once('include/identity.php');
$sys = get_sys_channel();
$uids = " and item.uid = " . intval($sys['channel_id']) . " ";
diff --git a/version.inc b/version.inc
index 080731a40..a8c40c9ac 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-03-29.631
+2014-03-31.633
diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl
index 22cefdea4..c6c15cec4 100755
--- a/view/tpl/admin_site.tpl
+++ b/view/tpl/admin_site.tpl
@@ -66,7 +66,7 @@
<h3>{{$corporate}}</h3>
{{include file="field_checkbox.tpl" field=$block_public}}
{{include file="field_checkbox.tpl" field=$force_publish}}
- {{include file="field_checkbox.tpl" field=$discover_tab}}
+ {{include file="field_checkbox.tpl" field=$disable_discover_tab}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>
diff --git a/view/tpl/notes.tpl b/view/tpl/notes.tpl
index 09932e545..b67f66f5b 100644
--- a/view/tpl/notes.tpl
+++ b/view/tpl/notes.tpl
@@ -1,6 +1,6 @@
<div class="widget">
<script>
-$("#note-text").live('input paste',function(e){
+$(document).on('focusout',"#note-text",function(e){
$.post('notes', { 'note_text' : $('#note-text').val() });
});
</script>