Compare commits

...

84 Commits
5.0 ... 5.0.3

Author SHA1 Message Date
Mario
0f6166da00 Merge branch 'dev' 2020-11-26 18:43:53 +00:00
Mario
07e5b8295e changelog 2020-11-26 18:41:51 +00:00
Mario
9afdf86961 coverage config 2020-11-26 12:10:16 +00:00
Mario
f4f1974be0 those would require dbunit 2020-11-26 12:01:15 +00:00
Mario
6f6399ca0f fix test 2020-11-26 11:43:07 +00:00
Mario
5018c0fbb8 add dms/phpunit-arraysubset-asserts 2020-11-26 11:37:13 +00:00
Mario
188975ccbd update gitlab-ci 2020-11-26 11:20:16 +00:00
Mario
5e1addc75e revert folder renaming 2020-11-26 11:14:40 +00:00
Mario
138beeac41 wrong path 2020-11-26 10:24:00 +00:00
Mario
187364d94a set xdebug.mode=coverage in php.ini 2020-11-26 10:21:13 +00:00
Mario
6e74e76fcd update phpunit.xml 2020-11-26 10:12:35 +00:00
Mario
615424d272 update ci file 2020-11-26 10:04:33 +00:00
Mario
d40a7a609e run vendor/bin/phpunit --migrate-configuration 2020-11-26 10:03:39 +00:00
Mario
0ec40f00a9 minor adjustion 2020-11-26 09:52:24 +00:00
Mario
de054026f2 try phpunit 9, remove dbunit (not compatible and abandoned), re-enable xdebug 2020-11-26 09:26:37 +00:00
Mario
175b45d1ed update php-mock 2020-11-26 08:56:38 +00:00
Mario
e236b77817 more psr-4 autoloading standard 2020-11-26 08:48:09 +00:00
Mario
21cd4a1b48 psr-4 autoloading standard 2020-11-26 08:43:03 +00:00
Mario
e9a50371f5 comment out xdebug 2020-11-26 08:30:06 +00:00
Mario
71f8a08e5f update phpunit 2020-11-26 08:19:51 +00:00
Mario
4419c93d80 this should not be required anymore 2020-11-26 07:58:57 +00:00
Mario
fcc13ce02c version 2020-11-25 18:45:37 +00:00
Mario
941db04260 add a uuid version 5 based uuid to imported feeds. if rewrite author for sourced items, also rewrite mid to be fetchable 2020-11-25 13:52:27 +00:00
Mario
87d7a3053a do not reset item_origin to 1 for deleted items to prevent possible looping and do not set item_uplink for sourced rss items - we can not sen anything to them. 2020-11-25 11:01:25 +00:00
Mario
ae11b2c281 profile_load() requires channel_address 2020-11-24 22:14:24 +00:00
Mario
f43577ec27 add logging 2020-11-23 21:26:52 +00:00
Mario
c648c38fb0 fix warning 2020-11-23 20:23:17 +00:00
Mario
34d54fd309 simplify code and fix issue with categories 2020-11-23 19:57:28 +00:00
Mario
891b1428cc do not use chanlink_url() at this place 2020-11-23 18:23:46 +00:00
Mario
453dd38e51 missing include 2020-11-23 14:01:04 +00:00
Mario
f59aefd3d9 store actor of fetched acivities 2020-11-23 09:10:53 +00:00
Mario
451468d129 fix mod item issue with remote channels 2020-11-22 16:37:20 +00:00
Mario
c0adf31da9 fix like issue with remote channels 2020-11-22 13:07:03 +00:00
Mario
bb43c57b07 make simple update more simple again 2020-11-21 20:57:50 +00:00
Mario
6c94bbc93f collase the updated content 2020-11-21 20:52:38 +00:00
Mario
50422c608f fix #1492 2020-11-21 20:35:38 +00:00
Mario
7639157a49 restrict returned html usage to local_channel() until some issues will be worked out 2020-11-21 20:15:05 +00:00
Mario
f74cfaec5f fix pubstream id issue 2020-11-21 10:22:23 +00:00
Mario
d559b4a201 deliver to local hub first 2020-11-21 10:21:14 +00:00
Mario
2d4064aca4 returning the rendered html when liking a post or comment 2020-11-20 20:38:10 +00:00
Mario
337d8ea78c minor cleanup 2020-11-20 14:42:46 +00:00
Mario
4c0a26dbf9 move post_comment() handling via ctrl-enter out of handle_comment_form() - to many issues with multiple triggers 2020-11-20 10:45:35 +00:00
Mario
885edd6261 version 2020-11-20 09:15:19 +00:00
Mario
011de75706 returning the rendered html when posting a comment will make the following update (and its implication in mod pubstream) obsolete 2020-11-20 09:14:46 +00:00
Mario
852e456d44 this is silly but it seems to be required for firefox to stop scrolling in certain conditions 2020-11-18 20:34:41 +00:00
Mario
18136788e4 be more specific 2020-11-18 20:33:32 +00:00
Mario
f1101808b7 fix regression in relation to pustream notifications 2020-11-18 17:09:53 +00:00
Mario
791d5098a0 fix regression 2020-11-18 12:28:20 +00:00
Mario
f2fd12fbe5 Do away with auto updates except for our own actions. We might consider to re-implement this for single thread view like eg /display. Instead of calculating scroll positions during updates, keep track of expanded items and set the expanded state when updating - this fixes issue #1488 2020-11-18 09:52:44 +00:00
Mario
b5ab77908e implement submit on ctrl-enter for post editor and comments 2020-11-17 09:09:36 +00:00
Mario
25620081a1 translation 2020-11-16 09:36:27 +00:00
Mario
5750e6cada Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-11-16 09:34:08 +00:00
Mario
394aa76a8f changelog 2020-11-16 09:33:57 +00:00
Mario
35c4deb884 work around an edge case in acl selector
(cherry picked from commit e7c83a81c7)
2020-11-16 10:31:14 +01:00
Mario
0daccead12 changellog 2020-11-16 09:29:49 +00:00
Mario
e7c83a81c7 work around an edge case in acl selector 2020-11-16 09:28:18 +00:00
Mario
dcf8830752 Merge branch 'dev' 2020-11-16 08:26:44 +00:00
Mario
3d519f478a changelog 2020-11-15 13:49:25 +00:00
Mario
3f0fc40ef8 fix ping_site() 2020-11-15 13:44:13 +00:00
Mario
820494c7a6 deprecate daemon/ratenotif 2020-11-15 12:34:10 +00:00
Mario
60b82d3690 more changelog 2020-11-15 11:49:16 +00:00
Mario
57d9b1b332 fix directory post url 2020-11-15 11:48:23 +00:00
Mario
67f8b78a7d changelog 2020-11-15 11:35:26 +00:00
Mario
aada997601 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-11-15 11:03:47 +00:00
Mario
e5dd108bd7 outq_hash is unique - no need for limit 2020-11-15 11:03:17 +00:00
Mario
ad91ab68ce cleanup 2020-11-15 11:02:21 +00:00
Max Kostikov
66c3c32154 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1883
2020-11-15 11:17:59 +01:00
Max Kostikov
c9ce562369 Update hmessages.po 2020-11-15 11:10:49 +01:00
Max Kostikov
a1f01529a7 Update hstrings.php 2020-11-15 11:10:28 +01:00
Max Kostikov
38985dc4e2 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!1
2020-11-15 11:09:44 +01:00
Mario
e74c52094f remove dot 2020-11-14 21:37:49 +00:00
Mario
e05f1f95cf bump version 2020-11-14 21:31:45 +00:00
Mario
b63c5f2785 Polling fallback to server sent events. Polling is the default. SSE must be enabled in /admin/site > Advanced > Enable SSE Notifications if desired. 2020-11-14 21:28:50 +00:00
Mario
685c569eaf minor queue adjustments 2020-11-13 13:49:39 +00:00
Mario
b6e3469519 update to fix more broken hublocs and version bump 2020-11-13 09:26:04 +00:00
Mario
16071f300e better check for valid inbox 2020-11-13 09:18:54 +00:00
Mario
a8de999b7c do not store actors without an inbox - they are not valid 2020-11-12 20:17:03 +00:00
Mario
0dcbcf93c2 some work on include/import 2020-11-12 11:50:00 +00:00
Mario
06273e980e Merge branch 'dev' 2020-11-12 09:00:56 +00:00
Mario
c879e5de44 changelog and version bump 2020-11-12 08:57:51 +00:00
Mario
890290fff0 log the body if fetch failed 2020-11-11 12:10:35 +00:00
Mario
cddae14352 do not log exception - it could exhaust memory 2020-11-09 11:31:20 +00:00
Mario
b3e6a3c1e2 make share titles h3 to reflect the original titlÃe size 2020-11-08 19:07:44 +00:00
Mario
255b6a14a8 less hubloc confusion 2020-11-08 12:55:32 +00:00
76 changed files with 4973 additions and 3813 deletions

View File

@@ -40,7 +40,8 @@ before_script:
- curl -sS https://getcomposer.org/installer | php
# Install dev libraries from composer
- php ./composer.phar install --no-progress
# php.ini settings
- echo 'xdebug.mode=coverage' >> /usr/local/etc/php/php.ini
# hidden job definition with template for MySQL/MariaDB
.job_template_mysql: &job_definition_mysql

View File

@@ -1,3 +1,43 @@
Hubzilla 5.0.3 (2020-11-26)
- Upgrade phpunit to version 9
- Remove dbunit because its not maintained anymore
- Add uuid version 5 based uuid's to imported feeds
- Fix potential delivery loop
- Fix actor of fetched activities not stored
- Improve update mechanism for comments and likes to prevent page jumps
- Fix issue where channel suggestions was suggesting oneself
- Do not auto-update except for own actions
- Introduce ctrl-enter shortcut to send comments and posts
Addons
Pubcrawl: improve addressing of mentioned actors
Hubzilla 5.0.2 (2020-11-16)
- Fix edge case in acl selector
- Fix ping_site()
- Fix directory post url
- Update russian translation
- Implement polling for notifications (default) - SSE can be enabled in /admin/site if desired
- DB update to remove hublocs with no hubloc_hash or no hubloc_callback
- Do not save actors without an inbox
- Fix import_hublocs()
Addons
- Pubcrawl: do not save actors without an inbox
- Diaspora: fix issue with diaspora where hublocs without hubloc_hash were stored
Hubzilla 5.0.1 (2020-11-12)
- Fix share title size
- Fix issue where hublocs could get mixed up between different protocols
Addons
- Pubcrawl: implement authenticated profile fetches which are now partly required in mastodon
- Sse: call xchan_query() just once per item
- Pubcrawl: reject messages where sender is not the author if ld-signature is not ok
Hubzilla 5.0 (2020-11-05)
- Remove unmaintained and deprecated schemas
- Deprecate HTML5_Parser library

View File

