aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2018-05-24 05:35:50 -0400
committerAndrew Manning <tamanning@zoho.com>2018-05-24 05:35:50 -0400
commitfc6b337bbbd2fd3b5412c8b957122830f73feb2d (patch)
treee8417e561ac7445a4018c0cf3bf722779493c430 /include
parent40d99c171678654817e392b7f59050dccce770a8 (diff)
parent9cf8931136c703c66d0bf83e4c6b8fb7f4d2cf0b (diff)
downloadvolse-hubzilla-fc6b337bbbd2fd3b5412c8b957122830f73feb2d.tar.gz
volse-hubzilla-fc6b337bbbd2fd3b5412c8b957122830f73feb2d.tar.bz2
volse-hubzilla-fc6b337bbbd2fd3b5412c8b957122830f73feb2d.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Diffstat (limited to 'include')
-rw-r--r--include/api_zot.php7
-rw-r--r--include/conversation.php6
-rw-r--r--include/js_strings.php10
-rw-r--r--include/nav.php10
-rw-r--r--include/network.php4
-rw-r--r--include/oauth.php2
-rw-r--r--include/text.php14
7 files changed, 33 insertions, 20 deletions
diff --git a/include/api_zot.php b/include/api_zot.php
index 1d30a0845..921242152 100644
--- a/include/api_zot.php
+++ b/include/api_zot.php
@@ -96,9 +96,10 @@
// json_return_and_die(post_activity_item($_REQUEST));
}
else {
- $mindate = (($_REQUEST['mindate']) ? datetime_convert('UTC','UTC',$_REQUEST['mindate']) : '');
- if(! $mindate)
- $mindate = datetime_convert('UTC','UTC', 'now - 14 days');
+ if(array_key_exists('dbegin',$_REQUEST))
+ $_REQUEST['datequery2'] = $_REQUEST['dbegin'];
+ if(array_key_exists('dend',$_REQUEST))
+ $_REQUEST['datequery'] = $_REQUEST['dend'];
$arr = $_REQUEST;
$ret = [];
diff --git a/include/conversation.php b/include/conversation.php
index 3041d2e21..4a1cdc7da 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1304,6 +1304,8 @@ function status_editor($a, $x, $popup = false) {
$id_select = '';
$webpage = ((x($x,'webpage')) ? $x['webpage'] : '');
+
+ $reset = ((x($x,'reset')) ? $x['reset'] : '');
$feature_auto_save_draft = ((feature_enabled($x['profile_uid'], 'auto_save_draft')) ? "true" : "false");
@@ -1329,6 +1331,7 @@ function status_editor($a, $x, $popup = false) {
'$nocomment_enabled' => t('Comments enabled'),
'$nocomment_disabled' => t('Comments disabled'),
'$auto_save_draft' => $feature_auto_save_draft,
+ '$reset' => $reset
));
$tpl = get_markup_template('jot.tpl');
@@ -1441,7 +1444,8 @@ function status_editor($a, $x, $popup = false) {
'$expiryModalCANCEL' => t('Cancel'),
'$expanded' => ((x($x, 'expanded')) ? $x['expanded'] : false),
'$bbcode' => ((x($x, 'bbcode')) ? $x['bbcode'] : false),
- '$parent' => ((array_key_exists('parent',$x) && $x['parent']) ? $x['parent'] : 0)
+ '$parent' => ((array_key_exists('parent',$x) && $x['parent']) ? $x['parent'] : 0),
+ '$reset' => $reset
));
if ($popup === true) {
diff --git a/include/js_strings.php b/include/js_strings.php
index 936594291..d9038e838 100644
--- a/include/js_strings.php
+++ b/include/js_strings.php
@@ -23,6 +23,16 @@ function js_strings() {
'$linkurl' => t('Please enter a link URL'),
'$leavethispage' => t('Unsaved changes. Are you sure you wish to leave this page?'),
'$location' => t('Location'),
+ '$lovely' => t('lovely'),
+ '$wonderful' => t('wonderful'),
+ '$fantastic' => t('fantastic'),
+ '$great' => t('great'),
+ '$nick_invld1' => t('Your chosen nickname was either already taken or not valid. Please use our suggestion ('),
+ '$nick_invld2' => t(') or enter a new one.'),
+ '$nick_valid' => t('Thank you, this nickname is valid.'),
+ '$name_empty' => t('A channel name is required.'),
+ '$name_ok1' => t('This is a '),
+ '$name_ok2' => t(' channel name'),
// translatable prefix and suffix strings for jquery.timeago -
// using the defaults set below if left untranslated, empty strings if
diff --git a/include/nav.php b/include/nav.php
index a443c58ff..c5ceb97c5 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -17,15 +17,7 @@ function nav($template = 'default') {
if(!(x(App::$page,'nav')))
App::$page['nav'] = '';
- $base = z_root();
-
- App::$page['htmlhead'] .= <<< EOT
-<script>$(document).ready(function() {
- $("#nav-search-text").search_autocomplete('$base/acl');
-});
-
-</script>
-EOT;
+ App::$page['htmlhead'] .= '<script>$(document).ready(function() { $("#nav-search-text").search_autocomplete(\'' . z_root() . '/acl' . '\');});</script>';
$is_owner = (((local_channel()) && ((App::$profile_uid == local_channel()) || (App::$profile_uid == 0))) ? true : false);
diff --git a/include/network.php b/include/network.php
index ceba56e06..7e8f823a3 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1216,7 +1216,7 @@ function webfinger_rfc7033($webbie, $zot = false) {
if(strpos($webbie,'@')) {
$lhs = substr($webbie,0,strpos($webbie,'@'));
$rhs = substr($webbie,strpos($webbie,'@')+1);
- $resource = 'acct:' . $webbie;
+ $resource = urlencode('acct:' . $webbie);
}
else {
$m = parse_url($webbie);
@@ -1234,7 +1234,7 @@ function webfinger_rfc7033($webbie, $zot = false) {
$counter = 0;
$s = z_fetch_url('https://' . $rhs . '/.well-known/webfinger?f=&resource=' . $resource . (($zot) ? '&zot=1' : ''),
- false, $counter, [ 'headers' => [ 'Accept: application/jrd+json, */*' ] ]);
+ false, $counter, [ 'headers' => [ 'Accept: application/jrd+json, application/json, */*' ] ]);
if($s['success']) {
$j = json_decode($s['body'], true);
diff --git a/include/oauth.php b/include/oauth.php
index a3c52bf27..845ec4558 100644
--- a/include/oauth.php
+++ b/include/oauth.php
@@ -79,7 +79,7 @@ class ZotOAuth1DataStore extends OAuth1DataStore {
$k = $consumer;
}
- $r = q("INSERT INTO tokens (id, secret, client_id, auth_scope, expires) VALUES ('%s','%s','%s','%s', %d)",
+ $r = q("INSERT INTO tokens (id, secret, client_id, auth_scope, expires, uid) VALUES ('%s','%s','%s','%s', %d, 0)",
dbesc($key),
dbesc($sec),
dbesc($k),
diff --git a/include/text.php b/include/text.php
index ef3c8871c..34063cdd7 100644
--- a/include/text.php
+++ b/include/text.php
@@ -572,7 +572,7 @@ function item_message_id() {
$r = q("SELECT id FROM item WHERE mid = '%s' LIMIT 1",
dbesc($mid));
- if(count($r))
+ if($r)
$dups = true;
} while($dups == true);
@@ -593,7 +593,7 @@ function photo_new_resource() {
$r = q("SELECT id FROM photo WHERE resource_id = '%s' LIMIT 1",
dbesc($resource));
- if(count($r))
+ if($r)
$found = true;
} while($found === true);
@@ -1415,15 +1415,21 @@ function unobscure_mail(&$item) {
function theme_attachments(&$item) {
$arr = json_decode($item['attach'],true);
+
if(is_array($arr) && count($arr)) {
$attaches = array();
foreach($arr as $r) {
$icon = getIconFromType($r['type']);
- $label = (($r['title']) ? urldecode(htmlspecialchars($r['title'], ENT_COMPAT, 'UTF-8')) : t('Unknown Attachment'));
+
+ if($r['title'])
+ $label = urldecode(htmlspecialchars($r['title'], ENT_COMPAT, 'UTF-8'));
+
+ if(! $label && $r['href'])
+ $label = basename($r['href']);
//some feeds provide an attachment where title an empty space
- if($label == ' ')
+ if(! $label || $label == ' ')
$label = t('Unknown Attachment');
$title = t('Size') . ' ' . (($r['length']) ? userReadableSize($r['length']) : t('unknown'));