@@ -2,8 +2,7 @@
namespace Zotlabs\Daemon;
require_once('include/zot.php');
require_once('include/hubloc.php');
class Checksites {

View File

@@ -2,12 +2,8 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\DReport;
require_once('include/zot.php');
require_once('include/queue_fn.php');
class Deliver {
static public function run($argc,$argv) {
@@ -22,72 +18,16 @@ class Deliver {
if(! $argv[$x])
continue;
$dresult = null;
$r = q("select * from outq where outq_hash = '%s' limit 1",
$r = q("select * from outq where outq_hash = '%s'",
dbesc($argv[$x])
);
if($r) {
$notify = json_decode($r[0]['outq_notify'],true);
// Messages without an outq_msg will need to go via the web, even if it's a
// local delivery. This includes conversation requests and refresh packets.
if(($r[0]['outq_posturl'] === z_root() . '/post') && ($r[0]['outq_msg'])) {
logger('deliver: local delivery', LOGGER_DEBUG);
// local delivery
// we should probably batch these and save a few delivery processes
if($r[0]['outq_msg']) {
$m = json_decode($r[0]['outq_msg'],true);
if(array_key_exists('message_list',$m)) {
foreach($m['message_list'] as $mm) {
$msg = array('body' => json_encode(array('success' => true, 'pickup' => array(array('notify' => $notify,'message' => $mm)))));
zot_import($msg,z_root());
}
}
else {
$msg = array('body' => json_encode(array('success' => true, 'pickup' => array(array('notify' => $notify,'message' => $m)))));
$dresult = zot_import($msg,z_root());
}
remove_queue_item($r[0]['outq_hash']);
if($dresult && is_array($dresult)) {
// delivery reports for local deliveries do not require encryption
foreach($dresult as $xx) {
if(is_array($xx) && array_key_exists('message_id',$xx)) {
if(DReport::is_storable($xx)) {
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
dbesc($xx['message_id']),
dbesc($xx['location']),
dbesc($xx['recipient']),
dbesc(($xx['name']) ? $xx['name'] : EMPTY_STR),
dbesc($xx['status']),
dbesc(datetime_convert($xx['date'])),
dbesc($xx['sender'])
);
}
}
}
}
q("delete from dreport where dreport_queue = '%s'",
dbesc($argv[$x])
);
continue;
}
}
// otherwise it's a remote delivery - call queue_deliver() with the $immediate flag
queue_deliver($r[0],true);
}
}
}
}

View File

@@ -58,7 +58,8 @@ class Directory {
// otherwise send the changes upstream
$directory = Libzotdir::find_upstream_directory($dirmode);
$url = $directory['url'] . '/post';
$url = $directory['url'] . '/zot';
// ensure the upstream directory is updated

View File

@@ -4,6 +4,7 @@ namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\Queue;
require_once('include/queue_fn.php');
require_once('include/html2plain.php');
@@ -639,9 +640,16 @@ class Notifier {
}
else {
if(! in_array($hub['hubloc_url'],$urls)) {
$hublist[] = $hub['hubloc_host'] . ' ' . $hub['hubloc_network'];
$dhubs[] = $hub;
$urls[] = $hub['hubloc_url'];
if($hub['hubloc_url'] === z_root()) {
//deliver to local hub first
array_unshift($hublist, $hub['hubloc_host'] . ' ' . $hub['hubloc_network']);
array_unshift($dhubs, $hub);
}
else {
$hublist[] = $hub['hubloc_host'] . ' ' . $hub['hubloc_network'];
$dhubs[] = $hub;
}
$urls[] = $hub['hubloc_url'];
}
}
}
@@ -734,15 +742,17 @@ class Notifier {
}
if($packet) {
queue_insert(array(
'hash' => $hash,
'account_id' => $channel['channel_account_id'],
'channel_id' => $channel['channel_id'],
'posturl' => $hub['hubloc_callback'],
'driver' => $hub['hubloc_network'],
'notify' => $packet,
'msg' => (($pmsg) ? json_encode($pmsg) : '')
));
Queue::insert(
[
'hash' => $hash,
'account_id' => $channel['channel_account_id'],
'channel_id' => $channel['channel_id'],
'posturl' => $hub['hubloc_callback'],
'driver' => $hub['hubloc_network'],
'notify' => $packet,
'msg' => (($pmsg) ? json_encode($pmsg) : '')
]
);
}
else {
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
@@ -803,7 +813,7 @@ class Notifier {
}
}
queue_insert(
Queue::insert(
[
'hash' => $hash,
'account_id' => $target_item['aid'],

View File

@@ -10,6 +10,11 @@ class Ratenotif {
static public function run($argc,$argv) {
// Deprecated
return;
require_once("datetime.php");
require_once('include/items.php');

View File

@@ -1,6 +1,6 @@
<?php
namespace Zotlabs\Identity\BasicId;
namespace Zotlabs\Identity;
class BasicId {

View File

@@ -1,5 +1,5 @@
<?php
namespace Zotlabs\Identity\ProfilePhoto;
namespace Zotlabs\Identity;
class ProfilePhoto {

View File

@@ -104,6 +104,7 @@ class Activity {
}
else {
logger('fetch failed: ' . $url);
logger($x['body']);
}
return null;
}
@@ -167,7 +168,7 @@ class Activity {
);
if($r) {
xchan_query($r,true);
$r = fetch_post_tags($r,true);
$r = fetch_post_tags($r);
if (in_array($r[0]['verb'], ['Create', 'Invite']) && $r[0]['obj_type'] === ACTIVITY_OBJ_EVENT) {
$r[0]['verb'] = 'Invite';
return self::encode_activity($r[0]);
@@ -712,7 +713,7 @@ class Activity {
);
if($p) {
xchan_query($p,true);
$p = fetch_post_tags($p,true);
$p = fetch_post_tags($p);
$i['obj'] = self::encode_item($p[0]);
// convert to zot6 emoji reaction encoding which uses the target object to indicate the
@@ -799,7 +800,7 @@ class Activity {
$is_directmessage = false;
$recips = get_iconfig($i['parent'], 'activitypub', 'recips');
if(in_array($i['author']['xchan_url'], $recips['to'])) {
if(array_path_exists('to', $recips) && in_array($i['author']['xchan_url'], $recips['to'])) {
$reply_url = $d[0]['xchan_url'];
$is_directmessage = true;
}
@@ -1492,6 +1493,14 @@ class Activity {
if(! is_array($person_obj))
return;
$inbox = $person_obj['inbox'];
// invalid identity
if (! $inbox || strpos($inbox,z_root()) !== false) {
return;
}
$name = $person_obj['name'];
if(! $name)
$name = $person_obj['preferredUsername'];
@@ -1539,8 +1548,6 @@ class Activity {
$profile = $url;
}
$inbox = $person_obj['inbox'];
$collections = [];
if($inbox) {
@@ -2641,7 +2648,7 @@ class Activity {
$current_item = $item;
while($current_item['parent_mid'] !== $current_item['mid']) {
$n = ActivityStreams::fetch($current_item['parent_mid'], $channel);
$n = self::fetch($current_item['parent_mid'], $channel);
if(! $n) {
break;
}
@@ -2653,6 +2660,10 @@ class Activity {
break;
}
if (is_array($a->actor) && array_key_exists('id',$a->actor)) {
self::actor_store($a->actor['id'],$a->actor);
}
$replies = null;
if(isset($a->obj['replies']['first']['items'])) {
$replies = $a->obj['replies']['first']['items'];
@@ -2718,7 +2729,7 @@ class Activity {
foreach($arr as $url) {
$n = ActivityStreams::fetch($url, $channel);
$n = self::fetch($url, $channel);
if(! $n) {
break;
}

View File

@@ -51,7 +51,7 @@ class JSalmon {
. base64url_encode($x['encoding'],true) . '.'
. base64url_encode($x['alg'],true);
$key = HTTPSig::get_key(EMPTY_STR,base64url_decode($x['sigs']['key_id']));
$key = HTTPSig::get_key(EMPTY_STR,'zot6',base64url_decode($x['sigs']['key_id']));
logger('key: ' . print_r($key,true));
if($key['portable_id'] && $key['public_key']) {
if(rsa_verify($signed_data,base64url_decode($x['sigs']['value']),$key['public_key'])) {

View File

@@ -93,7 +93,8 @@ class LDSignatures {
$d = jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]);
}
catch (\Exception $e) {
logger('normalise error:' . print_r($e,true));
// Don't log the exception - this can exhaust memory
// logger('normalise error:' . print_r($e,true));
logger('normalise error: ' . print_r($data,true));
}

View File

@@ -133,7 +133,7 @@ class Share {
"' message_id='" . $this->item['mid'] .
"']";
if($this->item['title'])
$bb .= '[b]'.$this->item['title'].'[/b]'."\r\n";
$bb .= '[h3][b]'.$this->item['title'].'[/b][/h3]'."\r\n";
$bb .= (($is_photo) ? $photo_bb . "\r\n" . $this->item['body'] : $this->item['body']);
$bb .= "[/share]";
}

View File

@@ -6,7 +6,7 @@ use Zotlabs\Web\HTTPSig;
class Zotfinger {
static function exec($resource,$channel = null) {
static function exec($resource,$channel = null, $verify = true) {
if(! $resource) {
return false;
@@ -41,8 +41,9 @@ class Zotfinger {
logger('fetch: ' . print_r($x,true));
if($x['success']) {
$result['signature'] = HTTPSig::verify($x);
if ($verify) {
$result['signature'] = HTTPSig::verify($x, EMPTY_STR, 'zot6');
}
$result['data'] = json_decode($x['body'],true);

View File

@@ -62,6 +62,9 @@ class Site {
$from_email = ((array_key_exists('from_email',$_POST) && trim($_POST['from_email'])) ? trim($_POST['from_email']) : 'Administrator@' . \App::get_hostname());
$from_email_name = ((array_key_exists('from_email_name',$_POST) && trim($_POST['from_email_name'])) ? trim($_POST['from_email_name']) : \Zotlabs\Lib\System::get_site_name());
$sse_enabled = ((x($_POST,'sse_enabled')) ? true : false);
$verifyssl = ((x($_POST,'verifyssl')) ? True : False);
$proxyuser = ((x($_POST,'proxyuser')) ? notags(trim($_POST['proxyuser'])) : '');
$proxy = ((x($_POST,'proxy')) ? notags(trim($_POST['proxy'])) : '');
@@ -151,6 +154,9 @@ class Site {
set_config('system','no_community_page', $no_community_page);
set_config('system','no_utf', $no_utf);
set_config('system','sse_enabled', $sse_enabled);
set_config('system','verifyssl', $verifyssl);
set_config('system','proxyuser', $proxyuser);
set_config('system','proxy', $proxy);
@@ -331,6 +337,8 @@ class Site {
'$directory_server' => (($dir_choices) ? array('directory_server', t("Directory Server URL"), get_config('system','directory_server'), t("Default directory server"), $dir_choices) : null),
'$sse_enabled' => array('sse_enabled', t('Enable SSE Notifications'), get_config('system', 'sse_enabled', 0), t('If disabled, traditional polling will be used. Warning: this setting might not be suited for shared hosting')),
'$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""),
'$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""),
'$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),

View File

@@ -60,7 +60,7 @@ class Channel extends Controller {
if(Libzot::is_zot_request()) {
$sigdata = HTTPSig::verify(file_get_contents('php://input'));
$sigdata = HTTPSig::verify(file_get_contents('php://input'), EMPTY_STR, 'zot6');
if($sigdata && $sigdata['signer'] && $sigdata['header_valid']) {
$data = json_encode(Libzot::zotinfo([ 'address' => $channel['channel_address'], 'target_url' => $sigdata['signer'] ]));
@@ -130,9 +130,6 @@ class Channel extends Controller {
$noscript_content = get_config('system', 'noscript_content', '1');
if($load)
$_SESSION['loadtime'] = datetime_convert();
$category = $datequery = $datequery2 = '';
$mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
@@ -152,7 +149,6 @@ class Channel extends Controller {
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
$order = ((x($_GET,'order')) ? notags($_GET['order']) : 'post');
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$search = ((x($_GET,'search')) ? $_GET['search'] : EMPTY_STR);
$groups = array();
@@ -187,8 +183,6 @@ class Channel extends Controller {
nav_set_selected('Channel Home');
$static = channel_manual_conv_update(App::$profile['profile_uid']);
// search terms header
if($search) {
$o .= replace_macros(get_markup_template("section_title.tpl"),array(
@@ -255,7 +249,9 @@ class Channel extends Controller {
$abook_uids = " and abook.abook_channel = " . intval(App::$profile['profile_uid']) . " ";
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
$simple_update = '';
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($search) {
$search = escape_tags($search);
@@ -270,7 +266,6 @@ class Channel extends Controller {
}
}
head_add_link([
'rel' => 'alternate',
'type' => 'application/json+oembed',
@@ -278,14 +273,6 @@ class Channel extends Controller {
'title' => 'oembed'
]);
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($load)
$simple_update = '';
if($static && $simple_update)
$simple_update .= " and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
if(($update) && (! $load)) {
if($mid) {
@@ -294,7 +281,6 @@ class Channel extends Controller {
dbesc($mid . '%'),
intval(App::$profile['profile_uid'])
);
$_SESSION['loadtime'] = datetime_convert();
}
else {
$r = q("SELECT parent AS item_id from item
@@ -306,9 +292,7 @@ class Channel extends Controller {
ORDER BY created DESC",
intval(App::$profile['profile_uid'])
);
$_SESSION['loadtime'] = datetime_convert();
}
}
else {
@@ -406,7 +390,7 @@ class Channel extends Controller {
$o .= '<div id="live-channel"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . App::$profile['profile_uid']
. "; var netargs = '?f='; var profile_page = " . App::$pager['page']
. "; divmore_height = " . intval($maxheight) . "; </script>\r\n";
. "; divmore_height = " . intval($maxheight) . ";</script>\r\n";
App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array(
'$baseurl' => z_root(),
@@ -424,7 +408,6 @@ class Channel extends Controller {
'$wall' => '1',
'$fh' => '0',
'$dm' => '0',
'$static' => $static,
'$page' => ((App::$pager['page'] != 1) ? App::$pager['page'] : 1),
'$search' => $search,
'$xchan' => '',
@@ -437,7 +420,8 @@ class Channel extends Controller {
'$verb' => '',
'$net' => '',
'$dend' => $datequery,
'$dbegin' => $datequery2
'$dbegin' => $datequery2,
'$conv_mode' => 'channel'
));
}
@@ -476,6 +460,8 @@ class Channel extends Controller {
if($mid)
$o .= '<div id="content-complete"></div>';
$_SESSION['loadtime'] = datetime_convert();
return $o;
}
}

View File

@@ -294,8 +294,8 @@ class Connedit extends Controller {
intval($channel['channel_id'])
);
if(($pr) && (! intval($orig_record[0]['abook_hidden'])) && (intval(get_pconfig($channel['channel_id'],'system','post_newfriend')))) {
$xarr = array();
$xarr['verb'] = ACTIVITY_FRIEND;
$xarr = [];
$xarr['item_wall'] = 1;
$xarr['item_origin'] = 1;
$xarr['item_thread_top'] = 1;
@@ -305,17 +305,6 @@ class Connedit extends Controller {
$xarr['deny_cid'] = $channel['channel_deny_cid'];
$xarr['deny_gid'] = $channel['channel_deny_gid'];
$xarr['item_private'] = (($xarr['allow_cid']||$xarr['allow_gid']||$xarr['deny_cid']||$xarr['deny_gid']) ? 1 : 0);
$obj = array(
'type' => ACTIVITY_OBJ_PERSON,
'title' => App::$poi['xchan_name'],
'id' => App::$poi['xchan_hash'],
'link' => array(
array('rel' => 'alternate', 'type' => 'text/html', 'href' => App::$poi['xchan_url']),
array('rel' => 'photo', 'type' => App::$poi['xchan_photo_mimetype'], 'href' => App::$poi['xchan_photo_l'])
),
);
$xarr['obj'] = json_encode($obj);
$xarr['obj_type'] = ACTIVITY_OBJ_PERSON;
$xarr['body'] = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t('is now connected to') . ' ' . '[zrl=' . App::$poi['xchan_url'] . ']' . App::$poi['xchan_name'] . '[/zrl]';

View File

@@ -22,9 +22,6 @@ class Display extends \Zotlabs\Web\Controller {
$module_format = 'html';
}
if($load)
$_SESSION['loadtime'] = datetime_convert();
if(observer_prohibited()) {
notice( t('Public access denied.') . EOL);
return;
@@ -183,22 +180,11 @@ class Display extends \Zotlabs\Web\Controller {
return '';
}
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
$simple_update = '';
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($load)
$simple_update = '';
if($static && $simple_update)
$simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
if((! $update) && (! $load)) {
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
if((! $update) && (! $load)) {
// if the target item is not a post (eg a like) we want to address its thread parent
@@ -229,7 +215,6 @@ class Display extends \Zotlabs\Web\Controller {
'$dm' => '0',
'$nouveau' => '0',
'$wall' => '0',
'$static' => $static,
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$search' => '',
@@ -315,7 +300,6 @@ class Display extends \Zotlabs\Web\Controller {
dbesc($target_item['parent_mid'])
);
}
if($r === null) {
// in case somebody turned off public access to sys channel content using permissions
// make that content unsearchable by ensuring the owner_xchan can't match
@@ -335,7 +319,6 @@ class Display extends \Zotlabs\Web\Controller {
intval($sysid)
);
}
$_SESSION['loadtime'] = datetime_convert();
}
else {
@@ -448,6 +431,8 @@ class Display extends \Zotlabs\Web\Controller {
}
$_SESSION['loadtime'] = datetime_convert();
return $o;
}

View File

@@ -31,7 +31,8 @@ class Filer extends \Zotlabs\Web\Controller {
intval(local_channel())
);
if($r) {
$x = q("update item set item_retained = 1 where id = %d and uid = %d",
$x = q("update item set item_retained = 1, changed = '%s' where id = %d and uid = %d",
dbesc(datetime_convert()),
intval($r[0]['parent']),
intval(local_channel())
);

View File

@@ -28,10 +28,14 @@ class Filerm extends \Zotlabs\Web\Controller {
intval($item_id),
dbesc($term)
);
$x = q("update item set item_retained = 0, changed = '%s' where id = %d and uid = %d",
dbesc(datetime_convert()),
intval($item_id),
intval(local_channel())
);
}
if(x($_SESSION,'return_url'))
goaway(z_root() . '/' . $_SESSION['return_url']);
killme();
}

View File

@@ -38,9 +38,6 @@ class Hq extends \Zotlabs\Web\Controller {
if(!local_channel())
return;
if($load)
$_SESSION['loadtime'] = datetime_convert();
if(argc() > 1 && argv(1) !== 'load') {
$item_hash = argv(1);
}
@@ -87,15 +84,9 @@ class Hq extends \Zotlabs\Web\Controller {
goaway(z_root() . '/moderate/' . $target_item['id']);
}
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
$simple_update = '';
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($static && $simple_update)
$simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
$sys = get_sys_channel();
$sql_extra = item_permissions_sql($sys['channel_id']);
@@ -148,8 +139,6 @@ class Hq extends \Zotlabs\Web\Controller {
nav_set_selected('HQ');
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
if($target_item) {
// if the target item is not a post (eg a like) we want to address its thread parent
//$mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']);
@@ -182,8 +171,7 @@ class Hq extends \Zotlabs\Web\Controller {
'$dm' => '0',
'$nouveau' => '0',
'$wall' => '0',
'$static' => $static,
'$page' => 1,
'$page' => '1',
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$search' => '',
'$xchan' => '',
@@ -249,8 +237,6 @@ class Hq extends \Zotlabs\Web\Controller {
intval($sys['channel_id'])
);
}
$_SESSION['loadtime'] = datetime_convert();
}
else {
$r = [];
@@ -275,6 +261,8 @@ class Hq extends \Zotlabs\Web\Controller {
$o .= '<div id="content-complete"></div>';
$_SESSION['loadtime'] = datetime_convert();
return $o;
}

View File

@@ -20,6 +20,7 @@ use App;
require_once('include/crypto.php');
require_once('include/items.php');
require_once('include/security.php');
require_once('include/conversation.php');
/**
@@ -300,6 +301,7 @@ class Item extends Controller {
$parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : 0);
$parent_mid = ((x($_REQUEST,'parent_mid')) ? trim($_REQUEST['parent_mid']) : '');
$mode = (($_REQUEST['conv_mode'] === 'channel') ? 'channel' : 'network');
$remote_xchan = ((x($_REQUEST,'remote_xchan')) ? trim($_REQUEST['remote_xchan']) : false);
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
@@ -1373,8 +1375,21 @@ class Item extends Controller {
if($return_path) {
goaway(z_root() . "/" . $return_path);
}
$json = array('success' => 1);
if($mode === 'channel')
profile_load($channel['channel_address']);
$item[] = $datarray;
$item[0]['owner'] = $owner_xchan;
$item[0]['author'] = $observer;
$item[0]['attach'] = json_encode($datarray['attach']);
$json = [
'success' => 1,
'id' => $post_id,
'html' => conversation($item,$mode,true,'r_preview'),
];
if(x($_REQUEST,'jsreload') && strlen($_REQUEST['jsreload']))
$json['reload'] = z_root() . '/' . $_REQUEST['jsreload'];

View File

@@ -7,13 +7,10 @@ use Zotlabs\Lib\Libsync;
require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');
require_once('include/conversation.php');
class Like extends \Zotlabs\Web\Controller {
private function reaction_to_activity($reaction) {
$acts = [
@@ -42,7 +39,46 @@ class Like extends \Zotlabs\Web\Controller {
}
private function like_response($arr) {
if($arr['conv_mode'] === 'channel') {
$parts = explode('@', $arr['owner_xchan']['xchan_addr']);
profile_load($parts[0]);
}
$item_normal = item_normal();
$activities = q("SELECT item.*, item.id AS item_id FROM item
WHERE uid = %d $item_normal
AND thr_parent = '%s'
AND verb IN ('%s', '%s', '%s', '%s', '%s')",
intval($arr['item']['uid']),
dbesc($arr['item']['mid']),
dbesc(ACTIVITY_LIKE),
dbesc(ACTIVITY_DISLIKE),
dbesc(ACTIVITY_ATTEND),
dbesc(ACTIVITY_ATTENDNO),
dbesc(ACTIVITY_ATTENDMAYBE)
);
xchan_query($activities,true);
$convitems[] = $arr['item'];
$convitems = array_merge($convitems, $activities);
$convitems = fetch_post_tags($convitems,true);
$ret = [
'success' => 1,
'orig_id' => $arr['orig_item_id'], //this is required for pubstream items where $item_id != $item['id']
'id' => $arr['item']['id'],
'html' => conversation($convitems, $arr['conv_mode'], true, 'r_preview'),
];
return $ret;
}
public function get() {
@@ -66,7 +102,8 @@ class Like extends \Zotlabs\Web\Controller {
}
$verb = notags(trim($_GET['verb']));
$mode = (($_GET['conv_mode'] === 'channel') ? 'channel' : 'network');
if(! $verb)
$verb = 'like';
@@ -304,7 +341,7 @@ class Like extends \Zotlabs\Web\Controller {
$thread_owner = $r[0];
else
killme();
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($item['author_xchan'])
);
@@ -312,8 +349,7 @@ class Like extends \Zotlabs\Web\Controller {
$item_author = $r[0];
else
killme();
$verbs = " '".dbesc($activity)."' ";
$multi_undo = false;
@@ -357,16 +393,27 @@ class Like extends \Zotlabs\Web\Controller {
// drop_item was not done interactively, so we need to invoke the notifier
// in order to push the changes to connections
\Zotlabs\Daemon\Master::Summon(array('Notifier','drop',$rr['id']));
}
if($interactive)
return;
if(! $multi_undo)
killme();
if(! $multi_undo) {
$ret = self::like_response([
'item' => $item,
'orig_item_id' => $item_id,
'owner_xchan' => $thread_owner,
'conv_mode' => $mode
]);
json_return_and_die($ret);
}
}
}
@@ -501,7 +548,6 @@ class Like extends \Zotlabs\Web\Controller {
call_hooks('post_local',$arr);
$post = item_store($arr);
$post_id = $post['item_id'];
@@ -540,7 +586,6 @@ class Like extends \Zotlabs\Web\Controller {
}
\Zotlabs\Daemon\Master::Summon(array('Notifier','like',$post_id));
if($interactive) {
@@ -548,10 +593,15 @@ class Like extends \Zotlabs\Web\Controller {
$o .= t('Thank you.');
return $o;
}
killme();
$ret = self::like_response([
'item' => $item,
'orig_item_id' => $item_id,
'owner_xchan' => $thread_owner,
'conv_mode' => $mode
]);
json_return_and_die($ret);
}
}

View File

@@ -44,10 +44,6 @@ class Network extends \Zotlabs\Web\Controller {
$o = '';
if($load) {
$_SESSION['loadtime'] = datetime_convert();
}
$arr = array('query' => App::$query_string);
call_hooks('network_content_init', $arr);
@@ -64,7 +60,6 @@ class Network extends \Zotlabs\Web\Controller {
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
$static = ((x($_GET,'static')) ? intval($_GET['static']) : 0);
$gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0);
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
@@ -213,8 +208,6 @@ class Network extends \Zotlabs\Web\Controller {
$status_editor = status_editor($a,$x,false,'Network');
$o .= $status_editor;
$static = channel_manual_conv_update(local_channel());
}
@@ -370,7 +363,6 @@ class Network extends \Zotlabs\Web\Controller {
'$dm' => (($dm) ? $dm : '0'),
'$nouveau' => (($nouveau) ? $nouveau : '0'),
'$wall' => '0',
'$static' => $static,
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$page' => ((App::$pager['page'] != 1) ? App::$pager['page'] : 1),
'$search' => (($search) ? urlencode($search) : ''),
@@ -494,8 +486,6 @@ class Network extends \Zotlabs\Web\Controller {
$parents_str = '';
$simple_update = (($update) ? " and item_unseen = 1 " : '');
// This fixes a very subtle bug so I'd better explain it. You wake up in the morning or return after a day
// or three and look at your matrix page - after opening up your browser. The first page loads just as it
// should. All of a sudden a few seconds later, page 2 will get inserted at the beginning of the page
@@ -507,16 +497,11 @@ class Network extends \Zotlabs\Web\Controller {
// which "arrived as you were reading page 1". We're going to do this
// by storing in your session the current UTC time whenever you LOAD a network page, and only UPDATE items
// which are both ITEM_UNSEEN and have "changed" since that time. Cross fingers...
$simple_update = '';
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($load)
$simple_update = '';
if($static && $simple_update)
$simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
if($nouveau && $load) {
// "New Item View" - show all items unthreaded in reverse created date order
$items = q("SELECT item.*, item.id AS item_id, created FROM item
@@ -524,7 +509,6 @@ class Network extends \Zotlabs\Web\Controller {
$net_query
WHERE true $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$simple_update
$sql_extra $sql_options $sql_nets
$net_query2
ORDER BY item.created DESC $pager_sql "
@@ -570,7 +554,6 @@ class Network extends \Zotlabs\Web\Controller {
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_options $sql_nets $net_query2"
);
$_SESSION['loadtime'] = datetime_convert();
}
// Then fetch all the children of the parents that are on this page
@@ -605,6 +588,8 @@ class Network extends \Zotlabs\Web\Controller {
if(($items) && (! $update))
$o .= alt_pager(count($items));
$_SESSION['loadtime'] = datetime_convert();
return $o;
}

View File

@@ -23,9 +23,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
}
}
if($load)
$_SESSION['loadtime'] = datetime_convert();
if((observer_prohibited(true))) {
return login();
}
@@ -59,7 +56,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
$item_normal = item_normal();
$item_normal_update = item_normal_update();
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$net = ((array_key_exists('net',$_REQUEST)) ? escape_tags($_REQUEST['net']) : '');
$title = replace_macros(get_markup_template("section_title.tpl"),array(
@@ -103,11 +99,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
$o .= status_editor($a,$x,false,'Pubstream');
$o .= '</div>';
}
if(! $update && !$load) {
@@ -116,8 +107,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
if(!$mid)
$_SESSION['static_loadtime'] = datetime_convert();
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
$maxheight = get_config('system','home_divmore_height');
if(! $maxheight)
$maxheight = 400;
@@ -148,7 +137,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
'$nouveau' => '0',
'$wall' => '0',
'$list' => '0',
'$static' => $static,
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$search' => '',
'$xchan' => '',
@@ -200,14 +188,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
$net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
$abook_uids = " and abook.abook_channel = " . intval(\App::$profile['profile_uid']) . " ";
$simple_update = (($_SESSION['loadtime']) ? " AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' " : '');
if($load)
$simple_update = '';
if($static && $simple_update)
$simple_update .= " and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
$simple_update = '';
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
//logger('update: ' . $update . ' load: ' . $load);
@@ -220,10 +204,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
$r = q("SELECT parent AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
$net_query
WHERE mid like '%s' $uids $item_normal
WHERE mid = '%s' $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets $net_query2 LIMIT 1",
dbesc($mid . '%')
$sql_extra3 $sql_extra $sql_nets $net_query2",
dbesc($mid)
);
}
else {
@@ -243,10 +227,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
$r = q("SELECT parent AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
$net_query
WHERE mid like '%s' $uids $item_normal_update $simple_update
WHERE mid = '%s' $uids $item_normal_update $simple_update
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets $net_query2 LIMIT 1",
dbesc($mid . '%')
$sql_extra3 $sql_extra $sql_nets $net_query2",
dbesc($mid)
);
}
else {
@@ -259,7 +243,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
$sql_extra3 $sql_extra $sql_nets $net_query2"
);
}
$_SESSION['loadtime'] = datetime_convert();
}
// Then fetch all the children of the parents that are on this page
@@ -291,7 +274,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
// fake it
$mode = (($hashtags) ? 'search' : 'pubstream');
$o .= conversation($items,$mode,$update,$page_mode);
if($mid)
@@ -300,6 +283,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
if(($items) && (! $update))
$o .= alt_pager(count($items));
$_SESSION['loadtime'] = datetime_convert();
return $o;
}

View File

@@ -19,9 +19,6 @@ class Search extends \Zotlabs\Web\Controller {
}
}
if($load)
$_SESSION['loadtime'] = datetime_convert();
nav_set_selected('Search');
require_once("include/bbcode.php");
@@ -54,8 +51,6 @@ class Search extends \Zotlabs\Web\Controller {
$search = ((x($_GET,'tag')) ? trim(escape_tags(rawurldecode($_GET['tag']))) : '');
}
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$o .= search($search,'search-box','/search',((local_channel()) ? true : false));
if(strpos($search,'#') === 0) {
@@ -105,9 +100,6 @@ class Search extends \Zotlabs\Web\Controller {
if((! $update) && (! $load)) {
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 0);
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
// because browser prefetching might change it on us. We have to deliver it with the page.
@@ -131,7 +123,6 @@ class Search extends \Zotlabs\Web\Controller {
'$dm' => '0',
'$nouveau' => '0',
'$wall' => '0',
'$static' => $static,
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$search' => (($tag) ? urlencode('#') : '') . $search,

View File

@@ -28,7 +28,6 @@ class Display {
$user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable']) : 0);
$nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0);
$title_tosource = ((x($_POST,'title_tosource')) ? intval($_POST['title_tosource']) : 0);
$manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0);
$start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0);
$browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
@@ -47,7 +46,6 @@ class Display {
set_pconfig(local_channel(),'system','itemspage', $itemspage);
set_pconfig(local_channel(),'system','no_smilies',1-intval($nosmile));
set_pconfig(local_channel(),'system','title_tosource',$title_tosource);
set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update);
set_pconfig(local_channel(),'system','channel_menu', $channel_menu);
set_pconfig(local_channel(),'system','start_menu', $start_menu);
@@ -200,7 +198,6 @@ class Display {
'$itemspage' => array('itemspage', t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 30 items')),
'$nosmile' => array('nosmile', t("Show emoticons (smilies) as images"), 1-intval($nosmile), '', $yes_no),
'$channel_menu' => [ 'channel_menu', t('Provide channel menu in navigation bar'), get_pconfig(local_channel(),'system','channel_menu',get_config('system','channel_menu',0)), t('Default: channel menu located in app menu'),$yes_no ],
'$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no),
'$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no),
'$theme_config' => $theme_config,
'$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no]

View File

@@ -14,6 +14,7 @@ class Sse extends Controller {
public static $ob_hash;
public static $sse_id;
public static $vnotify;
public static $sse_enabled;
function init() {
@@ -49,18 +50,86 @@ class Sse extends Controller {
$sys = get_sys_channel();
$sleep_seconds = 3;
header("Content-Type: text/event-stream");
header("Cache-Control: no-cache");
header("Connection: keep-alive");
header("X-Accel-Buffering: no");
self::$sse_enabled = get_config('system', 'sse_enabled', 0);
while(true) {
if(self::$sse_enabled) {
/**
* Update chat presence indication (if applicable)
*/
// Server Sent Events
header("Content-Type: text/event-stream");
header("Cache-Control: no-cache");
header("Connection: keep-alive");
header("X-Accel-Buffering: no");
while(true) {
if(! self::$sse_id) {
// Update chat presence indication
$r = q("select cp_id, cp_room from chatpresence where cp_xchan = '%s' and cp_client = '%s' and cp_room = 0 limit 1",
dbesc(self::$ob_hash),
dbesc($_SERVER['REMOTE_ADDR'])
);
$basic_presence = false;
if($r) {
$basic_presence = true;
q("update chatpresence set cp_last = '%s' where cp_id = %d",
dbesc(datetime_convert()),
intval($r[0]['cp_id'])
);
}
if(! $basic_presence) {
q("insert into chatpresence ( cp_xchan, cp_last, cp_status, cp_client)
values( '%s', '%s', '%s', '%s' ) ",
dbesc(self::$ob_hash),
dbesc(datetime_convert()),
dbesc('online'),
dbesc($_SERVER['REMOTE_ADDR'])
);
}
}
XConfig::Load(self::$ob_hash);
$result = XConfig::Get(self::$ob_hash, 'sse', 'notifications', []);
$lock = XConfig::Get(self::$ob_hash, 'sse', 'lock');
if($result && !$lock) {
echo "event: notifications\n";
echo 'data: ' . json_encode($result);
echo "\n\n";
XConfig::Set(self::$ob_hash, 'sse', 'notifications', []);
unset($result);
}
// always send heartbeat to detect disconnected clients
echo "event: heartbeat\n";
echo 'data: {}';
echo "\n\n";
ob_end_flush();
flush();
if(connection_status() != CONNECTION_NORMAL || connection_aborted()) {
//TODO: this does not seem to be triggered
XConfig::Set(self::$ob_hash, 'sse', 'timestamp', NULL_DATE);
break;
}
sleep($sleep_seconds);
}
}
else {
// Fallback to traditional polling
if(! self::$sse_id) {
// Update chat presence indication
$r = q("select cp_id, cp_room from chatpresence where cp_xchan = '%s' and cp_client = '%s' and cp_room = 0 limit 1",
dbesc(self::$ob_hash),
dbesc($_SERVER['REMOTE_ADDR'])
@@ -90,29 +159,11 @@ class Sse extends Controller {
$lock = XConfig::Get(self::$ob_hash, 'sse', 'lock');
if($result && !$lock) {
echo "event: notifications\n";
echo 'data: ' . json_encode($result);
echo "\n\n";
XConfig::Set(self::$ob_hash, 'sse', 'notifications', []);
unset($result);
json_return_and_die($result);
}
// always send heartbeat to detect disconnected clients
echo "event: heartbeat\n";
echo 'data: {}';
echo "\n\n";
ob_end_flush();
flush();
if(connection_status() != CONNECTION_NORMAL || connection_aborted()) {
//TODO: this does not seem to be triggered
XConfig::Set(self::$ob_hash, 'sse', 'timestamp', NULL_DATE);
break;
}
sleep($sleep_seconds);
killme();
}

View File

@@ -34,7 +34,7 @@ class Zot_probe extends \Zotlabs\Web\Controller {
$o .= '<pre>' . htmlspecialchars($x['header']) . '</pre>' . EOL;
$o .= 'verify returns: ' . str_replace("\n",EOL,print_r(HTTPSig::verify($x),true)) . EOL;
$o .= 'verify returns: ' . str_replace("\n",EOL,print_r(HTTPSig::verify($x, EMPTY_STR, 'zot6'),true)) . EOL;
$o .= '<pre>' . htmlspecialchars(json_encode(json_decode($x['body']),JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES)) . '</pre>' . EOL;

27
Zotlabs/Update/_1239.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
namespace Zotlabs\Update;
class _1239 {
function run() {
dbq("START TRANSACTION");
// remove broken activitypub hubloc entries
$r = dbq("DELETE FROM hubloc WHERE hubloc_network = 'activitypub' and hubloc_callback = ''");
// remove broken hubloc entries from friendica
$r1 = dbq("DELETE FROM hubloc WHERE hubloc_hash = ''");
if($r && $r1) {
dbq("COMMIT");
return UPDATE_SUCCESS;
}
dbq("ROLLBACK");
return UPDATE_FAILED;
}
}

View File

@@ -76,7 +76,7 @@ class HTTPSig {
// See draft-cavage-http-signatures-10
static function verify($data,$key = '') {
static function verify($data,$key = '', $keytype = '') {
$body = $data;
$headers = null;
@@ -151,7 +151,7 @@ class HTTPSig {
$result['signer'] = $sig_block['keyId'];
$key = self::get_key($key,$result['signer']);
$key = self::get_key($key,$keytype,$result['signer']);
if(! ($key && $key['public_key'])) {
return $result;
@@ -162,13 +162,26 @@ class HTTPSig {
logger('verified: ' . $x, LOGGER_DEBUG);
if(! $x) {
logger('verify failed for ' . $result['signer'] . ' alg=' . $algorithm . (($key['public_key']) ? '' : ' no key'));
$sig_block['signature'] = base64_encode($sig_block['signature']);
logger('affected sigblock: ' . print_r($sig_block,true));
logger('signed_data: ' . print_r($signed_data,true));
logger('headers: ' . print_r($headers,true));
logger('server: ' . print_r($_SERVER,true));
return $result;
// try again, ignoring the local actor (xchan) cache and refetching the key
// from its source
$fkey = self::get_key($key,$keytype,$result['signer'],true);
if ($fkey && $fkey['public_key']) {
$y = rsa_verify($signed_data,$sig_block['signature'],$fkey['public_key'],$algorithm);
logger('verified: (cache reload) ' . $x, LOGGER_DEBUG);
}
if (! $y) {
logger('verify failed for ' . $result['signer'] . ' alg=' . $algorithm . (($fkey['public_key']) ? '' : ' no key'));
$sig_block['signature'] = base64_encode($sig_block['signature']);
logger('affected sigblock: ' . print_r($sig_block,true));
logger('headers: ' . print_r($headers,true));
logger('server: ' . print_r($_SERVER,true));
return $result;
}
}
$result['portable_id'] = $key['portable_id'];
@@ -187,12 +200,20 @@ class HTTPSig {
}
logger('Content_Valid: ' . (($result['content_valid']) ? 'true' : 'false'));
if (! $result['content_valid']) {
logger('invalid content signature: data ' . print_r($data,true));
logger('invalid content signature: headers ' . print_r($headers,true));
logger('invalid content signature: body ' . print_r($body,true));
}
}
return $result;
}
static function get_key($key,$id) {
static function get_key($key,$keytype,$id) {
if(is_array($key))
btlogger('key is array: ' . print_r($key,true));
if($key) {
if(function_exists($key)) {
@@ -201,6 +222,13 @@ class HTTPSig {
return [ 'public_key' => $key ];
}
if($keytype === 'zot6') {
$key = self::get_zotfinger_key($id,$force);
if($key) {
return $key;
}
}
if(strpos($id,'#') === false) {
$key = self::get_webfinger_key($id);
}
@@ -243,7 +271,7 @@ class HTTPSig {
$url = ((strpos($id,'#')) ? substr($id,0,strpos($id,'#')) : $id);
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s'",
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' and hubloc_network in ('zot6', 'activitypub')",
dbesc(str_replace('acct:','',$url)),
dbesc($url)
);
@@ -303,18 +331,15 @@ class HTTPSig {
return (($key['public_key']) ? $key : false);
}
function get_zotfinger_key($id) {
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s'",
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' and hubloc_network = 'zot6'",
dbesc(str_replace('acct:','',$id)),
dbesc($id)
);
$x = Libzot::zot_record_preferred($x);
if($x && $x['xchan_pubkey']) {
return [ 'portable_id' => $x['xchan_hash'], 'public_key' => $x['xchan_pubkey'] , 'hubloc' => $x ];
if($x && $x[0]['xchan_pubkey']) {
return [ 'portable_id' => $x[0]['xchan_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ];
}
$wf = Webfinger::exec($id);
@@ -330,13 +355,18 @@ class HTTPSig {
continue;
}
if($l['rel'] === 'http://purl.org/zot/protocol/6.0' && array_key_exists('href',$l) && $l['href'] !== EMPTY_STR) {
$z = \Zotlabs\Lib\Zotfinger::exec($l['href']);
// The third argument to Zotfinger::exec() tells it not to verify signatures
// Since we're inside a function that is fetching keys with which to verify signatures,
// this is necessary to prevent infinite loops.
$z = \Zotlabs\Lib\Zotfinger::exec($l['href'],null,false);
if($z) {
$i = Libzot::import_xchan($z['data']);
if($i['success']) {
$key['portable_id'] = $i['hash'];
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_id_url = '%s' limit 1",
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_id_url = '%s' and hubloc_network = 'zot6'",
dbesc($l['href'])
);
if($x) {
@@ -485,7 +515,6 @@ class HTTPSig {
if(preg_match('/iv="(.*?)"/ism',$header,$matches))
$header = self::decrypt_sigheader($header);
if(preg_match('/keyId="(.*?)"/ism',$header,$matches))
$ret['keyId'] = $matches[1];
if(preg_match('/algorithm="(.*?)"/ism',$header,$matches))

View File

@@ -155,7 +155,7 @@ class Receiver {
$result = false;
$this->sigdata = HTTPSig::verify($this->rawdata);
$this->sigdata = HTTPSig::verify($this->rawdata, EMPTY_STR, 'zot6');
if ($this->sigdata && $this->sigdata['header_signed'] && $this->sigdata['header_valid']) {
$result = true;

View File

@@ -50,10 +50,10 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '5.0' );
define ( 'STD_VERSION', '5.0.3' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1238 );
define ( 'DB_UPDATE_VERSION', 1239 );
define ( 'PROJECT_BASE', __DIR__ );
@@ -1207,6 +1207,7 @@ class App {
'$metas' => self::$meta->get(),
'$plugins' => $x['header'],
'$update_interval' => $interval,
'$sse_enabled' => get_config('system', 'sse_enabled', 0),
'$head_css' => head_get_css(),
'$head_js' => head_get_js(),
'$linkrel' => head_get_links(),

View File

@@ -1,76 +1,80 @@
{
"name" : "zotlabs/hubzilla",
"type" : "application",
"description" : "Hubzilla is a powerful platform for creating interconnected websites featuring a decentralized identity, communications, and permissions framework built using common webserver technology.",
"keywords" : [
"CMS",
"identity",
"decentralisation",
"permission",
"SSO",
"ZOT"
],
"homepage" : "http://framagit.org/hubzilla/core/",
"license" : "MIT",
"authors" : [{
"name" : "Mike Macgirvin",
"role" : "founder"
}
],
"support" : {
"issues" : "https://framagit.org/hubzilla/core/issues",
"source" : "https://framagit.org/hubzilla/core/"
},
"require" : {
"php" : ">=5.5",
"ext-curl" : "*",
"ext-gd" : "*",
"ext-mbstring" : "*",
"ext-xml" : "*",
"ext-openssl" : "*",
"sabre/dav" : "^4.0",
"michelf/php-markdown" : "^1.7",
"bshaffer/oauth2-server-php": "^1.9",
"ezyang/htmlpurifier": "^4.9",
"simplepie/simplepie": "~1.5",
"league/html-to-markdown": "^4.4",
"pear/text_languagedetect": "^1.0",
"commerceguys/intl": "~1.0.5",
"lukasreschke/id3parser": "^0.0.3",
"smarty/smarty": "~3.1",
"ramsey/uuid": "^3.8",
"twbs/bootstrap": "^4.3.1",
"blueimp/jquery-file-upload": "^10.3",
"desandro/imagesloaded": "^4.1"
},
"require-dev" : {
"phpunit/phpunit" : "@stable",
"behat/behat" : "@stable",
"behat/mink-extension": "@stable",
"behat/mink-goutte-driver": "@stable",
"php-mock/php-mock-phpunit": "@stable",
"phpunit/dbunit": "@stable",
"phpmd/phpmd": "^2.6",
"squizlabs/php_codesniffer": "*"
},
"autoload" : {
"psr-4" : {
"Hubzilla\\" : "include/",
"Zotlabs\\" : "Zotlabs/"
}
},
"autoload-dev" : {
"psr-4" : {
"Zotlabs\\Tests\\Unit\\" : "tests/unit"
}
},
"minimum-stability" : "stable",
"config" : {
"notify-on-install" : false,
"optimize-autoloader" : true
},
"repositories": [{
"type": "vcs",
"url": "https://github.com/simplepie/simplepie"
}]
"name": "zotlabs/hubzilla",
"type": "application",
"description": "Hubzilla is a powerful platform for creating interconnected websites featuring a decentralized identity, communications, and permissions framework built using common webserver technology.",
"keywords": [
"CMS",
"identity",
"decentralisation",
"permission",
"SSO",
"ZOT"
],
"homepage": "http://framagit.org/hubzilla/core/",
"license": "MIT",
"authors": [
{
"name": "Mike Macgirvin",
"role": "founder"
}
],
"support": {
"issues": "https://framagit.org/hubzilla/core/issues",
"source": "https://framagit.org/hubzilla/core/"
},
"require": {
"php": ">=5.5",
"ext-curl": "*",
"ext-gd": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"ext-openssl": "*",
"sabre/dav": "^4.0",
"michelf/php-markdown": "^1.7",
"bshaffer/oauth2-server-php": "^1.9",
"ezyang/htmlpurifier": "^4.9",
"simplepie/simplepie": "~1.5",
"league/html-to-markdown": "^4.4",
"pear/text_languagedetect": "^1.0",
"commerceguys/intl": "~1.0.5",
"lukasreschke/id3parser": "^0.0.3",
"smarty/smarty": "~3.1",
"ramsey/uuid": "^3.8",
"twbs/bootstrap": "^4.3.1",
"blueimp/jquery-file-upload": "^10.3",
"desandro/imagesloaded": "^4.1"
},
"require-dev": {
"phpunit/phpunit": "^9.4",
"behat/behat": "@stable",
"behat/mink-extension": "@stable",
"behat/mink-goutte-driver": "@stable",
"php-mock/php-mock-phpunit": "^2.6",
"phpmd/phpmd": "^2.6",
"squizlabs/php_codesniffer": "*",
"php-mock/php-mock": "^2.2",
"dms/phpunit-arraysubset-asserts": "^0.2.1"
},
"autoload": {
"psr-4": {
"Hubzilla\\": "include/",
"Zotlabs\\": "Zotlabs/"
}
},
"autoload-dev": {
"psr-4": {
"Zotlabs\\Tests\\Unit\\": "tests/unit"
}
},
"minimum-stability": "stable",
"config": {
"notify-on-install": false,
"optimize-autoloader": true
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/simplepie/simplepie"
}
]
}

1638
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -2573,26 +2573,6 @@ function channel_reddress($channel) {
return strtolower($channel['channel_address'] . '@' . App::get_hostname());
}
/**
* @brief Get manual channel conversation update config.
*
* Check the channel config \e manual_conversation_update, if not set fall back
* to global system config, defaults to 1 if nothing set.
*
* @param int $channel_id
* @return int
*/
function channel_manual_conv_update($channel_id) {
$x = get_pconfig($channel_id, 'system', 'manual_conversation_update');
if($x === false)
$x = get_config('system', 'manual_conversation_update', 1);
return intval($x);
}
/**
* @brief Return parsed HTML remote_login template.
*

View File

@@ -511,6 +511,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$jsreload = '';
$preview = (($page_mode === 'preview') ? true : false);
$r_preview = (($page_mode === 'r_preview') ? true : false);
$previewing = (($preview) ? ' preview ' : '');
$preview_lbl = t('This is an unsaved preview');
@@ -873,11 +874,13 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
}
$item['pagedrop'] = $page_dropping;
if($item['id'] == $item['parent']) {
if($item['id'] == $item['parent'] || $r_preview) {
$item_object = new Zotlabs\Lib\ThreadItem($item);
$conv->add_thread($item_object);
if(($page_mode === 'list') || ($page_mode === 'pager_list')) {
$item_object->set_template('conv_list.tpl');

View File

@@ -13,6 +13,10 @@
* @param array $params associative array which configures the feed
* @return string with an atom feed
*/
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
function get_public_feed($channel, $params) {
if(! $params)
@@ -431,6 +435,13 @@ function get_atom_elements($feed, $item) {
$res['plink'] = unxmlify($item->get_link(0));
$res['item_rss'] = 1;
try {
$uuid = Uuid::uuid5(Uuid::NAMESPACE_URL, $res['plink'])->toString();
} catch (UnsatisfiedDependencyException $e) {
$uuid = md5($res['plink']);
}
$res['uuid'] = $uuid;
$summary = unxmlify($item->get_description(true));
@@ -1516,6 +1527,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
continue;
}
}
}
}

View File

@@ -288,30 +288,18 @@ function locations_by_netid($netid) {
function ping_site($url) {
$ret = array('success' => false);
$ret = array('success' => false);
$sys = get_sys_channel();
$m = zot_build_packet($sys, 'ping');
$r = zot_zot($url . '/post', $m);
if(! $r['success']) {
$ret['message'] = 'no answer from ' . $url;
return $ret;
}
$packet_result = json_decode($r['body'], true);
if(! $packet_result['success']) {
$ret['message'] = 'packet failure from ' . $url;
return $ret;
}
if($packet_result['success']) {
$ret['success'] = true;
}
else {
$ret['message'] = 'unknown error from ' . $url;
}
$r = Zotlabs\Lib\Zotfinger::exec($url);
if(! $r['data']) {
$ret['message'] = 'no answer from ' . $url;
return $ret;
}
$ret['success'] = true;
return $ret;
}

View File

@@ -210,17 +210,24 @@ function import_hublocs($channel, $hublocs, $seize, $moving = false) {
if($channel && $hublocs) {
foreach($hublocs as $hubloc) {
$hash = make_xchan_hash($hubloc['hubloc_guid'],$hubloc['hubloc_guid_sig']);
if($hubloc['hubloc_network'] === 'zot' && $hash !== $hubloc['hubloc_hash']) {
logger('forged hubloc: ' . print_r($hubloc,true));
continue;
}
// verify the hash. We can only do this if we already stored the xchan corresponding to this hubloc
// as we need the public key from there
if(! array_key_exists('hubloc_primary',$hubloc)) {
$hubloc['hubloc_primary'] = (($hubloc['hubloc_flags'] & 0x0001) ? 1 : 0);
$hubloc['hubloc_orphancheck'] = (($hubloc['hubloc_flags'] & 0x0004) ? 1 : 0);
$hubloc['hubloc_error'] = (($hubloc['hubloc_status'] & 0x0003) ? 1 : 0);
$hubloc['hubloc_deleted'] = (($hubloc['hubloc_flags'] & 0x1000) ? 1 : 0);
if ($hubloc['hubloc_network'] === 'zot6') {
$x = q("select xchan_pubkey from xchan where xchan_guid = '%s' and xchan_hash = '%s'",
dbesc($hubloc['hubloc_guid']),
dbesc($hubloc['hubloc_hash'])
);
if (! $x) {
logger('hubloc could not be verified. ' . print_r($hubloc,true));
continue;
}
$hash = Libzot::make_xchan_hash($hubloc['hubloc_guid'],$x[0]['xchan_pubkey']);
if ($hash !== $hubloc['hubloc_hash']) {
logger('forged hubloc: ' . print_r($hubloc,true));
continue;
}
}
if($moving && $hubloc['hubloc_hash'] === $channel['channel_hash'] && $hubloc['hubloc_url'] !== z_root()) {
@@ -228,17 +235,17 @@ function import_hublocs($channel, $hublocs, $seize, $moving = false) {
}
$arr = [
'guid' => $hubloc['hubloc_guid'],
'guid_sig' => $hubloc['hubloc_guid_sig'],
'url' => $hubloc['hubloc_url'],
'url_sig' => $hubloc['hubloc_url_sig'],
'sitekey' => ((array_key_exists('hubloc_sitekey',$hubloc)) ? $hubloc['hubloc_sitekey'] : '')
'id' => $hubloc['hubloc_guid'],
'id_sig' => $hubloc['hubloc_guid_sig'],
'location' => $hubloc['hubloc_url'],
'location_sig' => $hubloc['hubloc_url_sig']
];
if(($hubloc['hubloc_hash'] === $channel['channel_hash']) && intval($hubloc['hubloc_primary']) && ($seize))
if (($hubloc['hubloc_hash'] === $channel['channel_hash']) && intval($hubloc['hubloc_primary']) && ($seize)) {
$hubloc['hubloc_primary'] = 0;
}
if(($x = zot_gethub($arr,false)) === false) {
if (($x = Libzot::gethub($arr,false)) === false) {
unset($hubloc['hubloc_id']);
hubloc_store_lowlevel($hubloc);
}
@@ -1333,7 +1340,7 @@ function sync_files($channel, $files) {
'time' => $time,
'resource' => $att['hash'],
'revision' => 0,
'signature' => base64url_encode(rsa_sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey']))
'signature' => Libzot::sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey'])
);
$store_path = $newfname;
@@ -1419,7 +1426,7 @@ function sync_files($channel, $files) {
'time' => $time,
'resource' => $p['resource_id'],
'revision' => 0,
'signature' => base64url_encode(rsa_sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey'])),
'signature' => Libzot::sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey']),
'resolution' => intval($p['imgscale'])
);

View File

@@ -2502,7 +2502,7 @@ function item_update_parent_commented($item) {
);
q("UPDATE item set commented = '%s', changed = '%s' WHERE id = %d",
dbesc(($z) ? $z[0]['commented'] : datetime_convert()),
dbesc(($z[0]['commented']) ? $z[0]['commented'] : datetime_convert()),
dbesc(datetime_convert()),
intval($item['parent'])
);
@@ -3179,8 +3179,18 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
if($rewrite_author) {
$item['author_xchan'] = $channel['channel_hash'];
$r = q("update item set author_xchan = '%s' where id = %d",
//if it's a toplevel rss item we will also rewrite the mid to something fetchable
if($item['item_rss'] && $item['item_thread_top']) {
$item['mid'] = z_root() . '/item/' . $item['uuid'];
$item['parent_mid'] = $item['mid'];
$item['thr_parent'] = $item['mid'];
}
$r = q("UPDATE item SET author_xchan = '%s', mid = '%s', parent_mid = '%s', thr_parent = '%s' WHERE id = %d",
dbesc($item['author_xchan']),
dbesc($item['mid']),
dbesc($item['parent_mid']),
dbesc($item['thr_parent']),
intval($item_id)
);
}
@@ -3235,7 +3245,6 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
$arr['item_origin'] = 1;
$arr['item_wall'] = 1;
$arr['item_thread_top'] = 1;
if (strpos($item['body'], "[/share]") !== false) {
@@ -3299,7 +3308,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
$private = 1;
$item_wall = 1;
$item_origin = 1;
$item_origin = (($item['item_deleted']) ? 0 : 1); // item_origin for deleted items is set to 0 in delete_imported_item() to prevent looping. In this case we probably should not set it back to 1 here.
$item_uplink = 0;
$item_nocomment = 0;
@@ -3315,7 +3324,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
);
}
else {
$item_uplink = 1;
$item_uplink = (($item['item_rss']) ? 0 : 1); // Do not set item_uplink for rss items - we can not send anything to them.
// if this is an edit, item_store_update() will have already updated the item
// with the correct value for source_xchan (by ignoring it). We cannot set to owner_xchan

View File

@@ -2,6 +2,7 @@
use Zotlabs\Lib\Zotfinger;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Queue;
/**
* @file include/network.php
@@ -1437,10 +1438,10 @@ function do_delivery($deliveries, $force = false) {
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300)) && (! $force)) {
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',3000)) && (! $force)) {
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
foreach($deliveries as $d) {
update_queue_item($d);
Queue::update($d);
}
return;
}

View File

@@ -271,6 +271,7 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) {
and xchan_hidden = 0
and xchan_deleted = 0
and xlink_static = 0
and xchan_network = 'zot6'
group by xchan_hash order by total desc limit %d offset %d ",
intval($uid),
intval($uid),
@@ -290,6 +291,7 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) {
and xchan_hidden = 0
and xchan_deleted = 0
and xlink_static = 0
and xchan_network = 'zot6'
group by xchan_hash order by total desc limit %d offset %d ",
intval($uid),
intval($uid),

View File

@@ -1667,7 +1667,7 @@ function format_filer(&$item) {
if(! trim($term))
continue;
$removelink = z_root() . '/filerm/' . $item['id'] . '?f=&term=' . urlencode($t['term']);
$categories[] = array('term' => $term, 'removelink' => $removelink);
$categories[] = array('term' => $term, 'removelink' => $removelink, 'id' => $item['id']);
}
$s = replace_macros(get_markup_template('item_filer.tpl'),array(

View File

@@ -3452,7 +3452,7 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',3000))) {
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
update_queue_item($hash);
continue;
@@ -4286,7 +4286,7 @@ function zot_reply_message_request($data) {
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',3000))) {
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
update_queue_item($hash);
continue;

View File

@@ -1,49 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
bootstrap="../boot.php"
forceCoversAnnotation="false"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">
<testsuites>
<testsuite name="Hubzilla default Test Suite">
<directory suffix="Test.php">./unit/</directory>
</testsuite>
<testsuite name="API Test Suite">
<directory suffix="Test.php" prefix="API">./unit/</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>mysql</group>
</exclude>
</groups>
<!--coverage reporting-->
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../Zotlabs/</directory>
<directory suffix=".php">../include/</directory>
</whitelist>
</filter>
<logging>
<log type="junit" target="./results/junit.xml"/>
<!--<log type="coverage-clover" target="./results/coverage-clover.xml"/>-->
<log type="coverage-html" target="./results/coverage-report/" lowUpperBound="35"
highLowerBound="70"/>
<!--<log type="testdox-text" target="./results/testdox.txt"/>-->
<log type="testdox-html" target="./results/testdox.html"/>
</logging>
<php>
<!-- Default test database config, only used if no environment variables
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="../boot.php" forceCoversAnnotation="false" beStrictAboutCoversAnnotation="true" beStrictAboutOutputDuringTests="true" beStrictAboutTodoAnnotatedTests="true" verbose="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">../Zotlabs/</directory>
<directory suffix=".php">../include/</directory>
</include>
<report>
<html outputDirectory="./results/coverage-report/" lowUpperBound="35" highLowerBound="70"/>
</report>
</coverage>
<testsuites>
<testsuite name="Hubzilla default Test Suite">
<directory suffix="Test.php">./unit/</directory>
</testsuite>
<testsuite name="API Test Suite">
<directory suffix="Test.php" prefix="API">./unit/</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>mysql</group>
</exclude>
</groups>
<!--coverage reporting-->
<logging>
<junit outputFile="./results/junit.xml"/>
<!--<log type="coverage-clover" target="./results/coverage-clover.xml"/>-->
<!--<log type="testdox-text" target="./results/testdox.txt"/>-->
<testdoxHtml outputFile="./results/testdox.html"/>
</logging>
<php>
<!-- Default test database config, only used if no environment variables
with same names are set.
!!! Never run against a real database, it will truncate all tables -->
<env name="hz_db_server" value="postgres"/>
<env name="hz_db_scheme" value="pgsql"/>
<env name="hz_db_port" value="5432"/>
<env name="hz_db_user" value="ci-user"/>
<env name="hz_db_pass" value="ci-pass"/>
<env name="hz_db_database" value="ci-db"/>
</php>
<env name="hz_db_server" value="postgres"/>
<env name="hz_db_scheme" value="pgsql"/>
<env name="hz_db_port" value="5432"/>
<env name="hz_db_user" value="ci-user"/>
<env name="hz_db_pass" value="ci-pass"/>
<env name="hz_db_database" value="ci-db"/>
</php>
</phpunit>

View File

@@ -1,42 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="../boot.php" colors="true">
<php>
<var name="db_dsn" value="mysql:dbname=gitlab_ci_hubzilla;host=mysql"/>
<var name="db_username" value="root"/>
<var name="db_password" value="mysql"/>
<env name="hz_db_server" value="mysql"/>
<env name="hz_db_scheme" value="mysql"/>
<env name="hz_db_port" value=""/>
<env name="hz_db_user" value="root"/>
<env name="hz_db_pass" value="mysql"/>
<env name="hz_db_database" value="hello_world_test"/>
</php>
<testsuites>
<testsuite name="Hubzilla default Test Suite">
<directory suffix="Test.php">./unit/</directory>
</testsuite>
<testsuite name="API Test Suite">
<directory suffix="Test.php" prefix="API">./unit/</directory>
</testsuite>
<testsuite name="Ex-/Import Test Suite">
<!--<directory suffix="Test.php">./unit/eximport/</directory>-->
</testsuite>
</testsuites>
<groups>
<exclude>
<group>postgresql</group>
</exclude>
</groups>
<!--cover reporting-->
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../Zotlabs/</directory>
<directory suffix=".php">../include/</directory>
</whitelist>
</filter>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="../boot.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="false" includeUncoveredFiles="false">
<include>
<directory suffix=".php">../Zotlabs/</directory>
<directory suffix=".php">../include/</directory>
</include>
</coverage>
<php>
<var name="db_dsn" value="mysql:dbname=gitlab_ci_hubzilla;host=mysql"/>
<var name="db_username" value="root"/>
<var name="db_password" value="mysql"/>
<env name="hz_db_server" value="mysql"/>
<env name="hz_db_scheme" value="mysql"/>
<env name="hz_db_port" value=""/>
<env name="hz_db_user" value="root"/>
<env name="hz_db_pass" value="mysql"/>
<env name="hz_db_database" value="hello_world_test"/>
</php>
<testsuites>
<testsuite name="Hubzilla default Test Suite">
<directory suffix="Test.php">./unit/</directory>
</testsuite>
<testsuite name="API Test Suite">
<directory suffix="Test.php" prefix="API">./unit/</directory>
</testsuite>
<testsuite name="Ex-/Import Test Suite">
<!--<directory suffix="Test.php">./Unit/eximport/</directory>-->
</testsuite>
</testsuites>
<groups>
<exclude>
<group>postgresql</group>
</exclude>
</groups>
<!--cover reporting-->
</phpunit>

View File

@@ -63,11 +63,12 @@ class AccessListTest extends UnitTestCase {
/**
* @expectedException PHPUnit\Framework\Error\Error
*/
/*
public function testPHPErrorOnInvalidConstructor() {
$accessList = new AccessList('invalid');
// Causes: "Illegal string offset 'channel_allow_cid'"
}
*/
public function testDefaultGetExplicit() {
$accessList = new AccessList([]);
@@ -112,12 +113,14 @@ class AccessListTest extends UnitTestCase {
/**
* @expectedException PHPUnit\Framework\Error\Error
*/
/*
public function testPHPErrorOnInvalidSet() {
$accessList = new AccessList([]);
$accessList->set('invalid');
// Causes: "Illegal string offset 'allow_cid'"
}
*/
/**
* set_from_array() calls some other functions, too which are not yet unit tested.
@@ -188,4 +191,4 @@ class AccessListTest extends UnitTestCase {
];
}
}
}

View File

@@ -26,6 +26,7 @@ namespace Zotlabs\Tests\Unit\Access;
use Zotlabs\Tests\Unit\UnitTestCase;
use Zotlabs\Access\PermissionRoles;
use phpmock\phpunit\PHPMock;
use DMS\PHPUnitExtensions\ArraySubset\Assert;
/**
* @brief Unit Test case for PermissionRoles class.
@@ -68,7 +69,7 @@ class PermissionRolesTest extends UnitTestCase {
'social_private' => 'Social - Private'
];
$this->assertArraySubset(['Social Networking' => $socialNetworking], $roles);
Assert::assertArraySubset(['Social Networking' => $socialNetworking], $roles);
$this->assertEquals($socialNetworking, $roles['Social Networking']);
$this->assertCount(5, $roles, 'There should be 5 permission groups.');

View File

@@ -1,68 +0,0 @@
<?php
/* Copyright (c) 2017 Hubzilla
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
namespace Zotlabs\Tests\Unit;
use PHPUnit\DbUnit\TestCaseTrait;
use PHPUnit\Framework\TestCase;
/**
* @brief Base class for our Database Unit Tests.
*
* @warning Never run these tests against a production database, because all
* tables will get truncated and there is no way to recover without a backup.
*
* @author Klaus Weidenbach
*/
abstract class DatabaseTestCase extends TestCase {
use TestCaseTrait;
/**
* Only instantiate PDO once for test clean-up/fixture load.
*
* @var \PDO
*/
static private $pdo = null;
/**
* Only instantiate \PHPUnit\DbUnit\Database\Connection once per test.
*
* @var \PHPUnit\DbUnit\Database\Connection
*/
private $conn = null;
final public function getConnection() {
if ($this->conn === null) {
if (self::$pdo === null) {
$dsn = \getenv('hz_db_scheme') . ':host=' . \getenv('hz_db_server')
. ';port=' . \getenv('hz_db_port') . ';dbname=' . \getenv('hz_db_database');
self::$pdo = new \PDO($dsn, \getenv('hz_db_user'), \getenv('hz_db_pass'));
}
$this->conn = $this->createDefaultDBConnection(self::$pdo, \getenv('hz_db_database'));
}
return $this->conn;
}
}

View File

@@ -33,7 +33,7 @@ use Zotlabs\Web\HTTPSig;
*
* @covers Zotlabs\Web\HTTPSig
*/
class PermissionDescriptionTest extends UnitTestCase {
class HttpSigTest extends UnitTestCase {
use PHPMock;

View File

@@ -1,67 +0,0 @@
<?php
/*
* Copyright (c) 2017 Hubzilla
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
namespace Zotlabs\Tests\Unit\includes;
use Zotlabs\Tests\Unit\UnitTestCase;
// required because of process isolation and no autoloading
require_once 'include/dba/dba_driver.php';
/**
* @brief Unit Test case for include/dba/DBA.php file.
*
* This test needs process isolation because of static \DBA.
* @runTestsInSeparateProcesses
*/
class DBATest extends UnitTestCase {
public function testDbaFactoryMysql() {
$this->assertNull(\DBA::$dba);
$ret = \DBA::dba_factory('server', 'port', 'user', 'pass', 'db', '0');
$this->assertInstanceOf('dba_pdo', $ret);
$this->assertFalse($ret->connected);
$this->assertSame('mysql', \DBA::$scheme);
$this->assertSame('schema_mysql.sql', \DBA::$install_script);
$this->assertSame('0001-01-01 00:00:00', \DBA::$null_date);
$this->assertSame('UTC_TIMESTAMP()', \DBA::$utc_now);
$this->assertSame('`', \DBA::$tquot);
}
public function testDbaFactoryPostgresql() {
$this->assertNull(\DBA::$dba);
$ret = \DBA::dba_factory('server', 'port', 'user', 'pass', 'db', '1');
$this->assertInstanceOf('dba_pdo', $ret);
$this->assertFalse($ret->connected);
$this->assertSame('pgsql', \DBA::$scheme);
$this->assertSame('schema_postgres.sql', \DBA::$install_script);
$this->assertSame('0001-01-01 00:00:00', \DBA::$null_date);
$this->assertSame("now() at time zone 'UTC'", \DBA::$utc_now);
$this->assertSame('"', \DBA::$tquot);
}
}

View File

@@ -1,189 +0,0 @@
<?php
/*
* Copyright (c) 2017 Hubzilla
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
namespace Zotlabs\Tests\Unit\includes;
use Zotlabs\Tests\Unit\DatabaseTestCase;
use PHPUnit\DbUnit\TestCaseTrait;
use PHPUnit\DbUnit\DataSet\YamlDataSet;
require_once 'include/dba/dba_pdo.php';
/**
* @brief Unit Test case for include/dba/dba_pdo.php file.
*
* Some very basic tests to see if our database layer can connect to a real
* database.
*/
class dba_pdoTest extends DatabaseTestCase {
use TestCaseTrait;
/**
* @var \dba_driver
*/
protected $dba;
/**
* Set initial state of the database before each test is executed.
* Load database fixtures.
*
* @return \PHPUnit\DbUnit\DataSet\IDataSet
*/
public function getDataSet() {
return new YamlDataSet(dirname(__FILE__) . '/_files/account.yml');
}
protected function setUp(): void {
// Will invoke getDataSet() to load fixtures into DB
parent::setUp();
$this->dba = new \dba_pdo(
\getenv('hz_db_server'),
\getenv('hz_db_scheme'),
\getenv('hz_db_port'),
\getenv('hz_db_user'),
\getenv('hz_db_pass'),
\getenv('hz_db_database')
);
}
protected function assertPreConditions() {
$this->assertSame('pdo', $this->dba->getdriver(), "Driver is expected to be 'pdo'.");
$this->assertInstanceOf('dba_driver', $this->dba);
$this->assertTrue($this->dba->connected, 'Pre condition failed, DB is not connected.');
$this->assertInstanceOf('PDO', $this->dba->db);
}
protected function tearDown(): void {
$this->dba = null;
}
/**
* @group mysql
*/
public function testQuoteintervalOnMysql() {
$this->assertSame('value', $this->dba->quote_interval('value'));
}
/**
* @group postgresql
*/
public function testQuoteintervalOnPostgresql() {
$this->assertSame("'value'", $this->dba->quote_interval('value'));
}
/**
* @group mysql
*/
public function testGenerateMysqlConcatSql() {
$this->assertSame('GROUP_CONCAT(DISTINCT field SEPARATOR \';\')', $this->dba->concat('field', ';'));
$this->assertSame('GROUP_CONCAT(DISTINCT field2 SEPARATOR \' \')', $this->dba->concat('field2', ' '));
}
/**
* @group postgresql
*/
public function testGeneratePostgresqlConcatSql() {
$this->assertSame('string_agg(field,\';\')', $this->dba->concat('field', ';'));
$this->assertSame('string_agg(field2,\' \')', $this->dba->concat('field2', ' '));
}
public function testConnectToSqlServer() {
// connect() is done in dba_pdo constructor which is called in setUp()
$this->assertTrue($this->dba->connected);
}
/**
* @depends testConnectToSqlServer
*/
public function testCloseSqlServerConnection() {
$this->dba->close();
$this->assertNull($this->dba->db);
$this->assertFalse($this->dba->connected);
}
/**
* @depends testConnectToSqlServer
*/
public function testSelectQueryShouldReturnArray() {
$ret = $this->dba->q('SELECT * FROM account');
$this->assertTrue(is_array($ret));
}
/**
* @depends testConnectToSqlServer
*/
public function testInsertQueryShouldReturnPdostatement() {
// Fixture account.yml adds two entries to account table
$this->assertEquals(2, $this->getConnection()->getRowCount('account'), 'Pre-Condition');
$ret = $this->dba->q('INSERT INTO account
(account_id, account_email, account_language)
VALUES (100, \'insert@example.com\', \'de\')
');
$this->assertInstanceOf('PDOStatement', $ret);
$this->assertEquals(3, $this->getConnection()->getRowCount('account'), 'Inserting failed');
}
public function testConnectToWrongSqlServer() {
$nodba = new \dba_pdo('wrongserver',
\getenv('hz_db_scheme'), \getenv('hz_db_port'),
\getenv('hz_db_user'), \getenv('hz_db_pass'),
\getenv('hz_db_database')
);
$this->assertSame('pdo', $nodba->getdriver());
$this->assertInstanceOf('dba_pdo', $nodba);
$this->assertFalse($nodba->connected);
$this->assertNull($nodba->db);
$this->assertFalse($nodba->q('SELECT * FROM account'));
}
/**
* @depends testConnectToSqlServer
*/
public function testSelectQueryToNonExistentTableShouldReturnFalse() {
$ret = $this->dba->q('SELECT * FROM non_existent_table');
$this->assertFalse($ret);
}
/**
* @depends testConnectToSqlServer
*/
public function testInsertQueryToNonExistentTableShouldReturnEmptyArray() {
$ret = $this->dba->q('INSERT INTO non_existent_table
(account_email, account_language)
VALUES (\'email@example.com\', \'en\')
');
$this->assertNotInstanceOf('PDOStatement', $ret);
$this->isEmpty($ret);
}
}

View File

@@ -37,8 +37,8 @@ namespace Composer\Autoload;
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{

421
vendor/composer/InstalledVersions.php vendored Normal file
View File

@@ -0,0 +1,421 @@
<?php
namespace Composer;
use Composer\Semver\VersionParser;
class InstalledVersions
{
private static $installed = array (
'root' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '188975ccbd3a9c584238c35dd8c5a8fda7718199',
'name' => 'zotlabs/hubzilla',
),
'versions' =>
array (
'blueimp/jquery-file-upload' =>
array (
'pretty_version' => 'v10.31.0',
'version' => '10.31.0.0',
'aliases' =>
array (
),
'reference' => '0740f81829698b84efe17e72501e0f420ea0d611',
),
'bshaffer/oauth2-server-php' =>
array (
'pretty_version' => 'v1.11.1',
'version' => '1.11.1.0',
'aliases' =>
array (
),
'reference' => '5a0c8000d4763b276919e2106f54eddda6bc50fa',
),
'commerceguys/intl' =>
array (
'pretty_version' => 'v1.0.6',
'version' => '1.0.6.0',
'aliases' =>
array (
),
'reference' => '47d5d6d60d0cc25f867e337ce229a228bf6be6f8',
),
'desandro/imagesloaded' =>
array (
'pretty_version' => 'v4.1.4',
'version' => '4.1.4.0',
'aliases' =>
array (
),
'reference' => '67c4e57453120935180c45c6820e7d3fbd2ea1f9',
),
'ezyang/htmlpurifier' =>
array (
'pretty_version' => 'v4.13.0',
'version' => '4.13.0.0',
'aliases' =>
array (
),
'reference' => '08e27c97e4c6ed02f37c5b2b20488046c8d90d75',
),
'league/html-to-markdown' =>
array (
'pretty_version' => '4.10.0',
'version' => '4.10.0.0',
'aliases' =>
array (
),
'reference' => '0868ae7a552e809e5cd8f93ba022071640408e88',
),
'lukasreschke/id3parser' =>
array (
'pretty_version' => 'v0.0.3',
'version' => '0.0.3.0',
'aliases' =>
array (
),
'reference' => '62f4de76d4eaa9ea13c66dacc1f22977dace6638',
),
'michelf/php-markdown' =>
array (
'pretty_version' => '1.9.0',
'version' => '1.9.0.0',
'aliases' =>
array (
),
'reference' => 'c83178d49e372ca967d1a8c77ae4e051b3a3c75c',
),
'paragonie/random_compat' =>
array (
'pretty_version' => 'v9.99.99',
'version' => '9.99.99.0',
'aliases' =>
array (
),
'reference' => '84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95',
),
'pear/text_languagedetect' =>
array (
'pretty_version' => 'v1.0.0',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => 'bb9ff6f4970f686fac59081e916b456021fe7ba6',
),
'psr/log' =>
array (
'pretty_version' => '1.1.3',
'version' => '1.1.3.0',
'aliases' =>
array (
),
'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc',
),
'ramsey/uuid' =>
array (
'pretty_version' => '3.9.3',
'version' => '3.9.3.0',
'aliases' =>
array (
),
'reference' => '7e1633a6964b48589b142d60542f9ed31bd37a92',
),
'rhumsaa/uuid' =>
array (
'replaced' =>
array (
0 => '3.9.3',
),
),
'sabre/dav' =>
array (
'pretty_version' => '4.1.1',
'version' => '4.1.1.0',
'aliases' =>
array (
),
'reference' => '5736f943c90d8d73d04cd8944d8c913811dc7360',
),
'sabre/event' =>
array (
'pretty_version' => '5.1.0',
'version' => '5.1.0.0',
'aliases' =>
array (
),
'reference' => 'd00a17507af0e7544cfe17096372f5d733e3b276',
),
'sabre/http' =>
array (
'pretty_version' => '5.1.0',
'version' => '5.1.0.0',
'aliases' =>
array (
),
'reference' => '23446999f1f6e62892bbd89745070aa902dd3539',
),
'sabre/uri' =>
array (
'pretty_version' => '2.2.0',
'version' => '2.2.0.0',
'aliases' =>
array (
),
'reference' => '059d11012603be2e32ddb7543602965563ddbb09',
),
'sabre/vobject' =>
array (
'pretty_version' => '4.3.1',
'version' => '4.3.1.0',
'aliases' =>
array (
),
'reference' => 'a7feca8311462e5da16952454e420b92c20d3586',
),
'sabre/xml' =>
array (
'pretty_version' => '2.2.1',
'version' => '2.2.1.0',
'aliases' =>
array (
),
'reference' => '41c6ba148966b10cafd31d1a4e5feb1e2138d95c',
),
'simplepie/simplepie' =>
array (
'pretty_version' => '1.5.5',
'version' => '1.5.5.0',
'aliases' =>
array (
),
'reference' => 'ae49e2201b6da9c808e5dac437aca356a11831b4',
),
'smarty/smarty' =>
array (
'pretty_version' => 'v3.1.36',
'version' => '3.1.36.0',
'aliases' =>
array (
),
'reference' => 'fd148f7ade295014fff77f89ee3d5b20d9d55451',
),
'symfony/polyfill-ctype' =>
array (
'pretty_version' => 'v1.20.0',
'version' => '1.20.0.0',
'aliases' =>
array (
),
'reference' => 'f4ba089a5b6366e453971d3aad5fe8e897b37f41',
),
'twbs/bootstrap' =>
array (
'pretty_version' => 'v4.5.2',
'version' => '4.5.2.0',
'aliases' =>
array (
),
'reference' => '5f2480a90ab911babc53039835fe78c6fc12646d',
),
'twitter/bootstrap' =>
array (
'replaced' =>
array (
0 => 'v4.5.2',
),
),
'zotlabs/hubzilla' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '188975ccbd3a9c584238c35dd8c5a8fda7718199',
),
),
);
public static function getInstalledPackages()
{
return array_keys(self::$installed['versions']);
}
public static function isInstalled($packageName)
{
return isset(self::$installed['versions'][$packageName]);
}
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
public static function getVersionRanges($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
$ranges = array();
if (isset(self::$installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = self::$installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
public static function getVersion($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['version'])) {
return null;
}
return self::$installed['versions'][$packageName]['version'];
}
public static function getPrettyVersion($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return self::$installed['versions'][$packageName]['pretty_version'];
}
public static function getReference($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['reference'])) {
return null;
}
return self::$installed['versions'][$packageName]['reference'];
}
public static function getRootPackage()
{
return self::$installed['root'];
}
public static function getRawData()
{
return self::$installed;
}
public static function reload($data)
{
self::$installed = $data;
}
}

View File

@@ -28,6 +28,7 @@ return array(
'CommerceGuys\\Intl\\NumberFormat\\NumberFormat' => $vendorDir . '/commerceguys/intl/src/NumberFormat/NumberFormat.php',
'CommerceGuys\\Intl\\NumberFormat\\NumberFormatRepository' => $vendorDir . '/commerceguys/intl/src/NumberFormat/NumberFormatRepository.php',
'CommerceGuys\\Intl\\NumberFormat\\NumberFormatRepositoryInterface' => $vendorDir . '/commerceguys/intl/src/NumberFormat/NumberFormatRepositoryInterface.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'HTMLPurifier' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.php',
'HTMLPurifier_Arborize' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php',
'HTMLPurifier_AttrCollections' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php',
@@ -206,9 +207,6 @@ return array(
'HTMLPurifier_Printer' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php',
'HTMLPurifier_Printer_CSSDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php',
'HTMLPurifier_Printer_ConfigForm' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_NullDecorator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_bool' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_default' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_HTMLDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php',
'HTMLPurifier_PropertyList' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php',
'HTMLPurifier_PropertyListIterator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php',
@@ -264,7 +262,6 @@ return array(
'ID3Parser\\ID3Parser' => $vendorDir . '/lukasreschke/id3parser/src/ID3Parser.php',
'ID3Parser\\getID3\\Tags\\getid3_id3v1' => $vendorDir . '/lukasreschke/id3parser/src/getID3/Tags/getid3_id3v1.php',
'ID3Parser\\getID3\\Tags\\getid3_id3v2' => $vendorDir . '/lukasreschke/id3parser/src/getID3/Tags/getid3_id3v2.php',
'ID3Parser\\getID3\\getID3' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3.php',
'ID3Parser\\getID3\\getid3_exception' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3_exception.php',
'ID3Parser\\getID3\\getid3_handler' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3_handler.php',
'ID3Parser\\getID3\\getid3_lib' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3_lib.php',
@@ -1009,10 +1006,10 @@ return array(
'Zotlabs\\Extend\\Hook' => $baseDir . '/Zotlabs/Extend/Hook.php',
'Zotlabs\\Extend\\Route' => $baseDir . '/Zotlabs/Extend/Route.php',
'Zotlabs\\Extend\\Widget' => $baseDir . '/Zotlabs/Extend/Widget.php',
'Zotlabs\\Identity\\BasicId\\BasicId' => $baseDir . '/Zotlabs/Identity/BasicId.php',
'Zotlabs\\Identity\\BasicId' => $baseDir . '/Zotlabs/Identity/BasicId.php',
'Zotlabs\\Identity\\OAuth2Server' => $baseDir . '/Zotlabs/Identity/OAuth2Server.php',
'Zotlabs\\Identity\\OAuth2Storage' => $baseDir . '/Zotlabs/Identity/OAuth2Storage.php',
'Zotlabs\\Identity\\ProfilePhoto\\ProfilePhoto' => $baseDir . '/Zotlabs/Identity/ProfilePhoto.php',
'Zotlabs\\Identity\\ProfilePhoto' => $baseDir . '/Zotlabs/Identity/ProfilePhoto.php',
'Zotlabs\\Lib\\AConfig' => $baseDir . '/Zotlabs/Lib/AConfig.php',
'Zotlabs\\Lib\\AbConfig' => $baseDir . '/Zotlabs/Lib/AbConfig.php',
'Zotlabs\\Lib\\AccessList' => $baseDir . '/Zotlabs/Lib/AccessList.php',
@@ -1169,7 +1166,7 @@ return array(
'Zotlabs\\Module\\Notes' => $baseDir . '/Zotlabs/Module/Notes.php',
'Zotlabs\\Module\\Notifications' => $baseDir . '/Zotlabs/Module/Notifications.php',
'Zotlabs\\Module\\Notify' => $baseDir . '/Zotlabs/Module/Notify.php',
'Zotlabs\\Module\\OAuth2TestVehicle' => $baseDir . '/Zotlabs/Module/Oauth2testvehicle.php',
'Zotlabs\\Module\\OAuth2TestVehicle' => $baseDir . '/Zotlabs/Module/OAuth2TestVehicle.php',
'Zotlabs\\Module\\Oauth' => $baseDir . '/Zotlabs/Module/Oauth.php',
'Zotlabs\\Module\\Oauth2' => $baseDir . '/Zotlabs/Module/Oauth2.php',
'Zotlabs\\Module\\Oauthinfo' => $baseDir . '/Zotlabs/Module/Oauthinfo.php',
@@ -1544,6 +1541,7 @@ return array(
'Zotlabs\\Update\\_1236' => $baseDir . '/Zotlabs/Update/_1236.php',
'Zotlabs\\Update\\_1237' => $baseDir . '/Zotlabs/Update/_1237.php',
'Zotlabs\\Update\\_1238' => $baseDir . '/Zotlabs/Update/_1238.php',
'Zotlabs\\Update\\_1239' => $baseDir . '/Zotlabs/Update/_1239.php',
'Zotlabs\\Web\\Controller' => $baseDir . '/Zotlabs/Web/Controller.php',
'Zotlabs\\Web\\HTTPHeaders' => $baseDir . '/Zotlabs/Web/HTTPHeaders.php',
'Zotlabs\\Web\\HTTPSig' => $baseDir . '/Zotlabs/Web/HTTPSig.php',

View File

@@ -22,6 +22,8 @@ class ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d', 'loadClassLoader'));
@@ -32,7 +34,7 @@ class ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d::getInitializer($loader));
} else {

View File

@@ -196,6 +196,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'CommerceGuys\\Intl\\NumberFormat\\NumberFormat' => __DIR__ . '/..' . '/commerceguys/intl/src/NumberFormat/NumberFormat.php',
'CommerceGuys\\Intl\\NumberFormat\\NumberFormatRepository' => __DIR__ . '/..' . '/commerceguys/intl/src/NumberFormat/NumberFormatRepository.php',
'CommerceGuys\\Intl\\NumberFormat\\NumberFormatRepositoryInterface' => __DIR__ . '/..' . '/commerceguys/intl/src/NumberFormat/NumberFormatRepositoryInterface.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'HTMLPurifier' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.php',
'HTMLPurifier_Arborize' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php',
'HTMLPurifier_AttrCollections' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php',
@@ -374,9 +375,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'HTMLPurifier_Printer' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php',
'HTMLPurifier_Printer_CSSDefinition' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php',
'HTMLPurifier_Printer_ConfigForm' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_NullDecorator' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_bool' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_default' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_HTMLDefinition' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php',
'HTMLPurifier_PropertyList' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php',
'HTMLPurifier_PropertyListIterator' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php',
@@ -432,7 +430,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'ID3Parser\\ID3Parser' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/ID3Parser.php',
'ID3Parser\\getID3\\Tags\\getid3_id3v1' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/Tags/getid3_id3v1.php',
'ID3Parser\\getID3\\Tags\\getid3_id3v2' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/Tags/getid3_id3v2.php',
'ID3Parser\\getID3\\getID3' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3.php',
'ID3Parser\\getID3\\getid3_exception' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3_exception.php',
'ID3Parser\\getID3\\getid3_handler' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3_handler.php',
'ID3Parser\\getID3\\getid3_lib' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3_lib.php',
@@ -1177,10 +1174,10 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Extend\\Hook' => __DIR__ . '/../..' . '/Zotlabs/Extend/Hook.php',
'Zotlabs\\Extend\\Route' => __DIR__ . '/../..' . '/Zotlabs/Extend/Route.php',
'Zotlabs\\Extend\\Widget' => __DIR__ . '/../..' . '/Zotlabs/Extend/Widget.php',
'Zotlabs\\Identity\\BasicId\\BasicId' => __DIR__ . '/../..' . '/Zotlabs/Identity/BasicId.php',
'Zotlabs\\Identity\\BasicId' => __DIR__ . '/../..' . '/Zotlabs/Identity/BasicId.php',
'Zotlabs\\Identity\\OAuth2Server' => __DIR__ . '/../..' . '/Zotlabs/Identity/OAuth2Server.php',
'Zotlabs\\Identity\\OAuth2Storage' => __DIR__ . '/../..' . '/Zotlabs/Identity/OAuth2Storage.php',
'Zotlabs\\Identity\\ProfilePhoto\\ProfilePhoto' => __DIR__ . '/../..' . '/Zotlabs/Identity/ProfilePhoto.php',
'Zotlabs\\Identity\\ProfilePhoto' => __DIR__ . '/../..' . '/Zotlabs/Identity/ProfilePhoto.php',
'Zotlabs\\Lib\\AConfig' => __DIR__ . '/../..' . '/Zotlabs/Lib/AConfig.php',
'Zotlabs\\Lib\\AbConfig' => __DIR__ . '/../..' . '/Zotlabs/Lib/AbConfig.php',
'Zotlabs\\Lib\\AccessList' => __DIR__ . '/../..' . '/Zotlabs/Lib/AccessList.php',
@@ -1337,7 +1334,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\Notes' => __DIR__ . '/../..' . '/Zotlabs/Module/Notes.php',
'Zotlabs\\Module\\Notifications' => __DIR__ . '/../..' . '/Zotlabs/Module/Notifications.php',
'Zotlabs\\Module\\Notify' => __DIR__ . '/../..' . '/Zotlabs/Module/Notify.php',
'Zotlabs\\Module\\OAuth2TestVehicle' => __DIR__ . '/../..' . '/Zotlabs/Module/Oauth2testvehicle.php',
'Zotlabs\\Module\\OAuth2TestVehicle' => __DIR__ . '/../..' . '/Zotlabs/Module/OAuth2TestVehicle.php',
'Zotlabs\\Module\\Oauth' => __DIR__ . '/../..' . '/Zotlabs/Module/Oauth.php',
'Zotlabs\\Module\\Oauth2' => __DIR__ . '/../..' . '/Zotlabs/Module/Oauth2.php',
'Zotlabs\\Module\\Oauthinfo' => __DIR__ . '/../..' . '/Zotlabs/Module/Oauthinfo.php',
@@ -1712,6 +1709,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Update\\_1236' => __DIR__ . '/../..' . '/Zotlabs/Update/_1236.php',
'Zotlabs\\Update\\_1237' => __DIR__ . '/../..' . '/Zotlabs/Update/_1237.php',
'Zotlabs\\Update\\_1238' => __DIR__ . '/../..' . '/Zotlabs/Update/_1238.php',
'Zotlabs\\Update\\_1239' => __DIR__ . '/../..' . '/Zotlabs/Update/_1239.php',
'Zotlabs\\Web\\Controller' => __DIR__ . '/../..' . '/Zotlabs/Web/Controller.php',
'Zotlabs\\Web\\HTTPHeaders' => __DIR__ . '/../..' . '/Zotlabs/Web/HTTPHeaders.php',
'Zotlabs\\Web\\HTTPSig' => __DIR__ . '/../..' . '/Zotlabs/Web/HTTPSig.php',

File diff suppressed because it is too large Load Diff

236
vendor/composer/installed.php vendored Normal file
View File

@@ -0,0 +1,236 @@
<?php return array (
'root' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '188975ccbd3a9c584238c35dd8c5a8fda7718199',
'name' => 'zotlabs/hubzilla',
),
'versions' =>
array (
'blueimp/jquery-file-upload' =>
array (
'pretty_version' => 'v10.31.0',
'version' => '10.31.0.0',
'aliases' =>
array (
),
'reference' => '0740f81829698b84efe17e72501e0f420ea0d611',
),
'bshaffer/oauth2-server-php' =>
array (
'pretty_version' => 'v1.11.1',
'version' => '1.11.1.0',
'aliases' =>
array (
),
'reference' => '5a0c8000d4763b276919e2106f54eddda6bc50fa',
),
'commerceguys/intl' =>
array (
'pretty_version' => 'v1.0.6',
'version' => '1.0.6.0',
'aliases' =>
array (
),
'reference' => '47d5d6d60d0cc25f867e337ce229a228bf6be6f8',
),
'desandro/imagesloaded' =>
array (
'pretty_version' => 'v4.1.4',
'version' => '4.1.4.0',
'aliases' =>
array (
),
'reference' => '67c4e57453120935180c45c6820e7d3fbd2ea1f9',
),
'ezyang/htmlpurifier' =>
array (
'pretty_version' => 'v4.13.0',
'version' => '4.13.0.0',
'aliases' =>
array (
),
'reference' => '08e27c97e4c6ed02f37c5b2b20488046c8d90d75',
),
'league/html-to-markdown' =>
array (
'pretty_version' => '4.10.0',
'version' => '4.10.0.0',
'aliases' =>
array (
),
'reference' => '0868ae7a552e809e5cd8f93ba022071640408e88',
),
'lukasreschke/id3parser' =>
array (
'pretty_version' => 'v0.0.3',
'version' => '0.0.3.0',
'aliases' =>
array (
),
'reference' => '62f4de76d4eaa9ea13c66dacc1f22977dace6638',
),
'michelf/php-markdown' =>
array (
'pretty_version' => '1.9.0',
'version' => '1.9.0.0',
'aliases' =>
array (
),
'reference' => 'c83178d49e372ca967d1a8c77ae4e051b3a3c75c',
),
'paragonie/random_compat' =>
array (
'pretty_version' => 'v9.99.99',
'version' => '9.99.99.0',
'aliases' =>
array (
),
'reference' => '84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95',
),
'pear/text_languagedetect' =>
array (
'pretty_version' => 'v1.0.0',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => 'bb9ff6f4970f686fac59081e916b456021fe7ba6',
),
'psr/log' =>
array (
'pretty_version' => '1.1.3',
'version' => '1.1.3.0',
'aliases' =>
array (
),
'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc',
),
'ramsey/uuid' =>
array (
'pretty_version' => '3.9.3',
'version' => '3.9.3.0',
'aliases' =>
array (
),
'reference' => '7e1633a6964b48589b142d60542f9ed31bd37a92',
),
'rhumsaa/uuid' =>
array (
'replaced' =>
array (
0 => '3.9.3',
),
),
'sabre/dav' =>
array (
'pretty_version' => '4.1.1',
'version' => '4.1.1.0',
'aliases' =>
array (
),
'reference' => '5736f943c90d8d73d04cd8944d8c913811dc7360',
),
'sabre/event' =>
array (
'pretty_version' => '5.1.0',
'version' => '5.1.0.0',
'aliases' =>
array (
),
'reference' => 'd00a17507af0e7544cfe17096372f5d733e3b276',
),
'sabre/http' =>
array (
'pretty_version' => '5.1.0',
'version' => '5.1.0.0',
'aliases' =>
array (
),
'reference' => '23446999f1f6e62892bbd89745070aa902dd3539',
),
'sabre/uri' =>
array (
'pretty_version' => '2.2.0',
'version' => '2.2.0.0',
'aliases' =>
array (
),
'reference' => '059d11012603be2e32ddb7543602965563ddbb09',
),
'sabre/vobject' =>
array (
'pretty_version' => '4.3.1',
'version' => '4.3.1.0',
'aliases' =>
array (
),
'reference' => 'a7feca8311462e5da16952454e420b92c20d3586',
),
'sabre/xml' =>
array (
'pretty_version' => '2.2.1',
'version' => '2.2.1.0',
'aliases' =>
array (
),
'reference' => '41c6ba148966b10cafd31d1a4e5feb1e2138d95c',
),
'simplepie/simplepie' =>
array (
'pretty_version' => '1.5.5',
'version' => '1.5.5.0',
'aliases' =>
array (
),
'reference' => 'ae49e2201b6da9c808e5dac437aca356a11831b4',
),
'smarty/smarty' =>
array (
'pretty_version' => 'v3.1.36',
'version' => '3.1.36.0',
'aliases' =>
array (
),
'reference' => 'fd148f7ade295014fff77f89ee3d5b20d9d55451',
),
'symfony/polyfill-ctype' =>
array (
'pretty_version' => 'v1.20.0',
'version' => '1.20.0.0',
'aliases' =>
array (
),
'reference' => 'f4ba089a5b6366e453971d3aad5fe8e897b37f41',
),
'twbs/bootstrap' =>
array (
'pretty_version' => 'v4.5.2',
'version' => '4.5.2.0',
'aliases' =>
array (
),
'reference' => '5f2480a90ab911babc53039835fe78c6fc12646d',
),
'twitter/bootstrap' =>
array (
'replaced' =>
array (
0 => 'v4.5.2',
),
),
'zotlabs/hubzilla' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '188975ccbd3a9c584238c35dd8c5a8fda7718199',
),
),
);

26
vendor/composer/platform_check.php vendored Normal file
View File

@@ -0,0 +1,26 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 70100)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}

View File

@@ -12,15 +12,35 @@
use Symfony\Polyfill\Ctype as p;
if (!function_exists('ctype_alnum')) {
function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); }
function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); }
function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); }
function ctype_digit($text) { return p\Ctype::ctype_digit($text); }
function ctype_graph($text) { return p\Ctype::ctype_graph($text); }
function ctype_lower($text) { return p\Ctype::ctype_lower($text); }
function ctype_print($text) { return p\Ctype::ctype_print($text); }
function ctype_punct($text) { return p\Ctype::ctype_punct($text); }
function ctype_space($text) { return p\Ctype::ctype_space($text); }
function ctype_upper($text) { return p\Ctype::ctype_upper($text); }
function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); }
function ctype_alnum($input) { return p\Ctype::ctype_alnum($input); }
}
if (!function_exists('ctype_alpha')) {
function ctype_alpha($input) { return p\Ctype::ctype_alpha($input); }
}
if (!function_exists('ctype_cntrl')) {
function ctype_cntrl($input) { return p\Ctype::ctype_cntrl($input); }
}
if (!function_exists('ctype_digit')) {
function ctype_digit($input) { return p\Ctype::ctype_digit($input); }
}
if (!function_exists('ctype_graph')) {
function ctype_graph($input) { return p\Ctype::ctype_graph($input); }
}
if (!function_exists('ctype_lower')) {
function ctype_lower($input) { return p\Ctype::ctype_lower($input); }
}
if (!function_exists('ctype_print')) {
function ctype_print($input) { return p\Ctype::ctype_print($input); }
}
if (!function_exists('ctype_punct')) {
function ctype_punct($input) { return p\Ctype::ctype_punct($input); }
}
if (!function_exists('ctype_space')) {
function ctype_space($input) { return p\Ctype::ctype_space($input); }
}
if (!function_exists('ctype_upper')) {
function ctype_upper($input) { return p\Ctype::ctype_upper($input); }
}
if (!function_exists('ctype_xdigit')) {
function ctype_xdigit($input) { return p\Ctype::ctype_xdigit($input); }
}

View File

@@ -16,7 +16,7 @@
}
],
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"autoload": {
"psr-4": { "Symfony\\Polyfill\\Ctype\\": "" },
@@ -28,7 +28,11 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "1.13-dev"
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
}
}

View File

@@ -23,10 +23,6 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Language: es_ES\n"
"Plural-Forms: nplurals=2; plural=(n != 1 ? 1 : 0);\n"
#: ../../view/theme/redbasic/php/config.php:15 ../../include/text.php:3231
#: ../../Zotlabs/Module/Admin/Site.php:187
msgid "Default"
msgstr "Predeterminado"
#: ../../view/theme/redbasic/php/config.php:15
#: ../../addon/cart/submodules/orderoptions.php:335

View File

@@ -340,7 +340,13 @@ ACL.prototype.update_view = function(value) {
that.list.hide(); //hide acl-list
that.info.hide(); //show acl-info
that.selected_id = that.contact_ids[that.allow_cid[0]];
that.update_select('\\^' + that.selected_id);
if(that.acl_select.find('option[id="\\^' + that.selected_id + '"]').length === 0) {
that.update_view('custom');
}
else {
that.update_select('\\^' + that.selected_id);
}
/* jot acl */
$('#jot-perms-icon, #dialog-perms-icon, #' + that.form_id[0].id + ' .jot-perms-icon').removeClass('fa-unlock').addClass('fa-lock');

View File

@@ -20,17 +20,18 @@ var pageHasMoreContent = true;
var divmore_height = 400;
var last_filestorage_id = null;
var mediaPlaying = false;
var contentHeightDiff = 0;
var liveRecurse = 0;
var savedTitle = '';
var followUpPageLoad = false;
var window_needs_alert = true;
var expanded_items = [];
var sse_bs_active = false;
var sse_offset = 0;
var sse_type;
var sse_partial_result = false;
var sse_rmids = [];
var sse_fallback_interval;
var page_cache = {};
@@ -68,6 +69,13 @@ $(document).ready(function() {
this.autocomplete_handled = true;
}
});
$(document).on('keydown', '.comment-edit-form textarea.expanded', function (e) {
if (e.ctrlKey && e.keyCode === 13) {
post_comment(this.id.replace('comment-edit-text-',''));
}
});
var tf = new Function('n', 's', 'var k = s.split("/")['+aStr['plural_func']+']; return (k ? k : s);');
@@ -94,37 +102,55 @@ $(document).ready(function() {
jQuery.timeago.settings.allowFuture = true;
if(typeof(window.SharedWorker) === 'undefined') {
// notifications with multiple tabs open will not work very well in this scenario
var evtSource = new EventSource('/sse');
if(sse_enabled) {
if(typeof(window.SharedWorker) === 'undefined') {
// notifications with multiple tabs open will not work very well in this scenario
var evtSource = new EventSource('/sse');
evtSource.addEventListener('notifications', function(e) {
var obj = JSON.parse(e.data);
sse_handleNotifications(obj, false, false);
}, false);
evtSource.addEventListener('notifications', function(e) {
var obj = JSON.parse(e.data);
sse_handleNotifications(obj, false, false);
}, false);
document.addEventListener('visibilitychange', function() {
if (!document.hidden) {
sse_offset = 0;
sse_bs_init();
document.addEventListener('visibilitychange', function() {
if (!document.hidden) {
sse_offset = 0;
sse_bs_init();
}
}, false);
}
else {
var myWorker = new SharedWorker('/view/js/sse_worker.js', localUser);
myWorker.port.onmessage = function(e) {
obj = e.data;
console.log(obj);
sse_handleNotifications(obj, false, false);
}
}, false);
myWorker.onerror = function(e) {
myWorker.port.close();
}
myWorker.port.start();
}
}
else {
var myWorker = new SharedWorker('/view/js/sse_worker.js', localUser);
if (!document.hidden)
sse_fallback_interval = setInterval(sse_fallback, updateInterval);
myWorker.port.onmessage = function(e) {
obj = e.data;
console.log(obj);
sse_handleNotifications(obj, false, false);
}
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
clearInterval(sse_fallback_interval);
}
else {
sse_offset = 0;
sse_bs_init();
sse_fallback_interval = setInterval(sse_fallback, updateInterval);
}
myWorker.onerror = function(e) {
myWorker.port.close();
}
myWorker.port.start();
}, false);
}
$('.notification-link').on('click', { replace: true, followup: false }, sse_bs_notifications);
@@ -188,33 +214,6 @@ $(document).ready(function() {
updateInit();
// Allow folks to stop the ajax page updates with the pause/break key
$(document).keydown(function(event) {
if(event.keyCode == '8') {
var target = event.target || event.srcElement;
if (!/input|textarea/i.test(target.nodeName)) {
return false;
}
}
if(event.keyCode == '19' || (event.ctrlKey && event.which == '32')) {
event.preventDefault();
if(stopped === false) {
stopped = true;
if (event.ctrlKey) {
totStopped = true;
}
$('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
} else {
unpause();
}
} else {
if (!totStopped) {
unpause();
}
}
});
var e = document.getElementById('content-complete');
if(e)
pageHasMoreContent = false;
@@ -288,6 +287,7 @@ function handle_comment_form(e) {
// handle clicked form
var form = $(this);
var fields = form.find(':input[type=text], textarea');
var fields_empty = true;
@@ -302,8 +302,9 @@ function handle_comment_form(e) {
form.find(':not(:visible)').show();
}
// handle click outside of form (close empty forms)
$(document).on('click', function(e) {
$(document).one('click', function(e) {
fields.each(function() {
if($(this).val() != '')
fields_empty = false;
@@ -322,18 +323,19 @@ function handle_comment_form(e) {
form.find(':button[type=submit]').prop('title', '');
}
});
var commentSaveTimer = null;
var emptyCommentElm = form.find('.comment-edit-text').attr('id');
var convId = emptyCommentElm.replace('comment-edit-text-','');
$(document).on('focusout','#' + emptyCommentElm,function(e){
$('#' + emptyCommentElm).on('focusout',function(e){
if(commentSaveTimer)
clearTimeout(commentSaveTimer);
commentSaveChanges(convId,true);
commentSaveTimer = null;
$('#' + emptyCommentElm).off();
});
$(document).on('focusin','#' + emptyCommentElm,function(e){
$('#' + emptyCommentElm).on('focusin', function (e){
commentSaveTimer = setTimeout(function () {
commentSaveChanges(convId,false);
},10000);
@@ -357,11 +359,13 @@ function handle_comment_form(e) {
}
}
}
}
function commentClose(obj, id) {
if(obj.value === '') {
obj.value = aStr.comment;
$("#comment-edit-text-" + id).removeClass("expanded");
$("#mod-cmnt-wrap-" + id).hide();
$("#comment-tools-" + id).hide();
@@ -616,7 +620,10 @@ function updatePageItems(mode, data) {
function updateConvItems(mode,data) {
$(document).trigger('hz:updateConvItems');
var scroll_position = $(window).scrollTop();
if(mode !== 'update')
$(document).trigger('hz:updateConvItems');
if(mode === 'update' || mode === 'replace') {
prev = 'threads-begin';
@@ -626,12 +633,11 @@ function updateConvItems(mode,data) {
}
if(mode === 'replace') {
$('.thread-wrapper').remove(); // clear existing content
$('.thread-parent').remove(); // clear existing content
}
$('.thread-wrapper', data).each(function() {
if(this.classList.contains('toplevel_item')) {
var ident = this.id;
var convId = ident.replace('thread-wrapper-','');
var commentWrap = $('#'+ident+' .collapsed-comments').attr('id');
@@ -746,6 +752,8 @@ function updateConvItems(mode,data) {
});
$(window).scrollTop(scroll_position);
if(followUpPageLoad)
sse_bs_counts();
else
@@ -841,25 +849,16 @@ function scrollToItem() {
}
function collapseHeight() {
var origContentHeight = Math.ceil($("#region_2").height());
var cDiff = 0;
var i = 0;
var position = $(window).scrollTop();
$(".wall-item-content, .directory-collapse").each(function() {
var orgHeight = $(this).outerHeight(true);
var id = $(this).attr('id')
var open = ((expanded_items.indexOf($(this).attr('id')) === -1) ? false : true);
if(orgHeight > divmore_height) {
if(! $(this).hasClass('divmore') && $(this).has('div.no-collapse').length == 0) {
// check if we will collapse some content above the visible content and compensate the diff later
if($(this).offset().top + divmore_height - $(window).scrollTop() + cDiff - ($(".divgrow-showmore").outerHeight() * i) < 65) {
diff = orgHeight - divmore_height;
cDiff = cDiff + diff;
i++;
}
$(this).readmore({
speed: 0,
startOpen: open,
heightMargin: 50,
collapsedHeight: divmore_height,
moreLink: '<a href="#" class="divgrow-showmore fakelink">' + aStr.divgrowmore + '</a>',
@@ -869,6 +868,10 @@ function collapseHeight() {
if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) {
$(window).scrollTop($(window).scrollTop() - ($(element).outerHeight(true) - divmore_height));
}
expanded_items = expanded_items.filter(expanded_items => expanded_items !== id);
}
else {
expanded_items.push(id);
}
}
});
@@ -877,15 +880,6 @@ function collapseHeight() {
}
});
var collapsedContentHeight = Math.ceil($("#region_2").height());
contentHeightDiff = liking ? 0 : origContentHeight - collapsedContentHeight;
console.log('collapseHeight() - contentHeightDiff: ' + contentHeightDiff + 'px');
if(i && !liking){
var sval = position - cDiff + ($(".divgrow-showmore").outerHeight() * i);
console.log('collapsed above viewport count: ' + i);
$(window).scrollTop(sval);
}
}
function updateInit() {
@@ -920,12 +914,7 @@ function liveUpdate(notify_id) {
if((src === null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; }
// if auto updates are enabled and a comment box is open,
// prevent live updates until the comment is submitted
var lockUpdates = (($('.comment-edit-text.expanded').length && (! bParam_static)) ? true : false);
if(lockUpdates || in_progress || mediaPlaying) {
if(in_progress || mediaPlaying) {
if(livetime) {
clearTimeout(livetime);
}
@@ -1027,11 +1016,6 @@ function liveUpdate(notify_id) {
scroll_next = false;
updateConvItems(update_mode,data);
// adjust scroll position if new content was added above viewport
if(update_mode === 'update' && !justifiedGalleryActive) {
$(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight + contentHeightDiff);
}
in_progress = false;
$('#image_counter').html('');
@@ -1162,19 +1146,30 @@ function justifyPhotosAjax(id) {
$('#' + id).justifiedGallery('norewind').on('jg.complete', function(e){ justifiedGalleryActive = false; });
}
// Since our ajax calls are asynchronous, we will give a few
// seconds for the first ajax call (setting like/dislike), then
// run the updater to pick up any changes and display on the page.
// The updater will turn any rotators off when it's done.
// This function will have returned long before any of these
// events have completed and therefore there won't be any
// visible feedback that anything changed without all this
// trickery. This still could cause confusion if the "like" ajax call
// is delayed and updateInit runs before it completes.
function dolike(ident, verb) {
unpause();
$('#like-rotator-' + ident.toString()).show();
$.get('like/' + ident.toString() + '?verb=' + verb, updateInit );
if(typeof conv_mode == typeof undefined)
conv_mode = '';
$.get('like/' + ident.toString() + '?verb=' + verb + '&conv_mode=' + conv_mode, function (data) {
if(data.success) {
// this is a bit tricky since the top level thread wrapper wraps the whole thread
if($('#thread-wrapper-' + data.orig_id).hasClass('toplevel_item')) {
var wrapper = $('<div></div>').html( data.html ).find('#wall-item-outside-wrapper-' + data.id);
$('#wall-item-outside-wrapper-' + data.orig_id).html(wrapper[0].innerHTML);
// those were not replaced - swap the id
$('#thread-wrapper-' + data.orig_id).attr('id', 'thread-wrapper-' + data.id);
$('#wall-item-outside-wrapper-' + data.orig_id).attr('id', 'wall-item-outside-wrapper-' + data.id);
}
else {
$('#thread-wrapper-' + data.orig_id).replaceWith(data.html);
}
$('#wall-item-ago-' + data.id + ' .autotime').timeago();
collapseHeight();
liking = 0;
}
});
liking = 1;
}
@@ -1279,14 +1274,12 @@ function dropItem(url, object) {
}
function dosubthread(ident) {
unpause();
$('#like-rotator-' + ident.toString()).show();
$.get('subthread/sub/' + ident.toString(), updateInit );
liking = 1;
}
function dounsubthread(ident) {
unpause();
$('#like-rotator-' + ident.toString()).show();
$.get('subthread/unsub/' + ident.toString(), updateInit );
liking = 1;
@@ -1365,44 +1358,53 @@ function submitPoll(id) {
function(data) {
$.jGrowl(data.message, { sticky: false, theme: ((data.success) ? 'info' : 'notice'), life: 10000 });
if(timer) clearTimeout(timer);
timer = setTimeout(updateInit,1500);
timer = setTimeout(updateInit, 500);
}
);
}
function post_comment(id) {
unpause();
commentBusy = true;
$('body').css('cursor', 'wait');
$("#comment-preview-inp-" + id).val("0");
if(typeof conv_mode == typeof undefined)
conv_mode = '';
var form_data = $("#comment-edit-form-" + id).serialize();
$.post(
"item",
$("#comment-edit-form-" + id).serialize(),
form_data + '&conv_mode=' + conv_mode,
function(data) {
if(data.success) {
localStorage.removeItem("comment_body-" + id);
$("#comment-edit-preview-" + id).hide();
$("#comment-edit-wrapper-" + id).hide();
$("#comment-edit-text-" + id).val('');
$("#comment-edit-text-" + id).val('').blur().attr('placeholder', aStr.comment);
$('#wall-item-comment-wrapper-' + id).before(data.html);
$('#wall-item-ago-' + data.id + ' .autotime').timeago();
$('body').css('cursor', 'unset');
collapseHeight();
commentBusy = false;
var tarea = document.getElementById("comment-edit-text-" + id);
if(tarea) {
commentClose(tarea, id);
$(document).unbind( "click.commentOpen");
$(document).off( "click.commentOpen");
}
if(timer) clearTimeout(timer);
timer = setTimeout(updateInit,1500);
}
if(data.reload) {
window.location.href=data.reload;
}
},
"json"
);
return false;
}
function preview_comment(id) {
$("#comment-preview-inp-" + id).val("1");
$("#comment-edit-preview-" + id).show();
@@ -1470,13 +1472,6 @@ function preview_mail() {
return true;
}
function unpause() {
// unpause auto reloads if they are currently stopped
totStopped = false;
stopped = false;
$('#pause').html('');
}
function bin2hex(s) {
// Converts the binary representation of data to hex
//
@@ -1573,7 +1568,6 @@ function zFormError(elm,x) {
}
}
$(window).scroll(function () {
if(typeof buildCmd == 'function') {
// This is a content page with items and/or conversations
@@ -1599,22 +1593,6 @@ $(window).scroll(function () {
}
});
var chanviewFullSize = false;
function chanviewFull() {
if(chanviewFullSize) {
chanviewFullSize = false;
$('#chanview-iframe-border').css({ 'position' : 'relative', 'z-index' : '10' });
$('#remote-channel').css({ 'position' : 'relative' , 'z-index' : '10' });
}
else {
chanviewFullSize = true;
$('#chanview-iframe-border').css({ 'position' : 'fixed', 'top' : '0', 'left' : '0', 'z-index' : '150001' });
$('#remote-channel').css({ 'position' : 'fixed', 'top' : '0', 'left' : '0', 'z-index' : '150000' });
resize_iframe();
}
}
function addhtmltext(data) {
data = h2b(data);
addeditortext(data);
@@ -1763,8 +1741,6 @@ function sse_bs_init() {
}
function sse_bs_counts() {
if(sse_bs_active)
return;
@@ -1847,8 +1823,6 @@ function sse_bs_notifications(e, replace, followup) {
}
}
function sse_handleNotifications(obj, replace, followup) {
var primary_notifications = ['dm', 'home', 'intros', 'register', 'mail', 'notify', 'files'];
@@ -2022,3 +1996,15 @@ function sse_setNotificationsStatus() {
}
}
function sse_fallback() {
$.get('/sse', function(obj) {
if(! obj)
return;
console.log('sse fallback');
console.log(obj);
sse_handleNotifications(obj, false, false);
});
}

File diff suppressed because it is too large Load Diff

View File

@@ -403,7 +403,6 @@ App::$strings["PHP"] = "";
App::$strings["Page content type"] = "Тип содержимого страницы";
App::$strings["photo"] = "фото";
App::$strings["event"] = "событие";
App::$strings["status"] = "статус";
App::$strings["comment"] = "комментарий";
App::$strings["activity"] = "активность";
App::$strings["poll"] = "голосование";
@@ -707,7 +706,7 @@ App::$strings["%d years"] = array(
App::$strings["timeago.prefixAgo"] = "";
App::$strings["timeago.prefixFromNow"] = "через";
App::$strings["timeago.suffixAgo"] = "назад";
App::$strings["timeago.suffixFromNow"] = "";
App::$strings["timeago.suffixFromNow"] = "NONE";
App::$strings["less than a minute"] = "менее чем одну минуту";
App::$strings["about a minute"] = "около минуты";
App::$strings["about an hour"] = "около часа";
@@ -803,13 +802,15 @@ App::$strings["__ctx:relative_date__ second"] = array(
App::$strings["%1\$s's birthday"] = "День рождения %1\$s";
App::$strings["Happy Birthday %1\$s"] = "С Днем рождения %1\$s !";
App::$strings["Visible to your default audience"] = "Видно вашей аудитории по умолчанию.";
App::$strings["__ctx:acl__ Profile"] = "Профиль";
App::$strings["Profile-Based Privacy Groups"] = "Группы конфиденциальности основанные на профиле";
App::$strings["Forums"] = "Форумы";
App::$strings["Private Forum"] = "Частный форум";
App::$strings["Only me"] = "Только мне";
App::$strings["Who can see this?"] = "Кто может это видеть?";
App::$strings["Share with"] = "Поделиться с";
App::$strings["Custom selection"] = "Настраиваемый выбор";
App::$strings["Select \"Show\" to allow viewing. \"Don't show\" lets you override and limit the scope of \"Show\"."] = "Нажмите \"Показать\" чтобы разрешить просмотр. \"Не показывать\" позволит вам переопределить и ограничить область показа.";
App::$strings["Show"] = "Показать";
App::$strings["Don't show"] = "Не показывать";
App::$strings["Select \"Allow\" to allow viewing. \"Don't allow\" lets you override and limit the scope of \"Allow\"."] = "Выберите \"Разрешить\" для разрешения просмотра. \"Не разрешать\" позволяет вам переопределить и ограничить разрешения.";
App::$strings["Allow"] = "Разрешить";
App::$strings["Don't allow"] = "Не разрешать";
App::$strings["Permissions"] = "Разрешения";
App::$strings["Close"] = "Закрыть";
App::$strings["Post permissions %s cannot be changed %s after a post is shared.</br />These permissions set who is allowed to view the post."] = "Разрешения публикации %s не могут быть изменены %s после того, как ею поделились. Эти разрешения устанавливают кому разрешено просматривать эту публикацию.";
@@ -1007,6 +1008,7 @@ App::$strings["Validation token"] = "Проверочный токен";
App::$strings["No channel."] = "Канала нет.";
App::$strings["No connections in common."] = "Общих контактов нет.";
App::$strings["View Common Connections"] = "Просмотр общий контактов";
App::$strings["__ctx:acl__ Profile"] = "Профиль";
App::$strings["network"] = "сеть";
App::$strings["Unable to locate original post."] = "Не удалось найти оригинальную публикацию.";
App::$strings["Empty post discarded."] = "Пустая публикация отклонена.";
@@ -1345,7 +1347,6 @@ App::$strings["Failed to remove event"] = "Не удалось удалить с
App::$strings["Unknown App"] = "Неизвестное приложение";
App::$strings["Authorize"] = "Авторизовать";
App::$strings["Do you authorize the app %s to access your channel data?"] = "Авторизуете ли вы приложение %s для доступа к данным вашего канала?";
App::$strings["Allow"] = "Разрешить";
App::$strings["Deny"] = "Запретить";
App::$strings["Public Stream App"] = "Приложение \"Публичный поток\"";
App::$strings["The unmoderated public stream of this hub"] = "Немодерируемый публичный поток с этого хаба";
@@ -1686,6 +1687,7 @@ App::$strings["Invalid request."] = "Неверный запрос.";
App::$strings["thing"] = "предмет";
App::$strings["Channel unavailable."] = "Канал недоступен.";
App::$strings["Previous action reversed."] = "Предыдущее действие отменено.";
App::$strings["status"] = "статус";
App::$strings["%1\$s agrees with %2\$s's %3\$s"] = "%1\$s согласен с %2\$s %3\$s";
App::$strings["%1\$s doesn't agree with %2\$s's %3\$s"] = "%1\$s не согласен с %2\$s %3\$s";
App::$strings["%1\$s abstains from a decision on %2\$s's %3\$s"] = "%1\$s воздерживается от решения по %2\$s%3\$s";
@@ -1701,7 +1703,8 @@ App::$strings["My Bookmarks"] = "Мои закладки";
App::$strings["My Connections Bookmarks"] = "Закладки моих контактов";
App::$strings["Update to Hubzilla 5.0 step 2"] = "Обновление Hubzilla 5.0, этап 2";
App::$strings["To complete the update please run"] = "Для завершения обновления пожалуйста выполните";
App::$strings["INFO: this command can take a very long time depending on your DB size."] = "К сведению: эта команда может выполняться очень долго в зависимости от размеры базы данных.";
App::$strings["php util/z6convert.php"] = "";
App::$strings["from the terminal."] = "из терминала.";
App::$strings["Item not available."] = "Элемент недоступен.";
App::$strings["Remote Diagnostics App"] = "Приложение \"Удалённая диагностика\"";
App::$strings["Perform diagnostics on remote channels"] = "Производит диагностику удалённых каналов";
@@ -1711,8 +1714,6 @@ App::$strings["Channel removals are not allowed within 48 hours of changing the
App::$strings["Remove This Channel"] = "Удалить этот канал";
App::$strings["This channel will be completely removed from the network. "] = "Этот канал будет полностью удалён из сети. ";
App::$strings["This action is permanent and can not be undone!"] = "Это действие необратимо и не может быть отменено!";
App::$strings["Remove this channel and all its clones from the network"] = "Удалить этот канал и все его клоны из сети";
App::$strings["By default only the instance of the channel located on this hub will be removed from the network"] = "По умолчанию только представление канала расположенное на данном хабе будет удалено из сети";
App::$strings["Unable to update menu."] = "Невозможно обновить меню.";
App::$strings["Unable to create menu."] = "Невозможно создать меню.";
App::$strings["Menu Name"] = "Название меню";
@@ -2028,6 +2029,8 @@ App::$strings["Sender (From) email address for system generated email."] = "Ад
App::$strings["Name of email sender for system generated email."] = "Имя отправителя для генерируемых системой сообщений.";
App::$strings["Directory Server URL"] = "URL сервера каталогов";
App::$strings["Default directory server"] = "Сервер каталогов по умолчанию";
App::$strings["Enable SSE Notifications"] = "Включить уведомления SSE";
App::$strings["If disabled, traditional polling will be used. Warning: this setting might not be suited for shared hosting"] = "Если выключено будет использоваться традиционный периодический опрос. Предупреждение: этот режим не подходит для виртуального (shared) хостинга";
App::$strings["Proxy user"] = "Имя пользователя proxy-сервера";
App::$strings["Proxy URL"] = "URL proxy-сервера";
App::$strings["Network timeout"] = "Время ожидания сети";
@@ -2453,7 +2456,6 @@ App::$strings["Move this channel (disable all previous locations)"] = "Пере
App::$strings["Use this channel nickname instead of the one provided"] = "Использовать псевдоним этого канала вместо предоставленного";
App::$strings["Leave blank to keep your existing channel nickname. You will be randomly assigned a similar nickname if either name is already allocated on this site."] = "Оставьте пустым для сохранения существующего псевдонима канала. Вам будет случайным образом назначен похожий псевдоним если такое имя уже выделено на этом сайте.";
App::$strings["This process may take several minutes to complete. Please submit the form only once and leave this page open until finished."] = "Процесс может занять несколько минут. Пожалуйста, отправьте форму только один раз и оставьте эту страницу открытой до завершения.";
App::$strings["Hub not found."] = "Узел не найден.";
App::$strings["Warning: Database versions differ by %1\$d updates."] = "Предупреждение: Версия базы данных отличается от %1\$d обновления.";
App::$strings["Import completed"] = "Импорт завершён.";
App::$strings["Import Items"] = "Импортировать объекты";
@@ -2474,8 +2476,6 @@ App::$strings["Add Card"] = "Добавить карточку";
App::$strings["Account removals are not allowed within 48 hours of changing the account password."] = "Удаление канала не разрешается в течении 48 часов после смены пароля у аккаунта.";
App::$strings["Remove This Account"] = "Удалить этот аккаунт";
App::$strings["This account and all its channels will be completely removed from the network. "] = "Этот аккаунт и все его каналы будут полностью удалены из сети.";
App::$strings["Remove this account, all its channels and all its channel clones from the network"] = "Удалить этот аккаунт, все его каналы и их клоны из сети.";
App::$strings["By default only the instances of the channels located on this hub will be removed from the network"] = "По умолчанию только представление канала расположенное на данном хабе будет удалено из сети";
App::$strings["Unable to find your hub."] = "Невозможно найти ваш сервер";
App::$strings["Post successful."] = "Успешно опубликовано.";
App::$strings["Authentication failed."] = "Ошибка аутентификации.";
@@ -2497,7 +2497,6 @@ App::$strings["Visit your channel homepage"] = "Посетить страниц
App::$strings["View your connections and/or add somebody whose address you already know"] = "Просмотреть ваши контакты и / или добавить кого-то чей адрес в уже знаете";
App::$strings["View your personal stream (this may be empty until you add some connections)"] = "Ваш персональный поток (может быть пуст пока вы не добавите контакты)";
App::$strings["View the public stream. Warning: this content is not moderated"] = "Просмотр публичного потока. Предупреждение: этот контент не модерируется";
App::$strings["Forums"] = "Форумы";
App::$strings["Notes"] = "Записки";
App::$strings["Suggestions"] = "Рекомендации";
App::$strings["See more..."] = "Просмотреть больше...";
@@ -2602,6 +2601,7 @@ App::$strings["via"] = "через";
App::$strings["Attendance Options"] = "Параметры посещаемости";
App::$strings["Voting Options"] = "Параметры голосования";
App::$strings["Pinned post"] = "Прикреплённая заметка";
App::$strings["Don't show"] = "Не показывать";
App::$strings["Events Tools"] = "Инструменты для событий";
App::$strings["Export Calendar"] = "Экспортировать календарь";
App::$strings["Import Calendar"] = "Импортировать календарь";
@@ -2630,7 +2630,7 @@ App::$strings["Show posts to this forum"] = "Показывать публика
App::$strings["Show forums"] = "Показывать форумы";
App::$strings["Starred Posts"] = "Отмеченные публикации";
App::$strings["Show posts that I have starred"] = "Показывать публикации которые я отметил";
App::$strings["Personal Posts"] = "Личные публикации";
App::$strings["Personal Posts"] = "Свои публикации";
App::$strings["Show posts that mention or involve me"] = "Показывать публикации где вы были упомянуты или привлечены";
App::$strings["Show posts that I have filed to %s"] = "Показывать публикации которые я добавил в %s";
App::$strings["Show filed post categories"] = "Показывать категории добавленных публикаций";
@@ -2753,6 +2753,7 @@ App::$strings["commented on %s's post"] = "прокомментировал пу
App::$strings["repeated %s's post"] = "разместил публикацию %s";
App::$strings["edited a post dated %s"] = "отредактировал публикацию датированную %s";
App::$strings["edited a comment dated %s"] = "отредактировал комментарий датированный %s";
App::$strings["created an event"] = "создано событие";
App::$strings["(No Title)"] = "(нет заголовка)";
App::$strings["Wiki page create failed."] = "Не удалось создать страницу Wiki.";
App::$strings["Wiki not found."] = "Wiki не найдена.";

View File

@@ -95,6 +95,7 @@
</div>
<h3>{{$advanced}}</h3>
{{include file="field_checkbox.tpl" field=$sse_enabled}}
{{include file="field_input.tpl" field=$imagick_path}}
{{include file="field_input.tpl" field=$proxy}}
{{include file="field_input.tpl" field=$proxyuser}}

View File

@@ -2,6 +2,9 @@
var bParam_cmd = "{{$baseurl}}/update/{{$pgtype}}";
{{if $conv_mode}}
var conv_mode = '{{$conv_mode}}';
{{/if}}
var bParam_uid = {{$uid}};
var bParam_gid = {{$gid}};
@@ -18,7 +21,6 @@
var bParam_list = {{$list}};
var bParam_fh = {{$fh}};
var bParam_dm = {{$dm}};
var bParam_static = {{$static}};
var bParam_search = "{{$search}}";
var bParam_xchan = "{{$xchan}}";
@@ -42,7 +44,6 @@
if(bParam_cmax != (-1)) bCmd = bCmd + "&cmax=" + bParam_cmax;
if(bParam_gid != 0) { bCmd = bCmd + "&gid=" + bParam_gid; } else
if(bParam_cid != 0) { bCmd = bCmd + "&cid=" + bParam_cid; }
if(bParam_static != 0) { bCmd = bCmd + "&static=" + bParam_static; }
if(bParam_star != 0) bCmd = bCmd + "&star=" + bParam_star;
if(bParam_liked != 0) bCmd = bCmd + "&liked=" + bParam_liked;
if(bParam_conv!= 0) bCmd = bCmd + "&conv=" + bParam_conv;

View File

@@ -259,7 +259,7 @@
{{/foreach}}
{{/if}}
{{if $item.comment}}
<div class="p-2 wall-item-comment-wrapper{{if $item.children}} wall-item-comment-wrapper-wc{{/if}}" >
<div id="wall-item-comment-wrapper-{{$item.id}}" class="p-2 wall-item-comment-wrapper{{if $item.children}} wall-item-comment-wrapper-wc{{/if}}" >
{{$item.comment}}
</div>
{{/if}}

View File

@@ -9,11 +9,12 @@
{{$plugins}}
<script>
var updateInterval = {{$update_interval}};
var sse_enabled = {{$sse_enabled}};
var localUser = {{if $local_channel}}{{$local_channel}}{{else}}false{{/if}};
var zid = {{if $zid}}'{{$zid}}'{{else}}null{{/if}};
var justifiedGalleryActive = false;
{{if $channel_hash}}var channelHash = '{{$channel_hash}}';{{/if}}
{{if $channel_id}}var channelId = '{{$channel_id}}';{{/if}}{{* Used in e.g. autocomplete *}}
var channelId = {{if $channel_id}}{{$channel_id}}{{else}}false{{/if}};{{* Used in e.g. autocomplete *}}
var preloadImages = {{$preload_images}};
var auto_save_draft = {{$auto_save_draft}};
</script>

View File

@@ -1,7 +1,7 @@
{{if $categories}}
<!--div class="filesavetags"-->
{{foreach $categories as $cat}}
<span class="item-category badge badge-pill badge-danger"><i class="fa fa-folder-o"></i>&nbsp;{{$cat.term}}&nbsp;<a href="{{$cat.removelink}}" class="text-white" title="{{$remove}}"><i class="fa fa-close"></i></a></span>
<span class="item-category badge badge-pill badge-danger"><i class="fa fa-folder-o"></i>&nbsp;{{$cat.term}}&nbsp;<a href="{{$cat.removelink}}" class="text-white" title="{{$remove}}" onClick="itemFilerRm({{$cat.id}}, '{{$cat.term}}'); return false;"><i class="fa fa-close"></i></a></span>
{{/foreach}}
<!--/div-->
{{/if}}

View File

@@ -61,13 +61,11 @@ var activeCommentText = '';
$('#jot-add-option').on('click', jotAddOption);
$(document).on('click', '.poll-option-close', jotRemoveOption);
function jotSetMime() {
var mtype = $('#id_mimetype').val();
if(mtype == 'text/bbcode')
$('#profile-jot-submit-left').show();
else
$('#profile-jot-submit-left').hide();
}
$('#profile-jot-form').keydown(function(e) {
if (e.ctrlKey && e.keyCode === 13) {
$(this).trigger('submit');
}
});
$('#invisible-wall-file-upload').fileupload({
url: 'wall_attach/{{$nickname}}',
@@ -91,11 +89,10 @@ var activeCommentText = '';
$('#wall-file-upload').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;});
$('#wall-file-upload-sub').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;});
// call initialization file
if (window.File && window.FileList && window.FileReader) {
DragDropUploadInit();
}
// call initialization file
if (window.File && window.FileList && window.FileReader) {
DragDropUploadInit();
}
$('#invisible-comment-upload').fileupload({
url: 'wall_attach/{{$nickname}}',
@@ -128,6 +125,14 @@ var activeCommentText = '';
});
function jotSetMime() {
var mtype = $('#id_mimetype').val();
if(mtype == 'text/bbcode')
$('#profile-jot-submit-left').show();
else
$('#profile-jot-submit-left').hide();
}
function deleteCheckedItems() {
var checkedstr = '';
@@ -298,13 +303,9 @@ var activeCommentText = '';
if(reply && reply.length) {
reply = reply.replace('#','');
if(reply.length) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('{{$baseurl}}/tagger/' + id + '?term=' + reply);
if(timer) clearTimeout(timer);
timer = setTimeout(updateInit,3000);
$.get('{{$baseurl}}/tagger/' + id + '?term=' + reply, updateInit);
liking = 1;
}
}
@@ -353,6 +354,13 @@ var activeCommentText = '';
}
function itemFilerRm(id, term) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('{{$baseurl}}/filerm/' + id + '?f=&term=' + term, updateInit);
liking = 1;
}
function itemBookmark(id) {
$.get('{{$baseurl}}/bookmarks?f=&item=' + id);
if(timer) clearTimeout(timer);

View File

@@ -63,7 +63,6 @@
{{include file="field_checkbox.tpl" field=$title_tosource}}
{{include file="field_checkbox.tpl" field=$user_scalable}}
{{include file="field_checkbox.tpl" field=$preload_images}}
{{include file="field_checkbox.tpl" field=$manual_update}}
{{include file="field_checkbox.tpl" field=$start_menu}}
<div class="settings-submit-wrapper" >
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>