From fabcf841c9b4a360e2e496d04775e2ef594cb0e3 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 5 Nov 2018 19:34:10 -0800 Subject: z6 work --- Zotlabs/Lib/Libzot.php | 9 +++++---- Zotlabs/Zot6/Zot6Handler.php | 3 ++- install/schema_mysql.sql | 4 ++++ install/schema_postgres.sql | 4 ++++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 2c726aff4..3d18df051 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -324,11 +324,12 @@ class Libzot { logger('zot-info: ' . print_r($record,true), LOGGER_DATA, LOG_DEBUG); $x = self::import_xchan($record['data'], (($force) ? UPDATE_FLAGS_FORCED : UPDATE_FLAGS_UPDATED)); - +logger('1'); if(! $x['success']) return false; - +logger('2'); if($channel && $record['data']['permissions']) { +logger('3'); $old_read_stream_perm = their_perms_contains($channel['channel_id'],$x['hash'],'view_stream'); set_abconfig($channel['channel_id'],$x['hash'],'system','their_perms',$record['data']['permissions']); @@ -350,7 +351,7 @@ class Libzot { ); if($r) { - +logger('4'); // connection exists // if the dob is the same as what we have stored (disregarding the year), keep the one @@ -2749,7 +2750,7 @@ class Libzot { ]; $ret['channel_role'] = get_pconfig($e['channel_id'],'system','permissions_role','custom'); - $ret['protocols'] = [ 'zot6' ]; + $ret['protocols'] = [ 'zot', 'zot6' ]; $ret['searchable'] = $searchable; $ret['adult_content'] = $adult_channel; $ret['public_forum'] = $public_forum; diff --git a/Zotlabs/Zot6/Zot6Handler.php b/Zotlabs/Zot6/Zot6Handler.php index 5597921cc..6fc82501a 100644 --- a/Zotlabs/Zot6/Zot6Handler.php +++ b/Zotlabs/Zot6/Zot6Handler.php @@ -70,9 +70,10 @@ class Zot6Handler implements IHandler { // This would be a permissions update, typically for one connection foreach ($recipients as $recip) { + $r = q("select channel.*,xchan.* from channel left join xchan on channel_hash = xchan_hash - where channel_hash ='%s' limit 1", + where xchan_hash ='%s' limit 1", dbesc($recip) ); diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index ef7e2a516..088c0414d 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -247,6 +247,7 @@ CREATE TABLE IF NOT EXISTS `channel` ( `channel_guid` char(191) NOT NULL DEFAULT '', `channel_guid_sig` text NOT NULL, `channel_hash` char(191) NOT NULL DEFAULT '', + `channel_portable_id` char(191) NOT NULL DEFAULT '', `channel_timezone` char(128) NOT NULL DEFAULT 'UTC', `channel_location` char(191) NOT NULL DEFAULT '', `channel_theme` char(191) NOT NULL DEFAULT '', @@ -306,6 +307,7 @@ CREATE TABLE IF NOT EXISTS `channel` ( KEY `channel_default_gid` (`channel_default_group`), KEY `channel_guid` (`channel_guid`), KEY `channel_hash` (`channel_hash`), + KEY `channel_portable_id` (`channel_portable_id`), KEY `channel_expire_days` (`channel_expire_days`), KEY `channel_deleted` (`channel_deleted`), KEY `channel_active` (`channel_active`), @@ -1296,6 +1298,7 @@ CREATE TABLE IF NOT EXISTS `vote` ( CREATE TABLE IF NOT EXISTS `xchan` ( `xchan_hash` char(191) NOT NULL, + `xchan_portable_id` char(191) NOT NULL DEFAULT '',, `xchan_guid` char(191) NOT NULL DEFAULT '', `xchan_guid_sig` text NOT NULL, `xchan_pubkey` text NOT NULL, @@ -1322,6 +1325,7 @@ CREATE TABLE IF NOT EXISTS `xchan` ( `xchan_pubforum` tinyint(1) NOT NULL DEFAULT 0 , `xchan_deleted` tinyint(1) NOT NULL DEFAULT 0 , PRIMARY KEY (`xchan_hash`), + KEY `xchan_portable_id` (`xchan_portable_id`), KEY `xchan_guid` (`xchan_guid`), KEY `xchan_addr` (`xchan_addr`), KEY `xchan_name` (`xchan_name`), diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index cb4476628..ec4fb63ad 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -242,6 +242,7 @@ CREATE TABLE "channel" ( "channel_guid" text NOT NULL DEFAULT '', "channel_guid_sig" text NOT NULL, "channel_hash" text NOT NULL DEFAULT '', + "channel_portable_id" text NOT NULL DEFAULT '', "channel_timezone" varchar(128) NOT NULL DEFAULT 'UTC', "channel_location" text NOT NULL DEFAULT '', "channel_theme" text NOT NULL DEFAULT '', @@ -284,6 +285,7 @@ create index "channel_max_friend_req" on channel ("channel_max_friend_req"); create index "channel_default_gid" on channel ("channel_default_group"); create index "channel_guid" on channel ("channel_guid"); create index "channel_hash" on channel ("channel_hash"); +create index "channel_portable_id" on channel ("channel_portable_id"); create index "channel_expire_days" on channel ("channel_expire_days"); create index "channel_deleted" on channel ("channel_deleted"); create index "channel_active" on channel ("channel_active"); @@ -1267,6 +1269,7 @@ create index "vote_poll" on vote ("vote_poll"); create index "vote_element" on vote ("vote_element"); CREATE TABLE "xchan" ( "xchan_hash" text NOT NULL, + "xchan_portable_id" text NOT NULL, "xchan_guid" text NOT NULL DEFAULT '', "xchan_guid_sig" text NOT NULL DEFAULT '', "xchan_pubkey" text NOT NULL DEFAULT '', @@ -1294,6 +1297,7 @@ CREATE TABLE "xchan" ( "xchan_deleted" smallint NOT NULL DEFAULT '0', PRIMARY KEY ("xchan_hash") ); +create index "xchan_portable_id" on xchan ("xchan_portable_id"); create index "xchan_guid" on xchan ("xchan_guid"); create index "xchan_addr" on xchan ("xchan_addr"); create index "xchan_name" on xchan ("xchan_name"); -- cgit v1.2.3 From 3b9aedec5f8445d723e41835ccba6d0add8068c8 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 5 Nov 2018 19:52:30 -0800 Subject: populate new fields --- include/channel.php | 57 ++++++++++++++++++++++++++++++++++++++--------------- include/xchan.php | 6 ++++++ 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/include/channel.php b/include/channel.php index 22cdb9fe7..030efffb9 100644 --- a/include/channel.php +++ b/include/channel.php @@ -10,6 +10,7 @@ use Zotlabs\Access\Permissions; use Zotlabs\Daemon\Master; use Zotlabs\Lib\System; use Zotlabs\Render\Comanche; +use Zotlabs\Lib\Zotlib; require_once('include/zot.php'); require_once('include/crypto.php'); @@ -232,6 +233,7 @@ function create_identity($arr) { $sig = base64url_encode(rsa_sign($guid,$key['prvkey'])); $hash = make_xchan_hash($guid,$sig); + $zhash = Zotlib::make_xchan_hash($guid,$key['pubkey']); // Force a few things on the short term until we can provide a theme or app with choice @@ -265,6 +267,7 @@ function create_identity($arr) { 'channel_guid' => $guid, 'channel_guid_sig' => $sig, 'channel_hash' => $hash, + 'channel_portable_id' => $zhash, 'channel_prvkey' => $key['prvkey'], 'channel_pubkey' => $key['pubkey'], 'channel_pageflags' => intval($pageflags), @@ -345,27 +348,48 @@ function create_identity($arr) { if(! $r) logger('Unable to store hub location'); + $r = hubloc_store_lowlevel( + [ + 'hubloc_guid' => $guid, + 'hubloc_guid_sig' => 'sha256.' . $sig, + 'hubloc_hash' => $zhash, + 'hubloc_addr' => channel_reddress($ret['channel']), + 'hubloc_primary' => intval($primary), + 'hubloc_url' => z_root(), + 'hubloc_url_sig' => 'sha256.' . base64url_encode(rsa_sign(z_root(),$ret['channel']['channel_prvkey'])), + 'hubloc_host' => App::get_hostname(), + 'hubloc_callback' => z_root() . '/zot', + 'hubloc_sitekey' => get_config('system','pubkey'), + 'hubloc_network' => 'zot6', + 'hubloc_updated' => datetime_convert() + ] + ); + if(! $r) + logger('Unable to store hub location'); + + $newuid = $ret['channel']['channel_id']; $r = xchan_store_lowlevel( [ - 'xchan_hash' => $hash, - 'xchan_guid' => $guid, - 'xchan_guid_sig' => $sig, - 'xchan_pubkey' => $key['pubkey'], + 'xchan_hash' => $hash, + 'xchan_portable_id' => $zhash, + 'xchan_guid' => $guid, + 'xchan_guid_sig' => $sig, + 'xchan_pubkey' => $key['pubkey'], 'xchan_photo_mimetype' => (($photo_type) ? $photo_type : 'image/png'), - 'xchan_photo_l' => z_root() . "/photo/profile/l/{$newuid}", - 'xchan_photo_m' => z_root() . "/photo/profile/m/{$newuid}", - 'xchan_photo_s' => z_root() . "/photo/profile/s/{$newuid}", - 'xchan_addr' => channel_reddress($ret['channel']), - 'xchan_url' => z_root() . '/channel/' . $ret['channel']['channel_address'], - 'xchan_follow' => z_root() . '/follow?f=&url=%s', - 'xchan_connurl' => z_root() . '/poco/' . $ret['channel']['channel_address'], - 'xchan_name' => $ret['channel']['channel_name'], - 'xchan_network' => 'zot', - 'xchan_photo_date' => datetime_convert(), - 'xchan_name_date' => datetime_convert(), - 'xchan_system' => $system + 'xchan_photo_l' => z_root() . "/photo/profile/l/{$newuid}", + 'xchan_photo_m' => z_root() . "/photo/profile/m/{$newuid}", + 'xchan_photo_s' => z_root() . "/photo/profile/s/{$newuid}", + 'xchan_addr' => channel_reddress($ret['channel']), + 'xchan_url' => z_root() . '/channel/' . $ret['channel']['channel_address'], + 'xchan_follow' => z_root() . '/follow?f=&url=%s', + 'xchan_connurl' => z_root() . '/poco/' . $ret['channel']['channel_address'], + 'xchan_name' => $ret['channel']['channel_name'], + 'xchan_network' => 'zot', + 'xchan_photo_date' => datetime_convert(), + 'xchan_name_date' => datetime_convert(), + 'xchan_system' => $system ] ); @@ -2355,6 +2379,7 @@ function channel_store_lowlevel($arr) { 'channel_guid' => ((array_key_exists('channel_guid',$arr)) ? $arr['channel_guid'] : ''), 'channel_guid_sig' => ((array_key_exists('channel_guid_sig',$arr)) ? $arr['channel_guid_sig'] : ''), 'channel_hash' => ((array_key_exists('channel_hash',$arr)) ? $arr['channel_hash'] : ''), + 'channel_portable_id' => ((array_key_exists('channel_portable_id',$arr)) ? $arr['channel_portable_id'] : ''), 'channel_timezone' => ((array_key_exists('channel_timezone',$arr)) ? $arr['channel_timezone'] : 'UTC'), 'channel_location' => ((array_key_exists('channel_location',$arr)) ? $arr['channel_location'] : ''), 'channel_theme' => ((array_key_exists('channel_theme',$arr)) ? $arr['channel_theme'] : ''), diff --git a/include/xchan.php b/include/xchan.php index eb5f1b4a3..5516d046f 100644 --- a/include/xchan.php +++ b/include/xchan.php @@ -5,8 +5,14 @@ use Zotlabs\Zot6\HTTPSig; function xchan_store_lowlevel($arr) { + if(! $arr['xchan_hash']) { + logger('No xchan_hash'); + return false; + } + $store = [ 'xchan_hash' => ((array_key_exists('xchan_hash',$arr)) ? $arr['xchan_hash'] : ''), + 'xchan_portable_id' => ((array_key_exists('xchan_portable_id',$arr)) ? $arr['xchan_portable_id'] : ''), 'xchan_guid' => ((array_key_exists('xchan_guid',$arr)) ? $arr['xchan_guid'] : ''), 'xchan_guid_sig' => ((array_key_exists('xchan_guid_sig',$arr)) ? $arr['xchan_guid_sig'] : ''), 'xchan_pubkey' => ((array_key_exists('xchan_pubkey',$arr)) ? $arr['xchan_pubkey'] : ''), -- cgit v1.2.3 From e7f1d350c92bb2be87adefd33ab877ef6e121af2 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 5 Nov 2018 21:29:26 -0800 Subject: more zot6 work --- Zotlabs/Zot6/HTTPSig.php | 44 ++++++++++++++++++++++++++++++++++---------- Zotlabs/Zot6/Zot6Handler.php | 17 +++++++++-------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/Zotlabs/Zot6/HTTPSig.php b/Zotlabs/Zot6/HTTPSig.php index a0f0d3500..f5c59f9d6 100644 --- a/Zotlabs/Zot6/HTTPSig.php +++ b/Zotlabs/Zot6/HTTPSig.php @@ -215,14 +215,19 @@ class HTTPSig { */ function get_activitystreams_key($id) { - - $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", + $x = q("select * from xchan left join hubloc on xchan_portable_id = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", dbesc(str_replace('acct:','',$id)), dbesc($id) ); + if(! $x) { + $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", + dbesc(str_replace('acct:','',$id)), + dbesc($id) + ); + } if($x && $x[0]['xchan_pubkey']) { - return [ 'portable_id' => $x[0]['xchan_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; + return [ 'portable_id' => $x[0]['hubloc_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; } $r = ActivityStreams::fetch_property($id); @@ -235,19 +240,25 @@ class HTTPSig { } } - return false; + return false; } function get_webfinger_key($id) { - $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", + $x = q("select * from xchan left join hubloc on xchan_portable_id = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", dbesc(str_replace('acct:','',$id)), dbesc($id) ); + if(! $x) { + $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", + dbesc(str_replace('acct:','',$id)), + dbesc($id) + ); + } if($x && $x[0]['xchan_pubkey']) { - return [ 'portable_id' => $x[0]['xchan_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; + return [ 'portable_id' => $x[0]['hubloc_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; } $wf = Webfinger::exec($id); @@ -269,18 +280,26 @@ class HTTPSig { } } - return (($key['public_key']) ? $key : false); + 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' limit 1", + $x = q("select * from xchan left join hubloc on xchan_portable_id = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", dbesc(str_replace('acct:','',$id)), dbesc($id) ); + if(! $x) { + $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", + dbesc(str_replace('acct:','',$id)), + dbesc($id) + ); + } + + if($x && $x[0]['xchan_pubkey']) { - return [ 'portable_id' => $x[0]['xchan_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; + return [ 'portable_id' => $x[0]['hubloc_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; } $wf = Webfinger::exec($id); @@ -302,9 +321,14 @@ class HTTPSig { 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_portable_id = hubloc_hash where hubloc_id_url = '%s' limit 1", dbesc($l['href']) ); + if(! $x) { + $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_id_url = '%s' limit 1", + dbesc($l['href']) + ); + } if($x) { $key['hubloc'] = $x[0]; } diff --git a/Zotlabs/Zot6/Zot6Handler.php b/Zotlabs/Zot6/Zot6Handler.php index 6fc82501a..1fae81ae6 100644 --- a/Zotlabs/Zot6/Zot6Handler.php +++ b/Zotlabs/Zot6/Zot6Handler.php @@ -72,8 +72,8 @@ class Zot6Handler implements IHandler { foreach ($recipients as $recip) { $r = q("select channel.*,xchan.* from channel - left join xchan on channel_hash = xchan_hash - where xchan_hash ='%s' limit 1", + left join xchan on channel_portable_id = xchan_portable_id + where xchan_portable_id ='%s' limit 1", dbesc($recip) ); @@ -141,7 +141,7 @@ class Zot6Handler implements IHandler { $arr = $data['recipients'][0]; - $c = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_hash = '%s' limit 1", + $c = q("select * from channel left join xchan on channel_portable_id = xchan_portable_id where channel_portable_id = '%s' limit 1", dbesc($arr['portable_id']) ); if (! $c) { @@ -197,7 +197,7 @@ class Zot6Handler implements IHandler { return $ret; } - $r = q("select * from xchan where xchan_hash = '%s' limit 1", + $r = q("select * from xchan where xchan_hash = '%s' or xchan_portable_id = '%s' limit 1", dbesc($sender) ); @@ -231,14 +231,15 @@ class Zot6Handler implements IHandler { // basically this means "unfriend" foreach ($recipients as $recip) { $r = q("select channel.*,xchan.* from channel - left join xchan on channel_hash = xchan_hash - where channel_hash = '%s' and channel_guid_sig = '%s' limit 1", + left join xchan on channel_portable_id = xchan_portable_id + where channel_portable_id = '%s' limit 1", dbesc($recip) ); if ($r) { - $r = q("select abook_id from abook where uid = %d and abook_xchan = '%s' limit 1", + $r = q("select abook_id from abook where uid = %d and (abook_xchan = '%s' or abook_xchan = '%s') limit 1", intval($r[0]['channel_id']), - dbesc($sender) + dbesc($sender), + dbesc($r[0]['xchan_portable_id']) ); if ($r) { contact_remove($r[0]['channel_id'],$r[0]['abook_id']); -- cgit v1.2.3 From bb8b3b92913832750a393533f491725b4330a8e1 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 6 Nov 2018 20:44:40 -0800 Subject: this is brutal --- Zotlabs/Lib/ActivityStreams.php | 191 +++++++++++++++++++++++++++++++++++----- Zotlabs/Lib/JSalmon.php | 50 +++++++++-- Zotlabs/Lib/Libzot.php | 74 +++++++++------- Zotlabs/Lib/Zotfinger.php | 23 +++-- Zotlabs/Module/Channel.php | 44 +++++++++ Zotlabs/Zot6/HTTPSig.php | 90 ++++++++++--------- Zotlabs/Zot6/Receiver.php | 2 +- Zotlabs/Zot6/Zot6Handler.php | 15 ++-- include/channel.php | 31 ++++++- include/xchan.php | 1 - 10 files changed, 397 insertions(+), 124 deletions(-) diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index 37e717f58..a322637fd 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -7,22 +7,25 @@ namespace Zotlabs\Lib; * * Parses an ActivityStream JSON string. */ + class ActivityStreams { - public $raw = null; - public $data; - public $valid = false; - public $id = ''; - public $type = ''; - public $actor = null; - public $obj = null; - public $tgt = null; - public $origin = null; - public $owner = null; - public $signer = null; - public $ldsig = null; - public $sigok = false; - public $recips = null; + public $raw = null; + public $data = null; + public $valid = false; + public $deleted = false; + public $id = ''; + public $parent_id = ''; + public $type = ''; + public $actor = null; + public $obj = null; + public $tgt = null; + public $origin = null; + public $owner = null; + public $signer = null; + public $ldsig = null; + public $sigok = false; + public $recips = null; public $raw_recips = null; /** @@ -35,16 +38,49 @@ class ActivityStreams { function __construct($string) { $this->raw = $string; - $this->data = json_decode($string, true); + + if(is_array($string)) { + $this->data = $string; + } + else { + $this->data = json_decode($string, true); + } if($this->data) { + + // verify and unpack JSalmon signature if present + + if(is_array($this->data) && array_key_exists('signed',$this->data)) { + $ret = JSalmon::verify($this->data); + $tmp = JSalmon::unpack($this->data['data']); + if($ret && $ret['success']) { + if($ret['signer']) { + $saved = json_encode($this->data,JSON_UNESCAPED_SLASHES); + $this->data = $tmp; + $this->data['signer'] = $ret['signer']; + $this->data['signed_data'] = $saved; + if($ret['hubloc']) { + $this->data['hubloc'] = $ret['hubloc']; + } + } + } + } + $this->valid = true; + + if(array_key_exists('type',$this->data) && array_key_exists('actor',$this->data) && array_key_exists('object',$this->data)) { + if($this->data['type'] === 'Delete' && $this->data['actor'] === $this->data['object']) { + $this->deleted = $this->data['actor']; + $this->valid = false; + } + } + } if($this->is_valid()) { $this->id = $this->get_property_obj('id'); $this->type = $this->get_primary_type(); - $this->actor = $this->get_compound_property('actor'); + $this->actor = $this->get_actor('actor','',''); $this->obj = $this->get_compound_property('object'); $this->tgt = $this->get_compound_property('target'); $this->origin = $this->get_compound_property('origin'); @@ -53,14 +89,31 @@ class ActivityStreams { $this->ldsig = $this->get_compound_property('signature'); if($this->ldsig) { $this->signer = $this->get_compound_property('creator',$this->ldsig); - if($this->signer && $this->signer['publicKey'] && $this->signer['publicKey']['publicKeyPem']) { - $this->sigok = \Zotlabs\Lib\LDSignatures::verify($this->data,$this->signer['publicKey']['publicKeyPem']); + if($this->signer && is_array($this->signer) && array_key_exists('publicKey',$this->signer) && is_array($this->signer['publicKey']) && $this->signer['publicKey']['publicKeyPem']) { + $this->sigok = LDSignatures::verify($this->data,$this->signer['publicKey']['publicKeyPem']); } } - if(($this->type === 'Note') && (! $this->obj)) { + if(! $this->obj) { $this->obj = $this->data; $this->type = 'Create'; + if(! $this->actor) { + $this->actor = $this->get_actor('attributedTo',$this->obj); + } + } + + if($this->obj && is_array($this->obj) && $this->obj['actor']) + $this->obj['actor'] = $this->get_actor('actor',$this->obj); + if($this->tgt && is_array($this->tgt) && $this->tgt['actor']) + $this->tgt['actor'] = $this->get_actor('actor',$this->tgt); + + $this->parent_id = $this->get_property_obj('inReplyTo'); + + if((! $this->parent_id) && is_array($this->obj)) { + $this->parent_id = $this->obj['inReplyTo']; + } + if((! $this->parent_id) && is_array($this->obj)) { + $this->parent_id = $this->obj['id']; } } } @@ -190,44 +243,122 @@ class ActivityStreams { $base = (($base) ? $base : $this->data); $propname = (($prefix) ? $prefix . ':' : '') . $property; + if(! is_array($base)) { + btlogger('not an array: ' . print_r($base,true)); + return null; + } + return ((array_key_exists($propname, $base)) ? $base[$propname] : null); } + /** * @brief Fetches a property from an URL. * * @param string $url * @return NULL|mixed */ + function fetch_property($url) { + return self::fetch($url); + } + + static function fetch($url) { $redirects = 0; if(! check_siteallowed($url)) { logger('blacklisted: ' . $url); return null; } - + logger('fetch: ' . $url, LOGGER_DEBUG); $x = z_fetch_url($url, true, $redirects, - ['headers' => [ 'Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ]]); - if($x['success']) + [ 'headers' => [ 'Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ]]); + if($x['success']) { + $y = json_decode($x['body'],true); + logger('returned: ' . json_encode($y,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES)); return json_decode($x['body'], true); + } + else { + logger('fetch failed: ' . $url); + } + return null; + } + + static function is_an_actor($s) { + return(in_array($s,[ 'Application','Group','Service','Person','Service' ])); + } + + /** + * @brief + * + * @param string $property + * @param array $base + * @param string $namespace (optional) default empty + * @return NULL|mixed + */ + + function get_actor($property,$base='',$namespace = '') { + $x = $this->get_property_obj($property, $base, $namespace); + if($this->is_url($x)) { + + // SECURITY: If we have already stored the actor profile, re-generate it + // from cached data - don't refetch it from the network + $r = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_id_url = '%s' limit 1", + dbesc($x) + ); + if($r) { + $y = Activity::encode_person($r[0]); + $y['cached'] = true; + return $y; + } + } + $actor = $this->get_compound_property($property,$base,$namespace,true); + if(is_array($actor) && self::is_an_actor($actor['type'])) { + if(array_key_exists('id',$actor) && (! array_key_exists('inbox',$actor))) { + $actor = $this->fetch_property($actor['id']); + } + return $actor; + } return null; } + /** * @brief * * @param string $property * @param array $base * @param string $namespace (optional) default empty + * @param boolean $first (optional) default false, if true and result is a sequential array return only the first element * @return NULL|mixed */ - function get_compound_property($property, $base = '', $namespace = '') { + function get_compound_property($property, $base = '', $namespace = '', $first = false) { $x = $this->get_property_obj($property, $base, $namespace); if($this->is_url($x)) { $x = $this->fetch_property($x); } + // verify and unpack JSalmon signature if present + + if(is_array($x) && array_key_exists('signed',$x)) { + $ret = JSalmon::verify($x); + $tmp = JSalmon::unpack($x['data']); + if($ret && $ret['success']) { + if($ret['signer']) { + $saved = json_encode($x,JSON_UNESCAPED_SLASHES); + $x = $tmp; + $x['signer'] = $ret['signer']; + $x['signed_data'] = $saved; + if($ret['hubloc']) { + $x['hubloc'] = $ret['hubloc']; + } + } + } + } + if($first && is_array($x) && array_key_exists(0,$x)) { + return $x[0]; + } + return $x; } @@ -273,4 +404,18 @@ class ActivityStreams { return $x; } + + static function is_as_request() { + + $x = getBestSupportedMimeType([ + 'application/ld+json;profile="https://www.w3.org/ns/activitystreams"', + 'application/activity+json', + 'application/ld+json;profile="http://www.w3.org/ns/activitystreams"' + ]); + + return(($x) ? true : false); + + } + + } \ No newline at end of file diff --git a/Zotlabs/Lib/JSalmon.php b/Zotlabs/Lib/JSalmon.php index 43d5f9d09..f35bf6235 100644 --- a/Zotlabs/Lib/JSalmon.php +++ b/Zotlabs/Lib/JSalmon.php @@ -2,15 +2,13 @@ namespace Zotlabs\Lib; +use Zotlabs\Zot6\HTTPSig; class JSalmon { - static function sign($data,$key_id,$key) { + static function sign($data,$key_id,$key,$data_type = 'application/x-zot+json') { - $arr = $data; - $data = json_encode($data,JSON_UNESCAPED_SLASHES); - $data = base64url_encode($data, false); // do not strip padding - $data_type = 'application/x-zot+json'; + $data = base64url_encode(json_encode($data,true),true); // strip padding $encoding = 'base64url'; $algorithm = 'RSA-SHA256'; @@ -18,9 +16,9 @@ class JSalmon { // precomputed base64url encoding of data_type, encoding, algorithm concatenated with periods - $precomputed = '.' . base64url_encode($data_type,false) . '.YmFzZTY0dXJs.UlNBLVNIQTI1Ng=='; + $precomputed = '.' . base64url_encode($data_type,true) . '.YmFzZTY0dXJs.UlNBLVNIQTI1Ng'; - $signature = base64url_encode(rsa_sign($data . $precomputed, $key), false); + $signature = base64url_encode(rsa_sign($data . $precomputed, $key), true); return ([ 'signed' => true, @@ -30,9 +28,45 @@ class JSalmon { 'alg' => $algorithm, 'sigs' => [ 'value' => $signature, - 'key_id' => base64url_encode($key_id) + 'key_id' => base64url_encode($key_id, true) ] ]); } + + static function verify($x) { + + logger('verify'); + $ret = [ 'results' => [] ]; + + if(! is_array($x)) { + return $false; + } + if(! ( array_key_exists('signed',$x) && $x['signed'])) { + return $false; + } + + $signed_data = preg_replace('/\s+/','',$x['data']) . '.' + . base64url_encode($x['data_type'],true) . '.' + . base64url_encode($x['encoding'],true) . '.' + . base64url_encode($x['alg'],true); + + $key = HTTPSig::get_key(EMPTY_STR,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'])) { + logger('verified'); + $ret = [ 'success' => true, 'signer' => $key['portable_id'], 'hubloc' => $key['hubloc'] ]; + } + } + + return $ret; + + } + + static function unpack($data) { + return json_decode(base64url_decode($data),true); + } + + } \ No newline at end of file diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 3d18df051..23703a040 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -109,7 +109,7 @@ class Libzot { $data = [ 'type' => $type, 'encoding' => $encoding, - 'sender' => $channel['channel_hash'], + 'sender' => $channel['channel_portable_id'], 'site_id' => self::make_xchan_hash(z_root(), get_config('system','pubkey')), 'version' => System::get_zot_revision(), ]; @@ -324,14 +324,19 @@ class Libzot { logger('zot-info: ' . print_r($record,true), LOGGER_DATA, LOG_DEBUG); $x = self::import_xchan($record['data'], (($force) ? UPDATE_FLAGS_FORCED : UPDATE_FLAGS_UPDATED)); -logger('1'); + if(! $x['success']) return false; -logger('2'); + if($channel && $record['data']['permissions']) { -logger('3'); - $old_read_stream_perm = their_perms_contains($channel['channel_id'],$x['hash'],'view_stream'); - set_abconfig($channel['channel_id'],$x['hash'],'system','their_perms',$record['data']['permissions']); + $permissions = explode(',',$record['data']['permissions']); + if($permissions && is_array($permissions)) { + $old_read_stream_perm = get_abconfig($channel['channel_id'],$x['hash'],'their_perms','view_stream'); + + foreach($permissions as $k => $v) { + set_abconfig($channel['channel_id'],$x['hash'],'their_perms',$k,$v); + } + } if(array_key_exists('profile',$record['data']) && array_key_exists('next_birthday',$record['data']['profile'])) { $next_birthday = datetime_convert('UTC','UTC',$record['data']['profile']['next_birthday']); @@ -380,14 +385,16 @@ logger('4'); else { $p = Permissions::connect_perms($channel['channel_id']); - $my_perms = Permissions::serialise($p['perms']); + $my_perms = $p['perms']; $automatic = $p['automatic']; // new connection if($my_perms) { - set_abconfig($channel['channel_id'],$x['hash'],'system','my_perms',$my_perms); + foreach($my_perms as $k => $v) { + set_abconfig($channel['channel_id'],$x['hash'],'my_perms',$k,$v); + } } $closeness = get_pconfig($channel['channel_id'],'system','new_abook_closeness'); @@ -410,7 +417,7 @@ logger('4'); if($y) { logger("New introduction received for {$channel['channel_name']}"); - $new_perms = get_all_perms($channel['channel_id'],$x['hash']); + $new_perms = get_all_perms($channel['channel_id'],$x['hash'],false); // Send a clone sync packet and a permissions update if permissions have changed @@ -426,7 +433,7 @@ logger('4'); [ 'type' => NOTIFY_INTRO, 'from_xchan' => $x['hash'], - 'to_xchan' => $channel['channel_hash'], + 'to_xchan' => $channel['channel_portable_id'], 'link' => z_root() . '/connedit/' . $new_connection[0]['abook_id'] ] ); @@ -777,7 +784,7 @@ logger('4'); // see if this is a channel clone that's hosted locally - which we treat different from other xchans/connections - $local = q("select channel_account_id, channel_id from channel where channel_hash = '%s' limit 1", + $local = q("select channel_account_id, channel_id from channel where channel_portable_id = '%s' limit 1", dbesc($xchan_hash) ); if($local) { @@ -1130,7 +1137,7 @@ logger('4'); if($recip_arr) { stringify_array_elms($recip_arr,true); $recips = implode(',',$recip_arr); - $r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) and channel_removed = 0 "); + $r = q("select channel_portable_id as hash from channel where channel_portable_id in ( " . $recips . " ) and channel_removed = 0 "); } if(! $r) { @@ -1304,12 +1311,12 @@ logger('4'); $r = []; - $c = q("select channel_id, channel_hash from channel where channel_removed = 0"); + $c = q("select channel_id, channel_portable_id from channel where channel_removed = 0"); if($c) { foreach($c as $cc) { if(perm_is_allowed($cc['channel_id'],$msg['sender'],$perm)) { - $r[] = $cc['channel_hash']; + $r[] = $cc['channel_portable_id']; } } } @@ -1317,7 +1324,7 @@ logger('4'); if($include_sys) { $sys = get_sys_channel(); if($sys) - $r[] = $sys['channel_hash']; + $r[] = $sys['channel_portable_id']; } @@ -1333,7 +1340,7 @@ logger('4'); if($tag['type'] === 'Mention' && (strpos($tag['href'],z_root()) !== false)) { $address = basename($tag['href']); if($address) { - $z = q("select channel_hash as hash from channel where channel_address = '%s' + $z = q("select channel_portable_id as hash from channel where channel_address = '%s' and channel_removed = 0 limit 1", dbesc($address) ); @@ -1354,7 +1361,7 @@ logger('4'); $thread_parent = self::find_parent($msg,$act); if($thread_parent) { - $z = q("select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = '%s' OR item.parent_mid = '%s' ) ", + $z = q("select channel_portable_id as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = '%s' OR item.parent_mid = '%s' ) ", dbesc($thread_parent), dbesc($thread_parent) ); @@ -1428,7 +1435,7 @@ logger('4'); * access checks. */ - if($sender === $channel['channel_hash'] && $arr['author_xchan'] === $channel['channel_hash'] && $arr['mid'] === $arr['parent_mid']) { + if($sender === $channel['channel_portable_id'] && $arr['author_xchan'] === $channel['channel_portable_id'] && $arr['mid'] === $arr['parent_mid']) { $DR->update('self delivery ignored'); $result[] = $DR->get(); continue; @@ -1710,7 +1717,7 @@ logger('4'); $stored = (($item_result && $item_result['item']) ? $item_result['item'] : false); if((is_array($stored)) && ($stored['id'] != $stored['parent']) - && ($stored['author_xchan'] === $channel['channel_hash'])) { + && ($stored['author_xchan'] === $channel['channel_hash'] || $stored['author_xchan'] === $channel['channel_portable_id'])) { retain_item($stored['item']['parent']); } @@ -1810,9 +1817,9 @@ logger('4'); } logger('FOF Activity received: ' . print_r($arr,true), LOGGER_DATA, LOG_DEBUG); - logger('FOF Activity recipient: ' . $channel['channel_hash'], LOGGER_DATA, LOG_DEBUG); + logger('FOF Activity recipient: ' . $channel['channel_portable_id'], LOGGER_DATA, LOG_DEBUG); - $result = self::process_delivery($arr['owner_xchan'],$arr, [ $channel['channel_hash'] ],false,false,true); + $result = self::process_delivery($arr['owner_xchan'],$arr, [ $channel['channel_portable_id'] ],false,false,true); if ($result) { $ret = array_merge($ret, $result); } @@ -2048,7 +2055,7 @@ logger('4'); $DR = new DReport(z_root(),$sender,$d,$arr['mid']); - $r = q("select * from channel where channel_hash = '%s' limit 1", + $r = q("select * from channel where channel_portable_id = '%s' limit 1", dbesc($d['hash']) ); @@ -2203,7 +2210,7 @@ logger('4'); $loc = $locations[0]; - $r = q("select * from channel where channel_hash = '%s' limit 1", + $r = q("select * from channel where channel_portable_id = '%s' limit 1", dbesc($sender_hash) ); @@ -2211,7 +2218,7 @@ logger('4'); return; if($loc['url'] !== z_root()) { - $x = q("update channel set channel_moved = '%s' where channel_hash = '%s' limit 1", + $x = q("update channel set channel_moved = '%s' where channel_portable_id = '%s' limit 1", dbesc($loc['url']), dbesc($sender_hash) ); @@ -2247,7 +2254,7 @@ logger('4'); static function encode_locations($channel) { $ret = []; - $x = self::get_hublocs($channel['channel_hash']); + $x = self::get_hublocs($channel['channel_portable_id']); if($x && count($x)) { foreach($x as $hub) { @@ -2558,6 +2565,9 @@ logger('4'); static function zotinfo($arr) { + logger('arr: ' . print_r($arr,true)); + + $ret = []; $zhash = ((x($arr,'guid_hash')) ? $arr['guid_hash'] : ''); @@ -2594,13 +2604,13 @@ logger('4'); $r = null; if(strlen($zhash)) { - $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash - where channel_hash = '%s' limit 1", + $r = q("select channel.*, xchan.* from channel left join xchan on channel_portable_id = xchan_hash + where channel_portable_id = '%s' limit 1", dbesc($zhash) ); } elseif(strlen($zguid) && strlen($zguid_sig)) { - $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash + $r = q("select channel.*, xchan.* from channel left join xchan on channel_portable_id = xchan_hash where channel_guid = '%s' and channel_guid_sig = '%s' limit 1", dbesc($zguid), dbesc($zguid_sig) @@ -2608,7 +2618,7 @@ logger('4'); } elseif(strlen($zaddr)) { if(strpos($zaddr,'[system]') === false) { /* normal address lookup */ - $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash + $r = q("select channel.*, xchan.* from channel left join xchan on channel_portable_id = xchan_hash where ( channel_address = '%s' or xchan_addr = '%s' ) limit 1", dbesc($zaddr), dbesc($zaddr) @@ -2628,10 +2638,10 @@ logger('4'); * */ - $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash + $r = q("select channel.*, xchan.* from channel left join xchan on channel_portable_id = xchan_hash where channel_system = 1 order by channel_id limit 1"); if(! $r) { - $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash + $r = q("select channel.*, xchan.* from channel left join xchan on channel_portable_id = xchan_hash where channel_removed = 0 order by channel_id limit 1"); } } @@ -2775,7 +2785,7 @@ logger('4'); if(! $ret['follow_url']) $ret['follow_url'] = z_root() . '/follow?f=&url=%s'; - $permissions = get_all_perms($e['channel_id'],$ztarget_hash,false); + $permissions = get_all_perms($e['channel_id'],$ztarget_hash,false,false); if($ztarget_hash) { $permissions['connected'] = false; diff --git a/Zotlabs/Lib/Zotfinger.php b/Zotlabs/Lib/Zotfinger.php index 537e440d4..d094fdc8d 100644 --- a/Zotlabs/Lib/Zotfinger.php +++ b/Zotlabs/Lib/Zotfinger.php @@ -2,7 +2,7 @@ namespace Zotlabs\Lib; -use Zotlabs\Web\HTTPSig; +use Zotlabs\Zot6\HTTPSig; class Zotfinger { @@ -12,10 +12,19 @@ class Zotfinger { return false; } - if($channel) { + $m = parse_url($resource); + + $data = json_encode([ 'zot_token' => random_string() ]); + + if($channel && $m) { + $headers = [ - 'Accept' => 'application/x-zot+json', - 'X-Zot-Token' => random_string(), + 'Accept' => 'application/x-zot+json', + 'Content-Type' => 'application/x-zot+json', + 'X-Zot-Token' => random_string(), + 'Digest' => HTTPSig::generate_digest_header($data), + 'Host' => $m['host'], + '(request-target)' => 'post ' . get_request_string($resource) ]; $h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),false); } @@ -27,7 +36,9 @@ class Zotfinger { $redirects = 0; - $x = z_fetch_url($resource,false,$redirects, [ 'headers' => $h ] ); + $x = z_post_url($resource,$data,$redirects, [ 'headers' => $h ] ); + + logger('fetch: ' . print_r($x,true)); if($x['success']) { @@ -39,6 +50,8 @@ class Zotfinger { $result['data'] = json_decode(crypto_unencapsulate($result['data'],get_config('system','prvkey')),true); } + logger('decrypted: ' . print_r($result,true)); + return $result; } diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index f1537ed15..12d87885f 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -6,6 +6,8 @@ namespace Zotlabs\Module; use App; use Zotlabs\Web\Controller; use Zotlabs\Lib\PermissionDescription; +use Zotlabs\Zot6\HTTPSig; +use Zotlabs\Lib\Libzot; require_once('include/items.php'); require_once('include/security.php'); @@ -43,6 +45,48 @@ class Channel extends Controller { $profile = 0; $channel = App::get_channel(); + if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { + $which = $channel['channel_address']; + $profile = argv(1); + } + + $channel = channelx_by_nick($which); + if(! $channel) { + http_status_exit(404, 'Not found'); + } + + // handle zot6 channel discovery + + if(Libzot::is_zot_request()) { + + $sigdata = HTTPSig::verify(file_get_contents('php://input')); + + if($sigdata && $sigdata['signer'] && $sigdata['header_valid']) { + $data = json_encode(Libzot::zotinfo([ 'address' => $channel['channel_address'], 'target_url' => $sigdata['signer'] ])); + $s = q("select site_crypto, hubloc_sitekey from site left join hubloc on hubloc_url = site_url where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", + dbesc($sigdata['signer']) + ); + + if($s) { + $data = json_encode(crypto_encapsulate($data,$s[0]['hubloc_sitekey'],Libzot::best_algorithm($s[0]['site_crypto']))); + } + } + else { + $data = json_encode(Libzot::zotinfo([ 'address' => $channel['channel_address'] ])); + } + + $headers = [ + 'Content-Type' => 'application/x-zot+json', + 'Digest' => HTTPSig::generate_digest_header($data), + '(request-target)' => strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI'] + ]; + $h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel)); + HTTPSig::set_headers($h); + echo $data; + killme(); + } + + if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { $which = $channel['channel_address']; $profile = argv(1); diff --git a/Zotlabs/Zot6/HTTPSig.php b/Zotlabs/Zot6/HTTPSig.php index f5c59f9d6..6d52e5033 100644 --- a/Zotlabs/Zot6/HTTPSig.php +++ b/Zotlabs/Zot6/HTTPSig.php @@ -48,12 +48,14 @@ class HTTPSig { $h = new HTTPHeaders($data['header']); $headers = $h->fetcharr(); $body = $data['body']; + $headers['(request-target)'] = $data['request_target']; } else { $headers = []; $headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI']; $headers['content-type'] = $_SERVER['CONTENT_TYPE']; + $headers['content-length'] = $_SERVER['CONTENT_LENGTH']; foreach($_SERVER as $k => $v) { if(strpos($k,'HTTP_') === 0) { @@ -121,6 +123,17 @@ class HTTPSig { if(array_key_exists($h,$headers)) { $signed_data .= $h . ': ' . $headers[$h] . "\n"; } + if($h === 'date') { + $d = new \DateTime($headers[$h]); + $d->setTimeZone(new \DateTimeZone('UTC')); + $dplus = datetime_convert('UTC','UTC','now + 1 day'); + $dminus = datetime_convert('UTC','UTC','now - 1 day'); + $c = $d->format('Y-m-d H:i:s'); + if($c > $dplus || $c < $dminus) { + logger('bad time: ' . $c); + return $result; + } + } } $signed_data = rtrim($signed_data,"\n"); @@ -147,8 +160,15 @@ class HTTPSig { logger('verified: ' . $x, LOGGER_DEBUG); - if(! $x) + if(! $x) { + logger('verify failed for ' . $result['signer'] . ' alg=' . $algorithm . (($key['public_key']) ? '' : ' no key')); + $sig_block['signature'] = base64url_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; + } $result['portable_id'] = $key['portable_id']; $result['header_valid'] = true; @@ -180,7 +200,9 @@ class HTTPSig { return [ 'public_key' => $key ]; } - $key = self::get_webfinger_key($id); + if(strpos($id,'#') === false) { + $key = self::get_webfinger_key($id); + } if(! $key) { $key = self::get_activitystreams_key($id); @@ -215,50 +237,43 @@ class HTTPSig { */ function get_activitystreams_key($id) { - $x = q("select * from xchan left join hubloc on xchan_portable_id = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", - dbesc(str_replace('acct:','',$id)), - dbesc($id) + + // remove fragment + + $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' limit 1", + dbesc(str_replace('acct:','',$url)), + dbesc($url) ); - if(! $x) { - $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", - dbesc(str_replace('acct:','',$id)), - dbesc($id) - ); - } if($x && $x[0]['xchan_pubkey']) { - return [ 'portable_id' => $x[0]['hubloc_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; + return [ 'portable_id' => $x[0]['xchan_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; } - $r = ActivityStreams::fetch_property($id); + $r = ActivityStreams::fetch($id); if($r) { - if(array_key_exists('publicKey',$j) && array_key_exists('publicKeyPem',$j['publicKey']) && array_key_exists('id',$j['publicKey'])) { - if($j['publicKey']['id'] === $id || $j['id'] === $id) { - return [ 'public_key' => self::convertKey($j['publicKey']['publicKeyPem']), 'portable_id' => '', 'hubloc' => [] ]; + if(array_key_exists('publicKey',$r) && array_key_exists('publicKeyPem',$r['publicKey']) && array_key_exists('id',$r['publicKey'])) { + if($r['publicKey']['id'] === $id || $r['id'] === $id) { + $portable_id = ((array_key_exists('owner',$r['publicKey'])) ? $r['publicKey']['owner'] : EMPTY_STR); + return [ 'public_key' => self::convertKey($r['publicKey']['publicKeyPem']), 'portable_id' => $portable_id, 'hubloc' => [] ]; } } } - - return false; + return false; } function get_webfinger_key($id) { - $x = q("select * from xchan left join hubloc on xchan_portable_id = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", + $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", dbesc(str_replace('acct:','',$id)), dbesc($id) ); - if(! $x) { - $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", - dbesc(str_replace('acct:','',$id)), - dbesc($id) - ); - } if($x && $x[0]['xchan_pubkey']) { - return [ 'portable_id' => $x[0]['hubloc_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; + return [ 'portable_id' => $x[0]['xchan_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; } $wf = Webfinger::exec($id); @@ -280,26 +295,18 @@ class HTTPSig { } } - return (($key['public_key']) ? $key : false); + return (($key['public_key']) ? $key : false); } function get_zotfinger_key($id) { - $x = q("select * from xchan left join hubloc on xchan_portable_id = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", + $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", dbesc(str_replace('acct:','',$id)), dbesc($id) ); - if(! $x) { - $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1", - dbesc(str_replace('acct:','',$id)), - dbesc($id) - ); - } - - if($x && $x[0]['xchan_pubkey']) { - return [ 'portable_id' => $x[0]['hubloc_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; + return [ 'portable_id' => $x[0]['xchan_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ]; } $wf = Webfinger::exec($id); @@ -321,14 +328,9 @@ class HTTPSig { if($i['success']) { $key['portable_id'] = $i['hash']; - $x = q("select * from xchan left join hubloc on xchan_portable_id = 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' limit 1", dbesc($l['href']) ); - if(! $x) { - $x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_id_url = '%s' limit 1", - dbesc($l['href']) - ); - } if($x) { $key['hubloc'] = $x[0]; } @@ -433,6 +435,8 @@ class HTTPSig { $headers = ''; $fields = ''; + logger('signing: ' . print_r($head,true), LOGGER_DATA); + if($head) { foreach($head as $k => $v) { $headers .= strtolower($k) . ': ' . trim($v) . "\n"; diff --git a/Zotlabs/Zot6/Receiver.php b/Zotlabs/Zot6/Receiver.php index 4f26e2b0c..66559c9a5 100644 --- a/Zotlabs/Zot6/Receiver.php +++ b/Zotlabs/Zot6/Receiver.php @@ -4,7 +4,7 @@ namespace Zotlabs\Zot6; use Zotlabs\Lib\Config; use Zotlabs\Lib\Libzot; -use Zotlabs\Web\HTTPSig; + class Receiver { diff --git a/Zotlabs/Zot6/Zot6Handler.php b/Zotlabs/Zot6/Zot6Handler.php index 1fae81ae6..e320e7825 100644 --- a/Zotlabs/Zot6/Zot6Handler.php +++ b/Zotlabs/Zot6/Zot6Handler.php @@ -72,8 +72,8 @@ class Zot6Handler implements IHandler { foreach ($recipients as $recip) { $r = q("select channel.*,xchan.* from channel - left join xchan on channel_portable_id = xchan_portable_id - where xchan_portable_id ='%s' limit 1", + left join xchan on channel_portable_id = xchan_hash + where xchan_hash ='%s' limit 1", dbesc($recip) ); @@ -141,7 +141,7 @@ class Zot6Handler implements IHandler { $arr = $data['recipients'][0]; - $c = q("select * from channel left join xchan on channel_portable_id = xchan_portable_id where channel_portable_id = '%s' limit 1", + $c = q("select * from channel left join xchan on channel_portable_id = xchan_hash where channel_portable_id = '%s' limit 1", dbesc($arr['portable_id']) ); if (! $c) { @@ -197,7 +197,7 @@ class Zot6Handler implements IHandler { return $ret; } - $r = q("select * from xchan where xchan_hash = '%s' or xchan_portable_id = '%s' limit 1", + $r = q("select * from xchan where xchan_hash = '%s' limit 1", dbesc($sender) ); @@ -231,15 +231,14 @@ class Zot6Handler implements IHandler { // basically this means "unfriend" foreach ($recipients as $recip) { $r = q("select channel.*,xchan.* from channel - left join xchan on channel_portable_id = xchan_portable_id + left join xchan on channel_portable_id = xchan_hash where channel_portable_id = '%s' limit 1", dbesc($recip) ); if ($r) { - $r = q("select abook_id from abook where uid = %d and (abook_xchan = '%s' or abook_xchan = '%s') limit 1", + $r = q("select abook_id from abook where uid = %d and abook_xchan = '%s' limit 1", intval($r[0]['channel_id']), - dbesc($sender), - dbesc($r[0]['xchan_portable_id']) + dbesc($sender) ); if ($r) { contact_remove($r[0]['channel_id'],$r[0]['abook_id']); diff --git a/include/channel.php b/include/channel.php index 030efffb9..1e5570f6b 100644 --- a/include/channel.php +++ b/include/channel.php @@ -10,7 +10,7 @@ use Zotlabs\Access\Permissions; use Zotlabs\Daemon\Master; use Zotlabs\Lib\System; use Zotlabs\Render\Comanche; -use Zotlabs\Lib\Zotlib; +use Zotlabs\Lib\Libzot; require_once('include/zot.php'); require_once('include/crypto.php'); @@ -233,7 +233,7 @@ function create_identity($arr) { $sig = base64url_encode(rsa_sign($guid,$key['prvkey'])); $hash = make_xchan_hash($guid,$sig); - $zhash = Zotlib::make_xchan_hash($guid,$key['pubkey']); + $zhash = Libzot::make_xchan_hash($guid,$key['pubkey']); // Force a few things on the short term until we can provide a theme or app with choice @@ -353,10 +353,12 @@ function create_identity($arr) { 'hubloc_guid' => $guid, 'hubloc_guid_sig' => 'sha256.' . $sig, 'hubloc_hash' => $zhash, + 'hubloc_id_url' => channel_url($ret['channel']), 'hubloc_addr' => channel_reddress($ret['channel']), 'hubloc_primary' => intval($primary), 'hubloc_url' => z_root(), 'hubloc_url_sig' => 'sha256.' . base64url_encode(rsa_sign(z_root(),$ret['channel']['channel_prvkey'])), + 'hubloc_site_id' => Libzot::make_xchan_hash(z_root(),get_config('system','pubkey')), 'hubloc_host' => App::get_hostname(), 'hubloc_callback' => z_root() . '/zot', 'hubloc_sitekey' => get_config('system','pubkey'), @@ -373,7 +375,6 @@ function create_identity($arr) { $r = xchan_store_lowlevel( [ 'xchan_hash' => $hash, - 'xchan_portable_id' => $zhash, 'xchan_guid' => $guid, 'xchan_guid_sig' => $sig, 'xchan_pubkey' => $key['pubkey'], @@ -393,6 +394,30 @@ function create_identity($arr) { ] ); + $r = xchan_store_lowlevel( + [ + 'xchan_hash' => $zhash, + 'xchan_guid' => $guid, + 'xchan_guid_sig' => 'sha256.' . $sig, + 'xchan_pubkey' => $key['pubkey'], + 'xchan_photo_mimetype' => (($photo_type) ? $photo_type : 'image/png'), + 'xchan_photo_l' => z_root() . "/photo/profile/l/{$newuid}", + 'xchan_photo_m' => z_root() . "/photo/profile/m/{$newuid}", + 'xchan_photo_s' => z_root() . "/photo/profile/s/{$newuid}", + 'xchan_addr' => channel_reddress($ret['channel']), + 'xchan_url' => z_root() . '/channel/' . $ret['channel']['channel_address'], + 'xchan_follow' => z_root() . '/follow?f=&url=%s', + 'xchan_connurl' => z_root() . '/poco/' . $ret['channel']['channel_address'], + 'xchan_name' => $ret['channel']['channel_name'], + 'xchan_network' => 'zot6', + 'xchan_photo_date' => datetime_convert(), + 'xchan_name_date' => datetime_convert(), + 'xchan_system' => $system + ] + ); + + + // Not checking return value. // It's ok for this to fail if it's an imported channel, and therefore the hash is a duplicate diff --git a/include/xchan.php b/include/xchan.php index 5516d046f..4cbfb42c5 100644 --- a/include/xchan.php +++ b/include/xchan.php @@ -12,7 +12,6 @@ function xchan_store_lowlevel($arr) { $store = [ 'xchan_hash' => ((array_key_exists('xchan_hash',$arr)) ? $arr['xchan_hash'] : ''), - 'xchan_portable_id' => ((array_key_exists('xchan_portable_id',$arr)) ? $arr['xchan_portable_id'] : ''), 'xchan_guid' => ((array_key_exists('xchan_guid',$arr)) ? $arr['xchan_guid'] : ''), 'xchan_guid_sig' => ((array_key_exists('xchan_guid_sig',$arr)) ? $arr['xchan_guid_sig'] : ''), 'xchan_pubkey' => ((array_key_exists('xchan_pubkey',$arr)) ? $arr['xchan_pubkey'] : ''), -- cgit v1.2.3 From a5483a03c90967eea58f5a0db17c59c4ec3ff2ff Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 6 Nov 2018 21:44:57 -0800 Subject: fix signatures --- Zotlabs/Zot6/HTTPSig.php | 2 +- include/network.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Zot6/HTTPSig.php b/Zotlabs/Zot6/HTTPSig.php index 6d52e5033..72785b1e9 100644 --- a/Zotlabs/Zot6/HTTPSig.php +++ b/Zotlabs/Zot6/HTTPSig.php @@ -162,7 +162,7 @@ class HTTPSig { if(! $x) { logger('verify failed for ' . $result['signer'] . ' alg=' . $algorithm . (($key['public_key']) ? '' : ' no key')); - $sig_block['signature'] = base64url_encode($sig_block['signature']); + $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)); diff --git a/include/network.php b/include/network.php index f976dcc35..d37da05f7 100644 --- a/include/network.php +++ b/include/network.php @@ -233,7 +233,7 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { return $ret; if(! array_key_exists('request_target',$opts)) { - $opts['request_target'] = 'get ' . get_request_string($url); + $opts['request_target'] = 'post ' . get_request_string($url); } @curl_setopt($ch, CURLOPT_HEADER, true); -- cgit v1.2.3 From 4e6758e31de60263e3a630c562efb93a11c57edf Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 8 Nov 2018 15:51:52 -0800 Subject: item db updates --- install/schema_mysql.sql | 3 +++ install/schema_postgres.sql | 3 +++ 2 files changed, 6 insertions(+) diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 088c0414d..8ece64ae2 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -579,6 +579,7 @@ CREATE TABLE IF NOT EXISTS `issue` ( CREATE TABLE IF NOT EXISTS `item` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `uuid` char(191) NOT NULL DEFAULT '', `mid` char(191) NOT NULL DEFAULT '', `aid` int(10) unsigned NOT NULL DEFAULT 0 , `uid` int(10) unsigned NOT NULL DEFAULT 0 , @@ -597,6 +598,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `source_xchan` char(191) NOT NULL DEFAULT '', `mimetype` char(191) NOT NULL DEFAULT '', `title` text NOT NULL, + `summary` mediumtext NOT NULL, `body` mediumtext NOT NULL, `html` mediumtext NOT NULL, `app` char(191) NOT NULL DEFAULT '', @@ -651,6 +653,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `item_pending_remove` tinyint(1) NOT NULL DEFAULT 0 , `item_blocked` tinyint(1) NOT NULL DEFAULT 0 , PRIMARY KEY (`id`), + KEY `uuid` (`uuid`), KEY `parent` (`parent`), KEY `created` (`created`), KEY `edited` (`edited`), diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index ec4fb63ad..6e2a09ebf 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -550,6 +550,7 @@ create index "issue_component" on issue ("issue_component"); CREATE TABLE "item" ( "id" serial NOT NULL, + "uuid" text NOT NULL DEFAULT '', "mid" text NOT NULL DEFAULT '', "aid" bigint NOT NULL DEFAULT '0', "uid" bigint NOT NULL DEFAULT '0', @@ -568,6 +569,7 @@ CREATE TABLE "item" ( "source_xchan" text NOT NULL DEFAULT '', "mimetype" text NOT NULL DEFAULT '', "title" text NOT NULL, + "summary" text NOT NULL, "body" text NOT NULL, "html" text NOT NULL, "app" text NOT NULL DEFAULT '', @@ -625,6 +627,7 @@ CREATE TABLE "item" ( PRIMARY KEY ("id") ); create index "item_uid" on item ("uid"); +create index "item_uuid" on item ("uuid"); create index "item_parent" on item ("parent"); create index "item_created" on item ("created"); create index "item_edited" on item ("edited"); -- cgit v1.2.3 From 3fe2491b737375e7c616c47366d5ab6f1c4fb851 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 8 Nov 2018 15:53:48 -0800 Subject: didn't need xchan_portable_id --- install/schema_mysql.sql | 2 -- install/schema_postgres.sql | 2 -- 2 files changed, 4 deletions(-) diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 8ece64ae2..fb8cd63f7 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -1301,7 +1301,6 @@ CREATE TABLE IF NOT EXISTS `vote` ( CREATE TABLE IF NOT EXISTS `xchan` ( `xchan_hash` char(191) NOT NULL, - `xchan_portable_id` char(191) NOT NULL DEFAULT '',, `xchan_guid` char(191) NOT NULL DEFAULT '', `xchan_guid_sig` text NOT NULL, `xchan_pubkey` text NOT NULL, @@ -1328,7 +1327,6 @@ CREATE TABLE IF NOT EXISTS `xchan` ( `xchan_pubforum` tinyint(1) NOT NULL DEFAULT 0 , `xchan_deleted` tinyint(1) NOT NULL DEFAULT 0 , PRIMARY KEY (`xchan_hash`), - KEY `xchan_portable_id` (`xchan_portable_id`), KEY `xchan_guid` (`xchan_guid`), KEY `xchan_addr` (`xchan_addr`), KEY `xchan_name` (`xchan_name`), diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 6e2a09ebf..2fdb2b105 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -1272,7 +1272,6 @@ create index "vote_poll" on vote ("vote_poll"); create index "vote_element" on vote ("vote_element"); CREATE TABLE "xchan" ( "xchan_hash" text NOT NULL, - "xchan_portable_id" text NOT NULL, "xchan_guid" text NOT NULL DEFAULT '', "xchan_guid_sig" text NOT NULL DEFAULT '', "xchan_pubkey" text NOT NULL DEFAULT '', @@ -1300,7 +1299,6 @@ CREATE TABLE "xchan" ( "xchan_deleted" smallint NOT NULL DEFAULT '0', PRIMARY KEY ("xchan_hash") ); -create index "xchan_portable_id" on xchan ("xchan_portable_id"); create index "xchan_guid" on xchan ("xchan_guid"); create index "xchan_addr" on xchan ("xchan_addr"); create index "xchan_name" on xchan ("xchan_name"); -- cgit v1.2.3 From 22b3ddab66f128ca05a42ebfccda0964bddd7509 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 8 Nov 2018 19:24:02 -0800 Subject: refresh packets --- Zotlabs/Daemon/Notifier.php | 15 ++++++++++++--- Zotlabs/Module/Wfinger.php | 6 ++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index f74c8f11c..48928f5ba 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -2,6 +2,8 @@ namespace Zotlabs\Daemon; +use Zotlabs\Lib\Libzot; + require_once('include/queue_fn.php'); require_once('include/html2plain.php'); require_once('include/conversation.php'); @@ -561,7 +563,7 @@ class Notifier { logger('notifier_hub: ' . $hub['hubloc_url'],LOGGER_DEBUG); - if($hub['hubloc_network'] !== 'zot') { + if(! in_array($hub['hubloc_network'], [ 'zot','zot6' ])) { $narr = [ 'channel' => $channel, 'upstream' => $upstream, @@ -610,14 +612,21 @@ class Notifier { continue; } - // default: zot protocol + if(! in_array($hub['hubloc_network'], [ 'zot','zot6' ])) { + continue; + } $hash = random_string(); $packet = null; $pmsg = ''; if($packet_type === 'refresh' || $packet_type === 'purge') { - $packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null)); + if($hub['hubloc_network'] === 'zot6') { + $packet = Libzot::build_packet($channel, $packet_type, ids_to_array($packet_recips,'hash')); + } + else { + $packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null)); + } } if($packet_type === 'keychange') { $pmsg = get_pconfig($channel['channel_id'],'system','keychange'); diff --git a/Zotlabs/Module/Wfinger.php b/Zotlabs/Module/Wfinger.php index 1866bce40..e4591df12 100644 --- a/Zotlabs/Module/Wfinger.php +++ b/Zotlabs/Module/Wfinger.php @@ -204,6 +204,12 @@ class Wfinger extends \Zotlabs\Web\Controller { 'href' => z_root() . '/.well-known/zot-info' . '?address=' . $r[0]['xchan_addr'], ], + [ + 'rel' => 'http://purl.org/zot/protocol/6.0', + 'type' => 'application/x-zot+json', + 'href' => channel_url($r[0]) + ], + [ 'rel' => 'http://purl.org/openwebauth/v1', 'type' => 'application/x-zot+json', -- cgit v1.2.3 From d56e1f6285fd2e4cc7b2f9cd88df88a26c5d2ad7 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 8 Nov 2018 19:49:57 -0800 Subject: begin native summary support --- Zotlabs/Module/Item.php | 24 +++++++++++++++++++++++- include/items.php | 15 +++++++++++++-- include/text.php | 23 +++++++++++++++++++++-- 3 files changed, 57 insertions(+), 5 deletions(-) diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 2ee639874..1e1df9d56 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -392,6 +392,7 @@ class Item extends \Zotlabs\Web\Controller { $verb = $orig_post['verb']; $app = $orig_post['app']; $title = escape_tags(trim($_REQUEST['title'])); + $summary = trim($_REQUEST['summary']); $body = trim($_REQUEST['body']); $item_flags = $orig_post['item_flags']; @@ -454,6 +455,7 @@ class Item extends \Zotlabs\Web\Controller { $coord = notags(trim($_REQUEST['coord'])); $verb = notags(trim($_REQUEST['verb'])); $title = escape_tags(trim($_REQUEST['title'])); + $summary = trim($_REQUEST['summary']); $body = trim($_REQUEST['body']); $body .= trim($_REQUEST['attachment']); $postopts = ''; @@ -505,12 +507,14 @@ class Item extends \Zotlabs\Web\Controller { && ($channel['channel_pageflags'] & PAGE_ALLOWCODE)) ? true : false); if($preview) { + $summary = z_input_filter($summary,$mimetype,$execflag); $body = z_input_filter($body,$mimetype,$execflag); } - $arr = [ 'profile_uid' => $profile_uid, 'content' => $body, 'mimetype' => $mimetype ]; + $arr = [ 'profile_uid' => $profile_uid, 'summary' => $summary, 'content' => $body, 'mimetype' => $mimetype ]; call_hooks('post_content',$arr); + $summary = $arr['summary']; $body = $arr['content']; $mimetype = $arr['mimetype']; @@ -531,9 +535,23 @@ class Item extends \Zotlabs\Web\Controller { // we may need virtual or template classes to implement the possible alternatives + if(strpos($body,'[/summary]') !== false) { + $match = ''; + $cnt = preg_match("/\[summary\](.*?)\[\/summary\]/ism",$body,$match); + if($cnt) { + $summary .= $match[1]; + } + $body_content = preg_replace("/^(.*?)\[summary\](.*?)\[\/summary\](.*?)$/ism", '',$body); + $body = trim($body_content); + } + + $summary = cleanup_bbcode($summary); + $body = cleanup_bbcode($body); // Look for tags and linkify them + + $results = linkify_tags($a, $summary, ($uid) ? $uid : $profile_uid); $results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid); if($results) { @@ -579,6 +597,9 @@ class Item extends \Zotlabs\Web\Controller { if(! $preview) { fix_attached_photo_permissions($profile_uid,$owner_xchan['xchan_hash'],((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny); + fix_attached_photo_permissions($profile_uid,$owner_xchan['xchan_hash'],((strpos($summary,'[/crypt]')) ? $_POST['media_str'] : $summary),$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny); + + fix_attached_file_permissions($channel,$observer['xchan_hash'],((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny); } @@ -778,6 +799,7 @@ class Item extends \Zotlabs\Web\Controller { $datarray['parent_mid'] = $parent_mid; $datarray['mimetype'] = $mimetype; $datarray['title'] = $title; + $datarray['summary'] = $summary; $datarray['body'] = $body; $datarray['app'] = $app; $datarray['location'] = $location; diff --git a/include/items.php b/include/items.php index cae380b01..24f1be84f 100755 --- a/include/items.php +++ b/include/items.php @@ -597,6 +597,7 @@ function get_item_elements($x,$allow_code = false) { $arr = array(); $arr['body'] = $x['body']; + $arr['summary'] = $x['summary']; $maxlen = get_max_import_size(); @@ -605,6 +606,11 @@ function get_item_elements($x,$allow_code = false) { logger('get_item_elements: message length exceeds max_import_size: truncated'); } + if($maxlen && mb_strlen($arr['summary']) > $maxlen) { + $arr['summary'] = mb_substr($arr['summary'],0,$maxlen,'UTF-8'); + logger('get_item_elements: message summary length exceeds max_import_size: truncated'); + } + $arr['created'] = datetime_convert('UTC','UTC',$x['created']); $arr['edited'] = datetime_convert('UTC','UTC',$x['edited']); @@ -749,9 +755,10 @@ function get_item_elements($x,$allow_code = false) { // Do this after signature checking as the original signature // was generated on the escaped content. - if($arr['mimetype'] === 'text/markdown') + if($arr['mimetype'] === 'text/markdown') { + $arr['summary'] = MarkdownSoap::unescape($arr['summary']); $arr['body'] = MarkdownSoap::unescape($arr['body']); - + } if(array_key_exists('revision',$x)) { // extended export encoding @@ -1073,6 +1080,7 @@ function encode_item($item,$mirror = false) { $x['commented'] = $item['commented']; $x['mimetype'] = $item['mimetype']; $x['title'] = $item['title']; + $x['summary'] = $item['summary']; $x['body'] = $item['body']; $x['app'] = $item['app']; $x['verb'] = $item['verb']; @@ -1631,6 +1639,7 @@ function item_store($arr, $allow_exec = false, $deliver = true) { } $arr['title'] = ((array_key_exists('title',$arr) && strlen($arr['title'])) ? trim($arr['title']) : ''); + $arr['summary'] = ((array_key_exists('summary',$arr) && strlen($arr['summary'])) ? trim($arr['summary']) : ''); $arr['body'] = ((array_key_exists('body',$arr) && strlen($arr['body'])) ? trim($arr['body']) : ''); $arr['allow_cid'] = ((x($arr,'allow_cid')) ? trim($arr['allow_cid']) : ''); @@ -1651,6 +1660,7 @@ function item_store($arr, $allow_exec = false, $deliver = true) { // apply the input filter here + $arr['summary'] = trim(z_input_filter($arr['summary'],$arr['mimetype'],$allow_exec)); $arr['body'] = trim(z_input_filter($arr['body'],$arr['mimetype'],$allow_exec)); item_sign($arr); @@ -2096,6 +2106,7 @@ function item_store_update($arr, $allow_exec = false, $deliver = true) { // apply the input filter here + $arr['summary'] = trim(z_input_filter($arr['summary'],$arr['mimetype'],$allow_exec)); $arr['body'] = trim(z_input_filter($arr['body'],$arr['mimetype'],$allow_exec)); item_sign($arr); diff --git a/include/text.php b/include/text.php index 15cc0ca8a..3d351f7dc 100644 --- a/include/text.php +++ b/include/text.php @@ -3,8 +3,11 @@ * @file include/text.php */ -use \Zotlabs\Lib as Zlib; -use \Michelf\MarkdownExtra; +use Zotlabs\Lib as Zlib; + +use Michelf\MarkdownExtra; +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; require_once("include/bbcode.php"); @@ -3467,3 +3470,19 @@ function print_val($v) { return $v; } + +/** + * @brief Generate a unique ID. + * + * @return string + */ +function new_uuid() { + + try { + $hash = Uuid::uuid4()->toString(); + } catch (UnsatisfiedDependencyException $e) { + $hash = random_string(48); + } + + return $hash; +} -- cgit v1.2.3 From c80ac58effdb71fe457daa164053ea57c1513e68 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 8 Nov 2018 20:42:09 -0800 Subject: add zot6 delivery method --- Zotlabs/Daemon/Notifier.php | 1 + include/queue_fn.php | 99 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 77 insertions(+), 23 deletions(-) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 48928f5ba..9a4b14d57 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -672,6 +672,7 @@ class Notifier { 'account_id' => $target_item['aid'], 'channel_id' => $target_item['uid'], 'posturl' => $hub['hubloc_callback'], + 'driver' => $hub['hubloc_network'], 'notify' => $packet, 'msg' => json_encode($encoded_item) ] diff --git a/include/queue_fn.php b/include/queue_fn.php index f05bac5b0..074e3c407 100644 --- a/include/queue_fn.php +++ b/include/queue_fn.php @@ -1,5 +1,9 @@ run(true); + logger('returned_json: ' . json_encode($result,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), LOGGER_DATA); + logger('deliver: local zot delivery succeeded to ' . $outq['outq_posturl']); + Libzot::process_response($outq['outq_posturl'],[ 'success' => true, 'body' => json_encode($result) ], $outq); + } + else { + logger('remote'); + $channel = null; + + if($outq['outq_channel']) { + $channel = channelx_by_n($outq['outq_channel']); + } + + $host_crypto = null; + if($channel && $base) { + $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' and\ + hubloc_network = 'zot6' order by hubloc_id desc limit 1", + dbesc($base) + ); + if($h) { + $host_crypto = $h[0]; + } + } + + $msg = $outq['outq_notify']; + + $result = Libzot::zot($outq['outq_posturl'],$msg,$channel,$host_crypto); + + if($result['success']) { + logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']); + Libzot::process_response($outq['outq_posturl'],$result, $outq); + } + else { + logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']); + logger('deliver: remote zot delivery fail data: ' . print_r($result,true), LOGGER_DATA); + update_queue_item($outq['outq_hash'],10); + } - if($outq['outq_msg'] && $outq['outq_channel']) { - $channel = channelx_by_n($outq['outq_channel']); + } + return; } + else { - $host_crypto = null; + $channel = null; - if($channel && $base) { - $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' order by hubloc_id desc limit 1", - dbesc($base) - ); - if($h) { - $host_crypto = $h[0]; + if($outq['outq_msg'] && $outq['outq_channel']) { + $channel = channelx_by_n($outq['outq_channel']); } - } - $msg = $outq['outq_notify']; + $host_crypto = null; - $result = zot_zot($outq['outq_posturl'],$msg,$channel,$host_crypto); + if($channel && $base) { + $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' order by hubloc_id desc limit 1", + dbesc($base) + ); + if($h) { + $host_crypto = $h[0]; + } + } + $msg = $outq['outq_notify']; - if($result['success']) { - logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']); - zot_process_response($outq['outq_posturl'],$result, $outq); - } - else { - logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']); - logger('deliver: remote zot delivery fail data: ' . print_r($result,true), LOGGER_DATA); - update_queue_item($outq['outq_hash'],10); + $result = zot_zot($outq['outq_posturl'],$msg,$channel,$host_crypto); + + + if($result['success']) { + logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']); + zot_process_response($outq['outq_posturl'],$result, $outq); + } + else { + logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']); + logger('deliver: remote zot delivery fail data: ' . print_r($result,true), LOGGER_DATA); + update_queue_item($outq['outq_hash'],10); + } + return; } - return; -} +} \ No newline at end of file -- cgit v1.2.3 From da452decf695ceac249642ec9d12fb724fa547f7 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 11 Nov 2018 15:12:01 -0800 Subject: more z6 debugging --- Zotlabs/Daemon/Notifier.php | 1 + Zotlabs/Lib/Libzot.php | 5 +++-- Zotlabs/Module/Connedit.php | 5 +++++ include/crypto.php | 9 +++++++-- include/queue_fn.php | 11 +++++------ 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 9a4b14d57..c7360b83c 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -645,6 +645,7 @@ class Notifier { '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) : '') )); diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 23703a040..f0248a85b 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -333,8 +333,8 @@ class Libzot { if($permissions && is_array($permissions)) { $old_read_stream_perm = get_abconfig($channel['channel_id'],$x['hash'],'their_perms','view_stream'); - foreach($permissions as $k => $v) { - set_abconfig($channel['channel_id'],$x['hash'],'their_perms',$k,$v); + foreach($permissions as $p) { + set_abconfig($channel['channel_id'],$x['hash'],'their_perms',$p,'1'); } } @@ -974,6 +974,7 @@ logger('4'); } $x = crypto_unencapsulate($x, get_config('system','prvkey')); + if(! is_array($x)) { $x = json_decode($x,true); } diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index 3d7ee449a..a9f643306 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -8,6 +8,7 @@ namespace Zotlabs\Module; */ use Zotlabs\Lib\Apps; +use Zotlabs\Lib\Libzot; require_once('include/socgraph.php'); require_once('include/selectors.php'); @@ -475,6 +476,10 @@ class Connedit extends \Zotlabs\Web\Controller { if(! zot_refresh($orig_record[0],\App::get_channel())) notice( t('Refresh failed - channel is currently unavailable.') ); } + elseif($orig_record[0]['xchan_network'] === 'zot6') { + if(! Libzot::refresh($orig_record[0],\App::get_channel())) + notice( t('Refresh failed - channel is currently unavailable.') ); + } else { // if you are on a different network we'll force a refresh of the connection basic info diff --git a/include/crypto.php b/include/crypto.php index 1040ac29b..fc1029e55 100644 --- a/include/crypto.php +++ b/include/crypto.php @@ -225,9 +225,14 @@ function crypto_unencapsulate($data,$prvkey) { if(! $data) return; - $alg = ((array_key_exists('alg',$data)) ? $data['alg'] : 'aes256cbc'); - if($alg === 'aes256cbc') + $alg = ((is_array($data) && array_key_exists('encrypted',$data)) ? $data['alg'] : ''); + if(! $alg) { + return $data; + } + + if($alg === 'aes256cbc') { return aes_unencapsulate($data,$prvkey); + } return other_unencapsulate($data,$prvkey,$alg); diff --git a/include/queue_fn.php b/include/queue_fn.php index 074e3c407..f7e2922c6 100644 --- a/include/queue_fn.php +++ b/include/queue_fn.php @@ -237,7 +237,7 @@ function queue_deliver($outq, $immediate = false) { $zot = new Receiver(new Zot6Handler(),$outq['outq_notify']); $result = $zot->run(true); logger('returned_json: ' . json_encode($result,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), LOGGER_DATA); - logger('deliver: local zot delivery succeeded to ' . $outq['outq_posturl']); + logger('deliver: local zot6 delivery succeeded to ' . $outq['outq_posturl']); Libzot::process_response($outq['outq_posturl'],[ 'success' => true, 'body' => json_encode($result) ], $outq); } else { @@ -250,8 +250,7 @@ function queue_deliver($outq, $immediate = false) { $host_crypto = null; if($channel && $base) { - $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' and\ - hubloc_network = 'zot6' order by hubloc_id desc limit 1", + $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' and hubloc_network = 'zot6' order by hubloc_id desc limit 1", dbesc($base) ); if($h) { @@ -264,12 +263,12 @@ function queue_deliver($outq, $immediate = false) { $result = Libzot::zot($outq['outq_posturl'],$msg,$channel,$host_crypto); if($result['success']) { - logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']); + logger('deliver: remote zot6 delivery succeeded to ' . $outq['outq_posturl']); Libzot::process_response($outq['outq_posturl'],$result, $outq); } else { - logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']); - logger('deliver: remote zot delivery fail data: ' . print_r($result,true), LOGGER_DATA); + logger('deliver: remote zot6 delivery failed to ' . $outq['outq_posturl']); + logger('deliver: remote zot6 delivery fail data: ' . print_r($result,true), LOGGER_DATA); update_queue_item($outq['outq_hash'],10); } -- cgit v1.2.3 From 171ff54ea407595a85e971f62abc556faf3dec73 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 11 Nov 2018 21:55:10 -0800 Subject: translate zot message packets to zot6 for delivery --- Zotlabs/Daemon/Notifier.php | 47 +++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index c7360b83c..8b81c49da 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -346,7 +346,16 @@ class Notifier { return; $encoded_item = encode_item($target_item); - + + // activitystreams version + $m = get_iconfig($target_item,'activitystreams','signed_data'); + if($m) { + $activity = json_decode($m,true); + } + else { + $activity = \Zotlabs\Lib\Activity::encode_activity($target_item); + } + // Send comments to the owner to re-deliver to everybody in the conversation // We only do this if the item in question originated on this site. This prevents looping. // To clarify, a site accepting a new comment is responsible for sending it to the owner for relay. @@ -616,7 +625,7 @@ class Notifier { continue; } - $hash = random_string(); + $hash = new_uuid(); $packet = null; $pmsg = ''; @@ -628,11 +637,11 @@ class Notifier { $packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null)); } } - if($packet_type === 'keychange') { + if($packet_type === 'keychange' && $hub['hubloc_network'] === 'zot') { $pmsg = get_pconfig($channel['channel_id'],'system','keychange'); $packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null)); } - elseif($packet_type === 'request') { + elseif($packet_type === 'request' && $hub['hubloc_network'] === 'zot') { $env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : ''); $packet = zot_build_packet($channel,$packet_type,$env,$hub['hubloc_sitekey'],$hub['site_crypto'], $hash, array('message_id' => $request_message_id) @@ -653,18 +662,32 @@ class Notifier { else { $env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : ''); - // currently zot6 delivery is only performed on normal items and not sync items or mail or anything else - // Eventually we will do this for all deliveries, but for now ensure this is precisely what we are dealing - // with before switching to zot6 as the primary zot6 handler checks for the existence of a message delivery report - // to trigger dequeue'ing - $z6 = (($encoded_item && $encoded_item['type'] === 'activity' && (! array_key_exists('allow_cid',$encoded_item))) ? true : false); - if($z6) { - $packet = zot6_build_packet($channel,'notify',$env, json_encode($encoded_item), (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash); + if($hub['hubloc_network'] === 'zot6') { + $zenv = []; + if($env) { + foreach($env as $e) { + $zenv[] = $e['hash']; + } + } + + $packet_type = (($upstream || $uplink) ? 'response' : 'activity'); + $packet = Libzot::build_packet($channel,$packet_type,$zenv,$activity,'activitystreams',(($private) ? $hub['hubloc_sitekey'] : null),$hub['site_crypto']); } else { - $packet = zot_build_packet($channel,'notify',$env, (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash); + // currently zot6 delivery is only performed on normal items and not sync items or mail or anything else + // Eventually we will do this for all deliveries, but for now ensure this is precisely what we are dealing + // with before switching to zot6 as the primary zot6 handler checks for the existence of a message delivery report + // to trigger dequeue'ing + + $z6 = (($encoded_item && $encoded_item['type'] === 'activity' && (! array_key_exists('allow_cid',$encoded_item))) ? true : false); + if($z6) { + $packet = zot6_build_packet($channel,'notify',$env, json_encode($encoded_item), (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash); + } + else { + $packet = zot_build_packet($channel,'notify',$env, (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash); + } } queue_insert( -- cgit v1.2.3 From 770fdb2b7d095d763d43ffe8d2f6b5b2182673cb Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 12 Nov 2018 16:08:22 -0800 Subject: dreport updates --- Zotlabs/Daemon/Deliver.php | 7 ++-- Zotlabs/Lib/DReport.php | 84 +++++++++++++++++++++++++++++++++++++++++++-- Zotlabs/Module/Dreport.php | 20 ++++++++--- include/zot.php | 10 +++--- install/schema_mysql.sql | 1 + install/schema_postgres.sql | 1 + 6 files changed, 110 insertions(+), 13 deletions(-) diff --git a/Zotlabs/Daemon/Deliver.php b/Zotlabs/Daemon/Deliver.php index b809cba91..43f426eb7 100644 --- a/Zotlabs/Daemon/Deliver.php +++ b/Zotlabs/Daemon/Deliver.php @@ -2,6 +2,8 @@ namespace Zotlabs\Daemon; +use Zotlabs\Lib\DReport; + require_once('include/zot.php'); require_once('include/queue_fn.php'); @@ -58,11 +60,12 @@ class Deliver { foreach($dresult as $xx) { if(is_array($xx) && array_key_exists('message_id',$xx)) { - if(delivery_report_is_storable($xx)) { - q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ", + 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']) diff --git a/Zotlabs/Lib/DReport.php b/Zotlabs/Lib/DReport.php index a68d6c18f..21b320cac 100644 --- a/Zotlabs/Lib/DReport.php +++ b/Zotlabs/Lib/DReport.php @@ -14,6 +14,7 @@ class DReport { $this->location = $location; $this->sender = $sender; $this->recipient = $recipient; + $this->name = EMPTY_STR; $this->message_id = $message_id; $this->status = $status; $this->date = datetime_convert(); @@ -24,8 +25,8 @@ class DReport { $this->date = datetime_convert(); } - function addto_recipient($name) { - $this->recipient = $this->recipient . ' ' . $name; + function set_name($name) { + $this->name = $name; } function addto_update($status) { @@ -37,6 +38,7 @@ class DReport { $this->location = $arr['location']; $this->sender = $arr['sender']; $this->recipient = $arr['recipient']; + $this->name = $arr['name']; $this->message_id = $arr['message_id']; $this->status = $arr['status']; $this->date = $arr['date']; @@ -47,9 +49,87 @@ class DReport { 'location' => $this->location, 'sender' => $this->sender, 'recipient' => $this->recipient, + 'name' => $this->name, 'message_id' => $this->message_id, 'status' => $this->status, 'date' => $this->date ); } + + /** + * @brief decide whether to store a returned delivery report + * + * @param array $dr + * @return boolean + */ + + static function is_storable($dr) { + + if(get_config('system', 'disable_dreport')) + return false; + + /** + * @hooks dreport_is_storable + * Called before storing a dreport record to determine whether to store it. + * * \e array + */ + + call_hooks('dreport_is_storable', $dr); + + // let plugins accept or reject - if neither, continue on + if(array_key_exists('accept',$dr) && intval($dr['accept'])) + return true; + if(array_key_exists('reject',$dr) && intval($dr['reject'])) + return false; + + if(! ($dr['sender'])) + return false; + + // Is the sender one of our channels? + + $c = q("select channel_id from channel where channel_hash = '%s' limit 1", + dbesc($dr['sender']) + ); + if(! $c) + return false; + + + // is the recipient one of our connections, or do we want to store every report? + + + $rxchan = $dr['recipient']; + $pcf = get_pconfig($c[0]['channel_id'],'system','dreport_store_all'); + if($pcf) + return true; + + // We always add ourself as a recipient to private and relayed posts + // So if a remote site says they can't find us, that's no big surprise + // and just creates a lot of extra report noise + + if(($dr['location'] !== z_root()) && ($dr['sender'] === $rxchan) && ($dr['status'] === 'recipient_not_found')) + return false; + + // If you have a private post with a recipient list, every single site is going to report + // back a failed delivery for anybody on that list that isn't local to them. We're only + // concerned about this if we have a local hubloc record which says we expected them to + // have a channel on that site. + + $r = q("select hubloc_id from hubloc where hubloc_hash = '%s' and hubloc_url = '%s'", + dbesc($rxchan), + dbesc($dr['location']) + ); + if((! $r) && ($dr['status'] === 'recipient_not_found')) + return false; + + $r = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1", + dbesc($rxchan), + intval($c[0]['channel_id']) + ); + if($r) + return true; + + return false; + } + + } diff --git a/Zotlabs/Module/Dreport.php b/Zotlabs/Module/Dreport.php index 76e07b147..16ae7941f 100644 --- a/Zotlabs/Module/Dreport.php +++ b/Zotlabs/Module/Dreport.php @@ -17,9 +17,17 @@ class Dreport extends \Zotlabs\Web\Controller { $mid = ((argc() > 1) ? argv(1) : ''); + if(strpos($mid,'b64.') === 0) + $mid = @base64url_decode(substr($mid,4)); + + if($mid === 'push') { $table = 'push'; $mid = ((argc() > 2) ? argv(2) : ''); + + if(strpos($mid,'b64.') === 0) + $mid = @base64url_decode(substr($mid,4)); + if($mid) { $i = q("select id from item where mid = '%s' and uid = %d and ( author_xchan = '%s' or ( owner_xchan = '%s' and item_wall = 1 )) ", dbesc($mid), @@ -38,6 +46,9 @@ class Dreport extends \Zotlabs\Web\Controller { if($mid === 'mail') { $table = 'mail'; $mid = ((argc() > 2) ? argv(2) : ''); + if(strpos($mid,'b64.') === 0) + $mid = @base64url_decode(substr($mid,4)); + } @@ -80,7 +91,6 @@ class Dreport extends \Zotlabs\Web\Controller { } for($x = 0; $x < count($r); $x++ ) { - $r[$x]['name'] = escape_tags(substr($r[$x]['dreport_recip'],strpos($r[$x]['dreport_recip'],' '))); // This has two purposes: 1. make the delivery report strings translateable, and // 2. assign an ordering to item delivery results so we can group them and provide @@ -138,14 +148,14 @@ class Dreport extends \Zotlabs\Web\Controller { $entries = array(); foreach($r as $rr) { $entries[] = [ - 'name' => $rr['name'], + 'name' => escape_tags($rr['dreport_name'] ?: $rr['dreport_recip']), 'result' => escape_tags($rr['dreport_result']), 'time' => escape_tags(datetime_convert('UTC',date_default_timezone_get(),$rr['dreport_time'])) ]; } $o = replace_macros(get_markup_template('dreport.tpl'), array( - '$title' => sprintf( t('Delivery report for %1$s'),substr($mid,0,32)) . '...', + '$title' => sprintf( t('Delivery report for %1$s'),basename($mid)) . '...', '$table' => $table, '$mid' => urlencode($mid), '$options' => t('Options'), @@ -162,9 +172,9 @@ class Dreport extends \Zotlabs\Web\Controller { private static function dreport_gravity_sort($a,$b) { if($a['gravity'] == $b['gravity']) { - if($a['name'] === $b['name']) + if($a['dreport_name'] === $b['dreport_name']) return strcmp($a['dreport_time'],$b['dreport_time']); - return strcmp($a['name'],$b['name']); + return strcmp($a['dreport_name'],$b['dreport_name']); } return (($a['gravity'] > $b['gravity']) ? 1 : (-1)); } diff --git a/include/zot.php b/include/zot.php index 49fc89e33..756a5bde6 100644 --- a/include/zot.php +++ b/include/zot.php @@ -8,6 +8,8 @@ * */ +use Zotlabs\Lib\DReport; + require_once('include/crypto.php'); require_once('include/items.php'); require_once('include/queue_fn.php'); @@ -1120,7 +1122,7 @@ function zot_process_response($hub, $arr, $outq) { foreach($x['delivery_report'] as $xx) { call_hooks('dreport_process',$xx); - if(is_array($xx) && array_key_exists('message_id',$xx) && delivery_report_is_storable($xx)) { + if(is_array($xx) && array_key_exists('message_id',$xx) && DReport::is_storable($xx)) { q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ", dbesc($xx['message_id']), dbesc($xx['location']), @@ -1748,7 +1750,7 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ } $channel = $r[0]; - $DR->addto_recipient($channel['channel_name'] . ' <' . channel_reddress($channel) . '>'); + $DR->set_name($channel['channel_name'] . ' <' . channel_reddress($channel) . '>'); /* blacklisted channels get a permission denied, no special message to tip them off */ @@ -2297,7 +2299,7 @@ function process_mail_delivery($sender, $arr, $deliveries) { } $channel = $r[0]; - $DR->addto_recipient($channel['channel_name'] . ' <' . channel_reddress($channel) . '>'); + $DR->set_name($channel['channel_name'] . ' <' . channel_reddress($channel) . '>'); /* blacklisted channels get a permission denied, no special message to tip them off */ @@ -3987,7 +3989,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { if(array_key_exists('item',$arr) && is_array($arr['item'][0])) { $DR = new Zotlabs\Lib\DReport(z_root(),$d['hash'],$d['hash'],$arr['item'][0]['message_id'],'channel sync processed'); - $DR->addto_recipient($channel['channel_name'] . ' <' . channel_reddress($channel) . '>'); + $DR->set_name($channel['channel_name'] . ' <' . channel_reddress($channel) . '>'); } else $DR = new Zotlabs\Lib\DReport(z_root(),$d['hash'],$d['hash'],'sync packet','channel sync delivered'); diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index fb8cd63f7..c820fca25 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -405,6 +405,7 @@ CREATE TABLE IF NOT EXISTS `dreport` ( `dreport_site` char(191) NOT NULL DEFAULT '', `dreport_recip` char(191) NOT NULL DEFAULT '', `dreport_result` char(191) NOT NULL DEFAULT '', + `dreport_name` char(191) NOT NULL DEFAULT '', `dreport_time` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', `dreport_xchan` char(191) NOT NULL DEFAULT '', `dreport_queue` char(191) NOT NULL DEFAULT '', diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 2fdb2b105..3bc256377 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -377,6 +377,7 @@ CREATE TABLE IF NOT EXISTS "dreport" ( "dreport_site" varchar(255) NOT NULL DEFAULT '', "dreport_recip" varchar(255) NOT NULL DEFAULT '', "dreport_result" varchar(255) NOT NULL DEFAULT '', + "dreport_name" varchar(255) NOT NULL DEFAULT '', "dreport_time" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', "dreport_xchan" varchar(255) NOT NULL DEFAULT '', "dreport_queue" varchar(255) NOT NULL DEFAULT '', -- cgit v1.2.3 From 1a2df9c51c4692fce433f483aba1b91738609df7 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 12 Nov 2018 18:25:55 -0800 Subject: item uuid changes --- Zotlabs/Module/Item.php | 4 +++- include/items.php | 10 +++++++++- include/text.php | 21 ++------------------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 1e1df9d56..464daa516 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -732,7 +732,8 @@ class Item extends \Zotlabs\Web\Controller { $notify_type = (($parent) ? 'comment-new' : 'wall-new' ); if(! $mid) { - $mid = (($message_id) ? $message_id : item_message_id()); + $uuid = (($message_id) ? $message_id : item_message_id()); + $mid = z_root() . '/item/' . $uuid; } @@ -787,6 +788,7 @@ class Item extends \Zotlabs\Web\Controller { $datarray['aid'] = $channel['channel_account_id']; $datarray['uid'] = $profile_uid; + $datarray['uuid'] = $uuid; $datarray['owner_xchan'] = (($owner_hash) ? $owner_hash : $owner_xchan['xchan_hash']); $datarray['author_xchan'] = $observer['xchan_hash']; $datarray['created'] = $created; diff --git a/include/items.php b/include/items.php index 24f1be84f..3d707a492 100755 --- a/include/items.php +++ b/include/items.php @@ -393,7 +393,11 @@ function post_activity_item($arr, $allow_code = false, $deliver = true) { if(! array_key_exists('mimetype',$arr)) $arr['mimetype'] = 'text/bbcode'; - $arr['mid'] = ((x($arr,'mid')) ? $arr['mid'] : item_message_id()); + + if(! $arr['mid']) { + $arr['uuid'] = ((x($arr,'uuid')) ? $arr['uuid'] : item_message_id()); + } + $arr['mid'] = ((x($arr,'mid')) ? $arr['mid'] : z_root() . '/item/' . $arr['uuid']); $arr['parent_mid'] = ((x($arr,'parent_mid')) ? $arr['parent_mid'] : $arr['mid']); $arr['thr_parent'] = ((x($arr,'thr_parent')) ? $arr['thr_parent'] : $arr['mid']); @@ -635,6 +639,7 @@ function get_item_elements($x,$allow_code = false) { if(mb_strlen($arr['title']) > 255) $arr['title'] = mb_substr($arr['title'],0,255); + $arr['uuid'] = (($x['uuid']) ? htmlspecialchars($x['uuid'], ENT_COMPAT,'UTF-8',false) : ''); $arr['app'] = (($x['app']) ? htmlspecialchars($x['app'], ENT_COMPAT,'UTF-8',false) : ''); $arr['route'] = (($x['route']) ? htmlspecialchars($x['route'], ENT_COMPAT,'UTF-8',false) : ''); $arr['mid'] = (($x['message_id']) ? htmlspecialchars($x['message_id'], ENT_COMPAT,'UTF-8',false) : ''); @@ -1070,6 +1075,7 @@ function encode_item($item,$mirror = false) { $x['item_blocked'] = $item['item_blocked']; } + $x['uuid'] = $item['uuid']; $x['message_id'] = $item['mid']; $x['message_top'] = $item['parent_mid']; $x['message_parent'] = $item['thr_parent']; @@ -1648,6 +1654,7 @@ function item_store($arr, $allow_exec = false, $deliver = true) { $arr['deny_gid'] = ((x($arr,'deny_gid')) ? trim($arr['deny_gid']) : ''); $arr['postopts'] = ((x($arr,'postopts')) ? trim($arr['postopts']) : ''); $arr['route'] = ((x($arr,'route')) ? trim($arr['route']) : ''); + $arr['uuid'] = ((x($arr,'uuid')) ? trim($arr['uuid']) : ''); $arr['item_private'] = ((x($arr,'item_private')) ? intval($arr['item_private']) : 0 ); $arr['item_wall'] = ((x($arr,'item_wall')) ? intval($arr['item_wall']) : 0 ); $arr['item_type'] = ((x($arr,'item_type')) ? intval($arr['item_type']) : 0 ); @@ -2183,6 +2190,7 @@ function item_store_update($arr, $allow_exec = false, $deliver = true) { $arr['route'] = ((array_key_exists('route',$arr)) ? trim($arr['route']) : $orig[0]['route']); $arr['location'] = ((x($arr,'location')) ? notags(trim($arr['location'])) : $orig[0]['location']); + $arr['uuid'] = ((x($arr,'uuid')) ? notags(trim($arr['uuid'])) : $orig[0]['uuid']); $arr['coord'] = ((x($arr,'coord')) ? notags(trim($arr['coord'])) : $orig[0]['coord']); $arr['verb'] = ((x($arr,'verb')) ? notags(trim($arr['verb'])) : $orig[0]['verb']); $arr['obj_type'] = ((x($arr,'obj_type')) ? notags(trim($arr['obj_type'])) : $orig[0]['obj_type']); diff --git a/include/text.php b/include/text.php index 3d351f7dc..d3130023c 100644 --- a/include/text.php +++ b/include/text.php @@ -574,18 +574,9 @@ function alt_pager($i, $more = '', $less = '') { * @return string a unique id */ function item_message_id() { - do { - $dups = false; - $hash = random_string(); - $mid = $hash . '@' . App::get_hostname(); - $r = q("SELECT id FROM item WHERE mid = '%s' LIMIT 1", - dbesc($mid)); - if($r) - $dups = true; - } while($dups == true); + return new_uuid(); - return $mid; } /** @@ -596,17 +587,9 @@ function item_message_id() { * @return string a uniqe hash */ function photo_new_resource() { - do { - $found = false; - $resource = hash('md5', uniqid(mt_rand(), true)); - $r = q("SELECT id FROM photo WHERE resource_id = '%s' LIMIT 1", - dbesc($resource)); - if($r) - $found = true; - } while($found === true); + return new_uuid(); - return $resource; } /** -- cgit v1.2.3 From ee85784be18c14905568fb259411f490c8d6bd91 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 13 Nov 2018 19:55:43 -0800 Subject: stay ahead of the game --- include/network.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/network.php b/include/network.php index d37da05f7..183a47105 100644 --- a/include/network.php +++ b/include/network.php @@ -153,7 +153,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { // Pull out multiple headers, e.g. proxy and continuation headers // allow for HTTP/2.x without fixing code - while(preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/',$base)) { + while(preg_match('/^HTTP\/[1-3].+? [1-5][0-9][0-9]/',$base)) { $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $header .= $chunk; $base = substr($base,strlen($chunk)); @@ -319,7 +319,7 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { // Pull out multiple headers, e.g. proxy and continuation headers // allow for HTTP/2.x without fixing code - while(preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/',$base)) { + while(preg_match('/^HTTP\/[1-3].+? [1-5][0-9][0-9]/',$base)) { $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $header .= $chunk; $base = substr($base,strlen($chunk)); -- cgit v1.2.3 From 62b367fa8177ed16958864a4799a0a2a9aa0119b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 14 Nov 2018 11:22:41 +0100 Subject: version 3.9.5 --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index f4ef1a036..53aad48c9 100755 --- a/boot.php +++ b/boot.php @@ -50,7 +50,7 @@ require_once('include/attach.php'); require_once('include/bbcode.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '3.8.4' ); +define ( 'STD_VERSION', '3.9.5' ); define ( 'ZOT_REVISION', '6.0a' ); define ( 'DB_UPDATE_VERSION', 1225 ); -- cgit v1.2.3 From 71cc2d7d5d7c74e7743a39720b3c418b95dba16e Mon Sep 17 00:00:00 2001 From: OJ Random Date: Wed, 14 Nov 2018 16:27:27 +0100 Subject: localhost, URLs, version updates --- .homeinstall/README.md | 28 +++++++++++++++---------- .homeinstall/hubzilla-config.txt.template | 2 ++ .homeinstall/hubzilla-setup.sh | 34 ++++++++++++++++++++++++------- 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/.homeinstall/README.md b/.homeinstall/README.md index aeecb9184..d63931a84 100644 --- a/.homeinstall/README.md +++ b/.homeinstall/README.md @@ -5,8 +5,8 @@ Run hubzilla-setup.sh for an unattended installation of hubzilla. The script is known to work without adjustments with + Hardware - - Mini-PC with Debian-9.2-amd64, or - - Rapberry 3 with Raspbian, Debian-9.3 + - Mini-PC with Debian-9.5-amd64, or + - Rapberry 3 with Raspbian, Debian-9.5 + DynDNS - selfHOST.de - freedns.afraid.org @@ -38,7 +38,7 @@ Software - apt-get install git - mkdir -p /var/www - cd /var/www - - git clone https://github.com/redmatrix/hubzilla.git html + - git clone https://framagit.org/hubzilla/core.git html - cd html/.homeinstall - cp hubzilla-config.txt.template hubzilla-config.txt - nano hubzilla-config.txt @@ -100,7 +100,7 @@ Create bootable USB drive with Debian on it.You could use Example for command dd... su - - dd if=2017-11-29-raspbian-stretch.img of=/dev/mmcblk0 + dd if=2018-10-09-raspbian-stretch.img of=/dev/mmcblk0 Do not forget to unmount the SD card before and check if unmounted like in this example... @@ -164,7 +164,7 @@ Make the directory for apache and change diretory to it Clone hubzilla from git ("git pull" will update it later) - git clone https://framagit.org/hubzilla/core html + git clone https://framagit.org/hubzilla/core.git html Change to the install script @@ -217,14 +217,20 @@ After the daily script was executed at 05:30 (am) - optionally view the daily log under yourdomain.org/admin/logs/ - set the logfile to var/www/html/hubzilla-daily.log -## Note for the Rasperry -The script was tested with an Raspberry 3 under Raspian (Debian 9.3, 2017-11-29-raspbian-stretch.img). +## Install Hubzilla in a Virtual Machine for Test Purposes + +Modify the file "hubzilla-config.txt". + + nano hubzilla-config.txt -It is recommended to deinstall these programms to avoid endless updates. Use... +There use + + le_domain=localhost + +## Note for the Rasperry - sudo apt-get purge wolfram-engine sonic-pi - sudo apt-get autoremove +The script was tested with an Raspberry 3 under Raspian (Debian 9.5, 2018-10-09-raspbian-stretch.img). It is recommended to run the Raspi without graphical frontend (X-Server). Use... @@ -234,7 +240,7 @@ to boot the Rapsi to the client console. DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI! -On a Raspian Stretch (Debian 9) the validation of the mail address fails for the very first user. +If the validation of the mail address fails for the very first registered user... This used to happen on some *bsd distros but there was some work to fix that a year ago (2017). So if your system isn't registered in DNS or DNS isn't active do diff --git a/.homeinstall/hubzilla-config.txt.template b/.homeinstall/hubzilla-config.txt.template index 2776ccd27..e42da0e4e 100644 --- a/.homeinstall/hubzilla-config.txt.template +++ b/.homeinstall/hubzilla-config.txt.template @@ -18,6 +18,8 @@ db_pass= # Example: my.cooldomain.org # Example: cooldomain.org # +# Example: localhost (test installation without certificates for httpS) +# # Email is optional # # diff --git a/.homeinstall/hubzilla-setup.sh b/.homeinstall/hubzilla-setup.sh index ff101086c..1f3ad5db5 100755 --- a/.homeinstall/hubzilla-setup.sh +++ b/.homeinstall/hubzilla-setup.sh @@ -816,15 +816,35 @@ install_run_selfhost ping_domain configure_cron_freedns configure_cron_selfhost -install_letsencrypt -configure_apache_for_https -check_https + +if [ "$le_domain" != "localhost" ] +then + install_letsencrypt + configure_apache_for_https + check_https +else + print_info "is localhost - skipped installation of letsencrypt and configuration of apache for https" +fi + install_hubzilla -rewrite_to_https -install_rsnapshot + +if [ "$le_domain" != "localhost" ] +then + rewrite_to_https + install_rsnapshot +else + print_info "is localhost - skipped rewrite to https and installation of rsnapshot" +fi + configure_cron_daily -install_cryptosetup -write_uninstall_script + +if [ "$le_domain" != "localhost" ] +then + install_cryptosetup + write_uninstall_script +else + print_info "is localhost - skipped installation of cryptosetup" +fi #set +x # stop debugging from here -- cgit v1.2.3 From bf013ecf00c710d6056890a6994eedd096121841 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 16:40:30 -0800 Subject: db updates for zot6 --- Zotlabs/Update/_1226.php | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ Zotlabs/Update/_1227.php | 30 +++++++++++++++++++ Zotlabs/Update/_1228.php | 37 +++++++++++++++++++++++ 3 files changed, 145 insertions(+) create mode 100644 Zotlabs/Update/_1226.php create mode 100644 Zotlabs/Update/_1227.php create mode 100644 Zotlabs/Update/_1228.php diff --git a/Zotlabs/Update/_1226.php b/Zotlabs/Update/_1226.php new file mode 100644 index 000000000..6e5a0e319 --- /dev/null +++ b/Zotlabs/Update/_1226.php @@ -0,0 +1,78 @@ + Date: Wed, 14 Nov 2018 16:56:07 -0800 Subject: change db update counter --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 53aad48c9..c74309be0 100755 --- a/boot.php +++ b/boot.php @@ -53,7 +53,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '3.9.5' ); define ( 'ZOT_REVISION', '6.0a' ); -define ( 'DB_UPDATE_VERSION', 1225 ); +define ( 'DB_UPDATE_VERSION', 1228 ); define ( 'PROJECT_BASE', __DIR__ ); -- cgit v1.2.3 From ab2376f8d85877f95c20fad3a3ece4ef517e083b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 17:42:02 -0800 Subject: fix dreport link --- Zotlabs/Lib/ThreadItem.php | 7 +++++-- view/tpl/conv_item.tpl | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 78714c2c4..93d8aa3a5 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -299,8 +299,10 @@ class ThreadItem { if($keep_reports === 0) $keep_reports = 10; - if((! get_config('system','disable_dreport')) && strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC',"now - $keep_reports days")) > 0) + if((! get_config('system','disable_dreport')) && strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC',"now - $keep_reports days")) > 0) { $dreport = t('Delivery Report'); + $dreport_link = gen_link_id($item['mid']); + } if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0) $is_new = true; @@ -316,7 +318,7 @@ class ThreadItem { $owner_address = substr($item['owner']['xchan_addr'],0,strpos($item['owner']['xchan_addr'],'@')); $viewthread = $item['llink']; if($conv->get_mode() === 'channel') - $viewthread = z_root() . '/channel/' . $owner_address . '?f=&mid=' . urlencode($item['mid']); + $viewthread = z_root() . '/channel/' . $owner_address . '?f=&mid=' . urlencode(gen_link_id($item['mid'])); $comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children ); $list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : ''); @@ -364,6 +366,7 @@ class ThreadItem { 'thread_action_menu' => thread_action_menu($item,$conv->get_mode()), 'thread_author_menu' => thread_author_menu($item,$conv->get_mode()), 'dreport' => $dreport, + 'dreport_link' => $dreport_link, 'name' => $profile_name, 'thumb' => $profile_avatar, 'osparkle' => $osparkle, diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 5720a2a5f..7dddf9c01 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -181,7 +181,7 @@ {{/if}} {{if $item.edpost && $item.dreport}} - {{$item.dreport}} + {{$item.dreport}} {{/if}} {{if $item.settings}} -- cgit v1.2.3 From 65a8965e85853b624f64a03930dfbe39a1a339cc Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 18:07:39 -0800 Subject: extra logging --- Zotlabs/Web/HTTPSig.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php index f27aa0556..0ec534948 100644 --- a/Zotlabs/Web/HTTPSig.php +++ b/Zotlabs/Web/HTTPSig.php @@ -342,6 +342,10 @@ class HTTPSig { */ static function parse_sigheader($header) { + if(is_array($header)) { + btlogger('is_array: ' . print_r($header,true)); + } + $ret = []; $matches = []; -- cgit v1.2.3 From d0f0a74df8835e54b42daf5b96e53eecc0481c71 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 18:14:47 -0800 Subject: encrypted header issue --- Zotlabs/Web/HTTPSig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php index 0ec534948..fe0b9428f 100644 --- a/Zotlabs/Web/HTTPSig.php +++ b/Zotlabs/Web/HTTPSig.php @@ -401,7 +401,7 @@ class HTTPSig { $data = $matches[1]; if($iv && $key && $alg && $data) { - return crypto_unencapsulate([ 'iv' => $iv, 'key' => $key, 'alg' => $alg, 'data' => $data ] , $prvkey); + return crypto_unencapsulate([ 'encrypted' => true, 'iv' => $iv, 'key' => $key, 'alg' => $alg, 'data' => $data ] , $prvkey); } return ''; -- cgit v1.2.3 From 4a06378d672cd355e337b2456096e76f698cf163 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 18:19:35 -0800 Subject: crypto fix --- include/crypto.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/crypto.php b/include/crypto.php index fc1029e55..39bfd8d43 100644 --- a/include/crypto.php +++ b/include/crypto.php @@ -225,7 +225,7 @@ function crypto_unencapsulate($data,$prvkey) { if(! $data) return; - $alg = ((is_array($data) && array_key_exists('encrypted',$data)) ? $data['alg'] : ''); + $alg = ((is_array($data) && (array_key_exists('encrypted',$data) || array_key_exists('iv',$data))) ? $data['alg'] : ''); if(! $alg) { return $data; } -- cgit v1.2.3 From 5f166158c3900bd85a204d3b7741d8e190a92bc4 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 18:25:02 -0800 Subject: filter by network --- include/zot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zot.php b/include/zot.php index 756a5bde6..b0d6ffd61 100644 --- a/include/zot.php +++ b/include/zot.php @@ -83,7 +83,7 @@ function zot_get_hublocs($hash) { /* Only search for active hublocs - e.g. those that haven't been marked deleted */ - $ret = q("select * from hubloc where hubloc_hash = '%s' and hubloc_deleted = 0 order by hubloc_url ", + $ret = q("select * from hubloc where hubloc_hash = '%s' and hubloc_deleted = 0 and hubloc_network = 'zot' order by hubloc_url ", dbesc($hash) ); @@ -656,7 +656,7 @@ function zot_gethub($arr, $multiple = false) { $r = q("select hubloc.*, site.site_crypto from hubloc left join site on hubloc_url = site_url where hubloc_guid = '%s' and hubloc_guid_sig = '%s' - and hubloc_url = '%s' and hubloc_url_sig = '%s' + and hubloc_url = '%s' and hubloc_url_sig = '%s' and hubloc_network = 'zot' $sitekey $limit", dbesc($arr['guid']), dbesc($arr['guid_sig']), -- cgit v1.2.3 From 079e2af0c07f54f521cdee9b31b8be4dd1acd159 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 18:33:00 -0800 Subject: check keyid --- include/zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zot.php b/include/zot.php index b0d6ffd61..12bd9995c 100644 --- a/include/zot.php +++ b/include/zot.php @@ -5187,7 +5187,7 @@ function zot6_check_sig() { $sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER['HTTP_SIGNATURE']); if($sigblock) { $keyId = $sigblock['keyId']; - + logger('keyID: ' . $keyId); if($keyId) { $r = q("select hubloc.*, site_crypto from hubloc left join site on hubloc_url = site_url where hubloc_addr = '%s' ", -- cgit v1.2.3 From 830c2472cb7b2b1d53f1d99062f37e52c4aa7074 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 18:39:23 -0800 Subject: more logging --- include/zot.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/zot.php b/include/zot.php index 12bd9995c..26eaee6b3 100644 --- a/include/zot.php +++ b/include/zot.php @@ -5197,6 +5197,7 @@ function zot6_check_sig() { foreach($r as $hubloc) { $verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']); if($verified && $verified['header_signed'] && $verified['header_valid'] && $verified['content_signed'] && $verified['content_valid']) { + logger('zot6 verified'); $ret['hubloc'] = $hubloc; $ret['success'] = true; return $ret; -- cgit v1.2.3 From db4ff56f0b5c4610ef6706af39ac496b5d98e69b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 18:41:36 -0800 Subject: more logging --- include/zot.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/zot.php b/include/zot.php index 26eaee6b3..2fca33a96 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1189,6 +1189,8 @@ function zot_fetch($arr) { $zret = zot6_check_sig(); + logger('zret: ' . print_r($zret,true)); + if($zret['success'] && $zret['hubloc'] && $zret['hubloc']['hubloc_guid'] === $data['sender']['guid'] && $data['msg']) { logger('zot6_delivery',LOGGER_DEBUG); logger('zot6_data: ' . print_r($data,true),LOGGER_DATA); -- cgit v1.2.3 From 9c25f300cf5032076c98bd597355c88e7ec08a34 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 18:56:38 -0800 Subject: fixes to old z6 delivery --- include/zot.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/zot.php b/include/zot.php index 2fca33a96..580220182 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1189,15 +1189,14 @@ function zot_fetch($arr) { $zret = zot6_check_sig(); - logger('zret: ' . print_r($zret,true)); + if($zret['success'] && $zret['hubloc'] && $zret['hubloc']['hubloc_guid'] === $arr['sender']['guid'] && $arr['msg']) { - if($zret['success'] && $zret['hubloc'] && $zret['hubloc']['hubloc_guid'] === $data['sender']['guid'] && $data['msg']) { logger('zot6_delivery',LOGGER_DEBUG); - logger('zot6_data: ' . print_r($data,true),LOGGER_DATA); + logger('zot6_data: ' . print_r($arr,true),LOGGER_DATA); $ret['collected'] = true; - $import = [ 'success' => true, 'body' => json_encode( [ 'success' => true, 'pickup' => [ [ 'notify' => $data, 'message' => json_decode($data['msg'],true) ] ] ] ) ]; + $import = [ 'success' => true, 'body' => json_encode( [ 'success' => true, 'pickup' => [ [ 'notify' => $arr, 'message' => json_decode($arr['msg'],true) ] ] ] ) ]; $hubs = [ $zret['hubloc'] ] ; } -- cgit v1.2.3 From 034f23b47ee38a237637a34ef02bc9aec4773f7f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 19:09:18 -0800 Subject: update httpsig unit test which is failing --- tests/unit/Web/HttpSigTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/Web/HttpSigTest.php b/tests/unit/Web/HttpSigTest.php index 18f2ce92b..9909a9883 100644 --- a/tests/unit/Web/HttpSigTest.php +++ b/tests/unit/Web/HttpSigTest.php @@ -91,6 +91,7 @@ class PermissionDescriptionTest extends UnitTestCase { function testDecrypt_sigheader() { $header = 'Header: iv="value_iv" key="value_key" alg="value_alg" data="value_data"'; $result = [ + 'encrypted' => true, 'iv' => 'value_iv', 'key' => 'value_key', 'alg' => 'value_alg', @@ -109,6 +110,7 @@ class PermissionDescriptionTest extends UnitTestCase { $header = 'Header: iv="value_iv" key="value_key" alg="value_alg" data="value_data"'; $result = [ + 'encrypted' => true, 'iv' => 'value_iv', 'key' => 'value_key', 'alg' => 'value_alg', -- cgit v1.2.3 From b11858bcaca9a5784f37e5b69eb7ca6096d0bde3 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Nov 2018 20:34:00 -0800 Subject: separate by network --- Zotlabs/Lib/Libzot.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index f0248a85b..010735487 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -508,6 +508,7 @@ logger('4'); $r = q("select hubloc.*, site.site_crypto from hubloc left join site on hubloc_url = site_url where hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' + and hubloc_network = 'zot6' and hubloc_site_id = '%s' $limit", dbesc($arr['id']), dbesc($arr['id_sig']), -- cgit v1.2.3 From ca4e7f9b4fab7035e511582a0755d58e9e4fa2f0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 15 Nov 2018 10:11:04 +0100 Subject: fix update 1228 --- Zotlabs/Update/_1228.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Zotlabs/Update/_1228.php b/Zotlabs/Update/_1228.php index b9ba1d86f..f8a506bb4 100644 --- a/Zotlabs/Update/_1228.php +++ b/Zotlabs/Update/_1228.php @@ -25,7 +25,6 @@ class _1228 { if($r) { q("COMMIT"); - self::upgrade(); return UPDATE_SUCCESS; } -- cgit v1.2.3 From a7d2f9b53005f0c27ddfe1ef32fab78591c5374f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 15 Nov 2018 15:35:06 -0800 Subject: remove checkjs and nojs --- Zotlabs/Module/Nojs.php | 15 --------------- Zotlabs/Web/CheckJS.php | 50 ------------------------------------------------- 2 files changed, 65 deletions(-) delete mode 100644 Zotlabs/Module/Nojs.php delete mode 100644 Zotlabs/Web/CheckJS.php diff --git a/Zotlabs/Module/Nojs.php b/Zotlabs/Module/Nojs.php deleted file mode 100644 index 5f3d80ecd..000000000 --- a/Zotlabs/Module/Nojs.php +++ /dev/null @@ -1,15 +0,0 @@ - 1) ? intval(argv(1)) : 1); - setcookie('jsdisabled', $n, 0, '/'); - $p = hex2bin($_GET['redir']); - $hasq = strpbrk($p,'?&'); - goaway(z_root() . (($p) ? '/' . $p : '') . (($hasq) ? '' : '?f=' ) . '&jsdisabled=' . $n); - - } -} diff --git a/Zotlabs/Web/CheckJS.php b/Zotlabs/Web/CheckJS.php deleted file mode 100644 index e83ccf27b..000000000 --- a/Zotlabs/Web/CheckJS.php +++ /dev/null @@ -1,50 +0,0 @@ -jsdisabled = 1; - else - $this->jsdisabled = 0; - if(intval($_COOKIE['jsdisabled'])) - $this->jsdisabled = 1; - else - $this->jsdisabled = 0; - - $page = bin2hex(\App::$query_string); - - if(! $this->jsdisabled) { - if($test) { - $this->jsdisabled = 1; - if(array_key_exists('jsdisabled',$_COOKIE)) - $this->jsdisabled = $_COOKIE['jsdisabled']; - - if(! array_key_exists('jsdisabled',$_COOKIE)) { - \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; - /* emulate JS cookie if cookies are not accepted */ - if (array_key_exists('jsdisabled',$_GET)) { - $_COOKIE['jsdisabled'] = $_GET['jsdisabled']; - } - } - } - else { - \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; - } - } - - } - - function disabled() { - return $this->jsdisabled; - } - - -} - - -- cgit v1.2.3 From 8d2f4d9dfd90d218a68e0e36ccf537d800b09755 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 15 Nov 2018 16:02:29 -0800 Subject: mid -> uuid conversions for basic reactions --- Zotlabs/Module/Like.php | 6 ++++-- Zotlabs/Module/React.php | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index 4e216f08b..c39726b88 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -371,10 +371,13 @@ class Like extends \Zotlabs\Web\Controller { } } - $mid = item_message_id(); + $uuid = item_message_id(); $arr = array(); + $arr['uuid'] = $uuid; + $arr['mid'] = z_root() . '/item/' . $uuid; + if($extended_like) { $arr['item_thread_top'] = 1; $arr['item_origin'] = 1; @@ -476,7 +479,6 @@ class Like extends \Zotlabs\Web\Controller { } - $arr['mid'] = $mid; $arr['aid'] = (($extended_like) ? $ch[0]['channel_account_id'] : $owner_aid); $arr['uid'] = $owner_uid; diff --git a/Zotlabs/Module/React.php b/Zotlabs/Module/React.php index fbb760786..3920301f5 100644 --- a/Zotlabs/Module/React.php +++ b/Zotlabs/Module/React.php @@ -44,6 +44,7 @@ class React extends \Zotlabs\Web\Controller { return; } + $uuid = item_message_id(); $n = array(); $n['aid'] = $channel['channel_account_id']; @@ -52,7 +53,8 @@ class React extends \Zotlabs\Web\Controller { $n['item_type'] = $i[0]['item_type']; $n['parent'] = $postid; $n['parent_mid'] = $i[0]['mid']; - $n['mid'] = item_message_id(); + $n['uuid'] = $uuid; + $n['mid'] = z_root() . '/item/' . $uuid; $n['verb'] = ACTIVITY_REACT . '#' . $emoji; $n['body'] = "\n\n[zmg=32x32]" . z_root() . '/images/emoji/' . $emoji . '.png[/zmg]' . "\n\n"; $n['author_xchan'] = $channel['channel_hash']; -- cgit v1.2.3 From 39d914c9dfe87021351cb2aad9feedd381e791ec Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 15 Nov 2018 16:34:09 -0800 Subject: add item.uuid to relevant places --- Zotlabs/Lib/NativeWiki.php | 17 ++++------------- Zotlabs/Module/Impel.php | 8 +++++--- Zotlabs/Module/Mood.php | 4 +++- Zotlabs/Module/Subthread.php | 6 ++++-- include/activities.php | 3 ++- include/attach.php | 14 +++++++++----- include/event.php | 7 +++++-- include/help.php | 3 ++- include/import.php | 3 ++- include/items.php | 3 ++- include/photos.php | 8 ++++++-- 11 files changed, 44 insertions(+), 32 deletions(-) diff --git a/Zotlabs/Lib/NativeWiki.php b/Zotlabs/Lib/NativeWiki.php index cdabbc3e9..e2bd07c0d 100644 --- a/Zotlabs/Lib/NativeWiki.php +++ b/Zotlabs/Lib/NativeWiki.php @@ -40,26 +40,17 @@ class NativeWiki { function create_wiki($channel, $observer_hash, $wiki, $acl) { - // Generate unique resource_id using the same method as item_message_id() - do { - $dups = false; - $resource_id = random_string(); - $r = q("SELECT mid FROM item WHERE resource_id = '%s' AND resource_type = '%s' AND uid = %d LIMIT 1", - dbesc($resource_id), - dbesc(NWIKI_ITEM_RESOURCE_TYPE), - intval($channel['channel_id']) - ); - if($r) - $dups = true; - } while($dups == true); + $resource_id = new_uuid(); + $uuid = new_uuid(); $ac = $acl->get(); - $mid = item_message_id(); + $mid = z_root() . '/item/' . $uuid; $arr = array(); // Initialize the array of parameters for the post $item_hidden = ((intval($wiki['postVisible']) === 0) ? 1 : 0); $wiki_url = z_root() . '/wiki/' . $channel['channel_address'] . '/' . $wiki['urlName']; $arr['aid'] = $channel['channel_account_id']; + $arr['uuid'] = $uuid; $arr['uid'] = $channel['channel_id']; $arr['mid'] = $mid; $arr['parent_mid'] = $mid; diff --git a/Zotlabs/Module/Impel.php b/Zotlabs/Module/Impel.php index 0c372bd96..e05027d9f 100644 --- a/Zotlabs/Module/Impel.php +++ b/Zotlabs/Module/Impel.php @@ -133,9 +133,11 @@ class Impel extends \Zotlabs\Web\Controller { $arr['author_xchan'] = (($j['author_xchan']) ? $j['author_xchan'] : get_observer_hash()); $arr['mimetype'] = (($j['mimetype']) ? $j['mimetype'] : 'text/bbcode'); - if(! $j['mid']) - $j['mid'] = item_message_id(); - + if(! $j['mid']) { + $j['uuid'] = item_message_id(); + $j['mid'] = z_root() . '/item/' . $j['uuid']; + } + $arr['uuid'] = $j['uuid']; $arr['mid'] = $arr['parent_mid'] = $j['mid']; diff --git a/Zotlabs/Module/Mood.php b/Zotlabs/Module/Mood.php index 16ef0b171..453f08f9f 100644 --- a/Zotlabs/Module/Mood.php +++ b/Zotlabs/Module/Mood.php @@ -70,7 +70,8 @@ class Mood extends Controller { $poster = App::get_observer(); - $mid = item_message_id(); + $uuid = item_message_id(); + $mid = z_root() . '/item/' . $uuid; $action = sprintf( t('%1$s is %2$s','mood'), '[zrl=' . $poster['xchan_url'] . ']' . $poster['xchan_name'] . '[/zrl]' , $verbs[$verb]); @@ -78,6 +79,7 @@ class Mood extends Controller { $arr['aid'] = get_account_id(); $arr['uid'] = $uid; + $arr['uuid'] = $uuid; $arr['mid'] = $mid; $arr['parent_mid'] = (($parent_mid) ? $parent_mid : $mid); $arr['author_xchan'] = $poster['xchan_hash']; diff --git a/Zotlabs/Module/Subthread.php b/Zotlabs/Module/Subthread.php index 1a9caff6c..54343fdfa 100644 --- a/Zotlabs/Module/Subthread.php +++ b/Zotlabs/Module/Subthread.php @@ -106,8 +106,9 @@ class Subthread extends \Zotlabs\Web\Controller { - $mid = item_message_id(); - + $uuid = item_message_id(); + $mid = z_root() . '/item/' . $uuid; + $post_type = (($item['resource_type'] === 'photo') ? t('photo') : t('status')); $links = array(array('rel' => 'alternate','type' => 'text/html', 'href' => $item['plink'])); @@ -145,6 +146,7 @@ class Subthread extends \Zotlabs\Web\Controller { $arr = array(); + $arr['uuid'] = $uuid; $arr['mid'] = $mid; $arr['aid'] = $owner_aid; $arr['uid'] = $owner_uid; diff --git a/include/activities.php b/include/activities.php index 9b83f7a5c..68c995338 100644 --- a/include/activities.php +++ b/include/activities.php @@ -16,7 +16,8 @@ function profile_activity($changed, $value) { return; $arr = array(); - $arr['mid'] = $arr['parent_mid'] = item_message_id(); + $arr['uuid'] = item_message_id(); + $arr['mid'] = $arr['parent_mid'] = z_root() . '/item/' . $arr['uuid']; $arr['uid'] = local_channel(); $arr['aid'] = $self['channel_account_id']; $arr['owner_xchan'] = $arr['author_xchan'] = $self['xchan_hash']; diff --git a/include/attach.php b/include/attach.php index 4db5bc435..6b0d3fb3b 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1759,16 +1759,18 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, $arr_allow_cid = check_list_permissions($channel_id, $arr_allow_cid, 'view_storage'); } - $mid = item_message_id(); + $uuid = item_message_id(); + $mid = z_root() . '/item/' . $uuid; $objtype = ACTIVITY_OBJ_FILE; $arr = array(); $arr['aid'] = get_account_id(); $arr['uid'] = $channel_id; - $arr['item_wall'] = 1; - $arr['item_origin'] = 1; - $arr['item_unseen'] = 1; + $arr['uuid'] = $uuid; + $arr['item_wall'] = 1; + $arr['item_origin'] = 1; + $arr['item_unseen'] = 1; $arr['author_xchan'] = $poster['xchan_hash']; $arr['owner_xchan'] = $poster['xchan_hash']; $arr['title'] = ''; @@ -1813,8 +1815,10 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, $private = (($u_arr_allow_cid[0] || $u_arr_allow_gid[0] || $u_arr_deny_cid[0] || $u_arr_deny_gid[0]) ? 1 : 0); - $u_mid = item_message_id(); + $uuid = item_message_id(); + $u_mid = z_root() . '/item/' . $uuid; + $arr['uuid'] = $uuid; $arr['mid'] = $u_mid; $arr['parent_mid'] = $u_mid; $arr['allow_cid'] = perms2str($u_arr_allow_cid); diff --git a/include/event.php b/include/event.php index 84a16e8be..a34250e7a 100644 --- a/include/event.php +++ b/include/event.php @@ -1125,11 +1125,14 @@ function event_store_item($arr, $event) { } } - if(! $arr['mid']) - $arr['mid'] = item_message_id(); + if(! $arr['mid']) { + $arr['uuid'] = item_message_id(); + $arr['mid'] = z_root() . '/item/' . $arr['uuid']; + } $item_arr['aid'] = $z[0]['channel_account_id']; $item_arr['uid'] = $arr['uid']; + $item_arr['uuid'] = $arr['uuid']; $item_arr['author_xchan'] = $arr['event_xchan']; $item_arr['mid'] = $arr['mid']; $item_arr['parent_mid'] = $arr['mid']; diff --git a/include/help.php b/include/help.php index 3b56a7238..f2aa4add3 100644 --- a/include/help.php +++ b/include/help.php @@ -351,7 +351,8 @@ function store_doc_file($s) { $x = item_store_update($item); } else { - $item['mid'] = $item['parent_mid'] = item_message_id(); + $item['uuid'] = $item_message_id(); + $item['mid'] = $item['parent_mid'] = z_root() . '/item/' . $item['uuid']; $x = item_store($item); } diff --git a/include/import.php b/include/import.php index 6476aa688..53b21c317 100644 --- a/include/import.php +++ b/include/import.php @@ -1520,7 +1520,8 @@ function import_webpage_element($element, $channel, $type) { } else { // otherwise, generate the creation times and unique id $arr['created'] = datetime_convert('UTC', 'UTC'); - $arr['mid'] = $arr['parent_mid'] = item_message_id(); + $arr['uuid'] = item_message_id(); + $arr['mid'] = $arr['parent_mid'] = z_root() . '/item/' . $arr['uuid']; } // Update the edited time whether or not the element already exists $arr['edited'] = datetime_convert('UTC', 'UTC'); diff --git a/include/items.php b/include/items.php index 3d707a492..2baad3d04 100755 --- a/include/items.php +++ b/include/items.php @@ -4765,7 +4765,8 @@ function item_create_edit_activity($post) { $new_item['id'] = 0; $new_item['parent'] = 0; - $new_item['mid'] = item_message_id(); + $new_item['uuid'] = item_message_id(); + $new_item['mid'] = z_root() . '/item/' . $new_item['uuid']; $new_item['body'] = sprintf( t('[Edited %s]'), (($update_item['item_thread_top']) ? t('Post','edit_activity') : t('Comment','edit_activity'))); diff --git a/include/photos.php b/include/photos.php index d5553b495..ae51703e0 100644 --- a/include/photos.php +++ b/include/photos.php @@ -441,11 +441,13 @@ function photo_upload($channel, $observer, $args) { } } else { - $mid = item_message_id(); + $uuid = item_message_id(); + $mid = z_root() . '/item/' . $uuid; $arr = [ 'aid' => $account_id, 'uid' => $channel_id, + 'uuid' => $uuid, 'mid' => $mid, 'parent_mid' => $mid, 'item_hidden' => $item_hidden, @@ -827,12 +829,14 @@ function photos_create_item($channel, $creator_hash, $photo, $visible = false) { $item_hidden = (($visible) ? 0 : 1 ); - $mid = item_message_id(); + $uuid = item_message_id(); + $mid = z_root() . '/item/' . $uuid; $arr = array(); $arr['aid'] = $channel['channel_account_id']; $arr['uid'] = $channel['channel_id']; + $arr['uuid'] = $uuid; $arr['mid'] = $mid; $arr['parent_mid'] = $mid; $arr['item_wall'] = 1; -- cgit v1.2.3 From 5162459e4a77ccd1e4a4a68a2deae2a231947f62 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 15 Nov 2018 18:07:58 -0800 Subject: delivery report issue --- include/zot.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/zot.php b/include/zot.php index 580220182..9208a6a99 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1121,12 +1121,13 @@ function zot_process_response($hub, $arr, $outq) { } foreach($x['delivery_report'] as $xx) { - call_hooks('dreport_process',$xx); + call_hooks('dreport_process',$xx); if(is_array($xx) && array_key_exists('message_id',$xx) && DReport::is_storable($xx)) { - q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ", + 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']), dbesc($xx['status']), dbesc(datetime_convert($xx['date'])), dbesc($xx['sender']) -- cgit v1.2.3 From e42a401987bb34eed4d90bf22e36652fc907b063 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 15 Nov 2018 20:50:47 -0800 Subject: more work on the mid/uuid conversion --- Zotlabs/Module/Item.php | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 464daa516..1d64ef60c 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -2,6 +2,16 @@ namespace Zotlabs\Module; +use Zotlabs\Lib\IConfig; +use Zotlabs\Lib\Enotify; +use Zotlabs\Web\Controller; +use Zotlabs\Daemon\Master; + +require_once('include/crypto.php'); +require_once('include/items.php'); +require_once('include/security.php'); + + /** * * This is the POST destination for most all locally posted @@ -17,16 +27,8 @@ namespace Zotlabs\Module; * */ -require_once('include/crypto.php'); -require_once('include/items.php'); -require_once('include/attach.php'); -require_once('include/bbcode.php'); -require_once('include/security.php'); - - -use \Zotlabs\Lib as Zlib; -class Item extends \Zotlabs\Web\Controller { +class Item extends Controller { function post() { @@ -911,12 +913,12 @@ class Item extends \Zotlabs\Web\Controller { $datarray['title'] = mb_substr($datarray['title'],0,191); if($webpage) { - Zlib\IConfig::Set($datarray,'system', webpage_to_namespace($webpage), - (($pagetitle) ? $pagetitle : substr($datarray['mid'],0,16)),true); + IConfig::Set($datarray,'system', webpage_to_namespace($webpage), + (($pagetitle) ? $pagetitle : basename($datarray['mid'])), true); } elseif($namespace) { - Zlib\IConfig::Set($datarray,'system', $namespace, - (($remote_id) ? $remote_id : substr($datarray['mid'],0,16)),true); + IConfig::Set($datarray,'system', $namespace, + (($remote_id) ? $remote_id : basename($datarray['mid'])), true); } @@ -948,7 +950,7 @@ class Item extends \Zotlabs\Web\Controller { } } if(! $nopush) - \Zotlabs\Daemon\Master::Summon(array('Notifier', 'edit_post', $post_id)); + Master::Summon([ 'Notifier', 'edit_post', $post_id ]); if($api_source) @@ -983,7 +985,7 @@ class Item extends \Zotlabs\Web\Controller { // otherwise it will happen during delivery if(($datarray['owner_xchan'] != $datarray['author_xchan']) && (intval($parent_item['item_wall']))) { - Zlib\Enotify::submit(array( + Enotify::submit(array( 'type' => NOTIFY_COMMENT, 'from_xchan' => $datarray['author_xchan'], 'to_xchan' => $datarray['owner_xchan'], @@ -1001,7 +1003,7 @@ class Item extends \Zotlabs\Web\Controller { $parent = $post_id; if(($datarray['owner_xchan'] != $datarray['author_xchan']) && ($datarray['item_type'] == ITEM_TYPE_POST)) { - Zlib\Enotify::submit(array( + Enotify::submit(array( 'type' => NOTIFY_WALL, 'from_xchan' => $datarray['author_xchan'], 'to_xchan' => $datarray['owner_xchan'], @@ -1063,7 +1065,7 @@ class Item extends \Zotlabs\Web\Controller { call_hooks('post_local_end', $datarray); if(! $nopush) - \Zotlabs\Daemon\Master::Summon(array('Notifier', $notify_type, $post_id)); + Master::Summon([ 'Notifier', $notify_type, $post_id ]); logger('post_complete'); -- cgit v1.2.3 From b0689614bff4272f90b0c3f064ca91b16cb392e0 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 15 Nov 2018 21:14:14 -0800 Subject: datetime_convert wrong args --- Zotlabs/Lib/Libzot.php | 2 +- include/zot.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 010735487..70f013eb7 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1006,7 +1006,7 @@ logger('4'); dbesc($xx['recipient']), dbesc($xx['name']), dbesc($xx['status']), - dbesc(datetime_convert($xx['date'])), + dbesc(datetime_convert('UTC','UTC',$xx['date'])), dbesc($xx['sender']) ); } diff --git a/include/zot.php b/include/zot.php index 9208a6a99..d031b4a96 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1129,7 +1129,7 @@ function zot_process_response($hub, $arr, $outq) { dbesc($xx['recipient']), dbesc($xx['name']), dbesc($xx['status']), - dbesc(datetime_convert($xx['date'])), + dbesc(datetime_convert('UTC','UTC',$xx['date'])), dbesc($xx['sender']) ); } -- cgit v1.2.3 From 4812c5486db3f49cd1df34f8678c51369ac76d7a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 16 Nov 2018 21:14:11 +0000 Subject: strlen($this->imageString()) does not return the correct size when dealing with os_storage images. use filesize() instead. (cherry picked from commit afc75af62f759181bbe6a806b523c6ca52126f5f) --- include/photo/photo_driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 4173d727e..b70a13622 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -413,7 +413,7 @@ abstract class photo_driver { intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), - intval(strlen($this->imageString())), + (intval($p['os_storage']) ? @filesize($p['os_syspath']) : strlen($this->imageString())), intval($p['imgscale']), intval($p['photo_usage']), dbesc($p['title']), @@ -445,7 +445,7 @@ abstract class photo_driver { intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), - intval(strlen($this->imageString())), + (intval($p['os_storage']) ? @filesize($p['os_syspath']) : strlen($this->imageString())), intval($p['imgscale']), intval($p['photo_usage']), dbesc($p['title']), -- cgit v1.2.3 From 6010b5c6198bf49c39029a657443b5bf1be8b408 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 16 Nov 2018 23:14:10 +0100 Subject: Fix return on wrong sotred in Content-Length size for full size photos --- Zotlabs/Module/Photo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 30e8340e2..91175c7df 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -163,11 +163,13 @@ class Photo extends \Zotlabs\Web\Controller { if($exists && $allowed) { $data = dbunescbin($e[0]['content']); - $filesize = $e[0]['filesize']; $mimetype = $e[0]['mimetype']; $modified = strtotime($e[0]['edited'] . 'Z'); - if(intval($e[0]['os_storage'])) + if(intval($e[0]['os_storage'])) { $streaming = $data; + } + else + $filesize = $e[0]['filesize']; if($e[0]['allow_cid'] != '' || $e[0]['allow_gid'] != '' || $e[0]['deny_gid'] != '' || $e[0]['deny_gid'] != '') $prvcachecontrol = true; } -- cgit v1.2.3 From 238a616292ad5c6e7be97a4dd763a302729abf80 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 16 Nov 2018 23:33:45 +0100 Subject: Add filesize for streaming content --- Zotlabs/Module/Photo.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 91175c7df..be9d55eb2 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -167,6 +167,7 @@ class Photo extends \Zotlabs\Web\Controller { $modified = strtotime($e[0]['edited'] . 'Z'); if(intval($e[0]['os_storage'])) { $streaming = $data; + $filesize = filesize($data); } else $filesize = $e[0]['filesize']; -- cgit v1.2.3 From 783cca1e13ae480b31ddcffce6f014fbd1cdc34a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 17 Nov 2018 08:41:26 +0000 Subject: recalculate photo filesize when rotating an image (cherry picked from commit f15e32d0637fdf84de7cab43b558ec8a383d3cf5) --- Zotlabs/Module/Photos.php | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 03fd8a53d..21f6293ef 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -264,7 +264,7 @@ class Photos extends \Zotlabs\Web\Controller { } $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 0", - dbesc(datetime_convert()), + dbesc(datetime_convert()), dbescbin($data), intval($fsize), intval($height), @@ -278,10 +278,13 @@ class Photos extends \Zotlabs\Web\Controller { $width = $ph->getWidth(); $height = $ph->getHeight(); + $data = $ph->imageString(); + $fsize = strlen($data); - $x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 1", - dbesc(datetime_convert()), - dbescbin($ph->imageString()), + $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 1", + dbesc(datetime_convert()), + dbescbin($data), + intval($fsize), intval($height), intval($width), dbesc($resource_id), @@ -294,10 +297,13 @@ class Photos extends \Zotlabs\Web\Controller { $width = $ph->getWidth(); $height = $ph->getHeight(); + $data = $ph->imageString(); + $fsize = strlen($data); - $x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 2", - dbesc(datetime_convert()), - dbescbin($ph->imageString()), + $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 2", + dbesc(datetime_convert()), + dbescbin($data), + intval($fsize), intval($height), intval($width), dbesc($resource_id), @@ -310,10 +316,13 @@ class Photos extends \Zotlabs\Web\Controller { $width = $ph->getWidth(); $height = $ph->getHeight(); + $data = $ph->imageString(); + $fsize = strlen($data); - $x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 3", - dbesc(datetime_convert()), - dbescbin($ph->imageString()), + $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 3", + dbesc(datetime_convert()), + dbescbin($data), + intval($fsize), intval($height), intval($width), dbesc($resource_id), -- cgit v1.2.3 From 0c94747ab1c740f47e5a796f5c60efcdfcd29ba1 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 18 Nov 2018 11:02:01 +0100 Subject: fix typo which prevented propagation of comments --- Zotlabs/Module/Zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Zot.php b/Zotlabs/Module/Zot.php index 8c34dced1..1cc0e54c9 100644 --- a/Zotlabs/Module/Zot.php +++ b/Zotlabs/Module/Zot.php @@ -19,7 +19,7 @@ class Zot extends \Zotlabs\Web\Controller { function init() { $zot = new ZotProtocol\Receiver(new ZotProtocol\Zot6Handler()); - json_return_and_die($zot->run(),'application/x-zot+jzon'); + json_return_and_die($zot->run(),'application/x-zot+json'); } } -- cgit v1.2.3 From 3787c490d4fe9c6beda393580e4ee8ad8f7cd6dc Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sun, 18 Nov 2018 07:00:06 -0500 Subject: Fix: delayed items propagate before publication on cloned channels --- include/items.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/items.php b/include/items.php index 2baad3d04..8268d3fe7 100755 --- a/include/items.php +++ b/include/items.php @@ -618,8 +618,6 @@ function get_item_elements($x,$allow_code = false) { $arr['created'] = datetime_convert('UTC','UTC',$x['created']); $arr['edited'] = datetime_convert('UTC','UTC',$x['edited']); - if($arr['created'] > datetime_convert()) - $arr['created'] = datetime_convert(); if($arr['edited'] > datetime_convert()) $arr['edited'] = datetime_convert(); -- cgit v1.2.3 From 0525eb2d29eb83fb157491aab13f268dc9fd3c15 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 19 Nov 2018 09:42:18 +0000 Subject: update sql schemas to include update column in pconfig table (cherry picked from commit ae97649948b8af575441e5a1f5b69db9f627a0e2) --- install/schema_mysql.sql | 6 +++--- install/schema_postgres.sql | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index c820fca25..3e3e6fe88 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -916,7 +916,6 @@ CREATE TABLE IF NOT EXISTS `outq` ( KEY `outq_priority` (`outq_priority`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE IF NOT EXISTS pchan ( `pchan_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `pchan_guid` char(191) NOT NULL DEFAULT '', @@ -928,15 +927,16 @@ CREATE TABLE IF NOT EXISTS pchan ( KEY `pchan_hash` (`pchan_hash`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE IF NOT EXISTS `pconfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL DEFAULT 0 , `cat` char(191) NOT NULL DEFAULT '', `k` char(191) NOT NULL DEFAULT '', `v` mediumtext NOT NULL, + `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', PRIMARY KEY (`id`), - UNIQUE KEY `access` (`uid`,`cat`,`k`) + UNIQUE KEY `access` (`uid`,`cat`,`k`), + KEY `pconfig_updated` (`updated`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `photo` ( diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 3bc256377..44f98b944 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -897,7 +897,6 @@ create index "outq_async" on outq ("outq_async"); create index "outq_delivered" on outq ("outq_delivered"); create index "outq_priority" on outq ("outq_priority"); - CREATE TABLE "pchan" ( "pchan_id" serial NOT NULL, "pchan_guid" text NOT NULL, @@ -906,7 +905,6 @@ CREATE TABLE "pchan" ( "pchan_prvkey" text NOT NULL, PRIMARY KEY ("pchan_id") ); - create index "pchan_guid" on pchan ("pchan_guid"); create index "pchan_hash" on pchan ("pchan_hash"); @@ -916,9 +914,11 @@ CREATE TABLE "pconfig" ( "cat" text NOT NULL, "k" text NOT NULL, "v" text NOT NULL, + "updated" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', PRIMARY KEY ("id"), UNIQUE ("uid","cat","k") ); +create index "pconfig_updated_idx" on pconfig ("updated"); CREATE TABLE "photo" ( "id" serial NOT NULL, -- cgit v1.2.3 From dffc0a4ed8fc04f0e95bbee1941509fb6b859913 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 19 Nov 2018 10:10:22 +0000 Subject: changelog (cherry picked from commit 5cb4cdaa5e42f87e9d26501150d6d689b56a1cd2) --- CHANGELOG | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 59e8bdfc9..b11016eba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,12 @@ +Hubzilla 3.8.5 (2018-11-19) + - Fix pconfig for new installs + - Fix delayed publication of posts in combination with channel clones + - Fix issue where photo filesize was not updated in the DB when a photo was edited + - Fix issue where the original photo size was not set correct in the DB + - Fix delivery issue in zot_fetch() + - Fix typo in channel reputation addon + + Hubzilla 3.8.4 (2018-11-14) - Fix xss issue (thanks to Eduardo) - Implement hook in enotify to be used by superblock -- cgit v1.2.3 From af0c2f59cc1a51d2e1847682f6d66ab4dc600004 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 19 Nov 2018 13:11:04 +0100 Subject: Revert "Add filesize for streaming content" This reverts commit 238a616292ad5c6e7be97a4dd763a302729abf80 --- Zotlabs/Module/Photo.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index be9d55eb2..91175c7df 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -167,7 +167,6 @@ class Photo extends \Zotlabs\Web\Controller { $modified = strtotime($e[0]['edited'] . 'Z'); if(intval($e[0]['os_storage'])) { $streaming = $data; - $filesize = filesize($data); } else $filesize = $e[0]['filesize']; -- cgit v1.2.3 From 73b836c73d6804bc29d7de89cd6397bfe857f9d7 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 19 Nov 2018 13:11:18 +0100 Subject: Revert "Fix return on wrong sotred in Content-Length size for full size photos" This reverts commit 6010b5c6198bf49c39029a657443b5bf1be8b408 --- Zotlabs/Module/Photo.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 91175c7df..30e8340e2 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -163,13 +163,11 @@ class Photo extends \Zotlabs\Web\Controller { if($exists && $allowed) { $data = dbunescbin($e[0]['content']); + $filesize = $e[0]['filesize']; $mimetype = $e[0]['mimetype']; $modified = strtotime($e[0]['edited'] . 'Z'); - if(intval($e[0]['os_storage'])) { + if(intval($e[0]['os_storage'])) $streaming = $data; - } - else - $filesize = $e[0]['filesize']; if($e[0]['allow_cid'] != '' || $e[0]['allow_gid'] != '' || $e[0]['deny_gid'] != '' || $e[0]['deny_gid'] != '') $prvcachecontrol = true; } -- cgit v1.2.3 From da44ab0529602d9d38db42ad21979c297f4c22eb Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 19 Nov 2018 13:51:54 +0100 Subject: Replace hstrings.php --- view/ru/hstrings.php | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/view/ru/hstrings.php b/view/ru/hstrings.php index 598d02718..02c88dde3 100644 --- a/view/ru/hstrings.php +++ b/view/ru/hstrings.php @@ -470,7 +470,6 @@ App::$strings["Help:"] = "Помощь:"; App::$strings["Help"] = "Помощь"; App::$strings["Not Found"] = "Не найдено"; App::$strings["Page not found."] = "Страница не найдена."; -App::$strings["Cannot locate DNS info for database server '%s'"] = "Не удается найти DNS информацию для сервера базы данных '%s'"; App::$strings["Image/photo"] = "Изображение / фотография"; App::$strings["Encrypted content"] = "Зашифрованное содержание"; App::$strings["Install %1\$s element %2\$s"] = "Установить %1\$s элемент %2\$s"; @@ -1152,8 +1151,6 @@ App::$strings["Blocked accounts"] = "Заблокированные аккаун App::$strings["Expired accounts"] = "Просроченные аккаунты"; App::$strings["Expiring accounts"] = "Близкие к просрочке аккаунты"; App::$strings["Channels"] = "Каналы"; -App::$strings["Primary"] = "Основной"; -App::$strings["Clones"] = "Клоны"; App::$strings["Message queues"] = "Очередь сообщений"; App::$strings["Your software should be updated"] = "Ваше программное обеспечение должно быть обновлено"; App::$strings["Administration"] = "Администрирование"; @@ -1439,6 +1436,7 @@ App::$strings["Please select another location to become primary before removing App::$strings["Syncing locations"] = "Синхронизировать местоположение"; App::$strings["No locations found."] = "Местоположений не найдено"; App::$strings["Manage Channel Locations"] = "Управление местоположением канала"; +App::$strings["Primary"] = "Основной"; App::$strings["Drop"] = "Удалить"; App::$strings["Sync Now"] = "Синхронизировать"; App::$strings["Please wait several minutes between consecutive operations."] = "Пожалуйста, подождите несколько минут между последовательными операциями."; @@ -1828,17 +1826,17 @@ App::$strings["Note: as a security measure, you should give the web server write App::$strings["%s is writable"] = "%s доступен для записи"; App::$strings["This software uses the store directory to save uploaded files. The web server needs to have write access to the store directory under the top level web folder"] = "Эта программа использует каталог хранения для загруженных файлов. Для веб-сервера требуется доступ на запись начиная с верхнего уровня каталога хранения."; App::$strings["store is writable"] = "хранилище доступно для записи"; -App::$strings["SSL certificate cannot be validated. Fix certificate or disable https access to this site."] = ""; -App::$strings["If you have https access to your website or allow connections to TCP port 443 (the https: port), you MUST use a browser-valid certificate. You MUST NOT use self-signed certificates!"] = ""; +App::$strings["SSL certificate cannot be validated. Fix certificate or disable https access to this site."] = "SSL certificate cannot be validated. Замените его или отключите https доступ к этому сайту."; +App::$strings["If you have https access to your website or allow connections to TCP port 443 (the https: port), you MUST use a browser-valid certificate. You MUST NOT use self-signed certificates!"] = "Если у вас есть https-доступ к вашему сайту или разрешено подключение к TCP-порту 443 (порт https), вы ДОЛЖНЫ использовать сертификат, действительный для браузера. Вы НЕ ДОЛЖНЫ использовать самоподписанные сертификаты!"; App::$strings["This restriction is incorporated because public posts from you may for example contain references to images on your own hub."] = "Эти ограничения приняты поскольку ваши общедоступные публикации могут, например, содержать ссылки на изображения на вашем собственном хабе."; -App::$strings["If your certificate is not recognized, members of other sites (who may themselves have valid certificates) will get a warning message on their own site complaining about security issues."] = ""; -App::$strings["This can cause usability issues elsewhere (not just on your own site) so we must insist on this requirement."] = ""; -App::$strings["Providers are available that issue free certificates which are browser-valid."] = ""; -App::$strings["If you are confident that the certificate is valid and signed by a trusted authority, check to see if you have failed to install an intermediate cert. These are not normally required by browsers, but are required for server-to-server communications."] = ""; -App::$strings["SSL certificate validation"] = ""; -App::$strings["Url rewrite in .htaccess is not working. Check your server configuration.Test: "] = ""; +App::$strings["If your certificate is not recognized, members of other sites (who may themselves have valid certificates) will get a warning message on their own site complaining about security issues."] = "Если ваш сертификат не признан, пользователи других сайтов (которые могут сами иметь действительные сертификаты) получат предупреждающее сообщение о проблемах с безопасностью."; +App::$strings["This can cause usability issues elsewhere (not just on your own site) so we must insist on this requirement."] = "Это может привести к проблемам удобства использования из других мест (не только на вашем собственном сайте), поэтому мы настаиваем на этом требовании."; +App::$strings["Providers are available that issue free certificates which are browser-valid."] = "Доступны поставщики, которые выдают действительные для браузера бесплатные сертификаты."; +App::$strings["If you are confident that the certificate is valid and signed by a trusted authority, check to see if you have failed to install an intermediate cert. These are not normally required by browsers, but are required for server-to-server communications."] = "Если вы уверены, что сертификат действителен и подписан доверенным органом, проверьте, установлен ли промежуточные сертификаты. Обычно они не требуются браузерами, но бывают необходимы для связи между серверами."; +App::$strings["SSL certificate validation"] = "Проверка SSL сертификата"; +App::$strings["Url rewrite in .htaccess is not working. Check your server configuration.Test: "] = "Перезапись URL в .htaccess не работает. Проверьте настройки вашего сервера."; App::$strings["Url rewrite is working"] = "Перезапись URL работает"; -App::$strings["The database configuration file \".htconfig.php\" could not be written. Please use the enclosed text to create a configuration file in your web server root."] = ""; +App::$strings["The database configuration file \".htconfig.php\" could not be written. Please use the enclosed text to create a configuration file in your web server root."] = "Файл конфигурации базы данных \".htconfig.php\" не может быть записан. Используйте прилагаемый текст для создания файла конфигурации в корневом каталоге веб-сервера."; App::$strings["Errors encountered creating database tables."] = "При создании базы данных возникли ошибки."; App::$strings["

What next?

"] = "

Что дальше?

"; App::$strings["IMPORTANT: You will need to [manually] setup a scheduled task for the poller."] = "Вам понадобится [вручную] настроить запланированную задачу для опрашивателя."; @@ -2588,14 +2586,14 @@ App::$strings["Addon Features"] = "Настройки расширений"; App::$strings["App Collections"] = "Коллекции приложений"; App::$strings["Installed apps"] = "Установленные приложения"; App::$strings["Remove term"] = "Удалить термин"; -App::$strings["Personal Posts"] = "Личные публикации"; -App::$strings["Show posts that mention or involve me"] = "Показывать публикации где вы были упомянуты или привлечены"; -App::$strings["Starred Posts"] = "Отмеченные публикации"; -App::$strings["Show posts that I have starred"] = "Показывать публикации которые я отметил"; App::$strings["Show posts related to the %s privacy group"] = "Показывать публикации относящиеся к группе безопасности %s"; App::$strings["Show my privacy groups"] = "Показывать мои группы безопасности"; 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["Show posts that mention or involve me"] = "Показывать публикации где вы были упомянуты или привлечены"; App::$strings["Show posts that I have filed to %s"] = "Показывать публикации которые я добавил в %s"; App::$strings["Show filed post categories"] = "Показывать категории добавленных публикаций"; App::$strings["Panel search"] = "Панель поиска"; @@ -2824,7 +2822,6 @@ App::$strings["Post to Dreamwidth by default"] = "Публиковать в Drea App::$strings["Dreamwidth Post Settings"] = "Настройки публикаций в Dreamwidth"; App::$strings["Project Servers and Resources"] = "Серверы и ресурсы проекта"; App::$strings["Project Creator and Tech Lead"] = "Создатель проекта и технический руководитель"; -App::$strings["Admin, developer, directorymin, support bloke"] = "Администратор, разработчик, администратор каталога, поддержка"; App::$strings["And the hundreds of other people and organisations who helped make the Hubzilla possible."] = "И сотни других людей и организаций которые помогали в создании Hubzilla."; App::$strings["The Redmatrix/Hubzilla projects are provided primarily by volunteers giving their time and expertise - and often paying out of pocket for services they share with others."] = "Проекты Redmatrix / Hubzilla предоставляются, в основном, добровольцами, которые предоставляют свое время и опыт и, часто, оплачивают из своего кармана услуги, которыми они делятся с другими."; App::$strings["There is no corporate funding and no ads, and we do not collect and sell your personal information. (We don't control your personal information - you do.)"] = "Здесь нет корпоративного финансирования и рекламы, мы не собираем и не продаем вашу личную информацию. (Мы не контролируем вашу личную информацию - это делаете вы.)"; @@ -3102,13 +3099,12 @@ App::$strings["This will import all your cloud files from another server."] = " App::$strings["Hubzilla Server base URL"] = "Базовый URL сервера Hubzilla"; App::$strings["Since modified date yyyy-mm-dd"] = "Начиная с даты изменений yyyy-mm-dd"; App::$strings["Until modified date yyyy-mm-dd"] = "Заканчивая датой изменений yyyy-mm-dd"; -App::$strings["Post to LiveJournal"] = "Опубликовать в LiveJournal"; -App::$strings["Enable LiveJournal Post Plugin"] = "Включить плагин публикаций LiveJournal"; -App::$strings["LiveJournal username"] = "Имя пользователя LiveJournal"; -App::$strings["LiveJournal password"] = "Пароль LiveJournal"; -App::$strings["Post to LiveJournal by default"] = "Публиковать в LiveJournal по умолчанию"; -App::$strings["LiveJournal Post Settings"] = "Настройки публикаций в LiveJournal"; -App::$strings["LiveJournal Settings saved."] = "Настройки LiveJournal сохранены."; +App::$strings["Post to Livejournal"] = "Опубликовать в Livejournal"; +App::$strings["Enable Livejournal Post Plugin"] = "Включить раширение публикаций в Livejournal"; +App::$strings["Livejournal username"] = "Имя пользователя Livejournal"; +App::$strings["Livejournal password"] = "Пароль Livejournal"; +App::$strings["Post to Livejournal by default"] = "Публиковать в Livejournal по умолчанию"; +App::$strings["Livejournal Post Settings"] = "Настройки публикации в Livejournal"; App::$strings["Post to GNU social"] = "Опубликовать в GNU Social"; App::$strings["Please contact your site administrator.
The provided API URL is not valid."] = "Пожалуйста свяжитесь с администратором сайта.
Предоставленный URL API недействителен."; App::$strings["We could not contact the GNU social API with the Path you entered."] = "Нам не удалось установить контакт с GNU Social API по введённому вами пути"; -- cgit v1.2.3 From 4dea1b5a0d719832a1d989099cb806f5d518b231 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 19 Nov 2018 13:52:31 +0100 Subject: Replace hmessages.po --- view/ru/hmessages.po | 1361 +++++++++++++++++++++++++------------------------- 1 file changed, 673 insertions(+), 688 deletions(-) diff --git a/view/ru/hmessages.po b/view/ru/hmessages.po index d21f707d1..6a8c8805c 100644 --- a/view/ru/hmessages.po +++ b/view/ru/hmessages.po @@ -12,7 +12,7 @@ msgstr "" "Project-Id-Version: hubzilla\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-10-18 11:03+0200\n" -"PO-Revision-Date: 2018-10-18 11:06+0200\n" +"PO-Revision-Date: 2018-11-19 14:12+0200\n" "Last-Translator: Max Kostikov \n" "Language-Team: Russian (http://www.transifex.com/Friendica/hubzilla/language/ru/)\n" "MIME-Version: 1.0\n" @@ -25,7 +25,7 @@ msgstr "" msgid "Source channel not found." msgstr "Канал-источник не найден." -#: ../../view/theme/redbasic/php/config.php:15 ../../include/text.php:3087 +#: ../../view/theme/redbasic/php/config.php:15 ../../include/text.php:3086 #: ../../Zotlabs/Module/Admin/Site.php:187 msgid "Default" msgstr "По умолчанию" @@ -41,8 +41,8 @@ msgstr "Фокус (по умолчанию Hubzilla)" #: ../../Zotlabs/Module/Xchan.php:15 #: ../../Zotlabs/Module/Email_validation.php:40 #: ../../Zotlabs/Module/Poke.php:217 ../../Zotlabs/Module/Appman.php:155 -#: ../../Zotlabs/Module/Profiles.php:723 ../../Zotlabs/Module/Photos.php:1084 -#: ../../Zotlabs/Module/Photos.php:1124 ../../Zotlabs/Module/Photos.php:1242 +#: ../../Zotlabs/Module/Profiles.php:723 ../../Zotlabs/Module/Photos.php:1097 +#: ../../Zotlabs/Module/Photos.php:1137 ../../Zotlabs/Module/Photos.php:1255 #: ../../Zotlabs/Module/Oauth.php:111 ../../Zotlabs/Module/Events.php:495 #: ../../Zotlabs/Module/Rate.php:166 ../../Zotlabs/Module/Locs.php:121 #: ../../Zotlabs/Module/Sources.php:125 ../../Zotlabs/Module/Sources.php:162 @@ -79,15 +79,15 @@ msgstr "Фокус (по умолчанию Hubzilla)" #: ../../Zotlabs/Module/Admin/Account_edit.php:73 #: ../../Zotlabs/Module/Tokens.php:188 ../../Zotlabs/Module/Thing.php:326 #: ../../Zotlabs/Module/Thing.php:379 ../../Zotlabs/Module/Editpost.php:85 -#: ../../Zotlabs/Module/Connedit.php:888 ../../Zotlabs/Module/Group.php:140 -#: ../../Zotlabs/Module/Group.php:156 ../../Zotlabs/Module/Mood.php:156 +#: ../../Zotlabs/Module/Connedit.php:893 ../../Zotlabs/Module/Group.php:140 +#: ../../Zotlabs/Module/Group.php:156 ../../Zotlabs/Module/Mood.php:158 #: ../../Zotlabs/Module/Invite.php:168 ../../Zotlabs/Module/Connect.php:124 #: ../../Zotlabs/Module/Pdledit.php:107 ../../Zotlabs/Module/Wiki.php:215 #: ../../Zotlabs/Module/Import.php:565 #: ../../Zotlabs/Module/Import_items.php:129 #: ../../Zotlabs/Widget/Wiki_pages.php:42 #: ../../Zotlabs/Widget/Wiki_pages.php:99 -#: ../../Zotlabs/Widget/Eventstools.php:16 ../../Zotlabs/Lib/ThreadItem.php:767 +#: ../../Zotlabs/Widget/Eventstools.php:16 ../../Zotlabs/Lib/ThreadItem.php:770 #: ../../extend/addon/hzaddons/dwpost/dwpost.php:89 #: ../../extend/addon/hzaddons/fuzzloc/fuzzloc.php:191 #: ../../extend/addon/hzaddons/redphotos/redphotos.php:136 @@ -106,7 +106,7 @@ msgstr "Фокус (по умолчанию Hubzilla)" #: ../../extend/addon/hzaddons/mailtest/mailtest.php:100 #: ../../extend/addon/hzaddons/openclipatar/openclipatar.php:53 #: ../../extend/addon/hzaddons/hzfiles/hzfiles.php:84 -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:86 +#: ../../extend/addon/hzaddons/ljpost/ljpost.php:89 #: ../../extend/addon/hzaddons/statusnet/statusnet.php:322 #: ../../extend/addon/hzaddons/statusnet/statusnet.php:380 #: ../../extend/addon/hzaddons/statusnet/statusnet.php:432 @@ -150,9 +150,9 @@ msgstr "Узкая панель навигации" #: ../../view/theme/redbasic/php/config.php:99 #: ../../view/theme/redbasic/php/config.php:116 ../../include/dir_fns.php:143 #: ../../include/dir_fns.php:144 ../../include/dir_fns.php:145 -#: ../../boot.php:1630 ../../Zotlabs/Storage/Browser.php:405 +#: ../../boot.php:1629 ../../Zotlabs/Storage/Browser.php:405 #: ../../Zotlabs/Module/Defperms.php:197 ../../Zotlabs/Module/Profiles.php:681 -#: ../../Zotlabs/Module/Photos.php:699 ../../Zotlabs/Module/Api.php:99 +#: ../../Zotlabs/Module/Photos.php:712 ../../Zotlabs/Module/Api.php:99 #: ../../Zotlabs/Module/Events.php:472 ../../Zotlabs/Module/Events.php:473 #: ../../Zotlabs/Module/Sources.php:124 ../../Zotlabs/Module/Sources.php:159 #: ../../Zotlabs/Module/Settings/Display.php:89 @@ -163,7 +163,7 @@ msgstr "Узкая панель навигации" #: ../../Zotlabs/Module/Menu.php:221 ../../Zotlabs/Module/Mitem.php:176 #: ../../Zotlabs/Module/Mitem.php:177 ../../Zotlabs/Module/Mitem.php:256 #: ../../Zotlabs/Module/Mitem.php:257 ../../Zotlabs/Module/Admin/Site.php:255 -#: ../../Zotlabs/Module/Connedit.php:397 ../../Zotlabs/Module/Connedit.php:780 +#: ../../Zotlabs/Module/Connedit.php:398 ../../Zotlabs/Module/Connedit.php:785 #: ../../Zotlabs/Module/Wiki.php:227 ../../Zotlabs/Module/Wiki.php:228 #: ../../Zotlabs/Module/Import.php:554 ../../Zotlabs/Module/Import.php:558 #: ../../Zotlabs/Module/Import.php:559 ../../Zotlabs/Lib/Libzotdir.php:162 @@ -189,8 +189,8 @@ msgstr "Узкая панель навигации" #: ../../extend/addon/hzaddons/pumpio/pumpio.php:227 #: ../../extend/addon/hzaddons/pumpio/pumpio.php:231 #: ../../extend/addon/hzaddons/nsabait/nsabait.php:157 -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:70 -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:82 +#: ../../extend/addon/hzaddons/ljpost/ljpost.php:73 +#: ../../extend/addon/hzaddons/ljpost/ljpost.php:85 #: ../../extend/addon/hzaddons/statusnet/statusnet.php:389 #: ../../extend/addon/hzaddons/statusnet/statusnet.php:411 #: ../../extend/addon/hzaddons/statusnet/statusnet.php:415 @@ -229,9 +229,9 @@ msgstr "Нет" #: ../../view/theme/redbasic/php/config.php:99 #: ../../view/theme/redbasic/php/config.php:116 ../../include/dir_fns.php:143 #: ../../include/dir_fns.php:144 ../../include/dir_fns.php:145 -#: ../../boot.php:1630 ../../Zotlabs/Storage/Browser.php:405 +#: ../../boot.php:1629 ../../Zotlabs/Storage/Browser.php:405 #: ../../Zotlabs/Module/Defperms.php:197 ../../Zotlabs/Module/Profiles.php:681 -#: ../../Zotlabs/Module/Photos.php:699 ../../Zotlabs/Module/Api.php:98 +#: ../../Zotlabs/Module/Photos.php:712 ../../Zotlabs/Module/Api.php:98 #: ../../Zotlabs/Module/Events.php:472 ../../Zotlabs/Module/Events.php:473 #: ../../Zotlabs/Module/Sources.php:124 ../../Zotlabs/Module/Sources.php:159 #: ../../Zotlabs/Module/Settings/Display.php:89 @@ -242,7 +242,7 @@ msgstr "Нет" #: ../../Zotlabs/Module/Menu.php:221 ../../Zotlabs/Module/Mitem.php:176 #: ../../Zotlabs/Module/Mitem.php:177 ../../Zotlabs/Module/Mitem.php:256 #: ../../Zotlabs/Module/Mitem.php:257 ../../Zotlabs/Module/Admin/Site.php:257 -#: ../../Zotlabs/Module/Connedit.php:397 ../../Zotlabs/Module/Wiki.php:227 +#: ../../Zotlabs/Module/Connedit.php:398 ../../Zotlabs/Module/Wiki.php:227 #: ../../Zotlabs/Module/Wiki.php:228 ../../Zotlabs/Module/Import.php:554 #: ../../Zotlabs/Module/Import.php:558 ../../Zotlabs/Module/Import.php:559 #: ../../Zotlabs/Lib/Libzotdir.php:162 ../../Zotlabs/Lib/Libzotdir.php:163 @@ -268,8 +268,8 @@ msgstr "Нет" #: ../../extend/addon/hzaddons/pumpio/pumpio.php:227 #: ../../extend/addon/hzaddons/pumpio/pumpio.php:231 #: ../../extend/addon/hzaddons/nsabait/nsabait.php:157 -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:70 -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:82 +#: ../../extend/addon/hzaddons/ljpost/ljpost.php:73 +#: ../../extend/addon/hzaddons/ljpost/ljpost.php:85 #: ../../extend/addon/hzaddons/statusnet/statusnet.php:389 #: ../../extend/addon/hzaddons/statusnet/statusnet.php:411 #: ../../extend/addon/hzaddons/statusnet/statusnet.php:415 @@ -414,13 +414,13 @@ msgid "Monthly" msgstr "Ежемесячно" #: ../../include/selectors.php:60 ../../include/selectors.php:77 -#: ../../include/channel.php:1487 +#: ../../include/channel.php:1536 #: ../../extend/addon/hzaddons/openid/Mod_Id.php:85 msgid "Male" msgstr "Мужчина" #: ../../include/selectors.php:60 ../../include/selectors.php:77 -#: ../../include/channel.php:1485 +#: ../../include/channel.php:1534 #: ../../extend/addon/hzaddons/openid/Mod_Id.php:87 msgid "Female" msgstr "Женщина" @@ -457,20 +457,20 @@ msgstr "Транссексуал" msgid "Hermaphrodite" msgstr "Гермафродит" -#: ../../include/selectors.php:60 ../../include/channel.php:1491 +#: ../../include/selectors.php:60 ../../include/channel.php:1540 msgid "Neuter" msgstr "Среднего рода" -#: ../../include/selectors.php:60 ../../include/channel.php:1493 +#: ../../include/selectors.php:60 ../../include/channel.php:1542 msgid "Non-specific" msgstr "Неспецифический" #: ../../include/selectors.php:60 ../../include/selectors.php:77 #: ../../include/selectors.php:115 ../../include/selectors.php:151 #: ../../include/connections.php:703 ../../include/connections.php:710 -#: ../../include/event.php:1315 ../../include/event.php:1322 +#: ../../include/event.php:1318 ../../include/event.php:1325 #: ../../Zotlabs/Module/Cdav.php:1227 ../../Zotlabs/Module/Profiles.php:795 -#: ../../Zotlabs/Module/Connedit.php:919 +#: ../../Zotlabs/Module/Connedit.php:924 #: ../../Zotlabs/Access/PermissionRoles.php:306 msgid "Other" msgstr "Другой" @@ -567,14 +567,14 @@ msgstr "Неверный" msgid "Sex Addict" msgstr "Эротоман" -#: ../../include/selectors.php:134 ../../include/channel.php:444 -#: ../../include/channel.php:445 ../../include/channel.php:452 +#: ../../include/selectors.php:134 ../../include/channel.php:493 +#: ../../include/channel.php:494 ../../include/channel.php:501 #: ../../Zotlabs/Module/Settings/Channel.php:70 #: ../../Zotlabs/Module/Settings/Channel.php:74 #: ../../Zotlabs/Module/Settings/Channel.php:75 #: ../../Zotlabs/Module/Settings/Channel.php:78 #: ../../Zotlabs/Module/Settings/Channel.php:89 -#: ../../Zotlabs/Module/Connedit.php:712 ../../Zotlabs/Widget/Affinity.php:24 +#: ../../Zotlabs/Module/Connedit.php:717 ../../Zotlabs/Widget/Affinity.php:24 msgid "Friends" msgstr "Друзья" @@ -662,7 +662,7 @@ msgstr "Всё равно" msgid "Ask me" msgstr "Спроси меня" -#: ../../include/photos.php:27 ../../include/items.php:3675 +#: ../../include/photos.php:27 ../../include/items.php:3701 #: ../../include/attach.php:150 ../../include/attach.php:197 #: ../../include/attach.php:270 ../../include/attach.php:379 #: ../../include/attach.php:393 ../../include/attach.php:400 @@ -670,8 +670,8 @@ msgstr "Спроси меня" #: ../../include/attach.php:1116 ../../include/attach.php:1281 #: ../../Zotlabs/Module/Mail.php:146 ../../Zotlabs/Module/Defperms.php:181 #: ../../Zotlabs/Module/Network.php:17 ../../Zotlabs/Module/Common.php:38 -#: ../../Zotlabs/Module/Item.php:229 ../../Zotlabs/Module/Item.php:248 -#: ../../Zotlabs/Module/Item.php:258 ../../Zotlabs/Module/Item.php:1110 +#: ../../Zotlabs/Module/Item.php:231 ../../Zotlabs/Module/Item.php:250 +#: ../../Zotlabs/Module/Item.php:260 ../../Zotlabs/Module/Item.php:1136 #: ../../Zotlabs/Module/Achievements.php:34 #: ../../Zotlabs/Module/Display.php:448 ../../Zotlabs/Module/Poke.php:157 #: ../../Zotlabs/Module/Profile.php:85 ../../Zotlabs/Module/Profile.php:101 @@ -698,8 +698,8 @@ msgstr "Спроси меня" #: ../../Zotlabs/Module/Filestorage.php:140 #: ../../Zotlabs/Module/Editblock.php:67 #: ../../Zotlabs/Module/Service_limits.php:11 -#: ../../Zotlabs/Module/Message.php:18 ../../Zotlabs/Module/Channel.php:119 -#: ../../Zotlabs/Module/Channel.php:286 ../../Zotlabs/Module/Channel.php:325 +#: ../../Zotlabs/Module/Message.php:18 ../../Zotlabs/Module/Channel.php:163 +#: ../../Zotlabs/Module/Channel.php:330 ../../Zotlabs/Module/Channel.php:369 #: ../../Zotlabs/Module/Like.php:185 ../../Zotlabs/Module/Bookmarks.php:70 #: ../../Zotlabs/Module/Viewsrc.php:19 ../../Zotlabs/Module/Menu.php:129 #: ../../Zotlabs/Module/Menu.php:140 ../../Zotlabs/Module/Setup.php:209 @@ -713,9 +713,9 @@ msgstr "Спроси меня" #: ../../Zotlabs/Module/Moderate.php:13 ../../Zotlabs/Module/Webpages.php:133 #: ../../Zotlabs/Module/Profile_photo.php:302 #: ../../Zotlabs/Module/Profile_photo.php:315 -#: ../../Zotlabs/Module/Editpost.php:17 ../../Zotlabs/Module/Connedit.php:390 +#: ../../Zotlabs/Module/Editpost.php:17 ../../Zotlabs/Module/Connedit.php:391 #: ../../Zotlabs/Module/Group.php:14 ../../Zotlabs/Module/Group.php:30 -#: ../../Zotlabs/Module/Connections.php:32 ../../Zotlabs/Module/Mood.php:124 +#: ../../Zotlabs/Module/Connections.php:32 ../../Zotlabs/Module/Mood.php:126 #: ../../Zotlabs/Module/Card_edit.php:51 #: ../../Zotlabs/Module/Article_edit.php:51 ../../Zotlabs/Module/Blocks.php:73 #: ../../Zotlabs/Module/Blocks.php:80 ../../Zotlabs/Module/Invite.php:21 @@ -727,6 +727,7 @@ msgstr "Спроси меня" #: ../../Zotlabs/Module/Layouts.php:71 ../../Zotlabs/Module/Layouts.php:78 #: ../../Zotlabs/Module/Layouts.php:89 ../../Zotlabs/Web/WebServer.php:123 #: ../../Zotlabs/Lib/Chatroom.php:133 +#: ../../extend/addon/hzaddons/flashcards/Mod_Flashcards.php:167 #: ../../extend/addon/hzaddons/pumpio/pumpio.php:40 #: ../../extend/addon/hzaddons/openid/Mod_Id.php:53 #: ../../extend/addon/hzaddons/keepout/keepout.php:36 @@ -761,16 +762,16 @@ msgctxt "photo_upload" msgid "%1$s posted %2$s to %3$s" msgstr "%1$s опубликовал %2$s в %3$s" -#: ../../include/photos.php:667 ../../include/nav.php:417 +#: ../../include/photos.php:669 ../../include/nav.php:417 msgid "Photo Albums" msgstr "Фотоальбомы" -#: ../../include/photos.php:668 ../../Zotlabs/Module/Photos.php:1367 -#: ../../Zotlabs/Module/Photos.php:1380 ../../Zotlabs/Module/Photos.php:1381 +#: ../../include/photos.php:670 ../../Zotlabs/Module/Photos.php:1380 +#: ../../Zotlabs/Module/Photos.php:1393 ../../Zotlabs/Module/Photos.php:1394 msgid "Recent Photos" msgstr "Последние фотографии" -#: ../../include/photos.php:672 +#: ../../include/photos.php:674 msgid "Upload New Photos" msgstr "Загрузить новые фотографии" @@ -778,19 +779,19 @@ msgstr "Загрузить новые фотографии" msgid "View PDF" msgstr "Просмотреть PDF" -#: ../../include/oembed.php:347 +#: ../../include/oembed.php:352 msgid " by " msgstr " по " -#: ../../include/oembed.php:348 +#: ../../include/oembed.php:353 msgid " on " msgstr " на " -#: ../../include/oembed.php:377 +#: ../../include/oembed.php:382 msgid "Embedded content" msgstr "Встроенное содержимое" -#: ../../include/oembed.php:386 +#: ../../include/oembed.php:391 msgid "Embedding disabled" msgstr "Встраивание отключено" @@ -853,7 +854,7 @@ msgstr "Расширенный пример: name=ivan and country=russia" #: ../../include/contact_widgets.php:53 ../../include/features.php:325 #: ../../Zotlabs/Widget/Filer.php:28 -#: ../../Zotlabs/Widget/Activity_filter.php:136 +#: ../../Zotlabs/Widget/Activity_filter.php:137 msgid "Saved Folders" msgstr "Сохранённые каталоги" @@ -879,8 +880,8 @@ msgstr "Общие контакты" msgid "View all %d common connections" msgstr "Просмотреть все %d общих контактов" -#: ../../include/menu.php:118 ../../include/channel.php:1303 -#: ../../include/channel.php:1307 ../../Zotlabs/Storage/Browser.php:290 +#: ../../include/menu.php:118 ../../include/channel.php:1352 +#: ../../include/channel.php:1356 ../../Zotlabs/Storage/Browser.php:290 #: ../../Zotlabs/Module/Oauth.php:173 ../../Zotlabs/Module/Oauth2.php:194 #: ../../Zotlabs/Module/Editlayout.php:114 #: ../../Zotlabs/Module/Editblock.php:114 ../../Zotlabs/Module/Menu.php:175 @@ -899,55 +900,55 @@ msgstr "Просмотреть все %d общих контактов" msgid "Edit" msgstr "Изменить" -#: ../../include/channel.php:42 +#: ../../include/channel.php:43 msgid "Unable to obtain identity information from database" msgstr "Невозможно получить идентификационную информацию из базы данных" -#: ../../include/channel.php:75 +#: ../../include/channel.php:76 msgid "Empty name" msgstr "Пустое имя" -#: ../../include/channel.php:78 +#: ../../include/channel.php:79 msgid "Name too long" msgstr "Слишком длинное имя" -#: ../../include/channel.php:195 +#: ../../include/channel.php:196 msgid "No account identifier" msgstr "Идентификатор аккаунта отсутствует" -#: ../../include/channel.php:207 +#: ../../include/channel.php:208 msgid "Nickname is required." msgstr "Требуется псевдоним." -#: ../../include/channel.php:221 ../../include/channel.php:606 +#: ../../include/channel.php:222 ../../include/channel.php:655 #: ../../Zotlabs/Module/Changeaddr.php:46 msgid "Reserved nickname. Please choose another." msgstr "Зарезервированый псевдоним. Пожалуйста, выберите другой." -#: ../../include/channel.php:226 ../../include/channel.php:611 +#: ../../include/channel.php:227 ../../include/channel.php:660 #: ../../Zotlabs/Module/Changeaddr.php:51 msgid "" "Nickname has unsupported characters or is already being used on this site." msgstr "Псевдоним имеет недопустимые символы или уже используется на этом сайте." -#: ../../include/channel.php:284 +#: ../../include/channel.php:287 msgid "Unable to retrieve created identity" msgstr "Не удается получить созданный идентификатор" -#: ../../include/channel.php:380 +#: ../../include/channel.php:429 msgid "Default Profile" msgstr "Профиль по умолчанию" -#: ../../include/channel.php:539 ../../include/channel.php:628 +#: ../../include/channel.php:588 ../../include/channel.php:677 msgid "Unable to retrieve modified identity" msgstr "Не удается найти изменённый идентификатор" -#: ../../include/channel.php:1158 +#: ../../include/channel.php:1207 #: ../../extend/addon/hzaddons/chess/chess.php:486 msgid "Requested channel is not available." msgstr "Запрошенный канал не доступен." -#: ../../include/channel.php:1204 ../../Zotlabs/Module/Achievements.php:15 +#: ../../include/channel.php:1253 ../../Zotlabs/Module/Achievements.php:15 #: ../../Zotlabs/Module/Profile.php:20 ../../Zotlabs/Module/Editlayout.php:31 #: ../../Zotlabs/Module/Filestorage.php:51 #: ../../Zotlabs/Module/Editblock.php:31 ../../Zotlabs/Module/Menu.php:91 @@ -959,84 +960,84 @@ msgstr "Запрошенный канал не доступен." msgid "Requested profile is not available." msgstr "Запрашиваемый профиль не доступен." -#: ../../include/channel.php:1296 ../../Zotlabs/Module/Profiles.php:728 +#: ../../include/channel.php:1345 ../../Zotlabs/Module/Profiles.php:728 msgid "Change profile photo" msgstr "Изменить фотографию профиля" -#: ../../include/channel.php:1303 ../../include/nav.php:109 +#: ../../include/channel.php:1352 ../../include/nav.php:109 #: ../../Zotlabs/Module/Profiles.php:830 msgid "Edit Profiles" msgstr "Редактирование профилей" -#: ../../include/channel.php:1304 +#: ../../include/channel.php:1353 msgid "Create New Profile" msgstr "Создать новый профиль" -#: ../../include/channel.php:1307 ../../include/nav.php:111 +#: ../../include/channel.php:1356 ../../include/nav.php:111 #: ../../extend/addon/hzaddons/openclipatar/openclipatar.php:58 msgid "Edit Profile" msgstr "Редактировать профиль" -#: ../../include/channel.php:1322 ../../Zotlabs/Module/Profiles.php:820 +#: ../../include/channel.php:1371 ../../Zotlabs/Module/Profiles.php:820 msgid "Profile Image" msgstr "Изображение профиля" -#: ../../include/channel.php:1325 +#: ../../include/channel.php:1374 msgid "Visible to everybody" msgstr "Видно всем" -#: ../../include/channel.php:1326 ../../Zotlabs/Module/Profiles.php:725 +#: ../../include/channel.php:1375 ../../Zotlabs/Module/Profiles.php:725 #: ../../Zotlabs/Module/Profiles.php:824 msgid "Edit visibility" msgstr "Редактировать видимость" -#: ../../include/channel.php:1383 ../../include/conversation.php:1058 +#: ../../include/channel.php:1432 ../../include/conversation.php:1058 #: ../../include/connections.php:110 ../../Zotlabs/Module/Directory.php:342 #: ../../Zotlabs/Module/Suggest.php:71 ../../Zotlabs/Widget/Suggestions.php:44 #: ../../Zotlabs/Widget/Follow.php:32 msgid "Connect" msgstr "Подключить" -#: ../../include/channel.php:1398 ../../include/event.php:54 +#: ../../include/channel.php:1447 ../../include/event.php:54 #: ../../include/event.php:86 ../../Zotlabs/Module/Directory.php:328 msgid "Location:" msgstr "Местоположение:" -#: ../../include/channel.php:1402 ../../include/channel.php:1530 +#: ../../include/channel.php:1451 ../../include/channel.php:1579 msgid "Gender:" msgstr "Пол:" -#: ../../include/channel.php:1403 ../../include/channel.php:1574 +#: ../../include/channel.php:1452 ../../include/channel.php:1623 #: ../../extend/addon/hzaddons/jappixmini/jappixmini.php:305 msgid "Status:" msgstr "Статус:" -#: ../../include/channel.php:1404 ../../include/channel.php:1598 +#: ../../include/channel.php:1453 ../../include/channel.php:1647 msgid "Homepage:" msgstr "Домашняя страница:" -#: ../../include/channel.php:1405 +#: ../../include/channel.php:1454 msgid "Online Now" msgstr "Сейчас в сети" -#: ../../include/channel.php:1458 +#: ../../include/channel.php:1507 msgid "Change your profile photo" msgstr "Изменить фотографию вашего профиля" -#: ../../include/channel.php:1489 +#: ../../include/channel.php:1538 msgid "Trans" msgstr "Трансексуал" -#: ../../include/channel.php:1528 ../../Zotlabs/Module/Settings/Channel.php:499 +#: ../../include/channel.php:1577 ../../Zotlabs/Module/Settings/Channel.php:499 msgid "Full Name:" msgstr "Полное имя:" -#: ../../include/channel.php:1535 +#: ../../include/channel.php:1584 msgid "Like this channel" msgstr "нравится этот канал" -#: ../../include/channel.php:1546 ../../include/conversation.php:1693 -#: ../../include/taxonomy.php:661 ../../Zotlabs/Module/Photos.php:1162 +#: ../../include/channel.php:1595 ../../include/conversation.php:1693 +#: ../../include/taxonomy.php:661 ../../Zotlabs/Module/Photos.php:1175 #: ../../Zotlabs/Lib/ThreadItem.php:218 msgctxt "noun" msgid "Like" @@ -1045,136 +1046,136 @@ msgstr[0] "Нравится" msgstr[1] "Нравится" msgstr[2] "Нравится" -#: ../../include/channel.php:1559 +#: ../../include/channel.php:1608 msgid "j F, Y" msgstr "" -#: ../../include/channel.php:1560 +#: ../../include/channel.php:1609 msgid "j F" msgstr "" -#: ../../include/channel.php:1567 +#: ../../include/channel.php:1616 msgid "Birthday:" msgstr "День рождения:" -#: ../../include/channel.php:1571 ../../Zotlabs/Module/Directory.php:323 +#: ../../include/channel.php:1620 ../../Zotlabs/Module/Directory.php:323 msgid "Age:" msgstr "Возраст:" -#: ../../include/channel.php:1580 +#: ../../include/channel.php:1629 #, php-format msgid "for %1$d %2$s" msgstr "для %1$d %2$s" -#: ../../include/channel.php:1592 +#: ../../include/channel.php:1641 msgid "Tags:" msgstr "Теги:" -#: ../../include/channel.php:1596 +#: ../../include/channel.php:1645 msgid "Sexual Preference:" msgstr "Сексуальные предпочтения:" -#: ../../include/channel.php:1600 ../../Zotlabs/Module/Directory.php:339 +#: ../../include/channel.php:1649 ../../Zotlabs/Module/Directory.php:339 msgid "Hometown:" msgstr "Родной город:" -#: ../../include/channel.php:1602 +#: ../../include/channel.php:1651 msgid "Political Views:" msgstr "Политические взгляды:" -#: ../../include/channel.php:1604 +#: ../../include/channel.php:1653 msgid "Religion:" msgstr "Религия:" -#: ../../include/channel.php:1606 ../../Zotlabs/Module/Directory.php:341 +#: ../../include/channel.php:1655 ../../Zotlabs/Module/Directory.php:341 msgid "About:" msgstr "О себе:" -#: ../../include/channel.php:1608 +#: ../../include/channel.php:1657 msgid "Hobbies/Interests:" msgstr "Хобби / интересы:" -#: ../../include/channel.php:1610 +#: ../../include/channel.php:1659 msgid "Likes:" msgstr "Что вам нравится:" -#: ../../include/channel.php:1612 +#: ../../include/channel.php:1661 msgid "Dislikes:" msgstr "Что вам не нравится:" -#: ../../include/channel.php:1614 +#: ../../include/channel.php:1663 msgid "Contact information and Social Networks:" msgstr "Контактная информация и социальные сети:" -#: ../../include/channel.php:1616 +#: ../../include/channel.php:1665 msgid "My other channels:" msgstr "Мои другие каналы:" -#: ../../include/channel.php:1618 +#: ../../include/channel.php:1667 msgid "Musical interests:" msgstr "Музыкальные интересы:" -#: ../../include/channel.php:1620 +#: ../../include/channel.php:1669 msgid "Books, literature:" msgstr "Книги, литература:" -#: ../../include/channel.php:1622 +#: ../../include/channel.php:1671 msgid "Television:" msgstr "Телевидение:" -#: ../../include/channel.php:1624 +#: ../../include/channel.php:1673 msgid "Film/dance/culture/entertainment:" msgstr "Кино / танцы / культура / развлечения:" -#: ../../include/channel.php:1626 +#: ../../include/channel.php:1675 msgid "Love/Romance:" msgstr "Любовь / романтика:" -#: ../../include/channel.php:1628 +#: ../../include/channel.php:1677 msgid "Work/employment:" msgstr "Работа / занятость:" -#: ../../include/channel.php:1630 +#: ../../include/channel.php:1679 msgid "School/education:" msgstr "Школа / образование:" -#: ../../include/channel.php:1651 ../../Zotlabs/Module/Profperm.php:113 +#: ../../include/channel.php:1700 ../../Zotlabs/Module/Profperm.php:113 #: ../../Zotlabs/Lib/Apps.php:337 msgid "Profile" msgstr "Профиль" -#: ../../include/channel.php:1653 +#: ../../include/channel.php:1702 msgid "Like this thing" msgstr "нравится этo" -#: ../../include/channel.php:1654 ../../Zotlabs/Module/Events.php:692 +#: ../../include/channel.php:1703 ../../Zotlabs/Module/Events.php:692 #: ../../Zotlabs/Module/Cal.php:340 msgid "Export" msgstr "Экспорт" -#: ../../include/channel.php:2088 ../../Zotlabs/Module/Cover_photo.php:276 +#: ../../include/channel.php:2137 ../../Zotlabs/Module/Cover_photo.php:276 msgid "cover photo" msgstr "фотография обложки" -#: ../../include/channel.php:2341 ../../boot.php:1626 +#: ../../include/channel.php:2390 ../../boot.php:1625 #: ../../Zotlabs/Module/Rmagic.php:75 msgid "Remote Authentication" msgstr "Удаленная аутентификация" -#: ../../include/channel.php:2342 ../../Zotlabs/Module/Rmagic.php:76 +#: ../../include/channel.php:2391 ../../Zotlabs/Module/Rmagic.php:76 msgid "Enter your channel address (e.g. channel@example.com)" msgstr "Введите адрес вашего канала (например: channel@example.com)" -#: ../../include/channel.php:2343 ../../Zotlabs/Module/Rmagic.php:77 +#: ../../include/channel.php:2392 ../../Zotlabs/Module/Rmagic.php:77 msgid "Authenticate" msgstr "Проверка подлинности" -#: ../../include/channel.php:2497 ../../Zotlabs/Module/Admin/Accounts.php:91 +#: ../../include/channel.php:2547 ../../Zotlabs/Module/Admin/Accounts.php:91 #, php-format msgid "Account '%s' deleted" msgstr "Аккаунт '%s' удален" -#: ../../include/message.php:13 ../../include/text.php:1709 +#: ../../include/message.php:13 ../../include/text.php:1708 msgid "Download binary/encrypted content" msgstr "Загрузить двоичное / зашифрованное содержимое" @@ -1205,7 +1206,7 @@ msgid "post" msgstr "публикация" #: ../../include/items.php:384 ../../Zotlabs/Module/Dreport.php:10 -#: ../../Zotlabs/Module/Dreport.php:68 ../../Zotlabs/Module/Profperm.php:28 +#: ../../Zotlabs/Module/Dreport.php:79 ../../Zotlabs/Module/Profperm.php:28 #: ../../Zotlabs/Module/Like.php:296 ../../Zotlabs/Module/Subthread.php:86 #: ../../Zotlabs/Module/Group.php:93 ../../Zotlabs/Module/Cloud.php:126 #: ../../Zotlabs/Module/Import_items.php:120 @@ -1217,44 +1218,44 @@ msgstr "публикация" msgid "Permission denied" msgstr "Доступ запрещен" -#: ../../include/items.php:911 ../../include/items.php:971 +#: ../../include/items.php:921 ../../include/items.php:981 msgid "(Unknown)" msgstr "(Неизвестный)" -#: ../../include/items.php:1157 +#: ../../include/items.php:1169 msgid "Visible to anybody on the internet." msgstr "Виден всем в интернете." -#: ../../include/items.php:1159 +#: ../../include/items.php:1171 msgid "Visible to you only." msgstr "Видно только вам." -#: ../../include/items.php:1161 +#: ../../include/items.php:1173 msgid "Visible to anybody in this network." msgstr "Видно всем в этой сети." -#: ../../include/items.php:1163 +#: ../../include/items.php:1175 msgid "Visible to anybody authenticated." msgstr "Видно всем аутентифицированным." -#: ../../include/items.php:1165 +#: ../../include/items.php:1177 #, php-format msgid "Visible to anybody on %s." msgstr "Видно всем в %s." -#: ../../include/items.php:1167 +#: ../../include/items.php:1179 msgid "Visible to all connections." msgstr "Видно всем контактам." -#: ../../include/items.php:1169 +#: ../../include/items.php:1181 msgid "Visible to approved connections." msgstr "Видно только одобренным контактам." -#: ../../include/items.php:1171 +#: ../../include/items.php:1183 msgid "Visible to specific connections." msgstr "Видно указанным контактам." -#: ../../include/items.php:3587 ../../Zotlabs/Module/Display.php:45 +#: ../../include/items.php:3613 ../../Zotlabs/Module/Display.php:45 #: ../../Zotlabs/Module/Display.php:452 ../../Zotlabs/Module/Admin.php:62 #: ../../Zotlabs/Module/Filestorage.php:24 ../../Zotlabs/Module/Viewsrc.php:25 #: ../../Zotlabs/Module/Admin/Addons.php:259 @@ -1262,90 +1263,90 @@ msgstr "Видно указанным контактам." msgid "Item not found." msgstr "Элемент не найден." -#: ../../include/items.php:4167 ../../Zotlabs/Module/Group.php:61 +#: ../../include/items.php:4193 ../../Zotlabs/Module/Group.php:61 #: ../../Zotlabs/Module/Group.php:200 msgid "Privacy group not found." msgstr "Группа безопасности не найдена." -#: ../../include/items.php:4183 +#: ../../include/items.php:4209 msgid "Privacy group is empty." msgstr "Группа безопасности пуста" -#: ../../include/items.php:4190 +#: ../../include/items.php:4216 #, php-format msgid "Privacy group: %s" msgstr "Группа безопасности: %s" -#: ../../include/items.php:4200 ../../Zotlabs/Module/Connedit.php:851 +#: ../../include/items.php:4226 ../../Zotlabs/Module/Connedit.php:856 #, php-format msgid "Connection: %s" msgstr "Контакт: %s" -#: ../../include/items.php:4202 +#: ../../include/items.php:4228 msgid "Connection not found." msgstr "Контакт не найден." -#: ../../include/items.php:4544 ../../Zotlabs/Module/Cover_photo.php:269 +#: ../../include/items.php:4570 ../../Zotlabs/Module/Cover_photo.php:269 msgid "female" msgstr "женщина" -#: ../../include/items.php:4545 ../../Zotlabs/Module/Cover_photo.php:270 +#: ../../include/items.php:4571 ../../Zotlabs/Module/Cover_photo.php:270 #, php-format msgid "%1$s updated her %2$s" msgstr "%1$s обновила её %2$s" -#: ../../include/items.php:4546 ../../Zotlabs/Module/Cover_photo.php:271 +#: ../../include/items.php:4572 ../../Zotlabs/Module/Cover_photo.php:271 msgid "male" msgstr "мужчина" -#: ../../include/items.php:4547 ../../Zotlabs/Module/Cover_photo.php:272 +#: ../../include/items.php:4573 ../../Zotlabs/Module/Cover_photo.php:272 #, php-format msgid "%1$s updated his %2$s" msgstr "%1$s обновил его %2$s" -#: ../../include/items.php:4549 ../../Zotlabs/Module/Cover_photo.php:274 +#: ../../include/items.php:4575 ../../Zotlabs/Module/Cover_photo.php:274 #, php-format msgid "%1$s updated their %2$s" msgstr "%1$s обновили их %2$s" -#: ../../include/items.php:4551 +#: ../../include/items.php:4577 msgid "profile photo" msgstr "Фотография профиля" -#: ../../include/items.php:4742 +#: ../../include/items.php:4769 #, php-format msgid "[Edited %s]" msgstr "[Отредактировано %s]" -#: ../../include/items.php:4742 +#: ../../include/items.php:4769 msgctxt "edit_activity" msgid "Post" msgstr "Публикация" -#: ../../include/items.php:4742 +#: ../../include/items.php:4769 msgctxt "edit_activity" msgid "Comment" msgstr "Комментарий" -#: ../../include/activities.php:41 +#: ../../include/activities.php:42 msgid " and " msgstr " и " -#: ../../include/activities.php:49 +#: ../../include/activities.php:50 msgid "public profile" msgstr "общедоступный профиль" -#: ../../include/activities.php:58 +#: ../../include/activities.php:59 #, php-format msgid "%1$s changed %2$s to “%3$s”" msgstr "%1$s изменил %2$s на “%3$s”" -#: ../../include/activities.php:59 +#: ../../include/activities.php:60 #, php-format msgid "Visit %1$s's %2$s" msgstr "Посетить %1$s %2$s" -#: ../../include/activities.php:62 +#: ../../include/activities.php:63 #, php-format msgid "%1$s has an updated %2$s, changing %3$s." msgstr "%1$s обновлено %2$s, изменено %3$s." @@ -1402,7 +1403,7 @@ msgstr "Использовать режим блога / списка" msgid "Comments will be displayed separately" msgstr "Комментарии будут отображаться отдельно" -#: ../../include/features.php:125 ../../include/text.php:981 +#: ../../include/features.php:125 ../../include/text.php:980 #: ../../Zotlabs/Module/Connections.php:334 ../../Zotlabs/Lib/Apps.php:308 msgid "Connections" msgstr "Контакты" @@ -1687,53 +1688,53 @@ msgstr "Несколько профилей" msgid "Ability to create multiple profiles" msgstr "Возможность создания нескольких профилей" -#: ../../include/text.php:498 +#: ../../include/text.php:501 msgid "prev" msgstr "предыдущий" -#: ../../include/text.php:500 +#: ../../include/text.php:503 msgid "first" msgstr "первый" -#: ../../include/text.php:529 +#: ../../include/text.php:532 msgid "last" msgstr "последний" -#: ../../include/text.php:532 +#: ../../include/text.php:535 msgid "next" msgstr "следующий" -#: ../../include/text.php:543 +#: ../../include/text.php:546 msgid "older" msgstr "старше" -#: ../../include/text.php:545 +#: ../../include/text.php:548 msgid "newer" msgstr "новее" -#: ../../include/text.php:969 +#: ../../include/text.php:968 msgid "No connections" msgstr "Нет контактов" -#: ../../include/text.php:1001 +#: ../../include/text.php:1000 #, php-format msgid "View all %s connections" msgstr "Просмотреть все %s контактов" -#: ../../include/text.php:1057 +#: ../../include/text.php:1056 #, php-format msgid "Network: %s" msgstr "Сеть: %s" -#: ../../include/text.php:1068 ../../include/text.php:1080 +#: ../../include/text.php:1067 ../../include/text.php:1079 #: ../../include/acl_selectors.php:118 ../../include/nav.php:183 #: ../../Zotlabs/Module/Search.php:44 ../../Zotlabs/Module/Connections.php:338 #: ../../Zotlabs/Widget/Sitesearch.php:31 -#: ../../Zotlabs/Widget/Activity_filter.php:150 ../../Zotlabs/Lib/Apps.php:328 +#: ../../Zotlabs/Widget/Activity_filter.php:151 ../../Zotlabs/Lib/Apps.php:328 msgid "Search" msgstr "Поиск" -#: ../../include/text.php:1069 ../../include/text.php:1081 +#: ../../include/text.php:1068 ../../include/text.php:1080 #: ../../Zotlabs/Module/Admin/Profs.php:94 #: ../../Zotlabs/Module/Admin/Profs.php:114 ../../Zotlabs/Module/Rbmark.php:32 #: ../../Zotlabs/Module/Rbmark.php:104 ../../Zotlabs/Module/Filer.php:53 @@ -1741,409 +1742,409 @@ msgstr "Поиск" msgid "Save" msgstr "Запомнить" -#: ../../include/text.php:1146 ../../include/text.php:1150 +#: ../../include/text.php:1145 ../../include/text.php:1149 msgid "poke" msgstr "Ткнуть" -#: ../../include/text.php:1146 ../../include/text.php:1150 +#: ../../include/text.php:1145 ../../include/text.php:1149 #: ../../include/conversation.php:251 msgid "poked" msgstr "ткнут" -#: ../../include/text.php:1151 +#: ../../include/text.php:1150 msgid "ping" msgstr "Пингануть" -#: ../../include/text.php:1151 +#: ../../include/text.php:1150 msgid "pinged" msgstr "Отпингован" -#: ../../include/text.php:1152 +#: ../../include/text.php:1151 msgid "prod" msgstr "Подтолкнуть" -#: ../../include/text.php:1152 +#: ../../include/text.php:1151 msgid "prodded" msgstr "Подтолкнут" -#: ../../include/text.php:1153 +#: ../../include/text.php:1152 msgid "slap" msgstr "Шлёпнуть" -#: ../../include/text.php:1153 +#: ../../include/text.php:1152 msgid "slapped" msgstr "Шлёпнут" -#: ../../include/text.php:1154 +#: ../../include/text.php:1153 msgid "finger" msgstr "Указать" -#: ../../include/text.php:1154 +#: ../../include/text.php:1153 msgid "fingered" msgstr "Указан" -#: ../../include/text.php:1155 +#: ../../include/text.php:1154 msgid "rebuff" msgstr "Дать отпор" -#: ../../include/text.php:1155 +#: ../../include/text.php:1154 msgid "rebuffed" msgstr "Дан отпор" -#: ../../include/text.php:1178 +#: ../../include/text.php:1177 msgid "happy" msgstr "счастливый" -#: ../../include/text.php:1179 +#: ../../include/text.php:1178 msgid "sad" msgstr "грустный" -#: ../../include/text.php:1180 +#: ../../include/text.php:1179 msgid "mellow" msgstr "спокойный" -#: ../../include/text.php:1181 +#: ../../include/text.php:1180 msgid "tired" msgstr "усталый" -#: ../../include/text.php:1182 +#: ../../include/text.php:1181 msgid "perky" msgstr "весёлый" -#: ../../include/text.php:1183 +#: ../../include/text.php:1182 msgid "angry" msgstr "сердитый" -#: ../../include/text.php:1184 +#: ../../include/text.php:1183 msgid "stupefied" msgstr "отупевший" -#: ../../include/text.php:1185 +#: ../../include/text.php:1184 msgid "puzzled" msgstr "недоумевающий" -#: ../../include/text.php:1186 +#: ../../include/text.php:1185 msgid "interested" msgstr "заинтересованный" -#: ../../include/text.php:1187 +#: ../../include/text.php:1186 msgid "bitter" msgstr "едкий" -#: ../../include/text.php:1188 +#: ../../include/text.php:1187 msgid "cheerful" msgstr "бодрый" -#: ../../include/text.php:1189 +#: ../../include/text.php:1188 msgid "alive" msgstr "энергичный" -#: ../../include/text.php:1190 +#: ../../include/text.php:1189 msgid "annoyed" msgstr "раздражённый" -#: ../../include/text.php:1191 +#: ../../include/text.php:1190 msgid "anxious" msgstr "обеспокоенный" -#: ../../include/text.php:1192 +#: ../../include/text.php:1191 msgid "cranky" msgstr "капризный" -#: ../../include/text.php:1193 +#: ../../include/text.php:1192 msgid "disturbed" msgstr "встревоженный" -#: ../../include/text.php:1194 +#: ../../include/text.php:1193 msgid "frustrated" msgstr "разочарованный" -#: ../../include/text.php:1195 +#: ../../include/text.php:1194 msgid "depressed" msgstr "подавленный" -#: ../../include/text.php:1196 +#: ../../include/text.php:1195 msgid "motivated" msgstr "мотивированный" -#: ../../include/text.php:1197 +#: ../../include/text.php:1196 msgid "relaxed" msgstr "расслабленный" -#: ../../include/text.php:1198 +#: ../../include/text.php:1197 msgid "surprised" msgstr "удивленный" -#: ../../include/text.php:1377 ../../include/js_strings.php:95 +#: ../../include/text.php:1376 ../../include/js_strings.php:95 msgid "Monday" msgstr "Понедельник" -#: ../../include/text.php:1377 ../../include/js_strings.php:96 +#: ../../include/text.php:1376 ../../include/js_strings.php:96 msgid "Tuesday" msgstr "Вторник" -#: ../../include/text.php:1377 ../../include/js_strings.php:97 +#: ../../include/text.php:1376 ../../include/js_strings.php:97 msgid "Wednesday" msgstr "Среда" -#: ../../include/text.php:1377 ../../include/js_strings.php:98 +#: ../../include/text.php:1376 ../../include/js_strings.php:98 msgid "Thursday" msgstr "Четверг" -#: ../../include/text.php:1377 ../../include/js_strings.php:99 +#: ../../include/text.php:1376 ../../include/js_strings.php:99 msgid "Friday" msgstr "Пятница" -#: ../../include/text.php:1377 ../../include/js_strings.php:100 +#: ../../include/text.php:1376 ../../include/js_strings.php:100 msgid "Saturday" msgstr "Суббота" -#: ../../include/text.php:1377 ../../include/js_strings.php:94 +#: ../../include/text.php:1376 ../../include/js_strings.php:94 msgid "Sunday" msgstr "Воскресенье" -#: ../../include/text.php:1381 ../../include/js_strings.php:70 +#: ../../include/text.php:1380 ../../include/js_strings.php:70 msgid "January" msgstr "Январь" -#: ../../include/text.php:1381 ../../include/js_strings.php:71 +#: ../../include/text.php:1380 ../../include/js_strings.php:71 msgid "February" msgstr "Февраль" -#: ../../include/text.php:1381 ../../include/js_strings.php:72 +#: ../../include/text.php:1380 ../../include/js_strings.php:72 msgid "March" msgstr "Март" -#: ../../include/text.php:1381 ../../include/js_strings.php:73 +#: ../../include/text.php:1380 ../../include/js_strings.php:73 msgid "April" msgstr "Апрель" -#: ../../include/text.php:1381 +#: ../../include/text.php:1380 msgid "May" msgstr "Май" -#: ../../include/text.php:1381 ../../include/js_strings.php:75 +#: ../../include/text.php:1380 ../../include/js_strings.php:75 msgid "June" msgstr "Июнь" -#: ../../include/text.php:1381 ../../include/js_strings.php:76 +#: ../../include/text.php:1380 ../../include/js_strings.php:76 msgid "July" msgstr "Июль" -#: ../../include/text.php:1381 ../../include/js_strings.php:77 +#: ../../include/text.php:1380 ../../include/js_strings.php:77 msgid "August" msgstr "Август" -#: ../../include/text.php:1381 ../../include/js_strings.php:78 +#: ../../include/text.php:1380 ../../include/js_strings.php:78 msgid "September" msgstr "Сентябрь" -#: ../../include/text.php:1381 ../../include/js_strings.php:79 +#: ../../include/text.php:1380 ../../include/js_strings.php:79 msgid "October" msgstr "Октябрь" -#: ../../include/text.php:1381 ../../include/js_strings.php:80 +#: ../../include/text.php:1380 ../../include/js_strings.php:80 msgid "November" msgstr "Ноябрь" -#: ../../include/text.php:1381 ../../include/js_strings.php:81 +#: ../../include/text.php:1380 ../../include/js_strings.php:81 msgid "December" msgstr "Декабрь" -#: ../../include/text.php:1455 +#: ../../include/text.php:1454 msgid "Unknown Attachment" msgstr "Неизвестное вложение" -#: ../../include/text.php:1457 ../../Zotlabs/Storage/Browser.php:287 +#: ../../include/text.php:1456 ../../Zotlabs/Storage/Browser.php:287 #: ../../Zotlabs/Module/Sharedwithme.php:106 msgid "Size" msgstr "Размер" -#: ../../include/text.php:1457 ../../include/feedutils.php:860 +#: ../../include/text.php:1456 ../../include/feedutils.php:860 msgid "unknown" msgstr "неизвестный" -#: ../../include/text.php:1493 +#: ../../include/text.php:1492 msgid "remove category" msgstr "удалить категорию" -#: ../../include/text.php:1567 +#: ../../include/text.php:1566 msgid "remove from file" msgstr "удалить из файла" -#: ../../include/text.php:1850 ../../Zotlabs/Module/Events.php:663 +#: ../../include/text.php:1849 ../../Zotlabs/Module/Events.php:663 #: ../../Zotlabs/Module/Cal.php:314 msgid "Link to Source" msgstr "Ссылка на источник" -#: ../../include/text.php:1872 ../../include/language.php:423 +#: ../../include/text.php:1871 ../../include/language.php:423 msgid "default" msgstr "по умолчанию" -#: ../../include/text.php:1880 +#: ../../include/text.php:1879 msgid "Page layout" msgstr "Шаблон страницы" -#: ../../include/text.php:1880 +#: ../../include/text.php:1879 msgid "You can create your own with the layouts tool" msgstr "Вы можете создать свой собственный с помощью инструмента шаблонов" -#: ../../include/text.php:1890 ../../Zotlabs/Module/Wiki.php:217 +#: ../../include/text.php:1889 ../../Zotlabs/Module/Wiki.php:217 #: ../../Zotlabs/Module/Wiki.php:371 ../../Zotlabs/Widget/Wiki_pages.php:38 #: ../../Zotlabs/Widget/Wiki_pages.php:95 msgid "BBcode" msgstr "" -#: ../../include/text.php:1891 +#: ../../include/text.php:1890 msgid "HTML" msgstr "" -#: ../../include/text.php:1892 ../../Zotlabs/Module/Wiki.php:217 +#: ../../include/text.php:1891 ../../Zotlabs/Module/Wiki.php:217 #: ../../Zotlabs/Module/Wiki.php:371 ../../Zotlabs/Widget/Wiki_pages.php:38 #: ../../Zotlabs/Widget/Wiki_pages.php:95 #: ../../extend/addon/hzaddons/mdpost/mdpost.php:41 msgid "Markdown" msgstr "Разметка Markdown" -#: ../../include/text.php:1893 ../../Zotlabs/Module/Wiki.php:217 +#: ../../include/text.php:1892 ../../Zotlabs/Module/Wiki.php:217 #: ../../Zotlabs/Widget/Wiki_pages.php:38 #: ../../Zotlabs/Widget/Wiki_pages.php:95 msgid "Text" msgstr "Текст" -#: ../../include/text.php:1894 +#: ../../include/text.php:1893 msgid "Comanche Layout" msgstr "Шаблон Comanche" -#: ../../include/text.php:1899 +#: ../../include/text.php:1898 msgid "PHP" msgstr "" -#: ../../include/text.php:1908 +#: ../../include/text.php:1907 msgid "Page content type" msgstr "Тип содержимого страницы" -#: ../../include/text.php:2028 ../../include/conversation.php:116 -#: ../../Zotlabs/Module/Tagger.php:69 ../../Zotlabs/Module/Like.php:384 -#: ../../Zotlabs/Module/Subthread.php:111 ../../Zotlabs/Lib/Activity.php:1570 +#: ../../include/text.php:2027 ../../include/conversation.php:116 +#: ../../Zotlabs/Module/Tagger.php:69 ../../Zotlabs/Module/Like.php:387 +#: ../../Zotlabs/Module/Subthread.php:112 ../../Zotlabs/Lib/Activity.php:1570 #: ../../extend/addon/hzaddons/redphotos/redphotohelper.php:71 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:1512 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1539 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:1494 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1541 msgid "photo" msgstr "фото" -#: ../../include/text.php:2031 ../../include/conversation.php:119 -#: ../../include/event.php:1153 ../../Zotlabs/Module/Tagger.php:73 -#: ../../Zotlabs/Module/Events.php:260 ../../Zotlabs/Module/Like.php:386 +#: ../../include/text.php:2030 ../../include/conversation.php:119 +#: ../../include/event.php:1156 ../../Zotlabs/Module/Tagger.php:73 +#: ../../Zotlabs/Module/Events.php:260 ../../Zotlabs/Module/Like.php:389 msgid "event" msgstr "событие" -#: ../../include/text.php:2034 ../../include/conversation.php:144 -#: ../../Zotlabs/Module/Like.php:384 ../../Zotlabs/Module/Subthread.php:111 +#: ../../include/text.php:2033 ../../include/conversation.php:144 +#: ../../Zotlabs/Module/Like.php:387 ../../Zotlabs/Module/Subthread.php:112 #: ../../Zotlabs/Lib/Activity.php:1570 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:1512 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1539 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:1494 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1541 msgid "status" msgstr "статус" -#: ../../include/text.php:2036 ../../include/conversation.php:146 +#: ../../include/text.php:2035 ../../include/conversation.php:146 #: ../../Zotlabs/Module/Tagger.php:79 msgid "comment" msgstr "комментарий" -#: ../../include/text.php:2041 +#: ../../include/text.php:2040 msgid "activity" msgstr "активность" -#: ../../include/text.php:2142 +#: ../../include/text.php:2141 msgid "a-z, 0-9, -, and _ only" msgstr "Только a-z, 0-9, -, и _" -#: ../../include/text.php:2462 +#: ../../include/text.php:2461 msgid "Design Tools" msgstr "Инструменты дизайна" -#: ../../include/text.php:2465 ../../Zotlabs/Module/Blocks.php:154 +#: ../../include/text.php:2464 ../../Zotlabs/Module/Blocks.php:154 msgid "Blocks" msgstr "Блокировки" -#: ../../include/text.php:2466 ../../Zotlabs/Module/Menu.php:170 +#: ../../include/text.php:2465 ../../Zotlabs/Module/Menu.php:170 msgid "Menus" msgstr "Меню" -#: ../../include/text.php:2467 ../../Zotlabs/Module/Layouts.php:184 +#: ../../include/text.php:2466 ../../Zotlabs/Module/Layouts.php:184 msgid "Layouts" msgstr "Шаблоны" -#: ../../include/text.php:2468 +#: ../../include/text.php:2467 msgid "Pages" msgstr "Страницы" -#: ../../include/text.php:2489 ../../Zotlabs/Module/Cal.php:343 +#: ../../include/text.php:2488 ../../Zotlabs/Module/Cal.php:343 msgid "Import" msgstr "Импортировать" -#: ../../include/text.php:2490 +#: ../../include/text.php:2489 msgid "Import website..." msgstr "Импорт веб-сайта..." -#: ../../include/text.php:2491 +#: ../../include/text.php:2490 msgid "Select folder to import" msgstr "Выбрать каталог для импорта" -#: ../../include/text.php:2492 +#: ../../include/text.php:2491 msgid "Import from a zipped folder:" msgstr "Импортировать из каталога в zip-архиве:" -#: ../../include/text.php:2493 +#: ../../include/text.php:2492 msgid "Import from cloud files:" msgstr "Импортировать из сетевых файлов:" -#: ../../include/text.php:2494 +#: ../../include/text.php:2493 msgid "/cloud/channel/path/to/folder" msgstr "" -#: ../../include/text.php:2495 +#: ../../include/text.php:2494 msgid "Enter path to website files" msgstr "Введите путь к файлам веб-сайта" -#: ../../include/text.php:2496 +#: ../../include/text.php:2495 msgid "Select folder" msgstr "Выбрать каталог" -#: ../../include/text.php:2497 +#: ../../include/text.php:2496 msgid "Export website..." msgstr "Экспорт веб-сайта..." -#: ../../include/text.php:2498 +#: ../../include/text.php:2497 msgid "Export to a zip file" msgstr "Экспортировать в ZIP файл." -#: ../../include/text.php:2499 +#: ../../include/text.php:2498 msgid "website.zip" msgstr "" -#: ../../include/text.php:2500 +#: ../../include/text.php:2499 msgid "Enter a name for the zip file." msgstr "Введите имя для ZIP файла." -#: ../../include/text.php:2501 +#: ../../include/text.php:2500 msgid "Export to cloud files" msgstr "Эскпортировать в сетевые файлы:" -#: ../../include/text.php:2502 +#: ../../include/text.php:2501 msgid "/path/to/export/folder" msgstr "" -#: ../../include/text.php:2503 +#: ../../include/text.php:2502 msgid "Enter a path to a cloud files destination." msgstr "Введите путь к расположению сетевых файлов." -#: ../../include/text.php:2504 +#: ../../include/text.php:2503 msgid "Specify folder" msgstr "Указать каталог" -#: ../../include/text.php:2824 ../../Zotlabs/Storage/Browser.php:131 +#: ../../include/text.php:2823 ../../Zotlabs/Storage/Browser.php:131 msgid "Collection" msgstr "Коллекция" @@ -2161,7 +2162,7 @@ msgstr "Не удалось создать дублирующийся идент msgid "Unable to create a unique channel address. Import failed." msgstr "Не удалось создать уникальный адрес канала. Импорт не завершен." -#: ../../include/import.php:117 +#: ../../include/import.php:116 msgid "Cloned channel not found. Import failed." msgstr "Клон канала не найден. Импорт невозможен." @@ -2182,7 +2183,7 @@ msgstr "редактировать" #: ../../include/group.php:320 ../../include/nav.php:95 #: ../../Zotlabs/Module/Group.php:132 ../../Zotlabs/Module/Group.php:143 -#: ../../Zotlabs/Widget/Activity_filter.php:70 ../../Zotlabs/Lib/Group.php:324 +#: ../../Zotlabs/Widget/Activity_filter.php:41 ../../Zotlabs/Lib/Group.php:324 #: ../../Zotlabs/Lib/Apps.php:339 msgid "Privacy Groups" msgstr "Группы безопасности" @@ -2272,20 +2273,20 @@ msgstr "Это действие превышает ограничения, ус msgid "This action is not available under your subscription plan." msgstr "Это действие невозможно из-за ограничений в вашем плане." -#: ../../include/zot.php:773 +#: ../../include/zot.php:775 msgid "Invalid data packet" msgstr "Неверный пакет данных" -#: ../../include/zot.php:800 ../../Zotlabs/Lib/Libzot.php:663 +#: ../../include/zot.php:802 ../../Zotlabs/Lib/Libzot.php:667 msgid "Unable to verify channel signature" msgstr "Невозможно проверить подпись канала" -#: ../../include/zot.php:2571 ../../Zotlabs/Lib/Libsync.php:733 +#: ../../include/zot.php:2575 ../../Zotlabs/Lib/Libsync.php:733 #, php-format msgid "Unable to verify site signature for %s" msgstr "Невозможно проверить подпись сайта %s" -#: ../../include/zot.php:4235 +#: ../../include/zot.php:4272 msgid "invalid target signature" msgstr "недопустимая целевая подпись" @@ -2346,11 +2347,6 @@ msgstr "Не найдено" msgid "Page not found." msgstr "Страница не найдена." -#: ../../include/dba/dba_driver.php:178 -#, php-format -msgid "Cannot locate DNS info for database server '%s'" -msgstr "Не удается найти DNS информацию для сервера базы данных '%s'" - #: ../../include/bbcode.php:200 ../../include/bbcode.php:1201 #: ../../include/bbcode.php:1204 ../../include/bbcode.php:1209 #: ../../include/bbcode.php:1212 ../../include/bbcode.php:1215 @@ -2430,17 +2426,17 @@ msgstr "$1 писал:" msgid "channel" msgstr "канал" -#: ../../include/conversation.php:160 ../../Zotlabs/Module/Like.php:438 +#: ../../include/conversation.php:160 ../../Zotlabs/Module/Like.php:441 #: ../../Zotlabs/Lib/Activity.php:1605 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:1547 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1568 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:1529 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1570 #, php-format msgid "%1$s likes %2$s's %3$s" msgstr "%1$s нравится %3$s %2$s" -#: ../../include/conversation.php:163 ../../Zotlabs/Module/Like.php:440 +#: ../../include/conversation.php:163 ../../Zotlabs/Module/Like.php:443 #: ../../Zotlabs/Lib/Activity.php:1607 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:1549 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:1531 #, php-format msgid "%1$s doesn't like %2$s's %3$s" msgstr "%1$s не нравится %2$s %3$s" @@ -2465,52 +2461,52 @@ msgstr "%1$s теперь в контакте с %2$s" msgid "%1$s poked %2$s" msgstr "%1$s ткнул %2$s" -#: ../../include/conversation.php:268 ../../Zotlabs/Module/Mood.php:75 +#: ../../include/conversation.php:268 ../../Zotlabs/Module/Mood.php:76 #, php-format msgctxt "mood" msgid "%1$s is %2$s" msgstr "%1$s в %2$s" -#: ../../include/conversation.php:483 ../../Zotlabs/Lib/ThreadItem.php:440 +#: ../../include/conversation.php:483 ../../Zotlabs/Lib/ThreadItem.php:443 msgid "This is an unsaved preview" msgstr "Это несохранённый просмотр" -#: ../../include/conversation.php:619 ../../Zotlabs/Module/Photos.php:1139 +#: ../../include/conversation.php:619 ../../Zotlabs/Module/Photos.php:1152 msgctxt "title" msgid "Likes" msgstr "Нравится" -#: ../../include/conversation.php:619 ../../Zotlabs/Module/Photos.php:1139 +#: ../../include/conversation.php:619 ../../Zotlabs/Module/Photos.php:1152 msgctxt "title" msgid "Dislikes" msgstr "Не нравится" -#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1140 +#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1153 msgctxt "title" msgid "Agree" msgstr "Согласен" -#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1140 +#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1153 msgctxt "title" msgid "Disagree" msgstr "Не согласен" -#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1140 +#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1153 msgctxt "title" msgid "Abstain" msgstr "Воздержался" -#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1141 +#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1154 msgctxt "title" msgid "Attending" msgstr "Посещаю" -#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1141 +#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1154 msgctxt "title" msgid "Not attending" msgstr "Не посещаю" -#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1141 +#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1154 msgctxt "title" msgid "Might attend" msgstr "Возможно посещу" @@ -2522,15 +2518,15 @@ msgstr "Выбрать" #: ../../include/conversation.php:691 ../../include/conversation.php:736 #: ../../Zotlabs/Storage/Browser.php:291 ../../Zotlabs/Module/Cdav.php:942 #: ../../Zotlabs/Module/Cdav.php:1232 ../../Zotlabs/Module/Profiles.php:800 -#: ../../Zotlabs/Module/Photos.php:1205 ../../Zotlabs/Module/Oauth.php:174 +#: ../../Zotlabs/Module/Photos.php:1218 ../../Zotlabs/Module/Oauth.php:174 #: ../../Zotlabs/Module/Oauth2.php:195 ../../Zotlabs/Module/Editlayout.php:138 #: ../../Zotlabs/Module/Editblock.php:139 #: ../../Zotlabs/Module/Admin/Channels.php:149 #: ../../Zotlabs/Module/Admin/Profs.php:176 #: ../../Zotlabs/Module/Admin/Accounts.php:175 #: ../../Zotlabs/Module/Editwebpage.php:167 ../../Zotlabs/Module/Thing.php:267 -#: ../../Zotlabs/Module/Webpages.php:257 ../../Zotlabs/Module/Connedit.php:655 -#: ../../Zotlabs/Module/Connedit.php:924 +#: ../../Zotlabs/Module/Webpages.php:257 ../../Zotlabs/Module/Connedit.php:660 +#: ../../Zotlabs/Module/Connedit.php:929 #: ../../Zotlabs/Module/Connections.php:292 #: ../../Zotlabs/Module/Card_edit.php:129 #: ../../Zotlabs/Module/Article_edit.php:129 @@ -2574,17 +2570,17 @@ msgstr "Категории:" msgid "Filed under:" msgstr "Хранить под:" -#: ../../include/conversation.php:766 ../../Zotlabs/Lib/ThreadItem.php:375 +#: ../../include/conversation.php:766 ../../Zotlabs/Lib/ThreadItem.php:378 #, php-format msgid "from %s" msgstr "от %s" -#: ../../include/conversation.php:769 ../../Zotlabs/Lib/ThreadItem.php:378 +#: ../../include/conversation.php:769 ../../Zotlabs/Lib/ThreadItem.php:381 #, php-format msgid "last edited: %s" msgstr "последнее редактирование: %s" -#: ../../include/conversation.php:770 ../../Zotlabs/Lib/ThreadItem.php:379 +#: ../../include/conversation.php:770 ../../Zotlabs/Lib/ThreadItem.php:382 #, php-format msgid "Expires: %s" msgstr "Срок действия: %s" @@ -2593,8 +2589,8 @@ msgstr "Срок действия: %s" msgid "View in context" msgstr "Показать в контексте" -#: ../../include/conversation.php:787 ../../Zotlabs/Module/Photos.php:1105 -#: ../../Zotlabs/Lib/ThreadItem.php:441 +#: ../../include/conversation.php:787 ../../Zotlabs/Module/Photos.php:1118 +#: ../../Zotlabs/Lib/ThreadItem.php:444 msgid "Please wait" msgstr "Подождите пожалуйста" @@ -2627,12 +2623,12 @@ msgid "Unfollow Thread" msgstr "Прекратить отслеживать тему" #: ../../include/conversation.php:1038 ../../include/nav.php:106 -#: ../../Zotlabs/Module/Connedit.php:595 ../../Zotlabs/Lib/Apps.php:319 +#: ../../Zotlabs/Module/Connedit.php:600 ../../Zotlabs/Lib/Apps.php:319 #: ../../extend/addon/hzaddons/openclipatar/openclipatar.php:57 msgid "View Profile" msgstr "Просмотреть профиль" -#: ../../include/conversation.php:1048 ../../Zotlabs/Module/Connedit.php:616 +#: ../../include/conversation.php:1048 ../../Zotlabs/Module/Connedit.php:621 msgid "Recent Activity" msgstr "Последние действия" @@ -2656,13 +2652,13 @@ msgstr "Ткнуть" #: ../../include/conversation.php:1166 ../../Zotlabs/Storage/Browser.php:164 #: ../../Zotlabs/Module/Cdav.php:811 ../../Zotlabs/Module/Cdav.php:812 -#: ../../Zotlabs/Module/Cdav.php:819 ../../Zotlabs/Module/Photos.php:819 -#: ../../Zotlabs/Module/Photos.php:1275 +#: ../../Zotlabs/Module/Cdav.php:819 ../../Zotlabs/Module/Photos.php:832 +#: ../../Zotlabs/Module/Photos.php:1288 #: ../../Zotlabs/Module/Embedphotos.php:146 #: ../../Zotlabs/Widget/Portfolio.php:95 ../../Zotlabs/Widget/Album.php:84 #: ../../Zotlabs/Lib/Apps.php:994 ../../Zotlabs/Lib/Apps.php:1078 #: ../../Zotlabs/Lib/Activity.php:858 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:964 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:949 msgid "Unknown" msgstr "Неизвестный" @@ -2800,14 +2796,14 @@ msgstr "Комментарии включены" msgid "Comments disabled" msgstr "Комментарии отключены" -#: ../../include/conversation.php:1356 ../../Zotlabs/Module/Photos.php:1125 +#: ../../include/conversation.php:1356 ../../Zotlabs/Module/Photos.php:1138 #: ../../Zotlabs/Module/Events.php:480 ../../Zotlabs/Module/Webpages.php:262 -#: ../../Zotlabs/Lib/ThreadItem.php:777 +#: ../../Zotlabs/Lib/ThreadItem.php:780 #: ../../extend/addon/hzaddons/hsse/hsse.php:153 msgid "Preview" msgstr "Предварительный просмотр" -#: ../../include/conversation.php:1389 ../../Zotlabs/Module/Photos.php:1104 +#: ../../include/conversation.php:1389 ../../Zotlabs/Module/Photos.php:1117 #: ../../Zotlabs/Module/Webpages.php:256 ../../Zotlabs/Module/Blocks.php:161 #: ../../Zotlabs/Module/Wiki.php:301 ../../Zotlabs/Module/Layouts.php:194 #: ../../Zotlabs/Widget/Cdav.php:124 @@ -2825,32 +2821,32 @@ msgstr "Название ссылки на страницу " msgid "Post as" msgstr "Опубликовать как" -#: ../../include/conversation.php:1403 ../../Zotlabs/Lib/ThreadItem.php:768 +#: ../../include/conversation.php:1403 ../../Zotlabs/Lib/ThreadItem.php:771 #: ../../extend/addon/hzaddons/hsse/hsse.php:200 msgid "Bold" msgstr "Жирный" -#: ../../include/conversation.php:1404 ../../Zotlabs/Lib/ThreadItem.php:769 +#: ../../include/conversation.php:1404 ../../Zotlabs/Lib/ThreadItem.php:772 #: ../../extend/addon/hzaddons/hsse/hsse.php:201 msgid "Italic" msgstr "Курсив" -#: ../../include/conversation.php:1405 ../../Zotlabs/Lib/ThreadItem.php:770 +#: ../../include/conversation.php:1405 ../../Zotlabs/Lib/ThreadItem.php:773 #: ../../extend/addon/hzaddons/hsse/hsse.php:202 msgid "Underline" msgstr "Подчеркнутый" -#: ../../include/conversation.php:1406 ../../Zotlabs/Lib/ThreadItem.php:771 +#: ../../include/conversation.php:1406 ../../Zotlabs/Lib/ThreadItem.php:774 #: ../../extend/addon/hzaddons/hsse/hsse.php:203 msgid "Quote" msgstr "Цитата" -#: ../../include/conversation.php:1407 ../../Zotlabs/Lib/ThreadItem.php:772 +#: ../../include/conversation.php:1407 ../../Zotlabs/Lib/ThreadItem.php:775 #: ../../extend/addon/hzaddons/hsse/hsse.php:204 msgid "Code" msgstr "Код" -#: ../../include/conversation.php:1408 ../../Zotlabs/Lib/ThreadItem.php:774 +#: ../../include/conversation.php:1408 ../../Zotlabs/Lib/ThreadItem.php:777 #: ../../extend/addon/hzaddons/hsse/hsse.php:205 msgid "Attach/Upload file" msgstr "Прикрепить/загрузить файл" @@ -2872,7 +2868,7 @@ msgstr "Встроить изображение из ваших альбомов #: ../../Zotlabs/Module/Admin/Addons.php:423 #: ../../Zotlabs/Module/Editwebpage.php:169 #: ../../Zotlabs/Module/Profile_photo.php:465 -#: ../../Zotlabs/Module/Editpost.php:109 ../../Zotlabs/Module/Connedit.php:925 +#: ../../Zotlabs/Module/Editpost.php:109 ../../Zotlabs/Module/Connedit.php:930 #: ../../Zotlabs/Module/Card_edit.php:131 #: ../../Zotlabs/Module/Article_edit.php:131 ../../Zotlabs/Module/Wiki.php:368 #: ../../Zotlabs/Module/Wiki.php:401 ../../Zotlabs/Module/Filer.php:55 @@ -2904,8 +2900,8 @@ msgstr "Отключить комментарии" msgid "Toggle comments" msgstr "Переключить комментарии" -#: ../../include/conversation.php:1424 ../../Zotlabs/Module/Photos.php:700 -#: ../../Zotlabs/Module/Photos.php:1070 ../../Zotlabs/Module/Editblock.php:129 +#: ../../include/conversation.php:1424 ../../Zotlabs/Module/Photos.php:713 +#: ../../Zotlabs/Module/Photos.php:1083 ../../Zotlabs/Module/Editblock.php:129 #: ../../Zotlabs/Module/Card_edit.php:117 #: ../../Zotlabs/Module/Article_edit.php:117 #: ../../extend/addon/hzaddons/hsse/hsse.php:221 @@ -2940,12 +2936,12 @@ msgstr "Установить дату публикации" #: ../../include/conversation.php:1458 ../../Zotlabs/Module/Mail.php:294 #: ../../Zotlabs/Module/Mail.php:436 ../../Zotlabs/Module/Chat.php:221 -#: ../../Zotlabs/Lib/ThreadItem.php:781 +#: ../../Zotlabs/Lib/ThreadItem.php:784 #: ../../extend/addon/hzaddons/hsse/hsse.php:255 msgid "Encrypt text" msgstr "Зашифровать текст" -#: ../../include/conversation.php:1696 ../../Zotlabs/Module/Photos.php:1167 +#: ../../include/conversation.php:1696 ../../Zotlabs/Module/Photos.php:1180 #: ../../Zotlabs/Lib/ThreadItem.php:223 msgctxt "noun" msgid "Dislike" @@ -3053,12 +3049,12 @@ msgstr "Выбор дополнительного языка" msgid "Delete this item?" msgstr "Удалить этот элемент?" -#: ../../include/js_strings.php:6 ../../Zotlabs/Module/Photos.php:1123 -#: ../../Zotlabs/Module/Photos.php:1241 ../../Zotlabs/Lib/ThreadItem.php:766 +#: ../../include/js_strings.php:6 ../../Zotlabs/Module/Photos.php:1136 +#: ../../Zotlabs/Module/Photos.php:1254 ../../Zotlabs/Lib/ThreadItem.php:769 msgid "Comment" msgstr "Комментарий" -#: ../../include/js_strings.php:7 ../../Zotlabs/Lib/ThreadItem.php:473 +#: ../../include/js_strings.php:7 ../../Zotlabs/Lib/ThreadItem.php:476 #, php-format msgid "%s show all" msgstr "%s показать всё" @@ -3115,7 +3111,7 @@ msgid "Rate This Channel (this is public)" msgstr "Оценкa этoго канала (общедоступно)" #: ../../include/js_strings.php:20 ../../Zotlabs/Module/Rate.php:155 -#: ../../Zotlabs/Module/Connedit.php:871 +#: ../../Zotlabs/Module/Connedit.php:876 msgid "Rating" msgstr "Оценка" @@ -3413,9 +3409,9 @@ msgstr "" #: ../../include/network.php:1778 ../../Zotlabs/Lib/Activity.php:1417 #: ../../Zotlabs/Lib/Activity.php:1614 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:1222 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:1377 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:1556 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:1204 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:1359 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:1538 msgid "ActivityPub" msgstr "" @@ -3423,7 +3419,7 @@ msgstr "" #: ../../Zotlabs/Module/Profiles.php:787 #: ../../Zotlabs/Module/Admin/Accounts.php:171 #: ../../Zotlabs/Module/Admin/Accounts.php:183 -#: ../../Zotlabs/Module/Connedit.php:911 +#: ../../Zotlabs/Module/Connedit.php:916 #: ../../extend/addon/hzaddons/rtof/rtof.php:93 #: ../../extend/addon/hzaddons/openid/MysqlProvider.php:56 #: ../../extend/addon/hzaddons/openid/MysqlProvider.php:57 @@ -3479,7 +3475,7 @@ msgstr "YYYY-MM-DD или MM-DD" msgid "Required" msgstr "Требуется" -#: ../../include/datetime.php:238 ../../boot.php:2558 +#: ../../include/datetime.php:238 ../../boot.php:2557 msgid "never" msgstr "никогда" @@ -3564,7 +3560,7 @@ msgstr "С Днем рождения %1$s !" msgid "Visible to your default audience" msgstr "Видно вашей аудитории по умолчанию." -#: ../../include/acl_selectors.php:88 ../../Zotlabs/Module/Acl.php:120 +#: ../../include/acl_selectors.php:88 ../../Zotlabs/Module/Acl.php:121 #: ../../Zotlabs/Module/Lockview.php:117 ../../Zotlabs/Module/Lockview.php:153 msgctxt "acl" msgid "Profile" @@ -3597,15 +3593,15 @@ msgstr "Показать" msgid "Don't show" msgstr "Не показывать" -#: ../../include/acl_selectors.php:123 ../../Zotlabs/Module/Photos.php:704 -#: ../../Zotlabs/Module/Photos.php:1073 ../../Zotlabs/Module/Chat.php:243 +#: ../../include/acl_selectors.php:123 ../../Zotlabs/Module/Photos.php:717 +#: ../../Zotlabs/Module/Photos.php:1086 ../../Zotlabs/Module/Chat.php:243 #: ../../Zotlabs/Module/Filestorage.php:170 ../../Zotlabs/Module/Thing.php:319 -#: ../../Zotlabs/Module/Thing.php:372 ../../Zotlabs/Module/Connedit.php:677 +#: ../../Zotlabs/Module/Thing.php:372 ../../Zotlabs/Module/Connedit.php:682 msgid "Permissions" msgstr "Разрешения" -#: ../../include/acl_selectors.php:125 ../../Zotlabs/Module/Photos.php:1295 -#: ../../Zotlabs/Lib/ThreadItem.php:435 +#: ../../include/acl_selectors.php:125 ../../Zotlabs/Module/Photos.php:1308 +#: ../../Zotlabs/Lib/ThreadItem.php:438 msgid "Close" msgstr "Закрыть" @@ -3629,37 +3625,37 @@ msgstr "Новое окно" msgid "Open the selected location in a different window or browser tab" msgstr "Открыть выбранное местоположение в другом окне или вкладке браузера" -#: ../../include/connections.php:696 ../../include/event.php:1308 +#: ../../include/connections.php:696 ../../include/event.php:1311 #: ../../Zotlabs/Module/Cdav.php:1224 ../../Zotlabs/Module/Profiles.php:792 -#: ../../Zotlabs/Module/Connedit.php:916 +#: ../../Zotlabs/Module/Connedit.php:921 msgid "Mobile" msgstr "Мобильный" -#: ../../include/connections.php:697 ../../include/event.php:1309 +#: ../../include/connections.php:697 ../../include/event.php:1312 #: ../../Zotlabs/Module/Cdav.php:1225 ../../Zotlabs/Module/Profiles.php:793 -#: ../../Zotlabs/Module/Connedit.php:917 +#: ../../Zotlabs/Module/Connedit.php:922 msgid "Home" msgstr "Домашний" -#: ../../include/connections.php:698 ../../include/event.php:1310 +#: ../../include/connections.php:698 ../../include/event.php:1313 msgid "Home, Voice" msgstr "Дом, голос" -#: ../../include/connections.php:699 ../../include/event.php:1311 +#: ../../include/connections.php:699 ../../include/event.php:1314 msgid "Home, Fax" msgstr "Дом, факс" -#: ../../include/connections.php:700 ../../include/event.php:1312 +#: ../../include/connections.php:700 ../../include/event.php:1315 #: ../../Zotlabs/Module/Cdav.php:1226 ../../Zotlabs/Module/Profiles.php:794 -#: ../../Zotlabs/Module/Connedit.php:918 +#: ../../Zotlabs/Module/Connedit.php:923 msgid "Work" msgstr "Рабочий" -#: ../../include/connections.php:701 ../../include/event.php:1313 +#: ../../include/connections.php:701 ../../include/event.php:1316 msgid "Work, Voice" msgstr "Работа, голос" -#: ../../include/connections.php:702 ../../include/event.php:1314 +#: ../../include/connections.php:702 ../../include/event.php:1317 msgid "Work, Fax" msgstr "Работа, факс" @@ -3679,23 +3675,23 @@ msgstr "Окончание:" msgid "This event has been added to your calendar." msgstr "Это событие было добавлено в ваш календарь." -#: ../../include/event.php:1227 +#: ../../include/event.php:1230 msgid "Not specified" msgstr "Не указано" -#: ../../include/event.php:1228 +#: ../../include/event.php:1231 msgid "Needs Action" msgstr "Требует действия" -#: ../../include/event.php:1229 +#: ../../include/event.php:1232 msgid "Completed" msgstr "Завершено" -#: ../../include/event.php:1230 +#: ../../include/event.php:1233 msgid "In Process" msgstr "В процессе" -#: ../../include/event.php:1231 +#: ../../include/event.php:1234 msgid "Cancelled" msgstr "Отменено" @@ -3753,7 +3749,7 @@ msgid "Account/Channel Settings" msgstr "Настройки аккаунта / канала" #: ../../include/nav.php:103 ../../include/nav.php:132 -#: ../../include/nav.php:151 ../../boot.php:1624 +#: ../../include/nav.php:151 ../../boot.php:1623 msgid "Logout" msgstr "Выход" @@ -3773,7 +3769,7 @@ msgstr "Управление / редактирование профилей" msgid "Edit your profile" msgstr "Редактировать профиль" -#: ../../include/nav.php:118 ../../include/nav.php:122 ../../boot.php:1625 +#: ../../include/nav.php:118 ../../include/nav.php:122 ../../boot.php:1624 #: ../../Zotlabs/Lib/Apps.php:311 msgid "Login" msgstr "Войти" @@ -3790,7 +3786,7 @@ msgstr "Домой" msgid "Log me out of this site" msgstr "Выйти с этого сайта" -#: ../../include/nav.php:156 ../../boot.php:1605 +#: ../../include/nav.php:156 ../../boot.php:1604 #: ../../Zotlabs/Module/Register.php:289 msgid "Register" msgstr "Регистрация" @@ -3818,7 +3814,7 @@ msgstr "Установка и конфигурация сайта" #: ../../include/nav.php:293 ../../Zotlabs/Module/Defperms.php:256 #: ../../Zotlabs/Module/New_channel.php:157 #: ../../Zotlabs/Module/New_channel.php:164 -#: ../../Zotlabs/Module/Connedit.php:853 +#: ../../Zotlabs/Module/Connedit.php:858 #: ../../Zotlabs/Widget/Notifications.php:162 msgid "Loading" msgstr "Загрузка" @@ -3914,7 +3910,7 @@ msgid "View Webpages" msgstr "Просмотр веб-страниц" #: ../../include/nav.php:506 ../../Zotlabs/Module/Wiki.php:206 -#: ../../Zotlabs/Widget/Wiki_list.php:19 +#: ../../Zotlabs/Widget/Wiki_list.php:15 msgid "Wikis" msgstr "" @@ -3993,51 +3989,51 @@ msgstr "ошибка при записи базы данных." msgid "Empty path" msgstr "Пустое имя пути" -#: ../../include/photo/photo_driver.php:741 +#: ../../include/photo/photo_driver.php:774 #: ../../Zotlabs/Module/Profile_photo.php:120 #: ../../Zotlabs/Module/Profile_photo.php:248 msgid "Profile Photos" msgstr "Фотографии профиля" -#: ../../boot.php:1604 +#: ../../boot.php:1603 msgid "Create an account to access services and applications" msgstr "Создайте аккаунт для доступа к службам и приложениям" -#: ../../boot.php:1628 +#: ../../boot.php:1627 msgid "Login/Email" msgstr "Пользователь / email" -#: ../../boot.php:1629 +#: ../../boot.php:1628 msgid "Password" msgstr "Пароль" -#: ../../boot.php:1630 +#: ../../boot.php:1629 msgid "Remember me" msgstr "Запомнить меня" -#: ../../boot.php:1633 +#: ../../boot.php:1632 msgid "Forgot your password?" msgstr "Забыли пароль или логин?" -#: ../../boot.php:1634 ../../Zotlabs/Module/Lostpass.php:91 +#: ../../boot.php:1633 ../../Zotlabs/Module/Lostpass.php:91 msgid "Password Reset" msgstr "Сбросить пароль" -#: ../../boot.php:2431 +#: ../../boot.php:2430 #, php-format msgid "[$Projectname] Website SSL error for %s" msgstr "[$Projectname] Ошибка SSL/TLS веб-сайта для %s" -#: ../../boot.php:2436 +#: ../../boot.php:2435 msgid "Website SSL certificate is not valid. Please correct." msgstr "SSL/TLS сертификат веб-сайт недействителен. Исправьте это." -#: ../../boot.php:2552 +#: ../../boot.php:2551 #, php-format msgid "[$Projectname] Cron tasks not running on %s" msgstr "[$Projectname] Задания Cron не запущены на %s" -#: ../../boot.php:2557 +#: ../../boot.php:2556 msgid "Cron/Scheduled tasks not running." msgstr "Задания Cron / планировщика не запущены." @@ -4072,7 +4068,7 @@ msgstr "Общие" #: ../../Zotlabs/Storage/Browser.php:276 ../../Zotlabs/Storage/Browser.php:390 #: ../../Zotlabs/Module/Cdav.php:1230 ../../Zotlabs/Module/Profiles.php:798 #: ../../Zotlabs/Module/New_channel.php:189 ../../Zotlabs/Module/Menu.php:181 -#: ../../Zotlabs/Module/Webpages.php:254 ../../Zotlabs/Module/Connedit.php:922 +#: ../../Zotlabs/Module/Webpages.php:254 ../../Zotlabs/Module/Connedit.php:927 #: ../../Zotlabs/Module/Blocks.php:159 ../../Zotlabs/Module/Articles.php:108 #: ../../Zotlabs/Module/Cards.php:109 ../../Zotlabs/Module/Layouts.php:185 #: ../../Zotlabs/Widget/Cdav.php:128 ../../Zotlabs/Widget/Cdav.php:165 @@ -4092,7 +4088,7 @@ msgstr "Удалено администратором" #: ../../Zotlabs/Module/Sharedwithme.php:104 ../../Zotlabs/Module/Chat.php:259 #: ../../Zotlabs/Module/Oauth2.php:118 ../../Zotlabs/Module/Oauth2.php:146 #: ../../Zotlabs/Module/Admin/Channels.php:159 -#: ../../Zotlabs/Module/Connedit.php:907 ../../Zotlabs/Module/Group.php:144 +#: ../../Zotlabs/Module/Connedit.php:912 ../../Zotlabs/Module/Group.php:144 #: ../../Zotlabs/Module/Wiki.php:218 #: ../../Zotlabs/Widget/Wiki_page_history.php:22 #: ../../Zotlabs/Lib/NativeWikiPage.php:561 @@ -4131,7 +4127,7 @@ msgstr "Создать новую папку" msgid "Upload file" msgstr "Загрузить файл" -#: ../../Zotlabs/Storage/Browser.php:392 ../../Zotlabs/Module/Photos.php:714 +#: ../../Zotlabs/Storage/Browser.php:392 ../../Zotlabs/Module/Photos.php:727 #: ../../Zotlabs/Module/Cover_photo.php:395 #: ../../Zotlabs/Module/Embedphotos.php:158 #: ../../Zotlabs/Module/Profile_photo.php:459 @@ -4280,7 +4276,7 @@ msgid "" "to correctly use this feature." msgstr "Предупреждение. Изменение некоторых настроек может привести к неработоспособности вашего канала. Пожалуйста, покиньте эту страницу, если вы точно не значете, как правильно использовать эту функцию." -#: ../../Zotlabs/Module/Defperms.php:67 ../../Zotlabs/Module/Connedit.php:80 +#: ../../Zotlabs/Module/Defperms.php:67 ../../Zotlabs/Module/Connedit.php:81 msgid "Could not access contact record." msgstr "Не удалось получить доступ к записи контакта." @@ -4308,7 +4304,7 @@ msgstr "Приложение \"Разрешения по умолчанию\"" #: ../../Zotlabs/Module/Uexport.php:61 ../../Zotlabs/Module/Bookmarks.php:78 #: ../../Zotlabs/Module/Probe.php:18 ../../Zotlabs/Module/Tokens.php:99 #: ../../Zotlabs/Module/Notes.php:55 ../../Zotlabs/Module/Webpages.php:48 -#: ../../Zotlabs/Module/Group.php:101 ../../Zotlabs/Module/Mood.php:132 +#: ../../Zotlabs/Module/Group.php:101 ../../Zotlabs/Module/Mood.php:134 #: ../../Zotlabs/Module/Lang.php:17 ../../Zotlabs/Module/Randprof.php:29 #: ../../Zotlabs/Module/Invite.php:110 ../../Zotlabs/Module/Articles.php:43 #: ../../Zotlabs/Module/Connect.php:104 ../../Zotlabs/Module/Pdledit.php:42 @@ -4321,11 +4317,11 @@ msgstr "не установлено" msgid "Set custom default permissions for new connections" msgstr "Настройка пользовательских разрешений по умолчанию для новых подключений " -#: ../../Zotlabs/Module/Defperms.php:254 ../../Zotlabs/Module/Connedit.php:851 +#: ../../Zotlabs/Module/Defperms.php:254 ../../Zotlabs/Module/Connedit.php:856 msgid "Connection Default Permissions" msgstr "Разрешения по умолчанию для контакта" -#: ../../Zotlabs/Module/Defperms.php:255 ../../Zotlabs/Module/Connedit.php:852 +#: ../../Zotlabs/Module/Defperms.php:255 ../../Zotlabs/Module/Connedit.php:857 msgid "Apply these permissions automatically" msgstr "Применить эти разрешения автоматически" @@ -4335,15 +4331,15 @@ msgid "" "If enabled, connection requests will be approved without your interaction" msgstr "Если включено, запросы контактов будут одобрены без вашего участия" -#: ../../Zotlabs/Module/Defperms.php:256 ../../Zotlabs/Module/Connedit.php:853 +#: ../../Zotlabs/Module/Defperms.php:256 ../../Zotlabs/Module/Connedit.php:858 msgid "Permission role" msgstr "Роль разрешения" -#: ../../Zotlabs/Module/Defperms.php:257 ../../Zotlabs/Module/Connedit.php:854 +#: ../../Zotlabs/Module/Defperms.php:257 ../../Zotlabs/Module/Connedit.php:859 msgid "Add permission role" msgstr "Добавить роль разрешения" -#: ../../Zotlabs/Module/Defperms.php:261 ../../Zotlabs/Module/Connedit.php:867 +#: ../../Zotlabs/Module/Defperms.php:261 ../../Zotlabs/Module/Connedit.php:872 msgid "" "The permissions indicated on this page will be applied to all new " "connections." @@ -4354,17 +4350,17 @@ msgid "Automatic approval settings" msgstr "Настройки автоматического одобрения" #: ../../Zotlabs/Module/Defperms.php:264 ../../Zotlabs/Module/Permcats.php:123 -#: ../../Zotlabs/Module/Tokens.php:183 ../../Zotlabs/Module/Connedit.php:887 +#: ../../Zotlabs/Module/Tokens.php:183 ../../Zotlabs/Module/Connedit.php:892 msgid "inherited" msgstr "наследуется" #: ../../Zotlabs/Module/Defperms.php:266 ../../Zotlabs/Module/Permcats.php:121 -#: ../../Zotlabs/Module/Tokens.php:181 ../../Zotlabs/Module/Connedit.php:892 +#: ../../Zotlabs/Module/Tokens.php:181 ../../Zotlabs/Module/Connedit.php:897 msgid "My Settings" msgstr "Мои настройки" #: ../../Zotlabs/Module/Defperms.php:269 ../../Zotlabs/Module/Permcats.php:126 -#: ../../Zotlabs/Module/Tokens.php:186 ../../Zotlabs/Module/Connedit.php:894 +#: ../../Zotlabs/Module/Tokens.php:186 ../../Zotlabs/Module/Connedit.php:899 msgid "Individual Permissions" msgstr "Индивидуальные разрешения" @@ -4405,7 +4401,7 @@ msgid "Permission category name" msgstr "Наименование категории разрешений" #: ../../Zotlabs/Module/Permcats.php:127 ../../Zotlabs/Module/Tokens.php:187 -#: ../../Zotlabs/Module/Connedit.php:895 +#: ../../Zotlabs/Module/Connedit.php:900 msgid "" "Some permissions may be inherited from your channel's privacy settings, which have higher priority than " @@ -4425,69 +4421,69 @@ msgstr "Запрос Xchan начинается с (или webbie):" msgid "Not found." msgstr "Не найдено." -#: ../../Zotlabs/Module/Dreport.php:45 +#: ../../Zotlabs/Module/Dreport.php:56 msgid "Invalid message" msgstr "Неверное сообщение" -#: ../../Zotlabs/Module/Dreport.php:78 +#: ../../Zotlabs/Module/Dreport.php:89 msgid "no results" msgstr "Ничего не найдено." -#: ../../Zotlabs/Module/Dreport.php:93 +#: ../../Zotlabs/Module/Dreport.php:103 msgid "channel sync processed" msgstr "синхронизация канала завершена" -#: ../../Zotlabs/Module/Dreport.php:97 +#: ../../Zotlabs/Module/Dreport.php:107 msgid "queued" msgstr "в очереди" -#: ../../Zotlabs/Module/Dreport.php:101 +#: ../../Zotlabs/Module/Dreport.php:111 msgid "posted" msgstr "опубликовано" -#: ../../Zotlabs/Module/Dreport.php:105 +#: ../../Zotlabs/Module/Dreport.php:115 msgid "accepted for delivery" msgstr "принято к доставке" -#: ../../Zotlabs/Module/Dreport.php:109 +#: ../../Zotlabs/Module/Dreport.php:119 msgid "updated" msgstr "обновлено" -#: ../../Zotlabs/Module/Dreport.php:112 +#: ../../Zotlabs/Module/Dreport.php:122 msgid "update ignored" msgstr "обновление игнорируется" -#: ../../Zotlabs/Module/Dreport.php:115 +#: ../../Zotlabs/Module/Dreport.php:125 msgid "permission denied" msgstr "доступ запрещен" -#: ../../Zotlabs/Module/Dreport.php:119 +#: ../../Zotlabs/Module/Dreport.php:129 msgid "recipient not found" msgstr "получатель не найден" -#: ../../Zotlabs/Module/Dreport.php:122 +#: ../../Zotlabs/Module/Dreport.php:132 msgid "mail recalled" msgstr "почта отозвана" -#: ../../Zotlabs/Module/Dreport.php:125 +#: ../../Zotlabs/Module/Dreport.php:135 msgid "duplicate mail received" msgstr "получено дублирующее сообщение" -#: ../../Zotlabs/Module/Dreport.php:128 +#: ../../Zotlabs/Module/Dreport.php:138 msgid "mail delivered" msgstr "почта доставлен" -#: ../../Zotlabs/Module/Dreport.php:148 +#: ../../Zotlabs/Module/Dreport.php:158 #, php-format msgid "Delivery report for %1$s" msgstr "Отчёт о доставке для %1$s" -#: ../../Zotlabs/Module/Dreport.php:151 ../../Zotlabs/Widget/Wiki_pages.php:41 +#: ../../Zotlabs/Module/Dreport.php:161 ../../Zotlabs/Widget/Wiki_pages.php:41 #: ../../Zotlabs/Widget/Wiki_pages.php:98 msgid "Options" msgstr "Параметры" -#: ../../Zotlabs/Module/Dreport.php:152 +#: ../../Zotlabs/Module/Dreport.php:162 msgid "Redeliver" msgstr "Доставить повторно" @@ -4495,29 +4491,29 @@ msgstr "Доставить повторно" msgid "No such group" msgstr "Нет такой группы" -#: ../../Zotlabs/Module/Network.php:148 +#: ../../Zotlabs/Module/Network.php:149 msgid "No such channel" msgstr "Нет такого канала" -#: ../../Zotlabs/Module/Network.php:163 ../../Zotlabs/Module/Channel.php:133 +#: ../../Zotlabs/Module/Network.php:164 ../../Zotlabs/Module/Channel.php:177 msgid "Search Results For:" msgstr "Результаты поиска для:" -#: ../../Zotlabs/Module/Network.php:193 ../../Zotlabs/Module/Display.php:80 -#: ../../Zotlabs/Module/Pubstream.php:94 ../../Zotlabs/Module/Channel.php:168 +#: ../../Zotlabs/Module/Network.php:194 ../../Zotlabs/Module/Display.php:80 +#: ../../Zotlabs/Module/Pubstream.php:94 ../../Zotlabs/Module/Channel.php:212 #: ../../Zotlabs/Module/Hq.php:134 msgid "Reset form" msgstr "Очистить форму" -#: ../../Zotlabs/Module/Network.php:231 +#: ../../Zotlabs/Module/Network.php:233 msgid "Privacy group is empty" msgstr "Группа безопасности пуста" -#: ../../Zotlabs/Module/Network.php:242 +#: ../../Zotlabs/Module/Network.php:243 msgid "Privacy group: " msgstr "Группа безопасности: " -#: ../../Zotlabs/Module/Network.php:291 +#: ../../Zotlabs/Module/Network.php:316 #: ../../extend/addon/hzaddons/redred/redred.php:65 msgid "Invalid channel." msgstr "Недействительный канал." @@ -4559,40 +4555,40 @@ msgstr "Общих контактов нет." msgid "View Common Connections" msgstr "Просмотр общий контактов" -#: ../../Zotlabs/Module/Acl.php:359 +#: ../../Zotlabs/Module/Acl.php:360 msgid "network" msgstr "сеть" -#: ../../Zotlabs/Module/Item.php:194 +#: ../../Zotlabs/Module/Item.php:196 msgid "Unable to locate original post." msgstr "Не удалось найти оригинальную публикацию." -#: ../../Zotlabs/Module/Item.php:479 +#: ../../Zotlabs/Module/Item.php:483 msgid "Empty post discarded." msgstr "Пустая публикация отклонена." -#: ../../Zotlabs/Module/Item.php:866 +#: ../../Zotlabs/Module/Item.php:892 msgid "Duplicate post suppressed." msgstr "Подавлена дублирующаяся публикация." -#: ../../Zotlabs/Module/Item.php:1011 +#: ../../Zotlabs/Module/Item.php:1037 msgid "System error. Post not saved." msgstr "Системная ошибка. Публикация не сохранена." -#: ../../Zotlabs/Module/Item.php:1047 +#: ../../Zotlabs/Module/Item.php:1073 msgid "Your comment is awaiting approval." msgstr "Ваш комментарий ожидает одобрения." -#: ../../Zotlabs/Module/Item.php:1164 +#: ../../Zotlabs/Module/Item.php:1190 msgid "Unable to obtain post information from database." msgstr "Невозможно получить информацию о публикации из базы данных" -#: ../../Zotlabs/Module/Item.php:1171 +#: ../../Zotlabs/Module/Item.php:1197 #, php-format msgid "You have reached your limit of %1$.0f top level posts." msgstr "Вы достигли вашего ограничения в %1$.0f публикаций высокого уровня." -#: ../../Zotlabs/Module/Item.php:1178 +#: ../../Zotlabs/Module/Item.php:1204 #, php-format msgid "You have reached your limit of %1$.0f webpages." msgstr "Вы достигли вашего ограничения в %1$.0f страниц." @@ -4602,13 +4598,13 @@ msgid "Some blurb about what to do when you're new here" msgstr "Некоторые предложения о том, что делать, если вы здесь новичок " #: ../../Zotlabs/Module/Display.php:29 ../../Zotlabs/Module/Directory.php:67 -#: ../../Zotlabs/Module/Directory.php:72 ../../Zotlabs/Module/Photos.php:545 +#: ../../Zotlabs/Module/Directory.php:72 ../../Zotlabs/Module/Photos.php:558 #: ../../Zotlabs/Module/Viewconnections.php:23 #: ../../Zotlabs/Module/Ratings.php:83 ../../Zotlabs/Module/Search.php:17 msgid "Public access denied." msgstr "Публичный доступ запрещен." -#: ../../Zotlabs/Module/Display.php:374 ../../Zotlabs/Module/Channel.php:424 +#: ../../Zotlabs/Module/Display.php:374 ../../Zotlabs/Module/Channel.php:468 msgid "" "You must enable javascript for your browser to be able to view this content." msgstr "Для просмотра этого содержимого в вашем браузере должен быть включён JavaScript" @@ -4649,11 +4645,11 @@ msgstr "событие опубликовано" msgid "shared a file with you" msgstr "с вами поделились файлом" -#: ../../Zotlabs/Module/Ping.php:659 +#: ../../Zotlabs/Module/Ping.php:665 msgid "Private forum" msgstr "Частный форум" -#: ../../Zotlabs/Module/Ping.php:659 +#: ../../Zotlabs/Module/Ping.php:665 msgid "Public forum" msgstr "Публичный форум" @@ -4858,13 +4854,13 @@ msgstr "Дата и время окончания" msgid "Description" msgstr "Описание" -#: ../../Zotlabs/Module/Cdav.php:924 ../../Zotlabs/Module/Photos.php:973 +#: ../../Zotlabs/Module/Cdav.php:924 ../../Zotlabs/Module/Photos.php:986 #: ../../Zotlabs/Module/Events.php:690 ../../Zotlabs/Module/Events.php:699 #: ../../Zotlabs/Module/Cal.php:338 ../../Zotlabs/Module/Cal.php:345 msgid "Previous" msgstr "Предыдущая" -#: ../../Zotlabs/Module/Cdav.php:925 ../../Zotlabs/Module/Photos.php:982 +#: ../../Zotlabs/Module/Cdav.php:925 ../../Zotlabs/Module/Photos.php:995 #: ../../Zotlabs/Module/Events.php:691 ../../Zotlabs/Module/Events.php:700 #: ../../Zotlabs/Module/Cal.php:339 ../../Zotlabs/Module/Cal.php:346 #: ../../Zotlabs/Module/Setup.php:263 @@ -4920,49 +4916,49 @@ msgstr "Удалить всё" msgid "Sorry! Editing of recurrent events is not yet implemented." msgstr "Простите, но редактирование повторяющихся событий пока не реализовано." -#: ../../Zotlabs/Module/Cdav.php:1216 ../../Zotlabs/Module/Connedit.php:908 +#: ../../Zotlabs/Module/Cdav.php:1216 ../../Zotlabs/Module/Connedit.php:913 msgid "Organisation" msgstr "Организация" -#: ../../Zotlabs/Module/Cdav.php:1217 ../../Zotlabs/Module/Connedit.php:909 +#: ../../Zotlabs/Module/Cdav.php:1217 ../../Zotlabs/Module/Connedit.php:914 msgid "Title" msgstr "Наименование" #: ../../Zotlabs/Module/Cdav.php:1218 ../../Zotlabs/Module/Profiles.php:786 -#: ../../Zotlabs/Module/Connedit.php:910 +#: ../../Zotlabs/Module/Connedit.php:915 msgid "Phone" msgstr "Телефон" #: ../../Zotlabs/Module/Cdav.php:1220 ../../Zotlabs/Module/Profiles.php:788 -#: ../../Zotlabs/Module/Connedit.php:912 +#: ../../Zotlabs/Module/Connedit.php:917 msgid "Instant messenger" msgstr "Мессенджер" #: ../../Zotlabs/Module/Cdav.php:1221 ../../Zotlabs/Module/Profiles.php:789 -#: ../../Zotlabs/Module/Connedit.php:913 +#: ../../Zotlabs/Module/Connedit.php:918 msgid "Website" msgstr "Веб-сайт" #: ../../Zotlabs/Module/Cdav.php:1222 ../../Zotlabs/Module/Profiles.php:502 #: ../../Zotlabs/Module/Profiles.php:790 ../../Zotlabs/Module/Locs.php:118 #: ../../Zotlabs/Module/Admin/Channels.php:160 -#: ../../Zotlabs/Module/Connedit.php:914 +#: ../../Zotlabs/Module/Connedit.php:919 msgid "Address" msgstr "Адрес" #: ../../Zotlabs/Module/Cdav.php:1223 ../../Zotlabs/Module/Profiles.php:791 -#: ../../Zotlabs/Module/Connedit.php:915 +#: ../../Zotlabs/Module/Connedit.php:920 msgid "Note" msgstr "Заметка" #: ../../Zotlabs/Module/Cdav.php:1228 ../../Zotlabs/Module/Profiles.php:796 -#: ../../Zotlabs/Module/Connedit.php:920 +#: ../../Zotlabs/Module/Connedit.php:925 #: ../../extend/addon/hzaddons/jappixmini/jappixmini.php:368 msgid "Add Contact" msgstr "Добавить контакт" #: ../../Zotlabs/Module/Cdav.php:1229 ../../Zotlabs/Module/Profiles.php:797 -#: ../../Zotlabs/Module/Connedit.php:921 +#: ../../Zotlabs/Module/Connedit.php:926 msgid "Add Field" msgstr "Добавить поле" @@ -4970,36 +4966,36 @@ msgstr "Добавить поле" #: ../../Zotlabs/Module/Oauth.php:53 ../../Zotlabs/Module/Oauth.php:137 #: ../../Zotlabs/Module/Oauth2.php:58 ../../Zotlabs/Module/Oauth2.php:144 #: ../../Zotlabs/Module/Admin/Addons.php:453 -#: ../../Zotlabs/Module/Connedit.php:923 ../../Zotlabs/Lib/Apps.php:513 +#: ../../Zotlabs/Module/Connedit.php:928 ../../Zotlabs/Lib/Apps.php:513 msgid "Update" msgstr "Обновить" -#: ../../Zotlabs/Module/Cdav.php:1234 ../../Zotlabs/Module/Connedit.php:926 +#: ../../Zotlabs/Module/Cdav.php:1234 ../../Zotlabs/Module/Connedit.php:931 msgid "P.O. Box" msgstr "абонентский ящик" -#: ../../Zotlabs/Module/Cdav.php:1235 ../../Zotlabs/Module/Connedit.php:927 +#: ../../Zotlabs/Module/Cdav.php:1235 ../../Zotlabs/Module/Connedit.php:932 msgid "Additional" msgstr "Дополнительно" -#: ../../Zotlabs/Module/Cdav.php:1236 ../../Zotlabs/Module/Connedit.php:928 +#: ../../Zotlabs/Module/Cdav.php:1236 ../../Zotlabs/Module/Connedit.php:933 msgid "Street" msgstr "Улица" -#: ../../Zotlabs/Module/Cdav.php:1237 ../../Zotlabs/Module/Connedit.php:929 +#: ../../Zotlabs/Module/Cdav.php:1237 ../../Zotlabs/Module/Connedit.php:934 msgid "Locality" msgstr "Населённый пункт" -#: ../../Zotlabs/Module/Cdav.php:1238 ../../Zotlabs/Module/Connedit.php:930 +#: ../../Zotlabs/Module/Cdav.php:1238 ../../Zotlabs/Module/Connedit.php:935 msgid "Region" msgstr "Регион" -#: ../../Zotlabs/Module/Cdav.php:1239 ../../Zotlabs/Module/Connedit.php:931 +#: ../../Zotlabs/Module/Cdav.php:1239 ../../Zotlabs/Module/Connedit.php:936 msgid "ZIP Code" msgstr "Индекс" #: ../../Zotlabs/Module/Cdav.php:1240 ../../Zotlabs/Module/Profiles.php:757 -#: ../../Zotlabs/Module/Connedit.php:932 +#: ../../Zotlabs/Module/Connedit.php:937 msgid "Country" msgstr "Страна" @@ -5011,12 +5007,12 @@ msgstr "Календарь по умолчанию" msgid "Default Addressbook" msgstr "Адресная книга по умолчанию" -#: ../../Zotlabs/Module/Profile.php:45 ../../Zotlabs/Module/Channel.php:54 +#: ../../Zotlabs/Module/Profile.php:45 ../../Zotlabs/Module/Channel.php:98 #: ../../Zotlabs/Module/Hcard.php:37 msgid "Posts and comments" msgstr "Публикации и комментарии" -#: ../../Zotlabs/Module/Profile.php:52 ../../Zotlabs/Module/Channel.php:61 +#: ../../Zotlabs/Module/Profile.php:52 ../../Zotlabs/Module/Channel.php:105 #: ../../Zotlabs/Module/Hcard.php:44 msgid "Only posts" msgstr "Только публикации" @@ -5026,7 +5022,7 @@ msgid "vcard" msgstr "vCard" #: ../../Zotlabs/Module/Ochannel.php:32 ../../Zotlabs/Module/Chat.php:31 -#: ../../Zotlabs/Module/Channel.php:39 +#: ../../Zotlabs/Module/Channel.php:41 #: ../../extend/addon/hzaddons/chess/chess.php:508 msgid "You must be logged in to see this page." msgstr "Вы должны авторизоваться, чтобы увидеть эту страницу." @@ -5039,12 +5035,12 @@ msgstr "Нет новых оповещений системы." msgid "System Notifications" msgstr "Системные оповещения " -#: ../../Zotlabs/Module/Impel.php:183 +#: ../../Zotlabs/Module/Impel.php:185 #, php-format msgid "%s element installed" msgstr "%s элемент установлен" -#: ../../Zotlabs/Module/Impel.php:186 +#: ../../Zotlabs/Module/Impel.php:188 #, php-format msgid "%s element installation failed" msgstr "%sустановка элемента неудачна." @@ -5179,23 +5175,15 @@ msgstr "Близкие к просрочке аккаунты" msgid "Channels" msgstr "Каналы" -#: ../../Zotlabs/Module/Admin.php:115 ../../Zotlabs/Module/Locs.php:119 -msgid "Primary" -msgstr "Основной" - -#: ../../Zotlabs/Module/Admin.php:116 -msgid "Clones" -msgstr "Клоны" - -#: ../../Zotlabs/Module/Admin.php:122 +#: ../../Zotlabs/Module/Admin.php:120 msgid "Message queues" msgstr "Очередь сообщений" -#: ../../Zotlabs/Module/Admin.php:136 +#: ../../Zotlabs/Module/Admin.php:134 msgid "Your software should be updated" msgstr "Ваше программное обеспечение должно быть обновлено" -#: ../../Zotlabs/Module/Admin.php:140 ../../Zotlabs/Module/Admin/Logs.php:82 +#: ../../Zotlabs/Module/Admin.php:138 ../../Zotlabs/Module/Admin/Logs.php:82 #: ../../Zotlabs/Module/Admin/Channels.php:145 #: ../../Zotlabs/Module/Admin/Security.php:92 #: ../../Zotlabs/Module/Admin/Addons.php:341 @@ -5207,35 +5195,35 @@ msgstr "Ваше программное обеспечение должно бы msgid "Administration" msgstr "Администрирование" -#: ../../Zotlabs/Module/Admin.php:141 +#: ../../Zotlabs/Module/Admin.php:139 msgid "Summary" msgstr "Резюме" -#: ../../Zotlabs/Module/Admin.php:144 +#: ../../Zotlabs/Module/Admin.php:142 msgid "Registered accounts" msgstr "Зарегистрированные аккаунты" -#: ../../Zotlabs/Module/Admin.php:145 +#: ../../Zotlabs/Module/Admin.php:143 msgid "Pending registrations" msgstr "Ждут утверждения" -#: ../../Zotlabs/Module/Admin.php:146 +#: ../../Zotlabs/Module/Admin.php:144 msgid "Registered channels" msgstr "Зарегистрированные каналы" -#: ../../Zotlabs/Module/Admin.php:147 +#: ../../Zotlabs/Module/Admin.php:145 msgid "Active addons" msgstr "Активные расширения" -#: ../../Zotlabs/Module/Admin.php:148 +#: ../../Zotlabs/Module/Admin.php:146 msgid "Version" msgstr "Версия системы" -#: ../../Zotlabs/Module/Admin.php:149 +#: ../../Zotlabs/Module/Admin.php:147 msgid "Repository version (master)" msgstr "Версия репозитория (master)" -#: ../../Zotlabs/Module/Admin.php:150 +#: ../../Zotlabs/Module/Admin.php:148 msgid "Repository version (dev)" msgstr "Версия репозитория (dev)" @@ -5511,173 +5499,173 @@ msgstr "Альбом не найден." msgid "Delete Album" msgstr "Удалить альбом" -#: ../../Zotlabs/Module/Photos.php:174 ../../Zotlabs/Module/Photos.php:1085 +#: ../../Zotlabs/Module/Photos.php:174 ../../Zotlabs/Module/Photos.php:1098 msgid "Delete Photo" msgstr "Удалить фотографию" -#: ../../Zotlabs/Module/Photos.php:556 +#: ../../Zotlabs/Module/Photos.php:569 msgid "No photos selected" msgstr "Никакие фотографии не выбраны" -#: ../../Zotlabs/Module/Photos.php:605 +#: ../../Zotlabs/Module/Photos.php:618 msgid "Access to this item is restricted." msgstr "Доступ к этому элементу ограничен." -#: ../../Zotlabs/Module/Photos.php:648 +#: ../../Zotlabs/Module/Photos.php:661 #, php-format msgid "%1$.2f MB of %2$.2f MB photo storage used." msgstr "Вы использовали %1$.2f мегабайт из %2$.2f для хранения фото." -#: ../../Zotlabs/Module/Photos.php:651 +#: ../../Zotlabs/Module/Photos.php:664 #, php-format msgid "%1$.2f MB photo storage used." msgstr "Вы использовали %1$.2f мегабайт для хранения фото." -#: ../../Zotlabs/Module/Photos.php:693 +#: ../../Zotlabs/Module/Photos.php:706 msgid "Upload Photos" msgstr "Загрузить фотографии" -#: ../../Zotlabs/Module/Photos.php:697 +#: ../../Zotlabs/Module/Photos.php:710 msgid "Enter an album name" msgstr "Введите название альбома" -#: ../../Zotlabs/Module/Photos.php:698 +#: ../../Zotlabs/Module/Photos.php:711 msgid "or select an existing album (doubleclick)" msgstr "или выберите существующий альбом (двойной щелчок)" -#: ../../Zotlabs/Module/Photos.php:699 +#: ../../Zotlabs/Module/Photos.php:712 msgid "Create a status post for this upload" msgstr "Сделать публикацию о статусе для этой загрузки" -#: ../../Zotlabs/Module/Photos.php:701 +#: ../../Zotlabs/Module/Photos.php:714 msgid "Description (optional)" msgstr "Описание (необязательно)" -#: ../../Zotlabs/Module/Photos.php:787 +#: ../../Zotlabs/Module/Photos.php:800 msgid "Show Newest First" msgstr "Показать новые первыми" -#: ../../Zotlabs/Module/Photos.php:789 +#: ../../Zotlabs/Module/Photos.php:802 msgid "Show Oldest First" msgstr "Показать старые первыми" -#: ../../Zotlabs/Module/Photos.php:813 ../../Zotlabs/Module/Photos.php:1352 +#: ../../Zotlabs/Module/Photos.php:826 ../../Zotlabs/Module/Photos.php:1365 #: ../../Zotlabs/Module/Embedphotos.php:140 #: ../../Zotlabs/Widget/Portfolio.php:87 ../../Zotlabs/Widget/Album.php:78 msgid "View Photo" msgstr "Посмотреть фотографию" -#: ../../Zotlabs/Module/Photos.php:844 ../../Zotlabs/Module/Embedphotos.php:156 +#: ../../Zotlabs/Module/Photos.php:857 ../../Zotlabs/Module/Embedphotos.php:156 #: ../../Zotlabs/Widget/Portfolio.php:108 ../../Zotlabs/Widget/Album.php:95 msgid "Edit Album" msgstr "Редактировать Фотоальбом" -#: ../../Zotlabs/Module/Photos.php:846 ../../Zotlabs/Module/Photos.php:1383 +#: ../../Zotlabs/Module/Photos.php:859 ../../Zotlabs/Module/Photos.php:1396 msgid "Add Photos" msgstr "Добавить фотографии" -#: ../../Zotlabs/Module/Photos.php:894 +#: ../../Zotlabs/Module/Photos.php:907 msgid "Permission denied. Access to this item may be restricted." msgstr "Доступ запрещен. Доступ к этому элементу может быть ограничен." -#: ../../Zotlabs/Module/Photos.php:896 +#: ../../Zotlabs/Module/Photos.php:909 msgid "Photo not available" msgstr "Фотография не доступна" -#: ../../Zotlabs/Module/Photos.php:954 +#: ../../Zotlabs/Module/Photos.php:967 msgid "Use as profile photo" msgstr "Использовать в качестве фотографии профиля" -#: ../../Zotlabs/Module/Photos.php:955 +#: ../../Zotlabs/Module/Photos.php:968 msgid "Use as cover photo" msgstr "Использовать в качестве фотографии обложки" -#: ../../Zotlabs/Module/Photos.php:962 +#: ../../Zotlabs/Module/Photos.php:975 msgid "Private Photo" msgstr "Личная фотография" -#: ../../Zotlabs/Module/Photos.php:977 +#: ../../Zotlabs/Module/Photos.php:990 msgid "View Full Size" msgstr "Посмотреть в полный размер" -#: ../../Zotlabs/Module/Photos.php:1022 ../../Zotlabs/Module/Tagrm.php:137 +#: ../../Zotlabs/Module/Photos.php:1035 ../../Zotlabs/Module/Tagrm.php:137 #: ../../Zotlabs/Module/Admin/Addons.php:455 #: ../../extend/addon/hzaddons/superblock/Mod_Superblock.php:91 msgid "Remove" msgstr "Удалить" -#: ../../Zotlabs/Module/Photos.php:1059 +#: ../../Zotlabs/Module/Photos.php:1072 msgid "Edit photo" msgstr "Редактировать фотографию" -#: ../../Zotlabs/Module/Photos.php:1061 +#: ../../Zotlabs/Module/Photos.php:1074 msgid "Rotate CW (right)" msgstr "Повернуть CW (направо)" -#: ../../Zotlabs/Module/Photos.php:1062 +#: ../../Zotlabs/Module/Photos.php:1075 msgid "Rotate CCW (left)" msgstr "Повернуть CCW (налево)" -#: ../../Zotlabs/Module/Photos.php:1065 +#: ../../Zotlabs/Module/Photos.php:1078 msgid "Move photo to album" msgstr "Переместить фотографию в альбом" -#: ../../Zotlabs/Module/Photos.php:1066 +#: ../../Zotlabs/Module/Photos.php:1079 msgid "Enter a new album name" msgstr "Введите новое название альбома" -#: ../../Zotlabs/Module/Photos.php:1067 +#: ../../Zotlabs/Module/Photos.php:1080 msgid "or select an existing one (doubleclick)" msgstr "или выбрать существующую (двойной щелчок)" -#: ../../Zotlabs/Module/Photos.php:1072 +#: ../../Zotlabs/Module/Photos.php:1085 msgid "Add a Tag" msgstr "Добавить тег" -#: ../../Zotlabs/Module/Photos.php:1080 +#: ../../Zotlabs/Module/Photos.php:1093 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com" msgstr "Пример: @bob, @Barbara_Jensen, @jim@example.com" -#: ../../Zotlabs/Module/Photos.php:1083 +#: ../../Zotlabs/Module/Photos.php:1096 msgid "Flag as adult in album view" msgstr "Пометить как альбом \"для взрослых\"" -#: ../../Zotlabs/Module/Photos.php:1102 ../../Zotlabs/Lib/ThreadItem.php:289 +#: ../../Zotlabs/Module/Photos.php:1115 ../../Zotlabs/Lib/ThreadItem.php:289 msgid "I like this (toggle)" msgstr "мне это нравится (переключение)" -#: ../../Zotlabs/Module/Photos.php:1103 ../../Zotlabs/Lib/ThreadItem.php:290 +#: ../../Zotlabs/Module/Photos.php:1116 ../../Zotlabs/Lib/ThreadItem.php:290 msgid "I don't like this (toggle)" msgstr "мне это не нравится (переключение)" -#: ../../Zotlabs/Module/Photos.php:1121 ../../Zotlabs/Module/Photos.php:1239 -#: ../../Zotlabs/Lib/ThreadItem.php:764 +#: ../../Zotlabs/Module/Photos.php:1134 ../../Zotlabs/Module/Photos.php:1252 +#: ../../Zotlabs/Lib/ThreadItem.php:767 msgid "This is you" msgstr "Это вы" -#: ../../Zotlabs/Module/Photos.php:1158 ../../Zotlabs/Module/Photos.php:1170 +#: ../../Zotlabs/Module/Photos.php:1171 ../../Zotlabs/Module/Photos.php:1183 #: ../../Zotlabs/Lib/ThreadItem.php:214 ../../Zotlabs/Lib/ThreadItem.php:226 msgid "View all" msgstr "Просмотреть все" -#: ../../Zotlabs/Module/Photos.php:1267 +#: ../../Zotlabs/Module/Photos.php:1280 msgid "Photo Tools" msgstr "Фото-Инструменты" -#: ../../Zotlabs/Module/Photos.php:1276 +#: ../../Zotlabs/Module/Photos.php:1289 msgid "In This Photo:" msgstr "На этой фотографии:" -#: ../../Zotlabs/Module/Photos.php:1281 +#: ../../Zotlabs/Module/Photos.php:1294 msgid "Map" msgstr "Карта" -#: ../../Zotlabs/Module/Photos.php:1289 ../../Zotlabs/Lib/ThreadItem.php:429 +#: ../../Zotlabs/Module/Photos.php:1302 ../../Zotlabs/Lib/ThreadItem.php:432 msgctxt "noun" msgid "Likes" msgstr "Нравится" -#: ../../Zotlabs/Module/Photos.php:1290 ../../Zotlabs/Lib/ThreadItem.php:430 +#: ../../Zotlabs/Module/Photos.php:1303 ../../Zotlabs/Lib/ThreadItem.php:433 msgctxt "noun" msgid "Dislikes" msgstr "Не нравится" @@ -6444,6 +6432,10 @@ msgstr "Местоположений не найдено" msgid "Manage Channel Locations" msgstr "Управление местоположением канала" +#: ../../Zotlabs/Module/Locs.php:119 +msgid "Primary" +msgstr "Основной" + #: ../../Zotlabs/Module/Locs.php:120 ../../Zotlabs/Module/Menu.php:176 msgid "Drop" msgstr "Удалить" @@ -7410,7 +7402,7 @@ msgstr "Редактировать блок" msgid "No service class restrictions found." msgstr "Ограничений класса обслуживание не найдено." -#: ../../Zotlabs/Module/Channel.php:116 +#: ../../Zotlabs/Module/Channel.php:160 msgid "Insufficient permissions. Request redirected to profile page." msgstr "Недостаточно прав. Запрос перенаправлен на страницу профиля." @@ -7519,44 +7511,44 @@ msgstr "Канал недоступен." msgid "Previous action reversed." msgstr "Предыдущее действие отменено." -#: ../../Zotlabs/Module/Like.php:442 +#: ../../Zotlabs/Module/Like.php:445 #, php-format msgid "%1$s agrees with %2$s's %3$s" msgstr "%1$s согласен с %2$s %3$s" -#: ../../Zotlabs/Module/Like.php:444 +#: ../../Zotlabs/Module/Like.php:447 #, php-format msgid "%1$s doesn't agree with %2$s's %3$s" msgstr "%1$s не согласен с %2$s %3$s" -#: ../../Zotlabs/Module/Like.php:446 +#: ../../Zotlabs/Module/Like.php:449 #, php-format msgid "%1$s abstains from a decision on %2$s's %3$s" msgstr "%1$s воздерживается от решения по %2$s%3$s" -#: ../../Zotlabs/Module/Like.php:448 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2111 +#: ../../Zotlabs/Module/Like.php:451 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2120 #, php-format msgid "%1$s is attending %2$s's %3$s" msgstr "%1$s посещает %2$s%3$s" -#: ../../Zotlabs/Module/Like.php:450 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2113 +#: ../../Zotlabs/Module/Like.php:453 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2122 #, php-format msgid "%1$s is not attending %2$s's %3$s" msgstr "%1$s не посещает %2$s%3$s" -#: ../../Zotlabs/Module/Like.php:452 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2115 +#: ../../Zotlabs/Module/Like.php:455 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2124 #, php-format msgid "%1$s may attend %2$s's %3$s" msgstr "%1$s может посетить %2$s%3$s" -#: ../../Zotlabs/Module/Like.php:564 +#: ../../Zotlabs/Module/Like.php:566 msgid "Action completed." msgstr "Действие завершено." -#: ../../Zotlabs/Module/Like.php:565 +#: ../../Zotlabs/Module/Like.php:567 msgid "Thank you." msgstr "Спасибо." @@ -8148,14 +8140,14 @@ msgstr "хранилище доступно для записи" msgid "" "SSL certificate cannot be validated. Fix certificate or disable https access " "to this site." -msgstr "" +msgstr "SSL certificate cannot be validated. Замените его или отключите https доступ к этому сайту." #: ../../Zotlabs/Module/Setup.php:659 msgid "" "If you have https access to your website or allow connections to TCP port " "443 (the https: port), you MUST use a browser-valid certificate. You MUST " "NOT use self-signed certificates!" -msgstr "" +msgstr "Если у вас есть https-доступ к вашему сайту или разрешено подключение к TCP-порту 443 (порт https), вы ДОЛЖНЫ использовать сертификат, действительный для браузера. Вы НЕ ДОЛЖНЫ использовать самоподписанные сертификаты!" #: ../../Zotlabs/Module/Setup.php:660 msgid "" @@ -8168,18 +8160,18 @@ msgid "" "If your certificate is not recognized, members of other sites (who may " "themselves have valid certificates) will get a warning message on their own " "site complaining about security issues." -msgstr "" +msgstr "Если ваш сертификат не признан, пользователи других сайтов (которые могут сами иметь действительные сертификаты) получат предупреждающее сообщение о проблемах с безопасностью." #: ../../Zotlabs/Module/Setup.php:662 msgid "" "This can cause usability issues elsewhere (not just on your own site) so we " "must insist on this requirement." -msgstr "" +msgstr "Это может привести к проблемам удобства использования из других мест (не только на вашем собственном сайте), поэтому мы настаиваем на этом требовании." #: ../../Zotlabs/Module/Setup.php:663 msgid "" "Providers are available that issue free certificates which are browser-valid." -msgstr "" +msgstr "Доступны поставщики, которые выдают действительные для браузера бесплатные сертификаты." #: ../../Zotlabs/Module/Setup.php:665 msgid "" @@ -8187,17 +8179,17 @@ msgid "" "authority, check to see if you have failed to install an intermediate cert. " "These are not normally required by browsers, but are required for server-to-" "server communications." -msgstr "" +msgstr "Если вы уверены, что сертификат действителен и подписан доверенным органом, проверьте, установлен ли промежуточные сертификаты. Обычно они не требуются браузерами, но бывают необходимы для связи между серверами." #: ../../Zotlabs/Module/Setup.php:667 msgid "SSL certificate validation" -msgstr "" +msgstr "Проверка SSL сертификата" #: ../../Zotlabs/Module/Setup.php:673 msgid "" "Url rewrite in .htaccess is not working. Check your server configuration." "Test: " -msgstr "" +msgstr "Перезапись URL в .htaccess не работает. Проверьте настройки вашего сервера." #: ../../Zotlabs/Module/Setup.php:676 msgid "Url rewrite is working" @@ -8208,7 +8200,7 @@ msgid "" "The database configuration file \".htconfig.php\" could not be written. " "Please use the enclosed text to create a configuration file in your web " "server root." -msgstr "" +msgstr "Файл конфигурации базы данных \".htconfig.php\" не может быть записан. Используйте прилагаемый текст для создания файла конфигурации в корневом каталоге веб-сервера." #: ../../Zotlabs/Module/Setup.php:714 #: ../../extend/addon/hzaddons/rendezvous/rendezvous.php:401 @@ -8953,7 +8945,7 @@ msgstr "Импортировать только публичные потоки #: ../../Zotlabs/Module/Admin/Site.php:323 #: ../../Zotlabs/Module/Admin/Site.php:324 -#: ../../Zotlabs/Module/Connedit.php:876 ../../Zotlabs/Module/Connedit.php:877 +#: ../../Zotlabs/Module/Connedit.php:881 ../../Zotlabs/Module/Connedit.php:882 msgid "" "words one per line or #tags or /patterns/ or lang=xx, leave blank to import " "all posts" @@ -9298,12 +9290,12 @@ msgid "No registrations." msgstr "Нет новых регистраций." #: ../../Zotlabs/Module/Admin/Accounts.php:176 -#: ../../Zotlabs/Module/Connedit.php:623 +#: ../../Zotlabs/Module/Connedit.php:628 msgid "Block" msgstr "Блокировать" #: ../../Zotlabs/Module/Admin/Accounts.php:177 -#: ../../Zotlabs/Module/Connedit.php:623 +#: ../../Zotlabs/Module/Connedit.php:628 msgid "Unblock" msgstr "Разблокировать" @@ -9467,21 +9459,21 @@ msgstr "Пароль" msgid "Expires (yyyy-mm-dd)" msgstr "Срок действия (yyyy-mm-dd)" -#: ../../Zotlabs/Module/Tokens.php:180 ../../Zotlabs/Module/Connedit.php:891 +#: ../../Zotlabs/Module/Tokens.php:180 ../../Zotlabs/Module/Connedit.php:896 msgid "Their Settings" msgstr "Их настройки" #: ../../Zotlabs/Module/Notifications.php:60 -#: ../../Zotlabs/Lib/ThreadItem.php:422 +#: ../../Zotlabs/Lib/ThreadItem.php:425 msgid "Mark all seen" msgstr "Отметить как просмотренное" -#: ../../Zotlabs/Module/Subthread.php:142 +#: ../../Zotlabs/Module/Subthread.php:143 #, php-format msgid "%1$s is following %2$s's %3$s" msgstr "%1$s отслеживает %2$s's %3$s" -#: ../../Zotlabs/Module/Subthread.php:144 +#: ../../Zotlabs/Module/Subthread.php:145 #, php-format msgid "%1$s stopped following %2$s's %3$s" msgstr "%1$s прекратил отслеживать %2$s's %3$s" @@ -9711,268 +9703,268 @@ msgstr "Контакт добавлен." msgid "Item is not editable" msgstr "Элемент нельзя редактировать" -#: ../../Zotlabs/Module/Connedit.php:110 +#: ../../Zotlabs/Module/Connedit.php:111 msgid "Could not locate selected profile." msgstr "Не удалось обнаружить выбранный профиль." -#: ../../Zotlabs/Module/Connedit.php:247 +#: ../../Zotlabs/Module/Connedit.php:248 msgid "Connection updated." msgstr "Контакты обновлены." -#: ../../Zotlabs/Module/Connedit.php:249 +#: ../../Zotlabs/Module/Connedit.php:250 msgid "Failed to update connection record." msgstr "Не удалось обновить запись контакта." -#: ../../Zotlabs/Module/Connedit.php:303 +#: ../../Zotlabs/Module/Connedit.php:304 msgid "is now connected to" msgstr "теперь подключён к" -#: ../../Zotlabs/Module/Connedit.php:428 +#: ../../Zotlabs/Module/Connedit.php:429 msgid "Could not access address book record." msgstr "Не удалось получить доступ к записи адресной книги." -#: ../../Zotlabs/Module/Connedit.php:476 +#: ../../Zotlabs/Module/Connedit.php:477 ../../Zotlabs/Module/Connedit.php:481 msgid "Refresh failed - channel is currently unavailable." msgstr "Обновление невозможно - в настоящее время канал недоступен." -#: ../../Zotlabs/Module/Connedit.php:491 ../../Zotlabs/Module/Connedit.php:500 -#: ../../Zotlabs/Module/Connedit.php:509 ../../Zotlabs/Module/Connedit.php:518 -#: ../../Zotlabs/Module/Connedit.php:531 +#: ../../Zotlabs/Module/Connedit.php:496 ../../Zotlabs/Module/Connedit.php:505 +#: ../../Zotlabs/Module/Connedit.php:514 ../../Zotlabs/Module/Connedit.php:523 +#: ../../Zotlabs/Module/Connedit.php:536 msgid "Unable to set address book parameters." msgstr "Не удалось получить доступ к параметрам адресной книги." -#: ../../Zotlabs/Module/Connedit.php:555 +#: ../../Zotlabs/Module/Connedit.php:560 msgid "Connection has been removed." msgstr "Контакт был удалён." -#: ../../Zotlabs/Module/Connedit.php:598 +#: ../../Zotlabs/Module/Connedit.php:603 #, php-format msgid "View %s's profile" msgstr "Просмотр %s профиля" -#: ../../Zotlabs/Module/Connedit.php:602 +#: ../../Zotlabs/Module/Connedit.php:607 msgid "Refresh Permissions" msgstr "Обновить разрешения" -#: ../../Zotlabs/Module/Connedit.php:605 +#: ../../Zotlabs/Module/Connedit.php:610 msgid "Fetch updated permissions" msgstr "Получить обновлённые разрешения" -#: ../../Zotlabs/Module/Connedit.php:609 +#: ../../Zotlabs/Module/Connedit.php:614 msgid "Refresh Photo" msgstr "Обновить фотографию" -#: ../../Zotlabs/Module/Connedit.php:612 +#: ../../Zotlabs/Module/Connedit.php:617 msgid "Fetch updated photo" msgstr "Получить обновлённую фотографию" -#: ../../Zotlabs/Module/Connedit.php:619 +#: ../../Zotlabs/Module/Connedit.php:624 msgid "View recent posts and comments" msgstr "Просмотреть последние публикации и комментарии" -#: ../../Zotlabs/Module/Connedit.php:626 +#: ../../Zotlabs/Module/Connedit.php:631 msgid "Block (or Unblock) all communications with this connection" msgstr "Блокировать (или разблокировать) связи с этим контактом" -#: ../../Zotlabs/Module/Connedit.php:627 +#: ../../Zotlabs/Module/Connedit.php:632 msgid "This connection is blocked!" msgstr "Этот контакт заблокирован!" -#: ../../Zotlabs/Module/Connedit.php:631 +#: ../../Zotlabs/Module/Connedit.php:636 msgid "Unignore" msgstr "Не игнорировать" -#: ../../Zotlabs/Module/Connedit.php:631 +#: ../../Zotlabs/Module/Connedit.php:636 #: ../../Zotlabs/Module/Connections.php:308 msgid "Ignore" msgstr "Игнорировать" -#: ../../Zotlabs/Module/Connedit.php:634 +#: ../../Zotlabs/Module/Connedit.php:639 msgid "Ignore (or Unignore) all inbound communications from this connection" msgstr "Игнорировать (или не игнорировать) все связи для этого контакта" -#: ../../Zotlabs/Module/Connedit.php:635 +#: ../../Zotlabs/Module/Connedit.php:640 msgid "This connection is ignored!" msgstr "Этот контакт игнорируется!" -#: ../../Zotlabs/Module/Connedit.php:639 +#: ../../Zotlabs/Module/Connedit.php:644 msgid "Unarchive" msgstr "Разархивировать" -#: ../../Zotlabs/Module/Connedit.php:639 +#: ../../Zotlabs/Module/Connedit.php:644 msgid "Archive" msgstr "Заархивировать" -#: ../../Zotlabs/Module/Connedit.php:642 +#: ../../Zotlabs/Module/Connedit.php:647 msgid "" "Archive (or Unarchive) this connection - mark channel dead but keep content" msgstr "Заархивировать (или разархивировать) этот контакт - пометить канал отключённым но сохранить содержимое" -#: ../../Zotlabs/Module/Connedit.php:643 +#: ../../Zotlabs/Module/Connedit.php:648 msgid "This connection is archived!" msgstr "Этот контакт заархивирован!" -#: ../../Zotlabs/Module/Connedit.php:647 +#: ../../Zotlabs/Module/Connedit.php:652 msgid "Unhide" msgstr "Показать" -#: ../../Zotlabs/Module/Connedit.php:647 +#: ../../Zotlabs/Module/Connedit.php:652 msgid "Hide" msgstr "Скрыть" -#: ../../Zotlabs/Module/Connedit.php:650 +#: ../../Zotlabs/Module/Connedit.php:655 msgid "Hide or Unhide this connection from your other connections" msgstr "Скрыть или показать этот контакт от / для остальных" -#: ../../Zotlabs/Module/Connedit.php:651 +#: ../../Zotlabs/Module/Connedit.php:656 msgid "This connection is hidden!" msgstr "Этот контакт скрыт!" -#: ../../Zotlabs/Module/Connedit.php:658 +#: ../../Zotlabs/Module/Connedit.php:663 msgid "Delete this connection" msgstr "Удалить этот контакт" -#: ../../Zotlabs/Module/Connedit.php:666 +#: ../../Zotlabs/Module/Connedit.php:671 msgid "Fetch Vcard" msgstr "Получить vCard" -#: ../../Zotlabs/Module/Connedit.php:669 +#: ../../Zotlabs/Module/Connedit.php:674 msgid "Fetch electronic calling card for this connection" msgstr "Получить электронную телефонную карточку для этого контакта" -#: ../../Zotlabs/Module/Connedit.php:680 +#: ../../Zotlabs/Module/Connedit.php:685 msgid "Open Individual Permissions section by default" msgstr "Открывать раздел \"Индивидуальные разрешения\" по умолчанию" -#: ../../Zotlabs/Module/Connedit.php:703 +#: ../../Zotlabs/Module/Connedit.php:708 msgid "Affinity" msgstr "Сходство" -#: ../../Zotlabs/Module/Connedit.php:706 +#: ../../Zotlabs/Module/Connedit.php:711 msgid "Open Set Affinity section by default" msgstr "Открыть секцию установления сходства по умолчанию" -#: ../../Zotlabs/Module/Connedit.php:710 ../../Zotlabs/Widget/Affinity.php:22 +#: ../../Zotlabs/Module/Connedit.php:715 ../../Zotlabs/Widget/Affinity.php:22 msgid "Me" msgstr "Я" -#: ../../Zotlabs/Module/Connedit.php:711 ../../Zotlabs/Widget/Affinity.php:23 +#: ../../Zotlabs/Module/Connedit.php:716 ../../Zotlabs/Widget/Affinity.php:23 msgid "Family" msgstr "Семья" -#: ../../Zotlabs/Module/Connedit.php:713 ../../Zotlabs/Widget/Affinity.php:25 +#: ../../Zotlabs/Module/Connedit.php:718 ../../Zotlabs/Widget/Affinity.php:25 msgid "Acquaintances" msgstr "Знакомые" -#: ../../Zotlabs/Module/Connedit.php:714 +#: ../../Zotlabs/Module/Connedit.php:719 #: ../../Zotlabs/Module/Connections.php:97 #: ../../Zotlabs/Module/Connections.php:111 #: ../../Zotlabs/Widget/Affinity.php:26 msgid "All" msgstr "Все" -#: ../../Zotlabs/Module/Connedit.php:740 +#: ../../Zotlabs/Module/Connedit.php:745 msgid "Filter" msgstr "Фильтр" -#: ../../Zotlabs/Module/Connedit.php:743 +#: ../../Zotlabs/Module/Connedit.php:748 msgid "Open Custom Filter section by default" msgstr "Открывать секцию \"Настраиваемый фильтр\" по умолчанию" -#: ../../Zotlabs/Module/Connedit.php:780 +#: ../../Zotlabs/Module/Connedit.php:785 msgid "Approve this connection" msgstr "Утвердить этот контакт" -#: ../../Zotlabs/Module/Connedit.php:780 +#: ../../Zotlabs/Module/Connedit.php:785 msgid "Accept connection to allow communication" msgstr "Принять контакт чтобы разрешить связь" -#: ../../Zotlabs/Module/Connedit.php:785 +#: ../../Zotlabs/Module/Connedit.php:790 msgid "Set Affinity" msgstr "Установить сходство" -#: ../../Zotlabs/Module/Connedit.php:788 +#: ../../Zotlabs/Module/Connedit.php:793 msgid "Set Profile" msgstr "Установить профиль" -#: ../../Zotlabs/Module/Connedit.php:791 +#: ../../Zotlabs/Module/Connedit.php:796 msgid "Set Affinity & Profile" msgstr "Установить сходство и профиль" -#: ../../Zotlabs/Module/Connedit.php:839 +#: ../../Zotlabs/Module/Connedit.php:844 msgid "This connection is unreachable from this location." msgstr "Этот контакт недоступен для данного местоположения" -#: ../../Zotlabs/Module/Connedit.php:840 +#: ../../Zotlabs/Module/Connedit.php:845 msgid "This connection may be unreachable from other channel locations." msgstr "Этот контакт может быть недоступен из других мест размещения канала" -#: ../../Zotlabs/Module/Connedit.php:842 +#: ../../Zotlabs/Module/Connedit.php:847 msgid "Location independence is not supported by their network." msgstr "Независимое местоположение не поддерживается их сетью." -#: ../../Zotlabs/Module/Connedit.php:848 +#: ../../Zotlabs/Module/Connedit.php:853 msgid "" "This connection is unreachable from this location. Location independence is " "not supported by their network." msgstr "Этот контакт недоступен из данного местоположения. Независимое местоположение не поддерживается их сетью." -#: ../../Zotlabs/Module/Connedit.php:852 +#: ../../Zotlabs/Module/Connedit.php:857 msgid "Connection requests will be approved without your interaction" msgstr "Запросы контактов будут одобрены без вашего участия" -#: ../../Zotlabs/Module/Connedit.php:861 +#: ../../Zotlabs/Module/Connedit.php:866 msgid "This connection's primary address is" msgstr "Главный адрес это контакта" -#: ../../Zotlabs/Module/Connedit.php:862 +#: ../../Zotlabs/Module/Connedit.php:867 msgid "Available locations:" msgstr "Доступные расположения:" -#: ../../Zotlabs/Module/Connedit.php:868 +#: ../../Zotlabs/Module/Connedit.php:873 msgid "Connection Tools" msgstr "Инструменты контактов" -#: ../../Zotlabs/Module/Connedit.php:870 +#: ../../Zotlabs/Module/Connedit.php:875 msgid "Slide to adjust your degree of friendship" msgstr "Прокрутить для настройки степени дружбы" -#: ../../Zotlabs/Module/Connedit.php:872 +#: ../../Zotlabs/Module/Connedit.php:877 msgid "Slide to adjust your rating" msgstr "Прокрутить для настройки оценки" -#: ../../Zotlabs/Module/Connedit.php:873 ../../Zotlabs/Module/Connedit.php:878 +#: ../../Zotlabs/Module/Connedit.php:878 ../../Zotlabs/Module/Connedit.php:883 msgid "Optionally explain your rating" msgstr "Объясните свою оценку (не обязательно)" -#: ../../Zotlabs/Module/Connedit.php:875 +#: ../../Zotlabs/Module/Connedit.php:880 msgid "Custom Filter" msgstr "Настраиваемый фильтр" -#: ../../Zotlabs/Module/Connedit.php:876 +#: ../../Zotlabs/Module/Connedit.php:881 msgid "Only import posts with this text" msgstr "Импортировать публикации только с этим текстом" -#: ../../Zotlabs/Module/Connedit.php:877 +#: ../../Zotlabs/Module/Connedit.php:882 msgid "Do not import posts with this text" msgstr "Не импортировать публикации с этим текстом" -#: ../../Zotlabs/Module/Connedit.php:879 +#: ../../Zotlabs/Module/Connedit.php:884 msgid "This information is public!" msgstr "Эта информация общедоступна!" -#: ../../Zotlabs/Module/Connedit.php:884 +#: ../../Zotlabs/Module/Connedit.php:889 msgid "Connection Pending Approval" msgstr "Ожидающие подтверждения контактов" -#: ../../Zotlabs/Module/Connedit.php:889 +#: ../../Zotlabs/Module/Connedit.php:894 #, php-format msgid "" "Please choose the profile you would like to display to %s when viewing your " "profile securely." msgstr "Пожалуйста, выберите профиль который вы хотит показывать в %s при безопасном просмотре." -#: ../../Zotlabs/Module/Connedit.php:896 +#: ../../Zotlabs/Module/Connedit.php:901 msgid "" "Some permissions may be inherited from your channel's privacy settings, which have higher priority than " @@ -9980,11 +9972,11 @@ msgid "" "any impact unless the inherited setting changes." msgstr "Некоторые разрешения могут быть унаследованы из настроек приватности вашего канала, которые могут иметь более высокий приоритет чем индивидуальные. Вы можете изменить эти настройки, однако они не будут применены до изменения переданных по наследству настроек." -#: ../../Zotlabs/Module/Connedit.php:897 +#: ../../Zotlabs/Module/Connedit.php:902 msgid "Last update:" msgstr "Последнее обновление:" -#: ../../Zotlabs/Module/Connedit.php:905 +#: ../../Zotlabs/Module/Connedit.php:910 msgid "Details" msgstr "Сведения" @@ -10180,15 +10172,15 @@ msgstr "Поиск ваших контактов" msgid "Connections search" msgstr "Поиск контаков" -#: ../../Zotlabs/Module/Mood.php:132 +#: ../../Zotlabs/Module/Mood.php:134 msgid "Mood App" msgstr "Приложение \"Настроение\"" -#: ../../Zotlabs/Module/Mood.php:133 ../../Zotlabs/Module/Mood.php:153 +#: ../../Zotlabs/Module/Mood.php:135 ../../Zotlabs/Module/Mood.php:155 msgid "Set your current mood and tell your friends" msgstr "Установить текущее настроение и рассказать друзьям" -#: ../../Zotlabs/Module/Mood.php:152 ../../Zotlabs/Lib/Apps.php:325 +#: ../../Zotlabs/Module/Mood.php:154 ../../Zotlabs/Lib/Apps.php:325 msgid "Mood" msgstr "Настроение" @@ -10413,6 +10405,7 @@ msgid "System layout" msgstr "Системный шаблон" #: ../../Zotlabs/Module/Wiki.php:35 +#: ../../extend/addon/hzaddons/flashcards/Mod_Flashcards.php:34 #: ../../extend/addon/hzaddons/cart/cart.php:1297 msgid "Profile Unavailable." msgstr "Профиль недоступен." @@ -10429,7 +10422,7 @@ msgstr "Предоставьте Wiki для вашего канала" #: ../../extend/addon/hzaddons/cart/submodules/paypalbutton.php:456 #: ../../extend/addon/hzaddons/cart/myshop.php:37 #: ../../extend/addon/hzaddons/cart/manual_payments.php:93 -#: ../../extend/addon/hzaddons/cart/cart.php:1440 +#: ../../extend/addon/hzaddons/cart/cart.php:1443 msgid "Invalid channel" msgstr "Недействительный канал" @@ -10937,7 +10930,7 @@ msgstr "Просмотр публичного потока. Предупрежд #: ../../Zotlabs/Widget/Forums.php:100 #: ../../Zotlabs/Widget/Notifications.php:119 #: ../../Zotlabs/Widget/Notifications.php:120 -#: ../../Zotlabs/Widget/Activity_filter.php:102 +#: ../../Zotlabs/Widget/Activity_filter.php:73 msgid "Forums" msgstr "Форумы" @@ -10979,7 +10972,7 @@ msgstr "Показывать только новые публикации" #: ../../Zotlabs/Widget/Notifications.php:46 #: ../../Zotlabs/Widget/Notifications.php:122 #: ../../Zotlabs/Widget/Notifications.php:153 -#: ../../Zotlabs/Widget/Activity_filter.php:164 +#: ../../Zotlabs/Widget/Activity_filter.php:165 msgid "Filter by name" msgstr "Отфильтровать по имени" @@ -11372,57 +11365,57 @@ msgstr "Установленные приложения" msgid "Remove term" msgstr "Удалить термин" -#: ../../Zotlabs/Widget/Activity_filter.php:26 -msgid "Personal Posts" -msgstr "Личные публикации" - -#: ../../Zotlabs/Widget/Activity_filter.php:30 -msgid "Show posts that mention or involve me" -msgstr "Показывать публикации где вы были упомянуты или привлечены" - -#: ../../Zotlabs/Widget/Activity_filter.php:41 -msgid "Starred Posts" -msgstr "Отмеченные публикации" - -#: ../../Zotlabs/Widget/Activity_filter.php:45 -msgid "Show posts that I have starred" -msgstr "Показывать публикации которые я отметил" - -#: ../../Zotlabs/Widget/Activity_filter.php:65 +#: ../../Zotlabs/Widget/Activity_filter.php:36 #, php-format msgid "Show posts related to the %s privacy group" msgstr "Показывать публикации относящиеся к группе безопасности %s" -#: ../../Zotlabs/Widget/Activity_filter.php:74 +#: ../../Zotlabs/Widget/Activity_filter.php:45 msgid "Show my privacy groups" msgstr "Показывать мои группы безопасности" -#: ../../Zotlabs/Widget/Activity_filter.php:95 +#: ../../Zotlabs/Widget/Activity_filter.php:66 msgid "Show posts to this forum" msgstr "Показывать публикации этого форума" -#: ../../Zotlabs/Widget/Activity_filter.php:106 +#: ../../Zotlabs/Widget/Activity_filter.php:77 msgid "Show forums" msgstr "Показывать форумы" -#: ../../Zotlabs/Widget/Activity_filter.php:130 +#: ../../Zotlabs/Widget/Activity_filter.php:91 +msgid "Starred Posts" +msgstr "Отмеченные публикации" + +#: ../../Zotlabs/Widget/Activity_filter.php:95 +msgid "Show posts that I have starred" +msgstr "Показывать публикации которые я отметил" + +#: ../../Zotlabs/Widget/Activity_filter.php:106 +msgid "Personal Posts" +msgstr "Личные публикации" + +#: ../../Zotlabs/Widget/Activity_filter.php:110 +msgid "Show posts that mention or involve me" +msgstr "Показывать публикации где вы были упомянуты или привлечены" + +#: ../../Zotlabs/Widget/Activity_filter.php:131 #, php-format msgid "Show posts that I have filed to %s" msgstr "Показывать публикации которые я добавил в %s" -#: ../../Zotlabs/Widget/Activity_filter.php:140 +#: ../../Zotlabs/Widget/Activity_filter.php:141 msgid "Show filed post categories" msgstr "Показывать категории добавленных публикаций" -#: ../../Zotlabs/Widget/Activity_filter.php:154 +#: ../../Zotlabs/Widget/Activity_filter.php:155 msgid "Panel search" msgstr "Панель поиска" -#: ../../Zotlabs/Widget/Activity_filter.php:179 +#: ../../Zotlabs/Widget/Activity_filter.php:180 msgid "Remove active filter" msgstr "Удалить активный фильтр" -#: ../../Zotlabs/Widget/Activity_filter.php:195 +#: ../../Zotlabs/Widget/Activity_filter.php:196 msgid "Stream Filters" msgstr "Фильтры потока" @@ -12164,7 +12157,7 @@ msgstr "поделиться" msgid "Delivery Report" msgstr "Отчёт о доставке" -#: ../../Zotlabs/Lib/ThreadItem.php:321 +#: ../../Zotlabs/Lib/ThreadItem.php:323 #, php-format msgid "%d comment" msgid_plural "%d comments" @@ -12172,73 +12165,73 @@ msgstr[0] "%d комментарий" msgstr[1] "%d комментария" msgstr[2] "%d комментариев" -#: ../../Zotlabs/Lib/ThreadItem.php:355 ../../Zotlabs/Lib/ThreadItem.php:356 +#: ../../Zotlabs/Lib/ThreadItem.php:357 ../../Zotlabs/Lib/ThreadItem.php:358 #, php-format msgid "View %s's profile - %s" msgstr "Просмотр %s профиля - %s" -#: ../../Zotlabs/Lib/ThreadItem.php:359 +#: ../../Zotlabs/Lib/ThreadItem.php:361 msgid "to" msgstr "к" -#: ../../Zotlabs/Lib/ThreadItem.php:360 +#: ../../Zotlabs/Lib/ThreadItem.php:362 msgid "via" msgstr "через" -#: ../../Zotlabs/Lib/ThreadItem.php:361 +#: ../../Zotlabs/Lib/ThreadItem.php:363 msgid "Wall-to-Wall" msgstr "Стена-к-Стене" -#: ../../Zotlabs/Lib/ThreadItem.php:362 +#: ../../Zotlabs/Lib/ThreadItem.php:364 msgid "via Wall-To-Wall:" msgstr "через Стена-к-Стене:" -#: ../../Zotlabs/Lib/ThreadItem.php:387 +#: ../../Zotlabs/Lib/ThreadItem.php:390 msgid "Attend" msgstr "Посетить" -#: ../../Zotlabs/Lib/ThreadItem.php:388 +#: ../../Zotlabs/Lib/ThreadItem.php:391 msgid "Attendance Options" msgstr "Параметры посещаемости" -#: ../../Zotlabs/Lib/ThreadItem.php:389 +#: ../../Zotlabs/Lib/ThreadItem.php:392 msgid "Vote" msgstr "Голосовать" -#: ../../Zotlabs/Lib/ThreadItem.php:390 +#: ../../Zotlabs/Lib/ThreadItem.php:393 msgid "Voting Options" msgstr "Параметры голосования" -#: ../../Zotlabs/Lib/ThreadItem.php:411 +#: ../../Zotlabs/Lib/ThreadItem.php:414 #: ../../extend/addon/hzaddons/bookmarker/bookmarker.php:38 msgid "Save Bookmarks" msgstr "Сохранить закладки" -#: ../../Zotlabs/Lib/ThreadItem.php:412 +#: ../../Zotlabs/Lib/ThreadItem.php:415 msgid "Add to Calendar" msgstr "Добавить в календарь" -#: ../../Zotlabs/Lib/ThreadItem.php:773 +#: ../../Zotlabs/Lib/ThreadItem.php:776 msgid "Image" msgstr "Изображение" -#: ../../Zotlabs/Lib/ThreadItem.php:775 +#: ../../Zotlabs/Lib/ThreadItem.php:778 msgid "Insert Link" msgstr "Вставить ссылку" -#: ../../Zotlabs/Lib/ThreadItem.php:776 +#: ../../Zotlabs/Lib/ThreadItem.php:779 msgid "Video" msgstr "Видео" -#: ../../Zotlabs/Lib/ThreadItem.php:786 +#: ../../Zotlabs/Lib/ThreadItem.php:789 msgid "Your full name (required)" msgstr "Ваше полное имя (требуется)" -#: ../../Zotlabs/Lib/ThreadItem.php:787 +#: ../../Zotlabs/Lib/ThreadItem.php:790 msgid "Your email address (required)" msgstr "Ваш адрес электронной почты (требуется)" -#: ../../Zotlabs/Lib/ThreadItem.php:788 +#: ../../Zotlabs/Lib/ThreadItem.php:791 msgid "Your website URL (optional)" msgstr "URL вашего вебсайта (необязательно)" @@ -12339,11 +12332,11 @@ msgstr "4. Эксперт - я умею программировать" msgid "5. Wizard - I probably know more than you do" msgstr "5. Волшебник - возможно я знаю больше чем ты" -#: ../../Zotlabs/Lib/NativeWiki.php:152 +#: ../../Zotlabs/Lib/NativeWiki.php:143 msgid "Wiki updated successfully" msgstr "Wiki успешно обновлена" -#: ../../Zotlabs/Lib/NativeWiki.php:206 +#: ../../Zotlabs/Lib/NativeWiki.php:197 msgid "Wiki files deleted successfully" msgstr "Wiki успешно удалена" @@ -12383,72 +12376,68 @@ msgstr "Серверы и ресурсы проекта" msgid "Project Creator and Tech Lead" msgstr "Создатель проекта и технический руководитель" -#: ../../extend/addon/hzaddons/donate/donate.php:23 -msgid "Admin, developer, directorymin, support bloke" -msgstr "Администратор, разработчик, администратор каталога, поддержка" - -#: ../../extend/addon/hzaddons/donate/donate.php:50 +#: ../../extend/addon/hzaddons/donate/donate.php:49 msgid "" "And the hundreds of other people and organisations who helped make the " "Hubzilla possible." msgstr "И сотни других людей и организаций которые помогали в создании Hubzilla." -#: ../../extend/addon/hzaddons/donate/donate.php:53 +#: ../../extend/addon/hzaddons/donate/donate.php:52 msgid "" "The Redmatrix/Hubzilla projects are provided primarily by volunteers giving " "their time and expertise - and often paying out of pocket for services they " "share with others." msgstr "Проекты Redmatrix / Hubzilla предоставляются, в основном, добровольцами, которые предоставляют свое время и опыт и, часто, оплачивают из своего кармана услуги, которыми они делятся с другими." -#: ../../extend/addon/hzaddons/donate/donate.php:54 +#: ../../extend/addon/hzaddons/donate/donate.php:53 msgid "" "There is no corporate funding and no ads, and we do not collect and sell " "your personal information. (We don't control your personal information - " "you do.)" msgstr "Здесь нет корпоративного финансирования и рекламы, мы не собираем и не продаем вашу личную информацию. (Мы не контролируем вашу личную информацию - это делаете вы.)" -#: ../../extend/addon/hzaddons/donate/donate.php:55 +#: ../../extend/addon/hzaddons/donate/donate.php:54 msgid "" "Help support our ground-breaking work in decentralisation, web identity, and " "privacy." msgstr "Помогите поддержать нашу новаторскую работу в областях децентрализации, веб-идентификации и конфиденциальности." -#: ../../extend/addon/hzaddons/donate/donate.php:57 +#: ../../extend/addon/hzaddons/donate/donate.php:56 msgid "" "Your donations keep servers and services running and also helps us to " "provide innovative new features and continued development." msgstr "В ваших пожертвованиях поддерживают серверы и службы, а также помогают нам предоставлять новые возможности и продолжать развитие." -#: ../../extend/addon/hzaddons/donate/donate.php:60 +#: ../../extend/addon/hzaddons/donate/donate.php:59 msgid "Donate" msgstr "Пожертвовать" -#: ../../extend/addon/hzaddons/donate/donate.php:62 +#: ../../extend/addon/hzaddons/donate/donate.php:61 msgid "" "Choose a project, developer, or public hub to support with a one-time " "donation" msgstr "Выберите проект, разработчика или общедоступный узел для поддержки в форме единоразового пожертвования" -#: ../../extend/addon/hzaddons/donate/donate.php:63 +#: ../../extend/addon/hzaddons/donate/donate.php:62 msgid "Donate Now" msgstr "Пожертвовать сейчас" -#: ../../extend/addon/hzaddons/donate/donate.php:64 +#: ../../extend/addon/hzaddons/donate/donate.php:63 msgid "" "Or become a project sponsor (Hubzilla Project only)" msgstr "или станьте спонсором проекта (только для Hubzilla)" -#: ../../extend/addon/hzaddons/donate/donate.php:65 +#: ../../extend/addon/hzaddons/donate/donate.php:64 msgid "" "Please indicate if you would like your first name or full name (or nothing) " "to appear in our sponsor listing" msgstr "Пожалуйста, если желаете, укажите ваше имя для отображения в списке спонсоров." -#: ../../extend/addon/hzaddons/donate/donate.php:66 +#: ../../extend/addon/hzaddons/donate/donate.php:65 msgid "Sponsor" msgstr "Спонсор" -#: ../../extend/addon/hzaddons/donate/donate.php:69 +#: ../../extend/addon/hzaddons/donate/donate.php:68 msgid "Special thanks to: " msgstr "Особые благодарности:" @@ -12535,11 +12524,11 @@ msgid "A simple gallery for your photo albums" msgstr "Простая галлерея для ваших фотоальбомов" #: ../../extend/addon/hzaddons/gallery/Mod_Gallery.php:115 -#: ../../extend/addon/hzaddons/gallery/gallery.php:47 +#: ../../extend/addon/hzaddons/gallery/gallery.php:28 msgid "Gallery" msgstr "Галерея" -#: ../../extend/addon/hzaddons/gallery/gallery.php:50 +#: ../../extend/addon/hzaddons/gallery/gallery.php:31 msgid "Photo Gallery" msgstr "Фотогалерея" @@ -12881,7 +12870,7 @@ msgid "" "return key" msgstr "Добро пожаловать в Hubzilla! Желаете получить обзор пользовательского интерфейса?

Вы можете его приостановаить и в любое время перезагрузив страницу или перейдя на другую.

Также вы можете нажать клавишу \"Назад\"" -#: ../../extend/addon/hzaddons/superblock/superblock.php:318 +#: ../../extend/addon/hzaddons/superblock/superblock.php:337 msgid "Block Completely" msgstr "Заблокировать полностью" @@ -13599,32 +13588,28 @@ msgid "Until modified date yyyy-mm-dd" msgstr "Заканчивая датой изменений yyyy-mm-dd" #: ../../extend/addon/hzaddons/ljpost/ljpost.php:42 -msgid "Post to LiveJournal" -msgstr "Опубликовать в LiveJournal" - -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:70 -msgid "Enable LiveJournal Post Plugin" -msgstr "Включить плагин публикаций LiveJournal" +msgid "Post to Livejournal" +msgstr "Опубликовать в Livejournal" -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:74 -msgid "LiveJournal username" -msgstr "Имя пользователя LiveJournal" +#: ../../extend/addon/hzaddons/ljpost/ljpost.php:73 +msgid "Enable Livejournal Post Plugin" +msgstr "Включить раширение публикаций в Livejournal" -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:78 -msgid "LiveJournal password" -msgstr "Пароль LiveJournal" +#: ../../extend/addon/hzaddons/ljpost/ljpost.php:77 +msgid "Livejournal username" +msgstr "Имя пользователя Livejournal" -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:82 -msgid "Post to LiveJournal by default" -msgstr "Публиковать в LiveJournal по умолчанию" +#: ../../extend/addon/hzaddons/ljpost/ljpost.php:81 +msgid "Livejournal password" +msgstr "Пароль Livejournal" -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:86 -msgid "LiveJournal Post Settings" -msgstr "Настройки публикаций в LiveJournal" +#: ../../extend/addon/hzaddons/ljpost/ljpost.php:85 +msgid "Post to Livejournal by default" +msgstr "Публиковать в Livejournal по умолчанию" -#: ../../extend/addon/hzaddons/ljpost/ljpost.php:101 -msgid "LiveJournal Settings saved." -msgstr "Настройки LiveJournal сохранены." +#: ../../extend/addon/hzaddons/ljpost/ljpost.php:89 +msgid "Livejournal Post Settings" +msgstr "Настройки публикации в Livejournal" #: ../../extend/addon/hzaddons/statusnet/statusnet.php:143 msgid "Post to GNU social" @@ -13825,8 +13810,8 @@ msgstr "Настройки модерирования сообщества" msgid "Can moderate reputation on my channel." msgstr "Может модерировать репутацию на моём канале" -#: ../../extend/addon/hzaddons/channelreputation/channelreputation.php:544 -#: ../../extend/addon/hzaddons/channelreputation/channelreputation.php:547 +#: ../../extend/addon/hzaddons/channelreputation/channelreputation.php:542 +#: ../../extend/addon/hzaddons/channelreputation/channelreputation.php:545 msgid "Channel Reputation" msgstr "Репутация канала" @@ -14160,7 +14145,7 @@ msgstr "Кнопка Paypal для платежей настроена непр #: ../../extend/addon/hzaddons/cart/submodules/paypalbutton.php:392 #: ../../extend/addon/hzaddons/cart/manual_payments.php:68 -#: ../../extend/addon/hzaddons/cart/cart.php:1462 +#: ../../extend/addon/hzaddons/cart/cart.php:1465 msgid "Order not found." msgstr "Заказ не найден." @@ -14173,7 +14158,7 @@ msgid "Access Denied." msgstr "Доступ запрещён." #: ../../extend/addon/hzaddons/cart/myshop.php:111 -#: ../../extend/addon/hzaddons/cart/cart.php:1330 +#: ../../extend/addon/hzaddons/cart/cart.php:1333 msgid "Order Not Found" msgstr "Заказ не найден" @@ -14217,32 +14202,32 @@ msgstr "Сбросить таблицы базы данных при деинс msgid "Shop" msgstr "Магазин" -#: ../../extend/addon/hzaddons/cart/cart.php:1391 +#: ../../extend/addon/hzaddons/cart/cart.php:1394 msgid "Cart utilities for orders and payments" msgstr "Утилиты карточек для заказов и платежей" -#: ../../extend/addon/hzaddons/cart/cart.php:1429 +#: ../../extend/addon/hzaddons/cart/cart.php:1432 msgid "You must be logged into the Grid to shop." msgstr "Вы должны быть в сети для доступа к магазину" -#: ../../extend/addon/hzaddons/cart/cart.php:1470 +#: ../../extend/addon/hzaddons/cart/cart.php:1473 msgid "Access denied." msgstr "Доступ запрещён." -#: ../../extend/addon/hzaddons/cart/cart.php:1522 -#: ../../extend/addon/hzaddons/cart/cart.php:1665 +#: ../../extend/addon/hzaddons/cart/cart.php:1525 +#: ../../extend/addon/hzaddons/cart/cart.php:1668 msgid "No Order Found" msgstr "Нет найденных заказов" -#: ../../extend/addon/hzaddons/cart/cart.php:1531 +#: ../../extend/addon/hzaddons/cart/cart.php:1534 msgid "An unknown error has occurred Please start again." msgstr "Произошла неизвестная ошибка. Пожалуйста, начните снова." -#: ../../extend/addon/hzaddons/cart/cart.php:1698 +#: ../../extend/addon/hzaddons/cart/cart.php:1701 msgid "Invalid Payment Type. Please start again." msgstr "Недействительный тип платежа. Пожалуйста, начните снова." -#: ../../extend/addon/hzaddons/cart/cart.php:1705 +#: ../../extend/addon/hzaddons/cart/cart.php:1708 msgid "Order not found" msgstr "Заказ не найден" @@ -14415,7 +14400,7 @@ msgstr "Ошибка создания новой игры." msgid "You must select a local channel /chess/channelname" msgstr "Вы должны выбрать локальный канал /chess/channelname" -#: ../../extend/addon/hzaddons/chess/chess.php:1066 +#: ../../extend/addon/hzaddons/chess/chess.php:1071 msgid "Enable notifications" msgstr "Включить оповещения" -- cgit v1.2.3 From 7aaa1973f492c3505b132a1f6af6c897fa6e0581 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 19 Nov 2018 15:04:08 -0800 Subject: push recent changes --- Zotlabs/Lib/ThreadItem.php | 4 ++++ Zotlabs/Module/Pconfig.php | 2 +- Zotlabs/Module/Zot.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 93d8aa3a5..98fb5c268 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -39,6 +39,9 @@ class ThreadItem { $this->data = $data; $this->toplevel = ($this->get_id() == $this->get_data_value('parent')); + $conv = $this->get_conversation(); + $observer = $conv->get_observer(); + // Prepare the children if($data['children']) { foreach($data['children'] as $item) { @@ -51,6 +54,7 @@ class ThreadItem { continue; } + $child = new ThreadItem($item); $this->add_child($child); } diff --git a/Zotlabs/Module/Pconfig.php b/Zotlabs/Module/Pconfig.php index 7c82bac7d..44fe5d9a9 100644 --- a/Zotlabs/Module/Pconfig.php +++ b/Zotlabs/Module/Pconfig.php @@ -43,7 +43,7 @@ class Pconfig extends \Zotlabs\Web\Controller { } - function get() { + function get() { if(! local_channel()) { return login(); diff --git a/Zotlabs/Module/Zot.php b/Zotlabs/Module/Zot.php index 8c34dced1..1cc0e54c9 100644 --- a/Zotlabs/Module/Zot.php +++ b/Zotlabs/Module/Zot.php @@ -19,7 +19,7 @@ class Zot extends \Zotlabs\Web\Controller { function init() { $zot = new ZotProtocol\Receiver(new ZotProtocol\Zot6Handler()); - json_return_and_die($zot->run(),'application/x-zot+jzon'); + json_return_and_die($zot->run(),'application/x-zot+json'); } } -- cgit v1.2.3 From 6481c9dca18d5b0e09e495b30edff987ac2da0b5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 19 Nov 2018 15:20:28 -0800 Subject: use this form instead --- Zotlabs/Lib/ThreadItem.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 98fb5c268..83d243177 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -39,8 +39,7 @@ class ThreadItem { $this->data = $data; $this->toplevel = ($this->get_id() == $this->get_data_value('parent')); - $conv = $this->get_conversation(); - $observer = $conv->get_observer(); + $observer = \App::get_observer(); // Prepare the children if($data['children']) { -- cgit v1.2.3 From e30be643c9f217dc379aac0feb085a1b1ffa44e1 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 21 Nov 2018 12:21:29 +0000 Subject: fix call to undefined function (cherry picked from commit 0bba9482dfbcc0fd8bea880ac3820548281ecfc2) --- Zotlabs/Lib/PConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php index b9384cf6b..5e5954c95 100644 --- a/Zotlabs/Lib/PConfig.php +++ b/Zotlabs/Lib/PConfig.php @@ -138,7 +138,7 @@ class PConfig { $hash = hash('sha256',$family.':'.$key); if (self::Get($uid, 'hz_delpconfig', $hash) !== false) { - if (Get($uid, 'hz_delpconfig', $hash) > $updated) { + if (self::Get($uid, 'hz_delpconfig', $hash) > $updated) { logger('Refusing to update pconfig with outdated info (Item deleted more recently).', LOGGER_NORMAL, LOG_ERR); return self::Get($uid,$family,$key); } else { -- cgit v1.2.3 From ea235c0c6751b682332b968b4c18f905e8ece451 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 21 Nov 2018 20:03:58 -0800 Subject: no mention notifications from mastodon (and pleroma) --- Zotlabs/Lib/PConfig.php | 2 +- include/items.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php index b9384cf6b..5e5954c95 100644 --- a/Zotlabs/Lib/PConfig.php +++ b/Zotlabs/Lib/PConfig.php @@ -138,7 +138,7 @@ class PConfig { $hash = hash('sha256',$family.':'.$key); if (self::Get($uid, 'hz_delpconfig', $hash) !== false) { - if (Get($uid, 'hz_delpconfig', $hash) > $updated) { + if (self::Get($uid, 'hz_delpconfig', $hash) > $updated) { logger('Refusing to update pconfig with outdated info (Item deleted more recently).', LOGGER_NORMAL, LOG_ERR); return self::Get($uid,$family,$key); } else { diff --git a/include/items.php b/include/items.php index 2baad3d04..19df3bb80 100755 --- a/include/items.php +++ b/include/items.php @@ -2664,7 +2664,7 @@ function tag_deliver($uid, $item_id) { if(preg_match_all($pluspattern,$body,$matches,PREG_SET_ORDER)) { foreach($matches as $match) { $matched_forums ++; - if($term['url'] === $match[1] && $term['term'] === $match[2] && intval($term['ttype']) === TERM_MENTION) { + if($term['url'] === $match[1] && intval($term['ttype']) === TERM_MENTION) { if($matched_forums <= $max_forums) { $plustagged = true; $found = true; @@ -2678,7 +2678,7 @@ function tag_deliver($uid, $item_id) { if(preg_match_all($forumpattern,$body,$matches,PREG_SET_ORDER)) { foreach($matches as $match) { $matched_forums ++; - if($term['url'] === $match[1] && $term['term'] === $match[2] && intval($term['ttype']) === TERM_FORUM) { + if($term['url'] === $match[1] && intval($term['ttype']) === TERM_FORUM) { if($matched_forums <= $max_forums) { $plustagged = true; $found = true; @@ -2914,7 +2914,7 @@ function tgroup_check($uid, $item) { if(preg_match_all($pluspattern,$body,$matches,PREG_SET_ORDER)) { foreach($matches as $match) { $matched_forums ++; - if($term['url'] === $match[1] && $term['term'] === $match[2] && intval($term['ttype']) === TERM_MENTION) { + if($term['url'] === $match[1] && intval($term['ttype']) === TERM_MENTION) { if($matched_forums <= $max_forums) { $found = true; break; @@ -2927,7 +2927,7 @@ function tgroup_check($uid, $item) { if(preg_match_all($forumpattern,$body,$matches,PREG_SET_ORDER)) { foreach($matches as $match) { $matched_forums ++; - if($term['url'] === $match[1] && $term['term'] === $match[2] && intval($term['ttype']) === TERM_FORUM) { + if($term['url'] === $match[1] && intval($term['ttype']) === TERM_FORUM) { if($matched_forums <= $max_forums) { $found = true; break; -- cgit v1.2.3 From 8e713245144d0bcedca0d3345017b5fa232c8ca3 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 21 Nov 2018 20:25:59 -0800 Subject: fix mastodon tag notifications (again) --- include/items.php | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/include/items.php b/include/items.php index 19df3bb80..4ccc3e01c 100755 --- a/include/items.php +++ b/include/items.php @@ -2646,28 +2646,30 @@ function tag_deliver($uid, $item_id) { $plustagged = false; $matches = array(); - $pattern = '/[\!@]\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($term['term'],'/') . '\[\/zrl\]/'; + $pattern = '/[\!@]\!?\[[uz]rl\=' . preg_quote($term['url'],'/') . '\](.*?)\[\/[uz]rl\]/'; if(preg_match($pattern,$body,$matches)) $tagged = true; - // original red forum tagging sequence @forumname+ + $pattern = '/\[url\=' . preg_quote($term['url'],'/') . '\]\@(.*?)\[\/url\]/'; + if(preg_match($pattern,$body,$matches)) + $tagged = true; + + // standard forum tagging sequence !forumname - $pluspattern = '/@\!?\[zrl\=([^\]]*?)\]((?:.(?!\[zrl\=))*?)\+\[\/zrl\]/'; + $forumpattern = '/\!\!?\[[uz]rl\=([^\]]*?)\]((?:.(?!\[[uz]rl\=))*?)\[\/[uz]rl\]/'; - $forumpattern = '/\!\!?\[zrl\=([^\]]*?)\]((?:.(?!\[zrl\=))*?)\[\/zrl\]/'; + $forumpattern2 = '/\[[uz]rl\=([^\]]*?)\]\!((?:.(?!\[[uz]rl\=))*?)\[\/[uz]rl\]/'; - $found = false; $matches = array(); - if(preg_match_all($pluspattern,$body,$matches,PREG_SET_ORDER)) { + if(preg_match_all($forumpattern,$body,$matches,PREG_SET_ORDER)) { foreach($matches as $match) { $matched_forums ++; - if($term['url'] === $match[1] && intval($term['ttype']) === TERM_MENTION) { + if($term['url'] === $match[1] && intval($term['ttype']) === TERM_FORUM) { if($matched_forums <= $max_forums) { $plustagged = true; - $found = true; break; } logger('forum ' . $term['term'] . ' exceeded max_tagged_forums - ignoring'); @@ -2675,13 +2677,12 @@ function tag_deliver($uid, $item_id) { } } - if(preg_match_all($forumpattern,$body,$matches,PREG_SET_ORDER)) { + if(preg_match_all($forumpattern2,$body,$matches,PREG_SET_ORDER)) { foreach($matches as $match) { $matched_forums ++; if($term['url'] === $match[1] && intval($term['ttype']) === TERM_FORUM) { if($matched_forums <= $max_forums) { $plustagged = true; - $found = true; break; } logger('forum ' . $term['term'] . ' exceeded max_tagged_forums - ignoring'); @@ -2903,18 +2904,19 @@ function tgroup_check($uid, $item) { $body = preg_replace('/\[share(.*?)\[\/share\]/','',$item['body']); - $pluspattern = '/@\!?\[zrl\=([^\]]*?)\]((?:.(?!\[zrl\=))*?)\+\[\/zrl\]/'; - $forumpattern = '/\!\!?\[zrl\=([^\]]*?)\]((?:.(?!\[zrl\=))*?)\[\/zrl\]/'; + $forumpattern2 = '/\[zrl\=([^\]]*?)\]\!((?:.(?!\[zrl\=))*?)\[\/zrl\]/'; + + $found = false; $matches = array(); - if(preg_match_all($pluspattern,$body,$matches,PREG_SET_ORDER)) { + if(preg_match_all($forumpattern,$body,$matches,PREG_SET_ORDER)) { foreach($matches as $match) { $matched_forums ++; - if($term['url'] === $match[1] && intval($term['ttype']) === TERM_MENTION) { + if($term['url'] === $match[1] && intval($term['ttype']) === TERM_FORUM) { if($matched_forums <= $max_forums) { $found = true; break; @@ -2924,7 +2926,7 @@ function tgroup_check($uid, $item) { } } - if(preg_match_all($forumpattern,$body,$matches,PREG_SET_ORDER)) { + if(preg_match_all($forumpattern2,$body,$matches,PREG_SET_ORDER)) { foreach($matches as $match) { $matched_forums ++; if($term['url'] === $match[1] && intval($term['ttype']) === TERM_FORUM) { -- cgit v1.2.3 From 16c7aa2813b8a7fca52ac3f214c214cc01834308 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 22 Nov 2018 12:52:08 +0100 Subject: fix db upgrade 1228 for postgres --- Zotlabs/Update/_1228.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Update/_1228.php b/Zotlabs/Update/_1228.php index f8a506bb4..9e6bf8047 100644 --- a/Zotlabs/Update/_1228.php +++ b/Zotlabs/Update/_1228.php @@ -11,8 +11,8 @@ class _1228 { if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { $r1 = q("ALTER TABLE item ADD uuid text NOT NULL DEFAULT '' "); - $r2 = q("create index \"uuid_idx\" on channel (\"uuid\")"); - $r3 = q("ALTER TABLE item add summary TEXT NOT NULL"); + $r2 = q("create index \"uuid_idx\" on item (\"uuid\")"); + $r3 = q("ALTER TABLE item add summary TEXT NOT NULL DEFAULT ''"); $r = ($r1 && $r2 && $r3); } -- cgit v1.2.3 From 9a8d1200ecc9f877b431a00a5219b41d2bd68de6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 22 Nov 2018 18:39:38 -0800 Subject: use uuid in file storage --- Zotlabs/Storage/Directory.php | 2 +- include/attach.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php index 642af6300..b30aecf92 100644 --- a/Zotlabs/Storage/Directory.php +++ b/Zotlabs/Storage/Directory.php @@ -224,7 +224,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo } $filesize = 0; - $hash = random_string(); + $hash = new_uuid(); $f = 'store/' . $this->auth->owner_nick . '/' . (($this->os_path) ? $this->os_path . '/' : '') . $hash; diff --git a/include/attach.php b/include/attach.php index 6b0d3fb3b..dd718aa14 100644 --- a/include/attach.php +++ b/include/attach.php @@ -739,7 +739,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { } if(! $hash) - $hash = random_string(); + $hash = new_uuid(); // Check storage limits if($options !== 'update') { @@ -1122,7 +1122,7 @@ function attach_mkdir($channel, $observer_hash, $arr = null) { return $ret; } - $arr['hash'] = (($arr['hash']) ? $arr['hash'] : random_string()); + $arr['hash'] = (($arr['hash']) ? $arr['hash'] : new_uuid()); // Check for duplicate name. // Check both the filename and the hash as we will be making use of both. -- cgit v1.2.3 From c5a9b00eaec750e2983e0e46565b7305fe4ae27e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 23 Nov 2018 12:25:05 -0800 Subject: Organization actor type was missing --- Zotlabs/Lib/ActivityStreams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index a322637fd..49978031e 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -284,7 +284,7 @@ class ActivityStreams { } static function is_an_actor($s) { - return(in_array($s,[ 'Application','Group','Service','Person','Service' ])); + return(in_array($s,[ 'Application','Group','Organization','Person','Service' ])); } /** -- cgit v1.2.3 From ca98a566ee7821c901b6a1db3013f3e9097747bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Jim=C3=A9nez=20Friaza?= Date: Sat, 24 Nov 2018 13:23:20 +0100 Subject: Update es-es --- view/es-es/hmessages.po | 26 +++++++++++++------------- view/es-es/hstrings.php | 28 ++++++++++++++-------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/view/es-es/hmessages.po b/view/es-es/hmessages.po index 3b42394b1..67cb21672 100644 --- a/view/es-es/hmessages.po +++ b/view/es-es/hmessages.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: hubzilla\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-10-19 11:04+0200\n" -"PO-Revision-Date: 2018-10-24 11:35+0000\n" +"PO-Revision-Date: 2018-11-21 11:04+0000\n" "Last-Translator: Manuel Jiménez Friaza \n" "Language-Team: Spanish (Spain) (http://www.transifex.com/Friendica/hubzilla/language/es_ES/)\n" "MIME-Version: 1.0\n" @@ -1729,7 +1729,7 @@ msgstr "Importar elementos" #: ../../Zotlabs/Module/Import_items.php:126 msgid "" "Use this form to import existing posts and content from an export file." -msgstr "Utilice este formulario para importar entradas existentes y contenido desde un archivo de exportación." +msgstr "Utilice este formulario para importar entradas y contenido desde un archivo de exportación." #: ../../Zotlabs/Module/Import_items.php:127 #: ../../Zotlabs/Module/Import.php:548 @@ -1807,7 +1807,7 @@ msgstr "Un canal es una identidad única en la red. Puede representar a una pers #: ../../Zotlabs/Module/New_channel.php:183 msgid "" "or import an existing channel from another location." -msgstr "O importar un canal existente desde otro lugar." +msgstr "O importar un canal desde otro lugar." #: ../../Zotlabs/Module/New_channel.php:188 msgid "Validate" @@ -4496,7 +4496,7 @@ msgid "" "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." -msgstr "Dejar en blanco para mantener su alias de canal existente. Se le asignará aleatoriamente uno similar si cualquiera de los dos nombres ya está asignado en este sitio." +msgstr "Dejar en blanco para mantener su alias de canal . Se le asignará aleatoriamente uno similar si cualquiera de los dos nombres ya está asignado en este sitio." #: ../../Zotlabs/Module/Import.php:562 msgid "" @@ -4942,7 +4942,7 @@ msgstr "Introducir un nombre de álbum" #: ../../Zotlabs/Module/Photos.php:698 msgid "or select an existing album (doubleclick)" -msgstr "o seleccionar uno existente (doble click)" +msgstr "o seleccionar un álbum (con un doble click)" #: ../../Zotlabs/Module/Photos.php:699 msgid "Create a status post for this upload" @@ -5010,7 +5010,7 @@ msgstr "Introducir un nuevo nombre de álbum" #: ../../Zotlabs/Module/Photos.php:1067 msgid "or select an existing one (doubleclick)" -msgstr "o seleccionar uno (doble click) existente" +msgstr "o seleccionar un álbum (con un doble click)" #: ../../Zotlabs/Module/Photos.php:1072 msgid "Add a Tag" @@ -5557,7 +5557,7 @@ msgstr "Usar una foto de sus álbumes" #: ../../Zotlabs/Module/Profile_photo.php:474 #: ../../Zotlabs/Module/Cover_photo.php:409 msgid "Select existing photo" -msgstr "Seleccionar una foto existente" +msgstr "Seleccionar una foto" #: ../../Zotlabs/Module/Profile_photo.php:493 #: ../../Zotlabs/Module/Cover_photo.php:426 @@ -8443,7 +8443,7 @@ msgid "" "A deleted group with this name was revived. Existing item permissions " "may apply to this group and any future members. If this is " "not what you intended, please create another group with a different name." -msgstr "Un grupo suprimido con este nombre ha sido restablecido. Es posible que los permisos existentes sean aplicados a este grupo y sus futuros miembros. Si no quiere esto, por favor cree otro grupo con un nombre diferente." +msgstr "Un grupo suprimido con este nombre ha sido restablecido. Es posible que los permisos que ya existen sean aplicados a este grupo y sus futuros miembros. Si no quiere esto, por favor cree otro grupo con un nombre diferente." #: ../../Zotlabs/Lib/Group.php:270 ../../include/group.php:264 msgid "Add new connections to this privacy group" @@ -11149,11 +11149,11 @@ msgstr "Por favor visite el sitio web de $Projectname" #: ../../addon/upgrade_info/upgrade_info.php:46 msgid "app store" -msgstr "depósito de apps" +msgstr "aplicaciones disponibles" #: ../../addon/upgrade_info/upgrade_info.php:47 msgid "and install possibly missing apps." -msgstr "e instalar aplicaciones que posiblemente falten." +msgstr "e instale las aplicaciones que posiblemente falten." #: ../../addon/upgrade_info/upgrade_info.php:52 msgid "Upgrade Info" @@ -11364,7 +11364,7 @@ msgstr "Eliminar los datos de localización geográfica del navegador" #: ../../addon/hsse/hsse.php:99 ../../include/conversation.php:1302 msgid "Embed (existing) photo from your photo albums" -msgstr "Insertar (existente) foto de sus álbumes de fotos" +msgstr "Insertar una foto de sus álbumes" #: ../../addon/hsse/hsse.php:135 ../../include/conversation.php:1338 msgid "Tag term:" @@ -12247,7 +12247,7 @@ msgstr "Crear nuevos eventos aquí." msgid "" "You can accept new connections and change permissions for existing ones " "here. You can also e.g. create groups of contacts." -msgstr "Puede aceptar nuevas conexiones y cambiar permisos para las existentes aquí. También puede, por ejemplo, crear grupos de contactos." +msgstr "Puede aceptar nuevas conexiones y cambiar permisos para las que ya existen aquí. También puede, por ejemplo, crear grupos de contactos." #: ../../addon/tour/tour.php:82 msgid "System notifications will arrive here" @@ -14455,7 +14455,7 @@ msgstr "Etiquetas de la comunidad" #: ../../include/features.php:143 msgid "Ability to tag existing posts" -msgstr "Capacidad de etiquetar entradas existentes" +msgstr "Capacidad de etiquetar entradas" #: ../../include/features.php:150 msgid "Emoji Reactions" diff --git a/view/es-es/hstrings.php b/view/es-es/hstrings.php index a459e10dd..67f499feb 100644 --- a/view/es-es/hstrings.php +++ b/view/es-es/hstrings.php @@ -2,10 +2,10 @@ if(! function_exists("string_plural_select_es_es")) { function string_plural_select_es_es($n){ - return ($n != 1 ? 1 : 0); + return ($n != 1 ? 1 : 0);; }} App::$rtl = 0; -App::$strings["plural_function_code"] = "(n != 1 ? 1 : 0)"; +App::$strings["plural_function_code"] = "(n != 1 ? 1 : 0);"; App::$strings["Can view my channel stream and posts"] = "Pueden verse la actividad y publicaciones de mi canal"; App::$strings["Can send me their channel stream and posts"] = "Se me pueden enviar entradas y contenido de un canal"; App::$strings["Can view my default channel profile"] = "Puede verse mi perfil de canal predeterminado."; @@ -300,7 +300,7 @@ App::$strings["Imported file is empty."] = "El fichero importado está vacío."; App::$strings["Warning: Database versions differ by %1\$d updates."] = "Atención: Las versiones de la base de datos difieren en %1\$d actualizaciones."; App::$strings["Import completed"] = "Importación completada"; App::$strings["Import Items"] = "Importar elementos"; -App::$strings["Use this form to import existing posts and content from an export file."] = "Utilice este formulario para importar entradas existentes y contenido desde un archivo de exportación."; +App::$strings["Use this form to import existing posts and content from an export file."] = "Utilice este formulario para importar entradas y contenido desde un archivo de exportación."; App::$strings["File to Upload"] = "Fichero para subir"; App::$strings["You have created %1$.0f of %2$.0f allowed channels."] = "Ha creado %1$.0f de %2$.0f canales permitidos."; App::$strings["Loading"] = "Cargando"; @@ -315,7 +315,7 @@ App::$strings["Select a channel permission role compatible with your usage needs App::$strings["Read more about channel permission roles"] = "Leer más sobre los roles y permisos"; App::$strings["Create a Channel"] = "Crear un canal"; App::$strings["A channel is a unique network identity. It can represent a person (social network profile), a forum (group), a business or celebrity page, a newsfeed, and many other things."] = "Un canal es una identidad única en la red. Puede representar a una persona (un perfil de una red social), un foro o grupo, un negocio o una página de una celebridad, un \"feed\" de noticias, y muchas otras cosas."; -App::$strings["or import an existing channel from another location."] = "O importar un canal existente desde otro lugar."; +App::$strings["or import an existing channel from another location."] = "O importar un canal desde otro lugar."; App::$strings["Validate"] = "Validar"; App::$strings["Channel removals are not allowed within 48 hours of changing the account password."] = "La eliminación de canales no está permitida hasta pasadas 48 horas desde el último cambio de contraseña."; App::$strings["Remove This Channel"] = "Eliminar este canal"; @@ -914,7 +914,7 @@ App::$strings["For either option, please choose whether to make this hub your ne App::$strings["Make this hub my primary location"] = "Convertir este servidor en mi ubicación primaria"; App::$strings["Move this channel (disable all previous locations)"] = "Mover este canal (desactivar todas las ubicaciones anteriores)"; App::$strings["Use this channel nickname instead of the one provided"] = "Usa este alias de canal en lugar del que se proporciona"; -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."] = "Dejar en blanco para mantener su alias de canal existente. Se le asignará aleatoriamente uno similar si cualquiera de los dos nombres ya está asignado en este sitio."; +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."] = "Dejar en blanco para mantener su alias de canal . Se le asignará aleatoriamente uno similar si cualquiera de los dos nombres ya está asignado en este sitio."; App::$strings["This process may take several minutes to complete. Please submit the form only once and leave this page open until finished."] = "Este proceso puede tardar varios minutos en completarse. Por favor envíe el formulario una sola vez y mantenga esta página abierta hasta que termine."; App::$strings["Authentication failed."] = "Falló la autenticación."; App::$strings["Remote Authentication"] = "Acceso desde su servidor"; @@ -1014,7 +1014,7 @@ App::$strings["%1$.2f MB of %2$.2f MB photo storage used."] = "%1$.2f MB de %2$. App::$strings["%1$.2f MB photo storage used."] = "%1$.2f MB de almacenamiento de fotos utilizado."; App::$strings["Upload Photos"] = "Subir fotos"; App::$strings["Enter an album name"] = "Introducir un nombre de álbum"; -App::$strings["or select an existing album (doubleclick)"] = "o seleccionar uno existente (doble click)"; +App::$strings["or select an existing album (doubleclick)"] = "o seleccionar un álbum (con un doble click)"; App::$strings["Create a status post for this upload"] = "Crear un mensaje de estado para esta subida"; App::$strings["Description (optional)"] = "Descripción (opcional)"; App::$strings["Show Newest First"] = "Mostrar lo más reciente primero"; @@ -1031,7 +1031,7 @@ App::$strings["Rotate CW (right)"] = "Girar CW (a la derecha)"; App::$strings["Rotate CCW (left)"] = "Girar CCW (a la izquierda)"; App::$strings["Move photo to album"] = "Mover la foto a un álbum"; App::$strings["Enter a new album name"] = "Introducir un nuevo nombre de álbum"; -App::$strings["or select an existing one (doubleclick)"] = "o seleccionar uno (doble click) existente"; +App::$strings["or select an existing one (doubleclick)"] = "o seleccionar un álbum (con un doble click)"; App::$strings["Add a Tag"] = "Añadir una etiqueta"; App::$strings["Example: @bob, @Barbara_Jensen, @jim@example.com"] = "Ejemplos: @eva, @Carmen_Osuna, @jaime@ejemplo.com"; App::$strings["Flag as adult in album view"] = "Marcar como \"solo para adultos\" en el álbum"; @@ -1153,7 +1153,7 @@ App::$strings["Use Photo for Profile"] = "Usar la fotografía para el perfil"; App::$strings["Change Profile Photo"] = "Cambiar la foto del perfil"; App::$strings["Use"] = "Usar"; App::$strings["Use a photo from your albums"] = "Usar una foto de sus álbumes"; -App::$strings["Select existing photo"] = "Seleccionar una foto existente"; +App::$strings["Select existing photo"] = "Seleccionar una foto"; App::$strings["Crop Image"] = "Recortar imagen"; App::$strings["Please adjust the image cropping for optimum viewing."] = "Por favor ajuste el recorte de la imagen para una visión óptima."; App::$strings["Done Editing"] = "Edición completada"; @@ -1829,7 +1829,7 @@ App::$strings["Directory Options"] = "Opciones del directorio"; App::$strings["Safe Mode"] = "Modo seguro"; App::$strings["Public Forums Only"] = "Solo foros públicos"; App::$strings["This Website Only"] = "Solo este sitio web"; -App::$strings["A deleted group with this name was revived. Existing item permissions may apply to this group and any future members. If this is not what you intended, please create another group with a different name."] = "Un grupo suprimido con este nombre ha sido restablecido. Es posible que los permisos existentes sean aplicados a este grupo y sus futuros miembros. Si no quiere esto, por favor cree otro grupo con un nombre diferente."; +App::$strings["A deleted group with this name was revived. Existing item permissions may apply to this group and any future members. If this is not what you intended, please create another group with a different name."] = "Un grupo suprimido con este nombre ha sido restablecido. Es posible que los permisos que ya existen sean aplicados a este grupo y sus futuros miembros. Si no quiere esto, por favor cree otro grupo con un nombre diferente."; App::$strings["Add new connections to this privacy group"] = "Añadir conexiones nuevas a este grupo de canales"; App::$strings["edit"] = "editar"; App::$strings["Edit group"] = "Editar grupo"; @@ -2458,8 +2458,8 @@ App::$strings["Jappix Mini Settings"] = "Ajustes de Jappix Mini"; App::$strings["Your channel has been upgraded to the latest \$Projectname version."] = "Su canal ha sido actualizado a la última versión de \$Projectname."; App::$strings["To improve usability, we have converted some features into installable stand-alone apps."] = "Para mejorar la usabilidad, hemos convertido algunas características en aplicaciones independientes instalables."; App::$strings["Please visit the \$Projectname"] = "Por favor visite el sitio web de \$Projectname"; -App::$strings["app store"] = "depósito de apps"; -App::$strings["and install possibly missing apps."] = "e instalar aplicaciones que posiblemente falten."; +App::$strings["app store"] = "aplicaciones disponibles"; +App::$strings["and install possibly missing apps."] = "e instale las aplicaciones que posiblemente falten."; App::$strings["Upgrade Info"] = "Información de actualización"; App::$strings["Do not show this again"] = "No mostrar esto de nuevo"; App::$strings["Access Denied"] = "Acceso denegado"; @@ -2509,7 +2509,7 @@ App::$strings["WYSIWYG status editor"] = "Editor de estado de WYSIWYG"; App::$strings["WYSIWYG Status"] = "Estado de WYSIWYG"; App::$strings["Set your location"] = "Establecer su ubicación"; App::$strings["Clear browser location"] = "Eliminar los datos de localización geográfica del navegador"; -App::$strings["Embed (existing) photo from your photo albums"] = "Insertar (existente) foto de sus álbumes de fotos"; +App::$strings["Embed (existing) photo from your photo albums"] = "Insertar una foto de sus álbumes"; App::$strings["Tag term:"] = "Término de la etiqueta:"; App::$strings["Where are you right now?"] = "¿Donde está ahora?"; App::$strings["Choose a different album..."] = "Elegir un álbum diferente..."; @@ -2706,7 +2706,7 @@ App::$strings["Click here to see activity from your connections."] = "Pulsar aqu App::$strings["Click here to see your channel home."] = "Pulsar aquí para ver la página de inicio de su canal."; App::$strings["You can access your private messages from here."] = "Puede acceder a sus mensajes privados desde aquí."; App::$strings["Create new events here."] = "Crear nuevos eventos aquí."; -App::$strings["You can accept new connections and change permissions for existing ones here. You can also e.g. create groups of contacts."] = "Puede aceptar nuevas conexiones y cambiar permisos para las existentes aquí. También puede, por ejemplo, crear grupos de contactos."; +App::$strings["You can accept new connections and change permissions for existing ones here. You can also e.g. create groups of contacts."] = "Puede aceptar nuevas conexiones y cambiar permisos para las que ya existen aquí. También puede, por ejemplo, crear grupos de contactos."; App::$strings["System notifications will arrive here"] = "Las notificaciones del sistema llegarán aquí"; App::$strings["Search for content and users"] = "Buscar contenido y usuarios"; App::$strings["Browse for new contacts"] = "Buscar nuevos contactos"; @@ -3270,7 +3270,7 @@ App::$strings["Connection Filtering"] = "Filtrado de conexiones"; App::$strings["Filter incoming posts from connections based on keywords/content"] = "Filtrar publicaciones entrantes de conexiones por palabras clave o contenido"; App::$strings["Conversation"] = "Conversación"; App::$strings["Community Tagging"] = "Etiquetas de la comunidad"; -App::$strings["Ability to tag existing posts"] = "Capacidad de etiquetar entradas existentes"; +App::$strings["Ability to tag existing posts"] = "Capacidad de etiquetar entradas"; App::$strings["Emoji Reactions"] = "Emoticonos \"emoji\""; App::$strings["Add emoji reaction ability to posts"] = "Activar la capacidad de añadir un emoticono \"emoji\" a las entradas"; App::$strings["Dislike Posts"] = "Desagrado de publicaciones"; -- cgit v1.2.3 From c667572d3eedb0c31b29a4c469b378ccdcee0ba1 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 25 Nov 2018 10:09:26 +0100 Subject: update imagesloaded to version 4.1.4 via composer --- composer.json | 3 +- composer.lock | 41 +- library/imagesloaded/imagesloaded.pkgd.js | 487 -------------------- library/imagesloaded/imagesloaded.pkgd.min.js | 7 - vendor/composer/ClassLoader.php | 2 +- vendor/composer/LICENSE | 69 +-- vendor/composer/autoload_classmap.php | 6 +- vendor/composer/autoload_static.php | 5 +- vendor/composer/installed.json | 41 ++ vendor/desandro/imagesloaded/.gitignore | 5 + vendor/desandro/imagesloaded/.jshintrc | 12 + vendor/desandro/imagesloaded/README.md | 362 +++++++++++++++ vendor/desandro/imagesloaded/bower.json | 37 ++ vendor/desandro/imagesloaded/composer.json | 15 + vendor/desandro/imagesloaded/contributing.md | 20 + vendor/desandro/imagesloaded/gulpfile.js | 128 ++++++ vendor/desandro/imagesloaded/imagesloaded.js | 377 ++++++++++++++++ vendor/desandro/imagesloaded/imagesloaded.pkgd.js | 497 +++++++++++++++++++++ .../desandro/imagesloaded/imagesloaded.pkgd.min.js | 7 + vendor/desandro/imagesloaded/package.json | 48 ++ .../sandbox/background/css/background.css | 29 ++ .../imagesloaded/sandbox/background/index.html | 51 +++ .../imagesloaded/sandbox/progress/index.html | 89 ++++ .../imagesloaded/sandbox/progress/progress.js | 111 +++++ vendor/desandro/imagesloaded/test/css/tests.css | 41 ++ .../desandro/imagesloaded/test/img/blue-shell.jpg | Bin 0 -> 24555 bytes .../desandro/imagesloaded/test/img/bowser-jr.jpg | Bin 0 -> 36987 bytes .../imagesloaded/test/img/thunder-cloud.jpg | Bin 0 -> 24588 bytes vendor/desandro/imagesloaded/test/index.html | 104 +++++ vendor/desandro/imagesloaded/test/unit/append.js | 30 ++ .../desandro/imagesloaded/test/unit/background.js | 70 +++ vendor/desandro/imagesloaded/test/unit/basics.js | 28 ++ vendor/desandro/imagesloaded/test/unit/data-uri.js | 10 + .../desandro/imagesloaded/test/unit/jquery-fail.js | 29 ++ .../imagesloaded/test/unit/jquery-success.js | 28 ++ .../desandro/imagesloaded/test/unit/local-files.js | 31 ++ .../desandro/imagesloaded/test/unit/no-images.js | 11 + .../desandro/imagesloaded/test/unit/non-element.js | 24 + .../imagesloaded/test/unit/selector-string.js | 12 + .../imagesloaded/test/unit/single-element.js | 11 + view/php/theme_init.php | 2 +- 41 files changed, 2326 insertions(+), 554 deletions(-) delete mode 100644 library/imagesloaded/imagesloaded.pkgd.js delete mode 100644 library/imagesloaded/imagesloaded.pkgd.min.js create mode 100644 vendor/desandro/imagesloaded/.gitignore create mode 100644 vendor/desandro/imagesloaded/.jshintrc create mode 100644 vendor/desandro/imagesloaded/README.md create mode 100644 vendor/desandro/imagesloaded/bower.json create mode 100644 vendor/desandro/imagesloaded/composer.json create mode 100644 vendor/desandro/imagesloaded/contributing.md create mode 100644 vendor/desandro/imagesloaded/gulpfile.js create mode 100644 vendor/desandro/imagesloaded/imagesloaded.js create mode 100644 vendor/desandro/imagesloaded/imagesloaded.pkgd.js create mode 100644 vendor/desandro/imagesloaded/imagesloaded.pkgd.min.js create mode 100644 vendor/desandro/imagesloaded/package.json create mode 100644 vendor/desandro/imagesloaded/sandbox/background/css/background.css create mode 100644 vendor/desandro/imagesloaded/sandbox/background/index.html create mode 100644 vendor/desandro/imagesloaded/sandbox/progress/index.html create mode 100644 vendor/desandro/imagesloaded/sandbox/progress/progress.js create mode 100644 vendor/desandro/imagesloaded/test/css/tests.css create mode 100644 vendor/desandro/imagesloaded/test/img/blue-shell.jpg create mode 100644 vendor/desandro/imagesloaded/test/img/bowser-jr.jpg create mode 100644 vendor/desandro/imagesloaded/test/img/thunder-cloud.jpg create mode 100644 vendor/desandro/imagesloaded/test/index.html create mode 100644 vendor/desandro/imagesloaded/test/unit/append.js create mode 100644 vendor/desandro/imagesloaded/test/unit/background.js create mode 100644 vendor/desandro/imagesloaded/test/unit/basics.js create mode 100644 vendor/desandro/imagesloaded/test/unit/data-uri.js create mode 100644 vendor/desandro/imagesloaded/test/unit/jquery-fail.js create mode 100644 vendor/desandro/imagesloaded/test/unit/jquery-success.js create mode 100644 vendor/desandro/imagesloaded/test/unit/local-files.js create mode 100644 vendor/desandro/imagesloaded/test/unit/no-images.js create mode 100644 vendor/desandro/imagesloaded/test/unit/non-element.js create mode 100644 vendor/desandro/imagesloaded/test/unit/selector-string.js create mode 100644 vendor/desandro/imagesloaded/test/unit/single-element.js diff --git a/composer.json b/composer.json index f117cc3b1..e6cefa241 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,8 @@ "smarty/smarty": "~3.1", "ramsey/uuid": "^3.8", "twbs/bootstrap": "4.1.3", - "blueimp/jquery-file-upload": "^9.25" + "blueimp/jquery-file-upload": "^9.25", + "desandro/imagesloaded": "^4.1" }, "require-dev" : { "phpunit/phpunit" : "@stable", diff --git a/composer.lock b/composer.lock index d7e8d11f6..64d28c22e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "63d0e52cc07f8113059ec30d3637b850", + "content-hash": "fe5e71d7076eeddf1c174be4a5c052dd", "packages": [ { "name": "blueimp/jquery-file-upload", @@ -163,6 +163,45 @@ "description": "Internationalization library powered by CLDR data.", "time": "2017-12-29T00:13:05+00:00" }, + { + "name": "desandro/imagesloaded", + "version": "v4.1.4", + "source": { + "type": "git", + "url": "https://github.com/desandro/imagesloaded.git", + "reference": "67c4e57453120935180c45c6820e7d3fbd2ea1f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/desandro/imagesloaded/zipball/67c4e57453120935180c45c6820e7d3fbd2ea1f9", + "reference": "67c4e57453120935180c45c6820e7d3fbd2ea1f9", + "shasum": "" + }, + "type": "component", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David DeSandro", + "homepage": "http://desandro.com/", + "role": "developer" + } + ], + "description": "JavaScript is all like _You images done yet or what?_", + "homepage": "http://imagesloaded.desandro.com", + "keywords": [ + "dom", + "images", + "javascript", + "jquery-plugin", + "library", + "loaded", + "ui" + ], + "time": "2018-01-02T16:53:35+00:00" + }, { "name": "ezyang/htmlpurifier", "version": "v4.10.0", diff --git a/library/imagesloaded/imagesloaded.pkgd.js b/library/imagesloaded/imagesloaded.pkgd.js deleted file mode 100644 index ef23971be..000000000 --- a/library/imagesloaded/imagesloaded.pkgd.js +++ /dev/null @@ -1,487 +0,0 @@ -/*! - * imagesLoaded PACKAGED v4.1.0 - * JavaScript is all like "You images are done yet or what?" - * MIT License - */ - -/** - * EvEmitter v1.0.1 - * Lil' event emitter - * MIT License - */ - -/* jshint unused: true, undef: true, strict: true */ - -( function( global, factory ) { - // universal module definition - /* jshint strict: false */ /* globals define, module */ - if ( typeof define == 'function' && define.amd ) { - // AMD - RequireJS - define( 'ev-emitter/ev-emitter',factory ); - } else if ( typeof module == 'object' && module.exports ) { - // CommonJS - Browserify, Webpack - module.exports = factory(); - } else { - // Browser globals - global.EvEmitter = factory(); - } - -}( this, function() { - - - -function EvEmitter() {} - -var proto = EvEmitter.prototype; - -proto.on = function( eventName, listener ) { - if ( !eventName || !listener ) { - return; - } - // set events hash - var events = this._events = this._events || {}; - // set listeners array - var listeners = events[ eventName ] = events[ eventName ] || []; - // only add once - if ( listeners.indexOf( listener ) == -1 ) { - listeners.push( listener ); - } - - return this; -}; - -proto.once = function( eventName, listener ) { - if ( !eventName || !listener ) { - return; - } - // add event - this.on( eventName, listener ); - // set once flag - // set onceEvents hash - var onceEvents = this._onceEvents = this._onceEvents || {}; - // set onceListeners array - var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || []; - // set flag - onceListeners[ listener ] = true; - - return this; -}; - -proto.off = function( eventName, listener ) { - var listeners = this._events && this._events[ eventName ]; - if ( !listeners || !listeners.length ) { - return; - } - var index = listeners.indexOf( listener ); - if ( index != -1 ) { - listeners.splice( index, 1 ); - } - - return this; -}; - -proto.emitEvent = function( eventName, args ) { - var listeners = this._events && this._events[ eventName ]; - if ( !listeners || !listeners.length ) { - return; - } - var i = 0; - var listener = listeners[i]; - args = args || []; - // once stuff - var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; - - while ( listener ) { - var isOnce = onceListeners && onceListeners[ listener ]; - if ( isOnce ) { - // remove listener - // remove before trigger to prevent recursion - this.off( eventName, listener ); - // unset once flag - delete onceListeners[ listener ]; - } - // trigger listener - listener.apply( this, args ); - // get next listener - i += isOnce ? 0 : 1; - listener = listeners[i]; - } - - return this; -}; - -return EvEmitter; - -})); - -/*! - * imagesLoaded v4.1.0 - * JavaScript is all like "You images are done yet or what?" - * MIT License - */ - -( function( window, factory ) { 'use strict'; - // universal module definition - - /*global define: false, module: false, require: false */ - - if ( typeof define == 'function' && define.amd ) { - // AMD - define( [ - 'ev-emitter/ev-emitter' - ], function( EvEmitter ) { - return factory( window, EvEmitter ); - }); - } else if ( typeof module == 'object' && module.exports ) { - // CommonJS - module.exports = factory( - window, - require('ev-emitter') - ); - } else { - // browser global - window.imagesLoaded = factory( - window, - window.EvEmitter - ); - } - -})( window, - -// -------------------------- factory -------------------------- // - -function factory( window, EvEmitter ) { - - - -var $ = window.jQuery; -var console = window.console; - -// -------------------------- helpers -------------------------- // - -// extend objects -function extend( a, b ) { - for ( var prop in b ) { - a[ prop ] = b[ prop ]; - } - return a; -} - -// turn element or nodeList into an array -function makeArray( obj ) { - var ary = []; - if ( Array.isArray( obj ) ) { - // use object if already an array - ary = obj; - } else if ( typeof obj.length == 'number' ) { - // convert nodeList to array - for ( var i=0; i < obj.length; i++ ) { - ary.push( obj[i] ); - } - } else { - // array of single index - ary.push( obj ); - } - return ary; -} - -// -------------------------- imagesLoaded -------------------------- // - -/** - * @param {Array, Element, NodeList, String} elem - * @param {Object or Function} options - if function, use as callback - * @param {Function} onAlways - callback function - */ -function ImagesLoaded( elem, options, onAlways ) { - // coerce ImagesLoaded() without new, to be new ImagesLoaded() - if ( !( this instanceof ImagesLoaded ) ) { - return new ImagesLoaded( elem, options, onAlways ); - } - // use elem as selector string - if ( typeof elem == 'string' ) { - elem = document.querySelectorAll( elem ); - } - - this.elements = makeArray( elem ); - this.options = extend( {}, this.options ); - - if ( typeof options == 'function' ) { - onAlways = options; - } else { - extend( this.options, options ); - } - - if ( onAlways ) { - this.on( 'always', onAlways ); - } - - this.getImages(); - - if ( $ ) { - // add jQuery Deferred object - this.jqDeferred = new $.Deferred(); - } - - // HACK check async to allow time to bind listeners - setTimeout( function() { - this.check(); - }.bind( this )); -} - -ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); - -ImagesLoaded.prototype.options = {}; - -ImagesLoaded.prototype.getImages = function() { - this.images = []; - - // filter & find items if we have an item selector - this.elements.forEach( this.addElementImages, this ); -}; - -/** - * @param {Node} element - */ -ImagesLoaded.prototype.addElementImages = function( elem ) { - // filter siblings - if ( elem.nodeName == 'IMG' ) { - this.addImage( elem ); - } - // get background image on element - if ( this.options.background === true ) { - this.addElementBackgroundImages( elem ); - } - - // find children - // no non-element nodes, #143 - var nodeType = elem.nodeType; - if ( !nodeType || !elementNodeTypes[ nodeType ] ) { - return; - } - var childImgs = elem.querySelectorAll('img'); - // concat childElems to filterFound array - for ( var i=0; i < childImgs.length; i++ ) { - var img = childImgs[i]; - this.addImage( img ); - } - - // get child background images - if ( typeof this.options.background == 'string' ) { - var children = elem.querySelectorAll( this.options.background ); - for ( i=0; i < children.length; i++ ) { - var child = children[i]; - this.addElementBackgroundImages( child ); - } - } -}; - -var elementNodeTypes = { - 1: true, - 9: true, - 11: true -}; - -ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { - var style = getComputedStyle( elem ); - if ( !style ) { - // Firefox returns null if in a hidden iframe https://bugzil.la/548397 - return; - } - // get url inside url("...") - var reURL = /url\((['"])?(.*?)\1\)/gi; - var matches = reURL.exec( style.backgroundImage ); - while ( matches !== null ) { - var url = matches && matches[2]; - if ( url ) { - this.addBackground( url, elem ); - } - matches = reURL.exec( style.backgroundImage ); - } -}; - -/** - * @param {Image} img - */ -ImagesLoaded.prototype.addImage = function( img ) { - var loadingImage = new LoadingImage( img ); - this.images.push( loadingImage ); -}; - -ImagesLoaded.prototype.addBackground = function( url, elem ) { - var background = new Background( url, elem ); - this.images.push( background ); -}; - -ImagesLoaded.prototype.check = function() { - var _this = this; - this.progressedCount = 0; - this.hasAnyBroken = false; - // complete if no images - if ( !this.images.length ) { - this.complete(); - return; - } - - function onProgress( image, elem, message ) { - // HACK - Chrome triggers event before object properties have changed. #83 - setTimeout( function() { - _this.progress( image, elem, message ); - }); - } - - this.images.forEach( function( loadingImage ) { - loadingImage.once( 'progress', onProgress ); - loadingImage.check(); - }); -}; - -ImagesLoaded.prototype.progress = function( image, elem, message ) { - this.progressedCount++; - this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; - // progress event - this.emitEvent( 'progress', [ this, image, elem ] ); - if ( this.jqDeferred && this.jqDeferred.notify ) { - this.jqDeferred.notify( this, image ); - } - // check if completed - if ( this.progressedCount == this.images.length ) { - this.complete(); - } - - if ( this.options.debug && console ) { - console.log( 'progress: ' + message, image, elem ); - } -}; - -ImagesLoaded.prototype.complete = function() { - var eventName = this.hasAnyBroken ? 'fail' : 'done'; - this.isComplete = true; - this.emitEvent( eventName, [ this ] ); - this.emitEvent( 'always', [ this ] ); - if ( this.jqDeferred ) { - var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; - this.jqDeferred[ jqMethod ]( this ); - } -}; - -// -------------------------- -------------------------- // - -function LoadingImage( img ) { - this.img = img; -} - -LoadingImage.prototype = Object.create( EvEmitter.prototype ); - -LoadingImage.prototype.check = function() { - // If complete is true and browser supports natural sizes, - // try to check for image status manually. - var isComplete = this.getIsImageComplete(); - if ( isComplete ) { - // report based on naturalWidth - this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); - return; - } - - // If none of the checks above matched, simulate loading on detached element. - this.proxyImage = new Image(); - this.proxyImage.addEventListener( 'load', this ); - this.proxyImage.addEventListener( 'error', this ); - // bind to image as well for Firefox. #191 - this.img.addEventListener( 'load', this ); - this.img.addEventListener( 'error', this ); - this.proxyImage.src = this.img.src; -}; - -LoadingImage.prototype.getIsImageComplete = function() { - return this.img.complete && this.img.naturalWidth !== undefined; -}; - -LoadingImage.prototype.confirm = function( isLoaded, message ) { - this.isLoaded = isLoaded; - this.emitEvent( 'progress', [ this, this.img, message ] ); -}; - -// ----- events ----- // - -// trigger specified handler for event type -LoadingImage.prototype.handleEvent = function( event ) { - var method = 'on' + event.type; - if ( this[ method ] ) { - this[ method ]( event ); - } -}; - -LoadingImage.prototype.onload = function() { - this.confirm( true, 'onload' ); - this.unbindEvents(); -}; - -LoadingImage.prototype.onerror = function() { - this.confirm( false, 'onerror' ); - this.unbindEvents(); -}; - -LoadingImage.prototype.unbindEvents = function() { - this.proxyImage.removeEventListener( 'load', this ); - this.proxyImage.removeEventListener( 'error', this ); - this.img.removeEventListener( 'load', this ); - this.img.removeEventListener( 'error', this ); -}; - -// -------------------------- Background -------------------------- // - -function Background( url, element ) { - this.url = url; - this.element = element; - this.img = new Image(); -} - -// inherit LoadingImage prototype -Background.prototype = Object.create( LoadingImage.prototype ); - -Background.prototype.check = function() { - this.img.addEventListener( 'load', this ); - this.img.addEventListener( 'error', this ); - this.img.src = this.url; - // check if image is already complete - var isComplete = this.getIsImageComplete(); - if ( isComplete ) { - this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); - this.unbindEvents(); - } -}; - -Background.prototype.unbindEvents = function() { - this.img.removeEventListener( 'load', this ); - this.img.removeEventListener( 'error', this ); -}; - -Background.prototype.confirm = function( isLoaded, message ) { - this.isLoaded = isLoaded; - this.emitEvent( 'progress', [ this, this.element, message ] ); -}; - -// -------------------------- jQuery -------------------------- // - -ImagesLoaded.makeJQueryPlugin = function( jQuery ) { - jQuery = jQuery || window.jQuery; - if ( !jQuery ) { - return; - } - // set local variable - $ = jQuery; - // $().imagesLoaded() - $.fn.imagesLoaded = function( options, callback ) { - var instance = new ImagesLoaded( this, options, callback ); - return instance.jqDeferred.promise( $(this) ); - }; -}; -// try making plugin -ImagesLoaded.makeJQueryPlugin(); - -// -------------------------- -------------------------- // - -return ImagesLoaded; - -}); - diff --git a/library/imagesloaded/imagesloaded.pkgd.min.js b/library/imagesloaded/imagesloaded.pkgd.min.js deleted file mode 100644 index c3e71fadc..000000000 --- a/library/imagesloaded/imagesloaded.pkgd.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * imagesLoaded PACKAGED v4.1.0 - * JavaScript is all like "You images are done yet or what?" - * MIT License - */ - -!function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}(this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||[];return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;iapcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE index f0157a6ed..f27399a04 100644 --- a/vendor/composer/LICENSE +++ b/vendor/composer/LICENSE @@ -1,56 +1,21 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: Composer -Upstream-Contact: Jordi Boggiano -Source: https://github.com/composer/composer -Files: * -Copyright: 2016, Nils Adermann - 2016, Jordi Boggiano -License: Expat +Copyright (c) Nils Adermann, Jordi Boggiano -Files: src/Composer/Util/TlsHelper.php -Copyright: 2016, Nils Adermann - 2016, Jordi Boggiano - 2013, Evan Coury -License: Expat and BSD-2-Clause +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: -License: BSD-2-Clause - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - . - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - . - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +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. -License: Expat - 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. diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index f3c814e02..b7cffc67c 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -981,7 +981,6 @@ return array( 'Zotlabs\\Module\\Mood' => $baseDir . '/Zotlabs/Module/Mood.php', 'Zotlabs\\Module\\Network' => $baseDir . '/Zotlabs/Module/Network.php', 'Zotlabs\\Module\\New_channel' => $baseDir . '/Zotlabs/Module/New_channel.php', - 'Zotlabs\\Module\\Nojs' => $baseDir . '/Zotlabs/Module/Nojs.php', 'Zotlabs\\Module\\Notes' => $baseDir . '/Zotlabs/Module/Notes.php', 'Zotlabs\\Module\\Notifications' => $baseDir . '/Zotlabs/Module/Notifications.php', 'Zotlabs\\Module\\Notify' => $baseDir . '/Zotlabs/Module/Notify.php', @@ -1337,7 +1336,10 @@ return array( 'Zotlabs\\Update\\_1222' => $baseDir . '/Zotlabs/Update/_1222.php', 'Zotlabs\\Update\\_1223' => $baseDir . '/Zotlabs/Update/_1223.php', 'Zotlabs\\Update\\_1224' => $baseDir . '/Zotlabs/Update/_1224.php', - 'Zotlabs\\Web\\CheckJS' => $baseDir . '/Zotlabs/Web/CheckJS.php', + 'Zotlabs\\Update\\_1225' => $baseDir . '/Zotlabs/Update/_1225.php', + 'Zotlabs\\Update\\_1226' => $baseDir . '/Zotlabs/Update/_1226.php', + 'Zotlabs\\Update\\_1227' => $baseDir . '/Zotlabs/Update/_1227.php', + 'Zotlabs\\Update\\_1228' => $baseDir . '/Zotlabs/Update/_1228.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', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index ce0232306..a02571a95 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -1149,7 +1149,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Zotlabs\\Module\\Mood' => __DIR__ . '/../..' . '/Zotlabs/Module/Mood.php', 'Zotlabs\\Module\\Network' => __DIR__ . '/../..' . '/Zotlabs/Module/Network.php', 'Zotlabs\\Module\\New_channel' => __DIR__ . '/../..' . '/Zotlabs/Module/New_channel.php', - 'Zotlabs\\Module\\Nojs' => __DIR__ . '/../..' . '/Zotlabs/Module/Nojs.php', 'Zotlabs\\Module\\Notes' => __DIR__ . '/../..' . '/Zotlabs/Module/Notes.php', 'Zotlabs\\Module\\Notifications' => __DIR__ . '/../..' . '/Zotlabs/Module/Notifications.php', 'Zotlabs\\Module\\Notify' => __DIR__ . '/../..' . '/Zotlabs/Module/Notify.php', @@ -1506,7 +1505,9 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Zotlabs\\Update\\_1223' => __DIR__ . '/../..' . '/Zotlabs/Update/_1223.php', 'Zotlabs\\Update\\_1224' => __DIR__ . '/../..' . '/Zotlabs/Update/_1224.php', 'Zotlabs\\Update\\_1225' => __DIR__ . '/../..' . '/Zotlabs/Update/_1225.php', - 'Zotlabs\\Web\\CheckJS' => __DIR__ . '/../..' . '/Zotlabs/Web/CheckJS.php', + 'Zotlabs\\Update\\_1226' => __DIR__ . '/../..' . '/Zotlabs/Update/_1226.php', + 'Zotlabs\\Update\\_1227' => __DIR__ . '/../..' . '/Zotlabs/Update/_1227.php', + 'Zotlabs\\Update\\_1228' => __DIR__ . '/../..' . '/Zotlabs/Update/_1228.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', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index af845828e..b9c998f12 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -162,6 +162,47 @@ ], "description": "Internationalization library powered by CLDR data." }, + { + "name": "desandro/imagesloaded", + "version": "v4.1.4", + "version_normalized": "4.1.4.0", + "source": { + "type": "git", + "url": "https://github.com/desandro/imagesloaded.git", + "reference": "67c4e57453120935180c45c6820e7d3fbd2ea1f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/desandro/imagesloaded/zipball/67c4e57453120935180c45c6820e7d3fbd2ea1f9", + "reference": "67c4e57453120935180c45c6820e7d3fbd2ea1f9", + "shasum": "" + }, + "time": "2018-01-02T16:53:35+00:00", + "type": "component", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David DeSandro", + "homepage": "http://desandro.com/", + "role": "developer" + } + ], + "description": "JavaScript is all like _You images done yet or what?_", + "homepage": "http://imagesloaded.desandro.com", + "keywords": [ + "dom", + "images", + "javascript", + "jquery-plugin", + "library", + "loaded", + "ui" + ] + }, { "name": "ezyang/htmlpurifier", "version": "v4.10.0", diff --git a/vendor/desandro/imagesloaded/.gitignore b/vendor/desandro/imagesloaded/.gitignore new file mode 100644 index 000000000..2486eb53d --- /dev/null +++ b/vendor/desandro/imagesloaded/.gitignore @@ -0,0 +1,5 @@ +bower_components/ +node_modules/ +_site/ +build/ +package-lock.json diff --git a/vendor/desandro/imagesloaded/.jshintrc b/vendor/desandro/imagesloaded/.jshintrc new file mode 100644 index 000000000..78aa4af7b --- /dev/null +++ b/vendor/desandro/imagesloaded/.jshintrc @@ -0,0 +1,12 @@ +{ + "browser": true, + "curly": true, + "newcap": false, + "strict": true, + "undef": true, + "unused": true, + "globals": { + "imagesLoaded": false, + "QUnit": false + } +} diff --git a/vendor/desandro/imagesloaded/README.md b/vendor/desandro/imagesloaded/README.md new file mode 100644 index 000000000..67b799dfd --- /dev/null +++ b/vendor/desandro/imagesloaded/README.md @@ -0,0 +1,362 @@ +# imagesLoaded + +

JavaScript is all like "You images done yet or what?"

+ +[imagesloaded.desandro.com](http://imagesloaded.desandro.com) + +Detect when images have been loaded. + +## Install + +### Download + ++ [imagesloaded.pkgd.min.js](https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.min.js) minified ++ [imagesloaded.pkgd.js](https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.js) un-minified + +### CDN + +``` html + + + +``` + +### Package managers + +Install via [npm](https://www.npmjs.com/package/imagesloaded): `npm install imagesloaded` + +Install via [Bower](http://bower.io): `bower install imagesloaded --save` + +## jQuery + +You can use imagesLoaded as a jQuery Plugin. + +``` js +$('#container').imagesLoaded( function() { + // images have loaded +}); + +// options +$('#container').imagesLoaded( { + // options... + }, + function() { + // images have loaded + } +); +``` + +`.imagesLoaded()` returns a [jQuery Deferred object](http://api.jquery.com/category/deferred-object/). This allows you to use `.always()`, `.done()`, `.fail()` and `.progress()`. + +``` js +$('#container').imagesLoaded() + .always( function( instance ) { + console.log('all images loaded'); + }) + .done( function( instance ) { + console.log('all images successfully loaded'); + }) + .fail( function() { + console.log('all images loaded, at least one is broken'); + }) + .progress( function( instance, image ) { + var result = image.isLoaded ? 'loaded' : 'broken'; + console.log( 'image is ' + result + ' for ' + image.img.src ); + }); +``` + +## Vanilla JavaScript + +You can use imagesLoaded with vanilla JS. + +``` js +imagesLoaded( elem, callback ) +// options +imagesLoaded( elem, options, callback ) +// you can use `new` if you like +new imagesLoaded( elem, callback ) +``` + ++ `elem` _Element, NodeList, Array, or Selector String_ ++ `options` _Object_ ++ `callback` _Function_ - function triggered after all images have been loaded + +Using a callback function is the same as binding it to the `always` event (see below). + +``` js +// element +imagesLoaded( document.querySelector('#container'), function( instance ) { + console.log('all images are loaded'); +}); +// selector string +imagesLoaded( '#container', function() {...}); +// multiple elements +var posts = document.querySelectorAll('.post'); +imagesLoaded( posts, function() {...}); +``` + +Bind events with vanilla JS with .on(), .off(), and .once() methods. + +``` js +var imgLoad = imagesLoaded( elem ); +function onAlways( instance ) { + console.log('all images are loaded'); +} +// bind with .on() +imgLoad.on( 'always', onAlways ); +// unbind with .off() +imgLoad.off( 'always', onAlways ); +``` + +## Background + +Detect when background images have loaded, in addition to ``s. + +Set `{ background: true }` to detect when the element's background image has loaded. + +``` js +// jQuery +$('#container').imagesLoaded( { background: true }, function() { + console.log('#container background image loaded'); +}); + +// vanilla JS +imagesLoaded( '#container', { background: true }, function() { + console.log('#container background image loaded'); +}); +``` + +[See jQuery demo](http://codepen.io/desandro/pen/pjVMPB) or [vanilla JS demo](http://codepen.io/desandro/pen/avKooW) on CodePen. + +Set to a selector string like `{ background: '.item' }` to detect when the background images of child elements have loaded. + +``` js +// jQuery +$('#container').imagesLoaded( { background: '.item' }, function() { + console.log('all .item background images loaded'); +}); + +// vanilla JS +imagesLoaded( '#container', { background: '.item' }, function() { + console.log('all .item background images loaded'); +}); +``` + +[See jQuery demo](http://codepen.io/desandro/pen/avKoZL) or [vanilla JS demo](http://codepen.io/desandro/pen/vNrBGz) on CodePen. + +## Events + +### always + +``` js +// jQuery +$('#container').imagesLoaded().always( function( instance ) { + console.log('ALWAYS - all images have been loaded'); +}); + +// vanilla JS +imgLoad.on( 'always', function( instance ) { + console.log('ALWAYS - all images have been loaded'); +}); +``` + +Triggered after all images have been either loaded or confirmed broken. + ++ `instance` _imagesLoaded_ - the imagesLoaded instance + +### done + +``` js +// jQuery +$('#container').imagesLoaded().done( function( instance ) { + console.log('DONE - all images have been successfully loaded'); +}); + +// vanilla JS +imgLoad.on( 'done', function( instance ) { + console.log('DONE - all images have been successfully loaded'); +}); +``` + +Triggered after all images have successfully loaded without any broken images. + +### fail + +``` js +$('#container').imagesLoaded().fail( function( instance ) { + console.log('FAIL - all images loaded, at least one is broken'); +}); + +// vanilla JS +imgLoad.on( 'fail', function( instance ) { + console.log('FAIL - all images loaded, at least one is broken'); +}); +``` + +Triggered after all images have been loaded with at least one broken image. + +### progress + +``` js +imgLoad.on( 'progress', function( instance, image ) { + var result = image.isLoaded ? 'loaded' : 'broken'; + console.log( 'image is ' + result + ' for ' + image.img.src ); +}); +``` + +Triggered after each image has been loaded. + ++ `instance` _imagesLoaded_ - the imagesLoaded instance ++ `image` _LoadingImage_ - the LoadingImage instance of the loaded image + + + +## Properties + +### LoadingImage.img + +_Image_ - The `img` element + +### LoadingImage.isLoaded + +_Boolean_ - `true` when the image has successfully loaded + +### imagesLoaded.images + +Array of _LoadingImage_ instances for each image detected + +``` js +var imgLoad = imagesLoaded('#container'); +imgLoad.on( 'always', function() { + console.log( imgLoad.images.length + ' images loaded' ); + // detect which image is broken + for ( var i = 0, len = imgLoad.images.length; i < len; i++ ) { + var image = imgLoad.images[i]; + var result = image.isLoaded ? 'loaded' : 'broken'; + console.log( 'image is ' + result + ' for ' + image.img.src ); + } +}); +``` + +## Browserify + +imagesLoaded works with [Browserify](http://browserify.org/). + +``` bash +npm install imagesloaded --save +``` + +``` js +var imagesLoaded = require('imagesloaded'); + +imagesLoaded( elem, function() {...} ); +``` + +Use `.makeJQueryPlugin` to make to use `.imagesLoaded()` jQuery plugin. + +``` js +var $ = require('jquery'); +var imagesLoaded = require('imagesloaded'); + +// provide jQuery argument +imagesLoaded.makeJQueryPlugin( $ ); +// now use .imagesLoaded() jQuery plugin +$('#container').imagesLoaded( function() {...}); +``` + +## Webpack + +Install imagesLoaded with npm. + +``` bash +npm install imagesloaded +``` + +You can then `require('imagesloaded')`. + +``` js +// main.js +var imagesLoaded = require('imagesloaded'); + +imagesLoaded( '#container', function() { + // images have loaded +}); +``` + +Use `.makeJQueryPlugin` to make `.imagesLoaded()` jQuery plugin. + +``` js +// main.js +var imagesLoaded = require('imagesloaded'); +var $ = require('jquery'); + +// provide jQuery argument +imagesLoaded.makeJQueryPlugin( $ ); +// now use .imagesLoaded() jQuery plugin +$('#container').imagesLoaded( function() {...}); +``` + +Run webpack. + +``` bash +webpack main.js bundle.js +``` + +## RequireJS + +imagesLoaded works with [RequireJS](http://requirejs.org). + +You can require [imagesloaded.pkgd.js](http://imagesloaded.desandro.com/imagesloaded.pkgd.js). + +``` js +requirejs( [ + 'path/to/imagesloaded.pkgd.js', +], function( imagesLoaded ) { + imagesLoaded( '#container', function() { ... }); +}); +``` + +Use `.makeJQueryPlugin` to make `.imagesLoaded()` jQuery plugin. + +``` js +requirejs( [ + 'jquery', + 'path/to/imagesloaded.pkgd.js', +], function( $, imagesLoaded ) { + // provide jQuery argument + imagesLoaded.makeJQueryPlugin( $ ); + // now use .imagesLoaded() jQuery plugin + $('#container').imagesLoaded( function() {...}); +}); +``` + +You can manage dependencies with [Bower](http://bower.io). Set `baseUrl` to `bower_components` and set a path config for all your application code. + +``` js +requirejs.config({ + baseUrl: 'bower_components/', + paths: { // path to your app + app: '../' + } +}); + +requirejs( [ + 'imagesloaded/imagesloaded', + 'app/my-component.js' +], function( imagesLoaded, myComp ) { + imagesLoaded( '#container', function() { ... }); +}); +``` + +## Browser support + ++ IE9+ ++ Android 2.3+ ++ iOS Safari 4+ ++ All other modern browsers + +Use [imagesLoaded v3](http://imagesloaded.desandro.com/v3/) for IE8 support. + +## MIT License + +imagesLoaded is released under the [MIT License](http://desandro.mit-license.org/). Have at it. diff --git a/vendor/desandro/imagesloaded/bower.json b/vendor/desandro/imagesloaded/bower.json new file mode 100644 index 000000000..795c69f07 --- /dev/null +++ b/vendor/desandro/imagesloaded/bower.json @@ -0,0 +1,37 @@ +{ + "name": "imagesloaded", + "description": "JavaScript is all like _You images done yet or what?_", + "main": "imagesloaded.js", + "dependencies": { + "ev-emitter": "^1.0.0" + }, + "devDependencies": { + "jquery": ">=1.9 <4.0", + "qunit": "^2.0.0" + }, + "ignore": [ + "**/.*", + "test", + "package.json", + "composer.json", + "node_modules", + "bower_components", + "tests", + "sandbox/", + "gulpfile.js", + "contributing.md" + ], + "homepage": "http://imagesloaded.desandro.com", + "authors": [ + "David DeSandro" + ], + "moduleType": [ + "amd", + "globals", + "node" + ], + "keywords": [ + "images" + ], + "license": "MIT" +} diff --git a/vendor/desandro/imagesloaded/composer.json b/vendor/desandro/imagesloaded/composer.json new file mode 100644 index 000000000..95ba64c4a --- /dev/null +++ b/vendor/desandro/imagesloaded/composer.json @@ -0,0 +1,15 @@ +{ + "name": "desandro/imagesloaded", + "description": "JavaScript is all like _You images done yet or what?_", + "type": "component", + "keywords": ["javascript", "library", "images", "loaded", "dom", "ui", "jquery-plugin"], + "homepage": "http://imagesloaded.desandro.com", + "license": "MIT", + "authors": [ + { + "name": "David DeSandro", + "homepage": "http://desandro.com/", + "role": "developer" + } + ] +} diff --git a/vendor/desandro/imagesloaded/contributing.md b/vendor/desandro/imagesloaded/contributing.md new file mode 100644 index 000000000..acac280cc --- /dev/null +++ b/vendor/desandro/imagesloaded/contributing.md @@ -0,0 +1,20 @@ +## Submitting issues + +### Reduced test case required + +All bug reports and problem issues require a [**reduced test case**](http://css-tricks.com/reduced-test-cases/). + ++ A reduced test case clearly demonstrates the bug or issue. ++ It contains the bare minimum HTML, CSS, and JavaScript required to demonstrate the bug. ++ A link to your production site is **not** a reduced test case. + +Create a test case by forking a [CodePen demos](http://codepen.io/desandro/pens/tags/?selected_tag=imagesloaded-docs). + ++ [progress with jQuery](http://codepen.io/desandro/pen/bIFyl) ++ [progress with vanilla JS](http://codepen.io/desandro/pen/hlzaw) ++ [`{ background: true }` with jQuery](http://codepen.io/desandro/pen/pjVMPB) ++ [`{ background: true }` with vanilla JS](http://codepen.io/desandro/pen/avKooW) ++ [`{ background: '.selector' }` with jQuery](http://codepen.io/desandro/pen/avKoZL) ++ [`{ background: '.selector' }` with vanilla JS](http://codepen.io/desandro/pen/vNrBGz) + +Providing a reduced test case is the best way to get your issue addressed. They help you point out the problem. They help me verify and debug the problem. They help others understand the problem. Without a reduced test case, your issue may be closed. diff --git a/vendor/desandro/imagesloaded/gulpfile.js b/vendor/desandro/imagesloaded/gulpfile.js new file mode 100644 index 000000000..66f775f3d --- /dev/null +++ b/vendor/desandro/imagesloaded/gulpfile.js @@ -0,0 +1,128 @@ +/*jshint node: true, strict: false */ + +var fs = require('fs'); +var gulp = require('gulp'); +var rename = require('gulp-rename'); +var replace = require('gulp-replace'); + +// ----- hint ----- // + +var jshint = require('gulp-jshint'); + +gulp.task( 'hint-js', function() { + return gulp.src('imagesloaded.js') + .pipe( jshint() ) + .pipe( jshint.reporter('default') ); +}); + +gulp.task( 'hint-test', function() { + return gulp.src('test/unit/*.js') + .pipe( jshint() ) + .pipe( jshint.reporter('default') ); +}); + +gulp.task( 'hint-task', function() { + return gulp.src('gulpfile.js') + .pipe( jshint() ) + .pipe( jshint.reporter('default') ); +}); + +var jsonlint = require('gulp-json-lint'); + +gulp.task( 'jsonlint', function() { + return gulp.src( '*.json' ) + .pipe( jsonlint() ) + .pipe( jsonlint.report('verbose') ); +}); + +gulp.task( 'hint', [ 'hint-js', 'hint-test', 'hint-task', 'jsonlint' ]); + +// -------------------------- RequireJS makes pkgd -------------------------- // + +// refactored from gulp-requirejs-optimize +// https://www.npmjs.com/package/gulp-requirejs-optimize/ + +var gutil = require('gulp-util'); +var chalk = require('chalk'); +var rjsOptimize = require('gulp-requirejs-optimize'); + +// regex for banner comment +var reBannerComment = new RegExp('^\\s*(?:\\/\\*[\\s\\S]*?\\*\\/)\\s*'); + +function getBanner() { + var src = fs.readFileSync( 'imagesloaded.js', 'utf8' ); + var matches = src.match( reBannerComment ); + var banner = matches[0].replace( 'imagesLoaded', 'imagesLoaded PACKAGED' ); + return banner; +} + +function addBanner( str ) { + return replace( /^/, str ); +} + +gulp.task( 'requirejs', function() { + var banner = getBanner(); + // HACK src is not needed + // should refactor rjsOptimize to produce src + return gulp.src('imagesloaded.js') + .pipe( rjsOptimize({ + baseUrl: 'bower_components', + optimize: 'none', + include: [ + '../imagesloaded' + ] + }) ) + // remove named module + .pipe( replace( "'../imagesloaded',", '' ) ) + // add banner + .pipe( addBanner( banner ) ) + .pipe( rename('imagesloaded.pkgd.js') ) + .pipe( gulp.dest('.') ); +}); + + +// ----- uglify ----- // + +var uglify = require('gulp-uglify'); + +gulp.task( 'uglify', [ 'requirejs' ], function() { + var banner = getBanner(); + gulp.src('imagesloaded.pkgd.js') + .pipe( uglify() ) + // add banner + .pipe( addBanner( banner ) ) + .pipe( rename('imagesloaded.pkgd.min.js') ) + .pipe( gulp.dest('.') ); +}); + +// ----- version ----- // + +// set version in source files + +var minimist = require('minimist'); + +// use gulp version -t 1.2.3 +gulp.task( 'version', function() { + var args = minimist( process.argv.slice(3) ); + var version = args.t; + if ( !version || !/\d+\.\d+\.\d+/.test( version ) ) { + gutil.log( 'invalid version: ' + chalk.red( version ) ); + return; + } + gutil.log( 'ticking version to ' + chalk.green( version ) ); + + gulp.src('imagesloaded.js') + .pipe( replace( /imagesLoaded v\d+\.\d+\.\d+/, 'imagesLoaded v' + version ) ) + .pipe( gulp.dest('.') ); + + gulp.src( [ 'bower.json', 'package.json' ] ) + .pipe( replace( /"version": "\d+\.\d+\.\d+"/, '"version": "' + version + '"' ) ) + .pipe( gulp.dest('.') ); +}); + +// ----- default ----- // + +gulp.task( 'default', [ + 'hint', + 'uglify' +]); diff --git a/vendor/desandro/imagesloaded/imagesloaded.js b/vendor/desandro/imagesloaded/imagesloaded.js new file mode 100644 index 000000000..f527a71e9 --- /dev/null +++ b/vendor/desandro/imagesloaded/imagesloaded.js @@ -0,0 +1,377 @@ +/*! + * imagesLoaded v4.1.4 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +( function( window, factory ) { 'use strict'; + // universal module definition + + /*global define: false, module: false, require: false */ + + if ( typeof define == 'function' && define.amd ) { + // AMD + define( [ + 'ev-emitter/ev-emitter' + ], function( EvEmitter ) { + return factory( window, EvEmitter ); + }); + } else if ( typeof module == 'object' && module.exports ) { + // CommonJS + module.exports = factory( + window, + require('ev-emitter') + ); + } else { + // browser global + window.imagesLoaded = factory( + window, + window.EvEmitter + ); + } + +})( typeof window !== 'undefined' ? window : this, + +// -------------------------- factory -------------------------- // + +function factory( window, EvEmitter ) { + +'use strict'; + +var $ = window.jQuery; +var console = window.console; + +// -------------------------- helpers -------------------------- // + +// extend objects +function extend( a, b ) { + for ( var prop in b ) { + a[ prop ] = b[ prop ]; + } + return a; +} + +var arraySlice = Array.prototype.slice; + +// turn element or nodeList into an array +function makeArray( obj ) { + if ( Array.isArray( obj ) ) { + // use object if already an array + return obj; + } + + var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + if ( isArrayLike ) { + // convert nodeList to array + return arraySlice.call( obj ); + } + + // array of single index + return [ obj ]; +} + +// -------------------------- imagesLoaded -------------------------- // + +/** + * @param {Array, Element, NodeList, String} elem + * @param {Object or Function} options - if function, use as callback + * @param {Function} onAlways - callback function + */ +function ImagesLoaded( elem, options, onAlways ) { + // coerce ImagesLoaded() without new, to be new ImagesLoaded() + if ( !( this instanceof ImagesLoaded ) ) { + return new ImagesLoaded( elem, options, onAlways ); + } + // use elem as selector string + var queryElem = elem; + if ( typeof elem == 'string' ) { + queryElem = document.querySelectorAll( elem ); + } + // bail if bad element + if ( !queryElem ) { + console.error( 'Bad element for imagesLoaded ' + ( queryElem || elem ) ); + return; + } + + this.elements = makeArray( queryElem ); + this.options = extend( {}, this.options ); + // shift arguments if no options set + if ( typeof options == 'function' ) { + onAlways = options; + } else { + extend( this.options, options ); + } + + if ( onAlways ) { + this.on( 'always', onAlways ); + } + + this.getImages(); + + if ( $ ) { + // add jQuery Deferred object + this.jqDeferred = new $.Deferred(); + } + + // HACK check async to allow time to bind listeners + setTimeout( this.check.bind( this ) ); +} + +ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); + +ImagesLoaded.prototype.options = {}; + +ImagesLoaded.prototype.getImages = function() { + this.images = []; + + // filter & find items if we have an item selector + this.elements.forEach( this.addElementImages, this ); +}; + +/** + * @param {Node} element + */ +ImagesLoaded.prototype.addElementImages = function( elem ) { + // filter siblings + if ( elem.nodeName == 'IMG' ) { + this.addImage( elem ); + } + // get background image on element + if ( this.options.background === true ) { + this.addElementBackgroundImages( elem ); + } + + // find children + // no non-element nodes, #143 + var nodeType = elem.nodeType; + if ( !nodeType || !elementNodeTypes[ nodeType ] ) { + return; + } + var childImgs = elem.querySelectorAll('img'); + // concat childElems to filterFound array + for ( var i=0; i < childImgs.length; i++ ) { + var img = childImgs[i]; + this.addImage( img ); + } + + // get child background images + if ( typeof this.options.background == 'string' ) { + var children = elem.querySelectorAll( this.options.background ); + for ( i=0; i < children.length; i++ ) { + var child = children[i]; + this.addElementBackgroundImages( child ); + } + } +}; + +var elementNodeTypes = { + 1: true, + 9: true, + 11: true +}; + +ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { + var style = getComputedStyle( elem ); + if ( !style ) { + // Firefox returns null if in a hidden iframe https://bugzil.la/548397 + return; + } + // get url inside url("...") + var reURL = /url\((['"])?(.*?)\1\)/gi; + var matches = reURL.exec( style.backgroundImage ); + while ( matches !== null ) { + var url = matches && matches[2]; + if ( url ) { + this.addBackground( url, elem ); + } + matches = reURL.exec( style.backgroundImage ); + } +}; + +/** + * @param {Image} img + */ +ImagesLoaded.prototype.addImage = function( img ) { + var loadingImage = new LoadingImage( img ); + this.images.push( loadingImage ); +}; + +ImagesLoaded.prototype.addBackground = function( url, elem ) { + var background = new Background( url, elem ); + this.images.push( background ); +}; + +ImagesLoaded.prototype.check = function() { + var _this = this; + this.progressedCount = 0; + this.hasAnyBroken = false; + // complete if no images + if ( !this.images.length ) { + this.complete(); + return; + } + + function onProgress( image, elem, message ) { + // HACK - Chrome triggers event before object properties have changed. #83 + setTimeout( function() { + _this.progress( image, elem, message ); + }); + } + + this.images.forEach( function( loadingImage ) { + loadingImage.once( 'progress', onProgress ); + loadingImage.check(); + }); +}; + +ImagesLoaded.prototype.progress = function( image, elem, message ) { + this.progressedCount++; + this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; + // progress event + this.emitEvent( 'progress', [ this, image, elem ] ); + if ( this.jqDeferred && this.jqDeferred.notify ) { + this.jqDeferred.notify( this, image ); + } + // check if completed + if ( this.progressedCount == this.images.length ) { + this.complete(); + } + + if ( this.options.debug && console ) { + console.log( 'progress: ' + message, image, elem ); + } +}; + +ImagesLoaded.prototype.complete = function() { + var eventName = this.hasAnyBroken ? 'fail' : 'done'; + this.isComplete = true; + this.emitEvent( eventName, [ this ] ); + this.emitEvent( 'always', [ this ] ); + if ( this.jqDeferred ) { + var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; + this.jqDeferred[ jqMethod ]( this ); + } +}; + +// -------------------------- -------------------------- // + +function LoadingImage( img ) { + this.img = img; +} + +LoadingImage.prototype = Object.create( EvEmitter.prototype ); + +LoadingImage.prototype.check = function() { + // If complete is true and browser supports natural sizes, + // try to check for image status manually. + var isComplete = this.getIsImageComplete(); + if ( isComplete ) { + // report based on naturalWidth + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + return; + } + + // If none of the checks above matched, simulate loading on detached element. + this.proxyImage = new Image(); + this.proxyImage.addEventListener( 'load', this ); + this.proxyImage.addEventListener( 'error', this ); + // bind to image as well for Firefox. #191 + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.proxyImage.src = this.img.src; +}; + +LoadingImage.prototype.getIsImageComplete = function() { + // check for non-zero, non-undefined naturalWidth + // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671 + return this.img.complete && this.img.naturalWidth; +}; + +LoadingImage.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.img, message ] ); +}; + +// ----- events ----- // + +// trigger specified handler for event type +LoadingImage.prototype.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +LoadingImage.prototype.onload = function() { + this.confirm( true, 'onload' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.onerror = function() { + this.confirm( false, 'onerror' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.unbindEvents = function() { + this.proxyImage.removeEventListener( 'load', this ); + this.proxyImage.removeEventListener( 'error', this ); + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +// -------------------------- Background -------------------------- // + +function Background( url, element ) { + this.url = url; + this.element = element; + this.img = new Image(); +} + +// inherit LoadingImage prototype +Background.prototype = Object.create( LoadingImage.prototype ); + +Background.prototype.check = function() { + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.img.src = this.url; + // check if image is already complete + var isComplete = this.getIsImageComplete(); + if ( isComplete ) { + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + this.unbindEvents(); + } +}; + +Background.prototype.unbindEvents = function() { + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +Background.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.element, message ] ); +}; + +// -------------------------- jQuery -------------------------- // + +ImagesLoaded.makeJQueryPlugin = function( jQuery ) { + jQuery = jQuery || window.jQuery; + if ( !jQuery ) { + return; + } + // set local variable + $ = jQuery; + // $().imagesLoaded() + $.fn.imagesLoaded = function( options, callback ) { + var instance = new ImagesLoaded( this, options, callback ); + return instance.jqDeferred.promise( $(this) ); + }; +}; +// try making plugin +ImagesLoaded.makeJQueryPlugin(); + +// -------------------------- -------------------------- // + +return ImagesLoaded; + +}); diff --git a/vendor/desandro/imagesloaded/imagesloaded.pkgd.js b/vendor/desandro/imagesloaded/imagesloaded.pkgd.js new file mode 100644 index 000000000..a230750b3 --- /dev/null +++ b/vendor/desandro/imagesloaded/imagesloaded.pkgd.js @@ -0,0 +1,497 @@ +/*! + * imagesLoaded PACKAGED v4.1.4 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +/** + * EvEmitter v1.1.0 + * Lil' event emitter + * MIT License + */ + +/* jshint unused: true, undef: true, strict: true */ + +( function( global, factory ) { + // universal module definition + /* jshint strict: false */ /* globals define, module, window */ + if ( typeof define == 'function' && define.amd ) { + // AMD - RequireJS + define( 'ev-emitter/ev-emitter',factory ); + } else if ( typeof module == 'object' && module.exports ) { + // CommonJS - Browserify, Webpack + module.exports = factory(); + } else { + // Browser globals + global.EvEmitter = factory(); + } + +}( typeof window != 'undefined' ? window : this, function() { + + + +function EvEmitter() {} + +var proto = EvEmitter.prototype; + +proto.on = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // set events hash + var events = this._events = this._events || {}; + // set listeners array + var listeners = events[ eventName ] = events[ eventName ] || []; + // only add once + if ( listeners.indexOf( listener ) == -1 ) { + listeners.push( listener ); + } + + return this; +}; + +proto.once = function( eventName, listener ) { + if ( !eventName || !listener ) { + return; + } + // add event + this.on( eventName, listener ); + // set once flag + // set onceEvents hash + var onceEvents = this._onceEvents = this._onceEvents || {}; + // set onceListeners object + var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; + // set flag + onceListeners[ listener ] = true; + + return this; +}; + +proto.off = function( eventName, listener ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + var index = listeners.indexOf( listener ); + if ( index != -1 ) { + listeners.splice( index, 1 ); + } + + return this; +}; + +proto.emitEvent = function( eventName, args ) { + var listeners = this._events && this._events[ eventName ]; + if ( !listeners || !listeners.length ) { + return; + } + // copy over to avoid interference if .off() in listener + listeners = listeners.slice(0); + args = args || []; + // once stuff + var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; + + for ( var i=0; i < listeners.length; i++ ) { + var listener = listeners[i] + var isOnce = onceListeners && onceListeners[ listener ]; + if ( isOnce ) { + // remove listener + // remove before trigger to prevent recursion + this.off( eventName, listener ); + // unset once flag + delete onceListeners[ listener ]; + } + // trigger listener + listener.apply( this, args ); + } + + return this; +}; + +proto.allOff = function() { + delete this._events; + delete this._onceEvents; +}; + +return EvEmitter; + +})); + +/*! + * imagesLoaded v4.1.4 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +( function( window, factory ) { 'use strict'; + // universal module definition + + /*global define: false, module: false, require: false */ + + if ( typeof define == 'function' && define.amd ) { + // AMD + define( [ + 'ev-emitter/ev-emitter' + ], function( EvEmitter ) { + return factory( window, EvEmitter ); + }); + } else if ( typeof module == 'object' && module.exports ) { + // CommonJS + module.exports = factory( + window, + require('ev-emitter') + ); + } else { + // browser global + window.imagesLoaded = factory( + window, + window.EvEmitter + ); + } + +})( typeof window !== 'undefined' ? window : this, + +// -------------------------- factory -------------------------- // + +function factory( window, EvEmitter ) { + + + +var $ = window.jQuery; +var console = window.console; + +// -------------------------- helpers -------------------------- // + +// extend objects +function extend( a, b ) { + for ( var prop in b ) { + a[ prop ] = b[ prop ]; + } + return a; +} + +var arraySlice = Array.prototype.slice; + +// turn element or nodeList into an array +function makeArray( obj ) { + if ( Array.isArray( obj ) ) { + // use object if already an array + return obj; + } + + var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; + if ( isArrayLike ) { + // convert nodeList to array + return arraySlice.call( obj ); + } + + // array of single index + return [ obj ]; +} + +// -------------------------- imagesLoaded -------------------------- // + +/** + * @param {Array, Element, NodeList, String} elem + * @param {Object or Function} options - if function, use as callback + * @param {Function} onAlways - callback function + */ +function ImagesLoaded( elem, options, onAlways ) { + // coerce ImagesLoaded() without new, to be new ImagesLoaded() + if ( !( this instanceof ImagesLoaded ) ) { + return new ImagesLoaded( elem, options, onAlways ); + } + // use elem as selector string + var queryElem = elem; + if ( typeof elem == 'string' ) { + queryElem = document.querySelectorAll( elem ); + } + // bail if bad element + if ( !queryElem ) { + console.error( 'Bad element for imagesLoaded ' + ( queryElem || elem ) ); + return; + } + + this.elements = makeArray( queryElem ); + this.options = extend( {}, this.options ); + // shift arguments if no options set + if ( typeof options == 'function' ) { + onAlways = options; + } else { + extend( this.options, options ); + } + + if ( onAlways ) { + this.on( 'always', onAlways ); + } + + this.getImages(); + + if ( $ ) { + // add jQuery Deferred object + this.jqDeferred = new $.Deferred(); + } + + // HACK check async to allow time to bind listeners + setTimeout( this.check.bind( this ) ); +} + +ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); + +ImagesLoaded.prototype.options = {}; + +ImagesLoaded.prototype.getImages = function() { + this.images = []; + + // filter & find items if we have an item selector + this.elements.forEach( this.addElementImages, this ); +}; + +/** + * @param {Node} element + */ +ImagesLoaded.prototype.addElementImages = function( elem ) { + // filter siblings + if ( elem.nodeName == 'IMG' ) { + this.addImage( elem ); + } + // get background image on element + if ( this.options.background === true ) { + this.addElementBackgroundImages( elem ); + } + + // find children + // no non-element nodes, #143 + var nodeType = elem.nodeType; + if ( !nodeType || !elementNodeTypes[ nodeType ] ) { + return; + } + var childImgs = elem.querySelectorAll('img'); + // concat childElems to filterFound array + for ( var i=0; i < childImgs.length; i++ ) { + var img = childImgs[i]; + this.addImage( img ); + } + + // get child background images + if ( typeof this.options.background == 'string' ) { + var children = elem.querySelectorAll( this.options.background ); + for ( i=0; i < children.length; i++ ) { + var child = children[i]; + this.addElementBackgroundImages( child ); + } + } +}; + +var elementNodeTypes = { + 1: true, + 9: true, + 11: true +}; + +ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { + var style = getComputedStyle( elem ); + if ( !style ) { + // Firefox returns null if in a hidden iframe https://bugzil.la/548397 + return; + } + // get url inside url("...") + var reURL = /url\((['"])?(.*?)\1\)/gi; + var matches = reURL.exec( style.backgroundImage ); + while ( matches !== null ) { + var url = matches && matches[2]; + if ( url ) { + this.addBackground( url, elem ); + } + matches = reURL.exec( style.backgroundImage ); + } +}; + +/** + * @param {Image} img + */ +ImagesLoaded.prototype.addImage = function( img ) { + var loadingImage = new LoadingImage( img ); + this.images.push( loadingImage ); +}; + +ImagesLoaded.prototype.addBackground = function( url, elem ) { + var background = new Background( url, elem ); + this.images.push( background ); +}; + +ImagesLoaded.prototype.check = function() { + var _this = this; + this.progressedCount = 0; + this.hasAnyBroken = false; + // complete if no images + if ( !this.images.length ) { + this.complete(); + return; + } + + function onProgress( image, elem, message ) { + // HACK - Chrome triggers event before object properties have changed. #83 + setTimeout( function() { + _this.progress( image, elem, message ); + }); + } + + this.images.forEach( function( loadingImage ) { + loadingImage.once( 'progress', onProgress ); + loadingImage.check(); + }); +}; + +ImagesLoaded.prototype.progress = function( image, elem, message ) { + this.progressedCount++; + this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; + // progress event + this.emitEvent( 'progress', [ this, image, elem ] ); + if ( this.jqDeferred && this.jqDeferred.notify ) { + this.jqDeferred.notify( this, image ); + } + // check if completed + if ( this.progressedCount == this.images.length ) { + this.complete(); + } + + if ( this.options.debug && console ) { + console.log( 'progress: ' + message, image, elem ); + } +}; + +ImagesLoaded.prototype.complete = function() { + var eventName = this.hasAnyBroken ? 'fail' : 'done'; + this.isComplete = true; + this.emitEvent( eventName, [ this ] ); + this.emitEvent( 'always', [ this ] ); + if ( this.jqDeferred ) { + var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; + this.jqDeferred[ jqMethod ]( this ); + } +}; + +// -------------------------- -------------------------- // + +function LoadingImage( img ) { + this.img = img; +} + +LoadingImage.prototype = Object.create( EvEmitter.prototype ); + +LoadingImage.prototype.check = function() { + // If complete is true and browser supports natural sizes, + // try to check for image status manually. + var isComplete = this.getIsImageComplete(); + if ( isComplete ) { + // report based on naturalWidth + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + return; + } + + // If none of the checks above matched, simulate loading on detached element. + this.proxyImage = new Image(); + this.proxyImage.addEventListener( 'load', this ); + this.proxyImage.addEventListener( 'error', this ); + // bind to image as well for Firefox. #191 + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.proxyImage.src = this.img.src; +}; + +LoadingImage.prototype.getIsImageComplete = function() { + // check for non-zero, non-undefined naturalWidth + // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671 + return this.img.complete && this.img.naturalWidth; +}; + +LoadingImage.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.img, message ] ); +}; + +// ----- events ----- // + +// trigger specified handler for event type +LoadingImage.prototype.handleEvent = function( event ) { + var method = 'on' + event.type; + if ( this[ method ] ) { + this[ method ]( event ); + } +}; + +LoadingImage.prototype.onload = function() { + this.confirm( true, 'onload' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.onerror = function() { + this.confirm( false, 'onerror' ); + this.unbindEvents(); +}; + +LoadingImage.prototype.unbindEvents = function() { + this.proxyImage.removeEventListener( 'load', this ); + this.proxyImage.removeEventListener( 'error', this ); + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +// -------------------------- Background -------------------------- // + +function Background( url, element ) { + this.url = url; + this.element = element; + this.img = new Image(); +} + +// inherit LoadingImage prototype +Background.prototype = Object.create( LoadingImage.prototype ); + +Background.prototype.check = function() { + this.img.addEventListener( 'load', this ); + this.img.addEventListener( 'error', this ); + this.img.src = this.url; + // check if image is already complete + var isComplete = this.getIsImageComplete(); + if ( isComplete ) { + this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); + this.unbindEvents(); + } +}; + +Background.prototype.unbindEvents = function() { + this.img.removeEventListener( 'load', this ); + this.img.removeEventListener( 'error', this ); +}; + +Background.prototype.confirm = function( isLoaded, message ) { + this.isLoaded = isLoaded; + this.emitEvent( 'progress', [ this, this.element, message ] ); +}; + +// -------------------------- jQuery -------------------------- // + +ImagesLoaded.makeJQueryPlugin = function( jQuery ) { + jQuery = jQuery || window.jQuery; + if ( !jQuery ) { + return; + } + // set local variable + $ = jQuery; + // $().imagesLoaded() + $.fn.imagesLoaded = function( options, callback ) { + var instance = new ImagesLoaded( this, options, callback ); + return instance.jqDeferred.promise( $(this) ); + }; +}; +// try making plugin +ImagesLoaded.makeJQueryPlugin(); + +// -------------------------- -------------------------- // + +return ImagesLoaded; + +}); + diff --git a/vendor/desandro/imagesloaded/imagesloaded.pkgd.min.js b/vendor/desandro/imagesloaded/imagesloaded.pkgd.min.js new file mode 100644 index 000000000..e443a77d6 --- /dev/null +++ b/vendor/desandro/imagesloaded/imagesloaded.pkgd.min.js @@ -0,0 +1,7 @@ +/*! + * imagesLoaded PACKAGED v4.1.4 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +!function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o + + + + + + background + + + + + + + +

background

+ +
+ +
+ +
+ +
+ + + + + + + diff --git a/vendor/desandro/imagesloaded/sandbox/progress/index.html b/vendor/desandro/imagesloaded/sandbox/progress/index.html new file mode 100644 index 000000000..b01ce28c5 --- /dev/null +++ b/vendor/desandro/imagesloaded/sandbox/progress/index.html @@ -0,0 +1,89 @@ + + + + + + + progress + + + + + + +

progress

+ +
+ + +
+
+ +
+
+ + + + + + + diff --git a/vendor/desandro/imagesloaded/sandbox/progress/progress.js b/vendor/desandro/imagesloaded/sandbox/progress/progress.js new file mode 100644 index 000000000..7c00003f5 --- /dev/null +++ b/vendor/desandro/imagesloaded/sandbox/progress/progress.js @@ -0,0 +1,111 @@ +/* jshint strict: false */ + +var progressElem, statusElem; +var supportsProgress; +var loadedImageCount, imageCount; + +var container = document.querySelector('#image-container'); +statusElem = document.querySelector('#status'); +progressElem = document.querySelector('progress'); + +supportsProgress = progressElem && + // IE does not support progress + progressElem.toString().indexOf('Unknown') === -1; + +document.querySelector('#add').onclick = function() { + // add new images + var fragment = getItemsFragment(); + container.insertBefore( fragment, container.firstChild ); + // use ImagesLoaded + var imgLoad = imagesLoaded( container ); + imgLoad.on( 'progress', onProgress ); + imgLoad.on( 'always', onAlways ); + // reset progress counter + imageCount = imgLoad.images.length; + resetProgress(); + updateProgress( 0 ); +}; + +// reset container +document.querySelector('#reset').onclick = function() { + empty( container ); +}; + +// ----- set text helper ----- // + +var docElem = document.documentElement; +var textSetter = docElem.textContent !== undefined ? 'textContent' : 'innerText'; + +function setText( elem, value ) { + elem[ textSetter ] = value; +} + +function empty( elem ) { + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } +} + +// ----- ----- // + +// return doc fragment with +function getItemsFragment() { + var fragment = document.createDocumentFragment(); + for ( var i = 0; i < 7; i++ ) { + var item = getImageItem(); + fragment.appendChild( item ); + } + return fragment; +} + +// return an
  • with a in it +function getImageItem() { + var item = document.createElement('li'); + item.className = 'is-loading'; + var img = document.createElement('img'); + var size = Math.random() * 3 + 1; + var width = Math.random() * 110 + 100; + width = Math.round( width * size ); + var height = Math.round( 140 * size ); + var rando = Math.ceil( Math.random() * 1000 ); + // 10% chance of broken image src + // random parameter to prevent cached images + img.src = rando < 100 ? '//foo/broken-' + rando + '.jpg' : + // use picsum for great random images + 'https://picsum.photos/' + width + '/' + height + '/' + '?random'; + item.appendChild( img ); + return item; +} + +// ----- ----- // + +function resetProgress() { + statusElem.style.opacity = 1; + loadedImageCount = 0; + if ( supportsProgress ) { + progressElem.setAttribute( 'max', imageCount ); + } +} + +function updateProgress( value ) { + if ( supportsProgress ) { + progressElem.setAttribute( 'value', value ); + } else { + // if you don't support progress elem + setText( statusElem, value + ' / ' + imageCount ); + } +} + +// triggered after each item is loaded +function onProgress( imgLoad, image ) { + // change class if the image is loaded or broken + image.img.parentNode.className = image.isLoaded ? '' : 'is-broken'; + // update progress element + loadedImageCount++; + updateProgress( loadedImageCount ); +} + +// hide status when done +function onAlways() { + statusElem.style.opacity = 0; +} diff --git a/vendor/desandro/imagesloaded/test/css/tests.css b/vendor/desandro/imagesloaded/test/css/tests.css new file mode 100644 index 000000000..af8a7e885 --- /dev/null +++ b/vendor/desandro/imagesloaded/test/css/tests.css @@ -0,0 +1,41 @@ +img { + display: inline-block; + max-width: 240px; +} + +/* ---- backgrounds ---- */ + +.bg-box { + width: 240px; + height: 240px; + margin: 0 20px 20px 0; + border: 1px solid; + display: inline-block; +} + +.bg-box.tulip { + background: url('http://i.imgur.com/9xYjgCk.jpg'); + background-size: cover; +} + +.bg-box.thunder-cloud { + background: url('../img/thunder-cloud.jpg'); + background-size: contain; +} + +.bg-box.multi { + background: + url("http://i.imgur.com/ZAVN3.png"), + url('http://i.imgur.com/6UdOxeB.png') bottom right, + url(https://picsum.photos/601/401/?random); + background-size: cover; +} + +.bg-box.blue { + background: #09F; +} + +.bg-box.gulls { + background-image: url('http://i.imgur.com/qKhkOKC.jpg'); + background-size: cover; +} diff --git a/vendor/desandro/imagesloaded/test/img/blue-shell.jpg b/vendor/desandro/imagesloaded/test/img/blue-shell.jpg new file mode 100644 index 000000000..b47f1e927 Binary files /dev/null and b/vendor/desandro/imagesloaded/test/img/blue-shell.jpg differ diff --git a/vendor/desandro/imagesloaded/test/img/bowser-jr.jpg b/vendor/desandro/imagesloaded/test/img/bowser-jr.jpg new file mode 100644 index 000000000..b1de2a76f Binary files /dev/null and b/vendor/desandro/imagesloaded/test/img/bowser-jr.jpg differ diff --git a/vendor/desandro/imagesloaded/test/img/thunder-cloud.jpg b/vendor/desandro/imagesloaded/test/img/thunder-cloud.jpg new file mode 100644 index 000000000..54fc9a1b7 Binary files /dev/null and b/vendor/desandro/imagesloaded/test/img/thunder-cloud.jpg differ diff --git a/vendor/desandro/imagesloaded/test/index.html b/vendor/desandro/imagesloaded/test/index.html new file mode 100644 index 000000000..02b04f4a6 --- /dev/null +++ b/vendor/desandro/imagesloaded/test/index.html @@ -0,0 +1,104 @@ + + + + + + imagesLoaded tests + + + + + + + + + + + + + + + + + + + + + + + + + +

    imagesLoaded tests

    + +
    + +

    Basics

    + +
    + + + + + +
    + + + +

    Locals

    + +
    + + + + +
    + +

    Data URI

    + +
    + + +
    + +

    append

    + +
    + +

    no images

    + +
    + +

    jQuery success

    + +
    + + + +
    + +

    jQuery fail

    + +
    + + + + + +
    + +

    background

    + +
    +
    +
    +
    +
    +
    + + +
    +
    + + + diff --git a/vendor/desandro/imagesloaded/test/unit/append.js b/vendor/desandro/imagesloaded/test/unit/append.js new file mode 100644 index 000000000..7a6b3c827 --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/append.js @@ -0,0 +1,30 @@ +QUnit.test( 'append', function( assert ) { + 'use strict'; + + var imgUrls = [ + 'http://i.imgur.com/bwy74ok.jpg', + 'http://i.imgur.com/bAZWoqx.jpg', + 'http://i.imgur.com/PgmEBSB.jpg', + 'http://i.imgur.com/aboaFoB.jpg', + 'http://i.imgur.com/LkmcILl.jpg', + 'http://i.imgur.com/q9zO6tw.jpg' + ]; + + // create images + var fragment = document.createDocumentFragment(); + for ( var i=0, len = imgUrls.length; i < len; i++ ) { + var img = document.createElement('img'); + img.src = imgUrls[i]; + fragment.appendChild( img ); + } + + var elem = document.querySelector('#append'); + elem.appendChild( fragment ); + var done = assert.async(); + + imagesLoaded( elem, { debug: false } ).on( 'always', function() { + assert.ok( 'appended images loaded' ); + done(); + }); + +}); diff --git a/vendor/desandro/imagesloaded/test/unit/background.js b/vendor/desandro/imagesloaded/test/unit/background.js new file mode 100644 index 000000000..ca76fad6f --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/background.js @@ -0,0 +1,70 @@ +QUnit.test( 'background', function( assert ) { + 'use strict'; + + // from Modernizr + var supportsMultiBGs = ( function() { + var style = document.createElement('a').style; + style.cssText = 'background:url(https://),url(https://),red url(https://)'; + return (/(url\s*\(.*?){3}/).test(style.background); + })(); + + var multiBGCount = supportsMultiBGs ? 3 : 0; + var done = assert.async( 14 + multiBGCount ); + + var imgLoad0 = imagesLoaded( '#background .tulip', { background: true }, function() { + assert.ok( true, 'callback triggered on .orange-tree'); + done(); + }); + assert.equal( imgLoad0.images.length, 1, '1 image on .images' ); + + imgLoad0.on( 'progress', function( instance, image, element ) { + assert.ok( element.nodeName == 'DIV', 'progress; element is div'); + assert.ok( image.isLoaded, 'progress; image.isLoaded'); + done(); + }); + + var imgLoad1 = imagesLoaded( '#background .thunder-cloud', { background: true }, function() { + assert.ok( true, 'callback triggered on .thunder-cloud'); + done(); + }); + assert.equal( imgLoad1.images.length, 1, '1 image on .images' ); + + // multiple backgrounds + var imgLoad2 = imagesLoaded( '#background .multi', { background: true }, function() { + assert.ok( true, 'callback triggered on .multi'); + done(); + }); + assert.equal( imgLoad2.images.length, multiBGCount, 'correct multiple BG count on .images' ); + + // multiple elements + var imgLoad3 = imagesLoaded( '#background .bg-box', { background: true }, function() { + assert.ok( true, 'callback triggered on .bg-box'); + var count = 5 + multiBGCount; + assert.equal( imgLoad3.images.length, count, count + ' images on .bg-box' ); + done(); + }); + + imgLoad3.on('progress', function( instance, image/*, element */) { + assert.ok( true, 'progress on .bg-box; ' + image.img.src ); + assert.equal( image.isLoaded, true, 'image.isLoaded == true' ); + done(); + }); + + // background and children + var imgLoad4 = imagesLoaded( '#background .gulls', { background: true } ); + assert.equal( imgLoad4.images.length, 3, '3 images: 1 background and 2 ' ); + + imgLoad4.on( 'progress', function( instance, image ) { + assert.equal( image.isLoaded, true, 'image is loaded' ); + done(); + }); + + // child background selector + var imgLoad5 = imagesLoaded( '#background', { background: '.bg-box' }, function() { + var count = 5 + multiBGCount; + assert.equal( imgLoad5.images.length, count, + count + ' images on .bg-box, with {background: .bg-box}' ); + done(); + }); + +}); diff --git a/vendor/desandro/imagesloaded/test/unit/basics.js b/vendor/desandro/imagesloaded/test/unit/basics.js new file mode 100644 index 000000000..6c502a793 --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/basics.js @@ -0,0 +1,28 @@ +QUnit.test( 'basics', function( assert ) { + + 'use strict'; + + var elem = document.querySelector('#basics'); + var images = elem.querySelectorAll('img'); + var done = assert.async( 3 + images.length ); + + var imgLoader = new imagesLoaded( elem, function( obj ) { + assert.ok( true, 'callback function triggered' ); + assert.equal( imgLoader, obj, 'callback argument and instance match' ); + done(); + }); + imgLoader.on( 'done', function() { + assert.ok( true, 'done event triggered' ); + done(); + }); + imgLoader.on( 'always', function() { + assert.ok( true, 'always event triggered' ); + done(); + }); + + imgLoader.on( 'progress', function( loader, image ) { + assert.ok( image.isLoaded, 'image is loaded'); + done(); + }); + +}); diff --git a/vendor/desandro/imagesloaded/test/unit/data-uri.js b/vendor/desandro/imagesloaded/test/unit/data-uri.js new file mode 100644 index 000000000..635f69859 --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/data-uri.js @@ -0,0 +1,10 @@ +QUnit.test( 'data-uri', function( assert ) { + 'use strict'; + + var done = assert.async(); + imagesLoaded('#data-uri', { debug: false }).on( 'done', function( obj ) { + assert.ok( true, 'data-uri images loaded' ); + assert.equal( obj.images.length, 2, 'instance has 2 images' ); + done(); + }); +}); diff --git a/vendor/desandro/imagesloaded/test/unit/jquery-fail.js b/vendor/desandro/imagesloaded/test/unit/jquery-fail.js new file mode 100644 index 000000000..b2180f6f2 --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/jquery-fail.js @@ -0,0 +1,29 @@ +QUnit.test( 'jquery fail', function( assert ) { + + 'use strict'; + + var $ = window.jQuery; + var $images = $('#jquery-fail img'); + var done = assert.async( 3 + $images.length ); + + $('#jquery-fail').imagesLoaded( function( instance ) { + assert.ok( true, 'callback triggered' ); + assert.ok( instance instanceof imagesLoaded, 'instance instanceof imagesLoaded' ); + done(); + }) + .fail( function( instance ) { + assert.ok( true, 'fail triggered' ); + assert.ok( instance instanceof imagesLoaded, 'instance instanceof imagesLoaded' ); + done(); + }) + .always( function( instance ) { + assert.ok( true, 'always triggered' ); + assert.ok( instance instanceof imagesLoaded, 'instance instanceof imagesLoaded' ); + done(); + }) + .progress( function(/* instance, image */) { + assert.ok( true, 'progress trigged'); + done(); + }); + + }); diff --git a/vendor/desandro/imagesloaded/test/unit/jquery-success.js b/vendor/desandro/imagesloaded/test/unit/jquery-success.js new file mode 100644 index 000000000..f16621088 --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/jquery-success.js @@ -0,0 +1,28 @@ +QUnit.test( 'jquery success', function( assert ) { + + 'use strict'; + + var $ = window.jQuery; + var done = assert.async( 6 ); + + $('#jquery-success').imagesLoaded( function( instance ) { + assert.ok( true, 'callback triggered' ); + assert.ok( instance instanceof imagesLoaded, 'instance instanceof imagesLoaded' ); + done(); + }) + .done( function( instance ) { + assert.ok( true, 'done triggered' ); + assert.ok( instance instanceof imagesLoaded, 'instance instanceof imagesLoaded' ); + done(); + }) + .always( function( instance ) { + assert.ok( true, 'always triggered' ); + assert.ok( instance instanceof imagesLoaded, 'instance instanceof imagesLoaded' ); + done(); + }) + .progress( function( instance, image ) { + assert.ok( image.isLoaded, 'progress trigged, image is loaded'); + done(); + }); + +}); diff --git a/vendor/desandro/imagesloaded/test/unit/local-files.js b/vendor/desandro/imagesloaded/test/unit/local-files.js new file mode 100644 index 000000000..61da6ae92 --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/local-files.js @@ -0,0 +1,31 @@ +QUnit.test( 'local files', function( assert ) { + 'use strict'; + + var elem = document.querySelector('#locals'); + var done = assert.async( 6 ); + + var imgLoader = new imagesLoaded( elem, function( obj ) { + assert.ok( true, 'callback function triggered' ); + assert.equal( imgLoader, obj, 'callback argument and instance match' ); + done(); + }); + imgLoader.on( 'fail', function() { + assert.ok( true, 'fail event triggered' ); + done(); + }); + imgLoader.on( 'always', function() { + assert.ok( true, 'always event triggered' ); + done(); + }); + + imgLoader.on( 'progress', function( loader, image ) { + assert.ok( true, 'image progressed'); + if ( image.img.src.indexOf('img/not-there.jpg') !== -1 ) { + assert.ok( !image.isLoaded, 'thunder cloud is not loaded' ); + } else { + assert.ok( image.isLoaded, 'image is loaded' ); + } + done(); + }); + +}); diff --git a/vendor/desandro/imagesloaded/test/unit/no-images.js b/vendor/desandro/imagesloaded/test/unit/no-images.js new file mode 100644 index 000000000..841216381 --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/no-images.js @@ -0,0 +1,11 @@ +QUnit.test( 'no images', function( assert ) { + 'use strict'; + + var elem = document.querySelector('#no-images'); + var done = assert.async(); + imagesLoaded( elem, function() { + assert.ok( true, 'triggered with no images' ); + done(); + }); + +}); diff --git a/vendor/desandro/imagesloaded/test/unit/non-element.js b/vendor/desandro/imagesloaded/test/unit/non-element.js new file mode 100644 index 000000000..4c9986fa6 --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/non-element.js @@ -0,0 +1,24 @@ +QUnit.test( 'dismiss non-element nodes', function( assert ) { + 'use strict'; + + var $ = window.jQuery; + var done = assert.async( 2 ); + + $(' ') + .imagesLoaded(function() { + assert.ok( true, 'elements from jQuery string ok' ); + done(); + }); + + // test fragment + var frag = document.createDocumentFragment(); + var img = new Image(); + img.src = 'https://picsum.photos/403/303/?random'; + frag.appendChild( img ); + var imgLoad = imagesLoaded( frag, function() { + assert.ok( true, 'document fragment ok' ); + assert.equal( imgLoad.images.length, 1, '1 image found' ); + done(); + }); + +}); diff --git a/vendor/desandro/imagesloaded/test/unit/selector-string.js b/vendor/desandro/imagesloaded/test/unit/selector-string.js new file mode 100644 index 000000000..8c43c4bef --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/selector-string.js @@ -0,0 +1,12 @@ +QUnit.test( 'selector string', function( assert ) { + 'use strict'; + var images = document.querySelectorAll('#basics img'); + var done = assert.async(); + var imgLoad = imagesLoaded('#basics', { debug: true }).on( 'done', function( obj ) { + assert.ok( true, 'selector string worked' ); + assert.ok( obj.images, 'argument has images' ); + assert.equal( obj.images.length, images.length, 'images.length matches' ); + done(); + }); + assert.ok( imgLoad.options.debug, 'debug option set' ); +}); diff --git a/vendor/desandro/imagesloaded/test/unit/single-element.js b/vendor/desandro/imagesloaded/test/unit/single-element.js new file mode 100644 index 000000000..42d7e48ee --- /dev/null +++ b/vendor/desandro/imagesloaded/test/unit/single-element.js @@ -0,0 +1,11 @@ +QUnit.test( 'single element', function( assert ) { + 'use strict'; + var elem = document.querySelector('#mario-with-shell'); + var done = assert.async(); + imagesLoaded( elem ).on( 'done', function( obj ) { + assert.ok( true, 'single element worked' ); + assert.ok( obj.images, 'argument has images' ); + assert.equal( obj.images.length, 1, 'images.length = 1' ); + done(); + }); +}); diff --git a/view/php/theme_init.php b/view/php/theme_init.php index dd8dcb5ee..73e559c45 100644 --- a/view/php/theme_init.php +++ b/view/php/theme_init.php @@ -36,7 +36,7 @@ head_add_js('/library/colorbox/jquery.colorbox-min.js'); head_add_js('/library/jquery.AreYouSure/jquery.are-you-sure.js'); head_add_js('/library/tableofcontents/jquery.toc.js'); -head_add_js('/library/imagesloaded/imagesloaded.pkgd.min.js'); +head_add_js('/vendor/desandro/imagesloaded/imagesloaded.pkgd.min.js'); /** * Those who require this feature will know what to do with it. * Those who don't, won't. -- cgit v1.2.3 From c7ae3fdc9af6e78ddee63fff4a9938df27d0d39d Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 25 Nov 2018 10:18:26 +0100 Subject: update jquery-file-upload and psr-log via composer --- composer.lock | 130 ++++++++++----------- vendor/blueimp/jquery-file-upload/README.md | 2 +- vendor/blueimp/jquery-file-upload/SECURITY.md | 2 +- vendor/blueimp/jquery-file-upload/angularjs.html | 8 +- vendor/blueimp/jquery-file-upload/basic-plus.html | 8 +- vendor/blueimp/jquery-file-upload/basic.html | 6 +- .../jquery-file-upload/bower-version-update.js | 0 vendor/blueimp/jquery-file-upload/bower.json | 2 +- .../jquery-file-upload/cors/postmessage.html | 2 +- vendor/blueimp/jquery-file-upload/index.html | 6 +- vendor/blueimp/jquery-file-upload/jquery-ui.html | 6 +- vendor/blueimp/jquery-file-upload/package.json | 2 +- .../server/php/UploadHandler.php | 34 +++--- .../jquery-file-upload/server/php/index.php | 2 +- vendor/blueimp/jquery-file-upload/test/index.html | 6 +- vendor/composer/ClassLoader.php | 2 +- vendor/composer/LICENSE | 69 +++-------- vendor/composer/autoload_classmap.php | 9 +- vendor/composer/autoload_static.php | 8 +- vendor/composer/installed.json | 28 ++--- vendor/psr/log/README.md | 7 ++ 21 files changed, 164 insertions(+), 175 deletions(-) mode change 100755 => 100644 vendor/blueimp/jquery-file-upload/bower-version-update.js mode change 100755 => 100644 vendor/blueimp/jquery-file-upload/server/php/UploadHandler.php diff --git a/composer.lock b/composer.lock index d7e8d11f6..158674a42 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "blueimp/jquery-file-upload", - "version": "v9.25.1", + "version": "v9.28.0", "source": { "type": "git", "url": "https://github.com/vkhramtsov/jQuery-File-Upload.git", - "reference": "28891f9b2bc339bcc1ca8d548e5401e8563bf04b" + "reference": "ff5accfe2e5c4a522777faa980a90cf86a636d1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/28891f9b2bc339bcc1ca8d548e5401e8563bf04b", - "reference": "28891f9b2bc339bcc1ca8d548e5401e8563bf04b", + "url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/ff5accfe2e5c4a522777faa980a90cf86a636d1d", + "reference": "ff5accfe2e5c4a522777faa980a90cf86a636d1d", "shasum": "" }, "type": "library", @@ -59,7 +59,7 @@ "upload", "widget" ], - "time": "2018-10-26T07:21:48+00:00" + "time": "2018-11-13T05:41:39+00:00" }, { "name": "bshaffer/oauth2-server-php", @@ -446,16 +446,16 @@ }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -489,7 +489,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" }, { "name": "ramsey/uuid", @@ -1110,7 +1110,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -2536,16 +2536,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "6.1.3", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "4d3ae9b21a7d7e440bd0cf65565533117976859f" + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4d3ae9b21a7d7e440bd0cf65565533117976859f", - "reference": "4d3ae9b21a7d7e440bd0cf65565533117976859f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "shasum": "" }, "require": { @@ -2595,7 +2595,7 @@ "testing", "xunit" ], - "time": "2018-10-23T05:59:32+00:00" + "time": "2018-10-31T16:06:48+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2788,16 +2788,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.4.3", + "version": "7.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c151651fb6ed264038d486ea262e243af72e5e64" + "reference": "b1be2c8530c4c29c3519a052c9fb6cee55053bbd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c151651fb6ed264038d486ea262e243af72e5e64", - "reference": "c151651fb6ed264038d486ea262e243af72e5e64", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b1be2c8530c4c29c3519a052c9fb6cee55053bbd", + "reference": "b1be2c8530c4c29c3519a052c9fb6cee55053bbd", "shasum": "" }, "require": { @@ -2868,7 +2868,7 @@ "testing", "xunit" ], - "time": "2018-10-23T05:57:41+00:00" + "time": "2018-11-14T16:52:02+00:00" }, { "name": "psr/container", @@ -3534,7 +3534,7 @@ }, { "name": "symfony/browser-kit", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -3591,16 +3591,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "f31333bdff54c7595f834d510a6d2325573ddb36" + "reference": "5605edec7b8f034ead2497ff4aab17bb70d558c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/f31333bdff54c7595f834d510a6d2325573ddb36", - "reference": "f31333bdff54c7595f834d510a6d2325573ddb36", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/5605edec7b8f034ead2497ff4aab17bb70d558c1", + "reference": "5605edec7b8f034ead2497ff4aab17bb70d558c1", "shasum": "" }, "require": { @@ -3643,20 +3643,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-31T09:06:03+00:00" }, { "name": "symfony/config", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "b3d4d7b567d7a49e6dfafb6d4760abc921177c96" + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/b3d4d7b567d7a49e6dfafb6d4760abc921177c96", - "reference": "b3d4d7b567d7a49e6dfafb6d4760abc921177c96", + "url": "https://api.github.com/repos/symfony/config/zipball/991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", + "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", "shasum": "" }, "require": { @@ -3706,20 +3706,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-09-08T13:24:10+00:00" + "time": "2018-10-31T09:09:42+00:00" }, { "name": "symfony/console", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "dc7122fe5f6113cfaba3b3de575d31112c9aa60b" + "reference": "432122af37d8cd52fba1b294b11976e0d20df595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/dc7122fe5f6113cfaba3b3de575d31112c9aa60b", - "reference": "dc7122fe5f6113cfaba3b3de575d31112c9aa60b", + "url": "https://api.github.com/repos/symfony/console/zipball/432122af37d8cd52fba1b294b11976e0d20df595", + "reference": "432122af37d8cd52fba1b294b11976e0d20df595", "shasum": "" }, "require": { @@ -3774,11 +3774,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:15:46+00:00" + "time": "2018-10-31T09:30:44+00:00" }, { "name": "symfony/css-selector", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -3831,16 +3831,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "f6b9d893ad28aefd8942dc0469c8397e2216fe30" + "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f6b9d893ad28aefd8942dc0469c8397e2216fe30", - "reference": "f6b9d893ad28aefd8942dc0469c8397e2216fe30", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e72ee2c23d952e4c368ee98610fa22b79b89b483", + "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483", "shasum": "" }, "require": { @@ -3898,11 +3898,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:40:59+00:00" + "time": "2018-10-31T10:54:16+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -3959,16 +3959,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e" + "reference": "552541dad078c85d9414b09c041ede488b456cd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bfb30c2ad377615a463ebbc875eba64a99f6aa3e", - "reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/552541dad078c85d9414b09c041ede488b456cd5", + "reference": "552541dad078c85d9414b09c041ede488b456cd5", "shasum": "" }, "require": { @@ -4018,20 +4018,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:10:45+00:00" + "time": "2018-10-10T13:52:42+00:00" }, { "name": "symfony/filesystem", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "596d12b40624055c300c8b619755b748ca5cf0b5" + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/596d12b40624055c300c8b619755b748ca5cf0b5", - "reference": "596d12b40624055c300c8b619755b748ca5cf0b5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd7bd6535beb1f0a0a9e3ee960666d0598546981", + "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981", "shasum": "" }, "require": { @@ -4068,20 +4068,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:40:59+00:00" + "time": "2018-10-30T13:18:25+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -4127,20 +4127,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/translation", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "9f0b61e339160a466ebcde167a6c5521c810e304" + "reference": "aa04dc1c75b7d3da7bd7003104cd0cfc5dff635c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/9f0b61e339160a466ebcde167a6c5521c810e304", - "reference": "9f0b61e339160a466ebcde167a6c5521c810e304", + "url": "https://api.github.com/repos/symfony/translation/zipball/aa04dc1c75b7d3da7bd7003104cd0cfc5dff635c", + "reference": "aa04dc1c75b7d3da7bd7003104cd0cfc5dff635c", "shasum": "" }, "require": { @@ -4196,11 +4196,11 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:36:10+00:00" + "time": "2018-10-28T18:38:52+00:00" }, { "name": "symfony/yaml", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", diff --git a/vendor/blueimp/jquery-file-upload/README.md b/vendor/blueimp/jquery-file-upload/README.md index d2f104d5c..d9e16ed18 100644 --- a/vendor/blueimp/jquery-file-upload/README.md +++ b/vendor/blueimp/jquery-file-upload/README.md @@ -10,7 +10,7 @@ Supports cross-domain, chunked and resumable file uploads and client-side image ## ⚠️ Security Notice Security related releases: -* [v9.25.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/v9.25.1) Mitigates some [Potential vulnerabilities with PHP+ImageMagick](VULNERABILITIES.md#potential-vulnerabilities-with-php+imagemagick). +* [v9.25.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/v9.25.1) Mitigates some [Potential vulnerabilities with PHP+ImageMagick](VULNERABILITIES.md#potential-vulnerabilities-with-php-imagemagick). * [v9.24.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/v9.24.1) Fixes a [Remote code execution vulnerability in the PHP component](VULNERABILITIES.md#remote-code-execution-vulnerability-in-the-php-component). * v[9.10.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/9.10.1) Fixes an [Open redirect vulnerability in the GAE components](VULNERABILITIES.md#open-redirect-vulnerability-in-the-gae-components). * Commit [4175032](https://github.com/blueimp/jQuery-File-Upload/commit/41750323a464e848856dc4c5c940663498beb74a) (*fixed in all tagged releases*) Fixes a [Cross-site scripting vulnerability in the Iframe Transport](VULNERABILITIES.md#cross-site-scripting-vulnerability-in-the-iframe-transport). diff --git a/vendor/blueimp/jquery-file-upload/SECURITY.md b/vendor/blueimp/jquery-file-upload/SECURITY.md index db58f7dd7..86ffc163b 100644 --- a/vendor/blueimp/jquery-file-upload/SECURITY.md +++ b/vendor/blueimp/jquery-file-upload/SECURITY.md @@ -113,7 +113,7 @@ location ^~ /path/to/project/server/php/files { ``` ## Secure image processing configurations -The following configuration mitigates [potential image processing vulnerabilities with ImageMagick](VULNERABILITIES.md#potential-vulnerabilities-with-php+imagemagick) by limiting the attack vectors to a small subset of image types (`GIF/JPEG/PNG`). +The following configuration mitigates [potential image processing vulnerabilities with ImageMagick](VULNERABILITIES.md#potential-vulnerabilities-with-php-imagemagick) by limiting the attack vectors to a small subset of image types (`GIF/JPEG/PNG`). Please also consider using alternative, safer image processing libraries like [libvips](https://github.com/libvips/libvips) or [imageflow](https://github.com/imazen/imageflow). diff --git a/vendor/blueimp/jquery-file-upload/angularjs.html b/vendor/blueimp/jquery-file-upload/angularjs.html index 2051bbf79..e8b05e77f 100644 --- a/vendor/blueimp/jquery-file-upload/angularjs.html +++ b/vendor/blueimp/jquery-file-upload/angularjs.html @@ -22,7 +22,7 @@ - + @@ -177,8 +177,8 @@
      - - + + @@ -186,7 +186,7 @@ - + diff --git a/vendor/blueimp/jquery-file-upload/basic-plus.html b/vendor/blueimp/jquery-file-upload/basic-plus.html index acee24843..6d53acdc1 100644 --- a/vendor/blueimp/jquery-file-upload/basic-plus.html +++ b/vendor/blueimp/jquery-file-upload/basic-plus.html @@ -20,7 +20,7 @@ - + @@ -96,15 +96,15 @@ - + - + - + diff --git a/vendor/blueimp/jquery-file-upload/basic.html b/vendor/blueimp/jquery-file-upload/basic.html index 232a24624..a9ef6273e 100644 --- a/vendor/blueimp/jquery-file-upload/basic.html +++ b/vendor/blueimp/jquery-file-upload/basic.html @@ -20,7 +20,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -104,7 +104,7 @@ - + + - + @@ -226,7 +226,7 @@ - + diff --git a/vendor/blueimp/jquery-file-upload/jquery-ui.html b/vendor/blueimp/jquery-file-upload/jquery-ui.html index 842dd4ca7..e44d41e89 100644 --- a/vendor/blueimp/jquery-file-upload/jquery-ui.html +++ b/vendor/blueimp/jquery-file-upload/jquery-ui.html @@ -22,7 +22,7 @@ - + @@ -201,8 +201,8 @@ {% } %} - - + + diff --git a/vendor/blueimp/jquery-file-upload/package.json b/vendor/blueimp/jquery-file-upload/package.json index 4b33a0362..0a635397c 100644 --- a/vendor/blueimp/jquery-file-upload/package.json +++ b/vendor/blueimp/jquery-file-upload/package.json @@ -1,6 +1,6 @@ { "name": "blueimp-file-upload", - "version": "9.25.1", + "version": "9.28.0", "title": "jQuery File Upload", "description": "File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.", "keywords": [ diff --git a/vendor/blueimp/jquery-file-upload/server/php/UploadHandler.php b/vendor/blueimp/jquery-file-upload/server/php/UploadHandler.php old mode 100755 new mode 100644 index e44004395..5215e4c0f --- a/vendor/blueimp/jquery-file-upload/server/php/UploadHandler.php +++ b/vendor/blueimp/jquery-file-upload/server/php/UploadHandler.php @@ -38,9 +38,9 @@ class UploadHandler 'image_resize' => 'Failed to resize image' ); - protected const IMAGETYPE_GIF = 1; - protected const IMAGETYPE_JPEG = 2; - protected const IMAGETYPE_PNG = 3; + const IMAGETYPE_GIF = 1; + const IMAGETYPE_JPEG = 2; + const IMAGETYPE_PNG = 3; protected $image_objects = array(); @@ -1047,13 +1047,18 @@ class UploadHandler } protected function create_scaled_image($file_name, $version, $options) { - if ($this->options['image_library'] === 2) { - return $this->imagemagick_create_scaled_image($file_name, $version, $options); - } - if ($this->options['image_library'] && extension_loaded('imagick')) { - return $this->imagick_create_scaled_image($file_name, $version, $options); + try { + if ($this->options['image_library'] === 2) { + return $this->imagemagick_create_scaled_image($file_name, $version, $options); + } + if ($this->options['image_library'] && extension_loaded('imagick')) { + return $this->imagick_create_scaled_image($file_name, $version, $options); + } + return $this->gd_create_scaled_image($file_name, $version, $options); + } catch (\Exception $e) { + error_log($e->getMessage()); + return false; } - return $this->gd_create_scaled_image($file_name, $version, $options); } protected function destroy_image_object($file_path) { @@ -1066,12 +1071,12 @@ class UploadHandler $fp = fopen($file_path, 'r'); $data = fread($fp, 4); fclose($fp); - // GIF: 47 49 46 - if (substr($data, 0, 3) === 'GIF') { + // GIF: 47 49 46 38 + if ($data === 'GIF8') { return self::IMAGETYPE_GIF; } - // JPG: FF D8 - if (bin2hex(substr($data, 0, 2)) === 'ffd8') { + // JPG: FF D8 FF + if (bin2hex(substr($data, 0, 3)) === 'ffd8ff') { return self::IMAGETYPE_JPEG; } // PNG: 89 50 4E 47 @@ -1082,6 +1087,9 @@ class UploadHandler } protected function is_valid_image_file($file_path) { + if (!preg_match('/\.(gif|jpe?g|png)$/i', $file_path)) { + return false; + } return !!$this->imagetype($file_path); } diff --git a/vendor/blueimp/jquery-file-upload/server/php/index.php b/vendor/blueimp/jquery-file-upload/server/php/index.php index 9c2cfb8eb..6caabb710 100644 --- a/vendor/blueimp/jquery-file-upload/server/php/index.php +++ b/vendor/blueimp/jquery-file-upload/server/php/index.php @@ -9,7 +9,7 @@ * Licensed under the MIT license: * https://opensource.org/licenses/MIT */ -exit; + error_reporting(E_ALL | E_STRICT); require('UploadHandler.php'); $upload_handler = new UploadHandler(); diff --git a/vendor/blueimp/jquery-file-upload/test/index.html b/vendor/blueimp/jquery-file-upload/test/index.html index 0b5cf57b7..b8c585df5 100644 --- a/vendor/blueimp/jquery-file-upload/test/index.html +++ b/vendor/blueimp/jquery-file-upload/test/index.html @@ -20,7 +20,7 @@ jQuery File Upload Plugin Test - +

      jQuery File Upload Plugin Test

      @@ -145,7 +145,7 @@ {% } %} - + @@ -166,7 +166,7 @@ window.testBasicWidget = $.blueimp.fileupload; /* global window, $ */ window.testUIWidget = $.blueimp.fileupload; - + diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 95f7e0978..fce8549f0 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -279,7 +279,7 @@ class ClassLoader */ public function setApcuPrefix($apcuPrefix) { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE index f0157a6ed..f27399a04 100644 --- a/vendor/composer/LICENSE +++ b/vendor/composer/LICENSE @@ -1,56 +1,21 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: Composer -Upstream-Contact: Jordi Boggiano -Source: https://github.com/composer/composer -Files: * -Copyright: 2016, Nils Adermann - 2016, Jordi Boggiano -License: Expat +Copyright (c) Nils Adermann, Jordi Boggiano -Files: src/Composer/Util/TlsHelper.php -Copyright: 2016, Nils Adermann - 2016, Jordi Boggiano - 2013, Evan Coury -License: Expat and BSD-2-Clause +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: -License: BSD-2-Clause - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - . - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - . - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +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. -License: Expat - 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. diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index f3c814e02..86acbb152 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -380,6 +380,9 @@ return array( 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', + 'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', + 'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', + 'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php', 'Ramsey\\Uuid\\BinaryUtils' => $vendorDir . '/ramsey/uuid/src/BinaryUtils.php', 'Ramsey\\Uuid\\Builder\\DefaultUuidBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/DefaultUuidBuilder.php', 'Ramsey\\Uuid\\Builder\\DegradedUuidBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/DegradedUuidBuilder.php', @@ -981,7 +984,6 @@ return array( 'Zotlabs\\Module\\Mood' => $baseDir . '/Zotlabs/Module/Mood.php', 'Zotlabs\\Module\\Network' => $baseDir . '/Zotlabs/Module/Network.php', 'Zotlabs\\Module\\New_channel' => $baseDir . '/Zotlabs/Module/New_channel.php', - 'Zotlabs\\Module\\Nojs' => $baseDir . '/Zotlabs/Module/Nojs.php', 'Zotlabs\\Module\\Notes' => $baseDir . '/Zotlabs/Module/Notes.php', 'Zotlabs\\Module\\Notifications' => $baseDir . '/Zotlabs/Module/Notifications.php', 'Zotlabs\\Module\\Notify' => $baseDir . '/Zotlabs/Module/Notify.php', @@ -1337,7 +1339,10 @@ return array( 'Zotlabs\\Update\\_1222' => $baseDir . '/Zotlabs/Update/_1222.php', 'Zotlabs\\Update\\_1223' => $baseDir . '/Zotlabs/Update/_1223.php', 'Zotlabs\\Update\\_1224' => $baseDir . '/Zotlabs/Update/_1224.php', - 'Zotlabs\\Web\\CheckJS' => $baseDir . '/Zotlabs/Web/CheckJS.php', + 'Zotlabs\\Update\\_1225' => $baseDir . '/Zotlabs/Update/_1225.php', + 'Zotlabs\\Update\\_1226' => $baseDir . '/Zotlabs/Update/_1226.php', + 'Zotlabs\\Update\\_1227' => $baseDir . '/Zotlabs/Update/_1227.php', + 'Zotlabs\\Update\\_1228' => $baseDir . '/Zotlabs/Update/_1228.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', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index ce0232306..ea23de753 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -548,6 +548,9 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', + 'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', + 'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', + 'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php', 'Ramsey\\Uuid\\BinaryUtils' => __DIR__ . '/..' . '/ramsey/uuid/src/BinaryUtils.php', 'Ramsey\\Uuid\\Builder\\DefaultUuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/DefaultUuidBuilder.php', 'Ramsey\\Uuid\\Builder\\DegradedUuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/DegradedUuidBuilder.php', @@ -1149,7 +1152,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Zotlabs\\Module\\Mood' => __DIR__ . '/../..' . '/Zotlabs/Module/Mood.php', 'Zotlabs\\Module\\Network' => __DIR__ . '/../..' . '/Zotlabs/Module/Network.php', 'Zotlabs\\Module\\New_channel' => __DIR__ . '/../..' . '/Zotlabs/Module/New_channel.php', - 'Zotlabs\\Module\\Nojs' => __DIR__ . '/../..' . '/Zotlabs/Module/Nojs.php', 'Zotlabs\\Module\\Notes' => __DIR__ . '/../..' . '/Zotlabs/Module/Notes.php', 'Zotlabs\\Module\\Notifications' => __DIR__ . '/../..' . '/Zotlabs/Module/Notifications.php', 'Zotlabs\\Module\\Notify' => __DIR__ . '/../..' . '/Zotlabs/Module/Notify.php', @@ -1506,7 +1508,9 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Zotlabs\\Update\\_1223' => __DIR__ . '/../..' . '/Zotlabs/Update/_1223.php', 'Zotlabs\\Update\\_1224' => __DIR__ . '/../..' . '/Zotlabs/Update/_1224.php', 'Zotlabs\\Update\\_1225' => __DIR__ . '/../..' . '/Zotlabs/Update/_1225.php', - 'Zotlabs\\Web\\CheckJS' => __DIR__ . '/../..' . '/Zotlabs/Web/CheckJS.php', + 'Zotlabs\\Update\\_1226' => __DIR__ . '/../..' . '/Zotlabs/Update/_1226.php', + 'Zotlabs\\Update\\_1227' => __DIR__ . '/../..' . '/Zotlabs/Update/_1227.php', + 'Zotlabs\\Update\\_1228' => __DIR__ . '/../..' . '/Zotlabs/Update/_1228.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', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index af845828e..30fe9b020 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,20 +1,20 @@ [ { "name": "blueimp/jquery-file-upload", - "version": "v9.25.1", - "version_normalized": "9.25.1.0", + "version": "v9.28.0", + "version_normalized": "9.28.0.0", "source": { "type": "git", "url": "https://github.com/vkhramtsov/jQuery-File-Upload.git", - "reference": "28891f9b2bc339bcc1ca8d548e5401e8563bf04b" + "reference": "ff5accfe2e5c4a522777faa980a90cf86a636d1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/28891f9b2bc339bcc1ca8d548e5401e8563bf04b", - "reference": "28891f9b2bc339bcc1ca8d548e5401e8563bf04b", + "url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/ff5accfe2e5c4a522777faa980a90cf86a636d1d", + "reference": "ff5accfe2e5c4a522777faa980a90cf86a636d1d", "shasum": "" }, - "time": "2018-10-26T07:21:48+00:00", + "time": "2018-11-13T05:41:39+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -457,23 +457,23 @@ }, { "name": "psr/log", - "version": "1.0.2", - "version_normalized": "1.0.2.0", + "version": "1.1.0", + "version_normalized": "1.1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { "php": ">=5.3.0" }, - "time": "2016-10-10T12:19:37+00:00", + "time": "2018-11-20T15:27:04+00:00", "type": "library", "extra": { "branch-alias": { @@ -1141,8 +1141,8 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", - "version_normalized": "1.9.0.0", + "version": "v1.10.0", + "version_normalized": "1.10.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", diff --git a/vendor/psr/log/README.md b/vendor/psr/log/README.md index 574bc1cb2..5571a25e8 100644 --- a/vendor/psr/log/README.md +++ b/vendor/psr/log/README.md @@ -7,6 +7,13 @@ This repository holds all interfaces/classes/traits related to Note that this is not a logger of its own. It is merely an interface that describes a logger. See the specification for more details. +Installation +------------ + +```bash +composer require psr/log +``` + Usage ----- -- cgit v1.2.3 From 6b02c664fb9444d66322605c408bb791457ee0b5 Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Sun, 25 Nov 2018 10:22:09 +0100 Subject: Do not store serialized pconfig value received via to Module/Pconfig.php --- Zotlabs/Module/Pconfig.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Zotlabs/Module/Pconfig.php b/Zotlabs/Module/Pconfig.php index 44fe5d9a9..f31d5fdf6 100644 --- a/Zotlabs/Module/Pconfig.php +++ b/Zotlabs/Module/Pconfig.php @@ -22,6 +22,11 @@ class Pconfig extends \Zotlabs\Web\Controller { $k = trim(escape_tags($_POST['k'])); $v = trim($_POST['v']); $aj = intval($_POST['aj']); + + // Do not store "serialized" data received in the $_POST + if (preg_match('|^a:[0-9]+:{.*}$|s',$v) || preg_match('O:8:"stdClass":[0-9]+:{.*}$|s',$v)) { + return; + } if(in_array(argv(2),$this->disallowed_pconfig())) { notice( t('This setting requires special processing and editing has been blocked.') . EOL); -- cgit v1.2.3 From 3775be4ce9c56639146efa877eefabb9e9f23b3c Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 26 Nov 2018 12:44:10 +0100 Subject: use flex for the default template --- view/css/default.css | 37 ++++++++++++++++++++++++++----------- view/css/mod_connedit.css | 1 - view/php/default.php | 14 +++++++++----- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/view/css/default.css b/view/css/default.css index 765a197d9..bd0f14ba2 100644 --- a/view/css/default.css +++ b/view/css/default.css @@ -1,22 +1,37 @@ main { - display: table; - table-layout: fixed; position: relative; - width: 100%; - height: 100vh; + min-height: 100vh; + display: flex; + flex-direction: column; } -aside { +.content { + display: flex; + flex: 1; +} + +.columns { + display: flex; + flex:1; + min-width: 0; +} + +#region_1 { position: relative; - display: table-cell; - vertical-align: top; + order: 1; padding: 4.5rem 7px 0px 7px; } -section { +#region_2 { position: relative; - width: 100%; - display: table-cell; - vertical-align: top; + flex: 1; + order: 2; padding: 4.5rem 7px 200px 7px; + min-width: 0; +} + +#region_3 { + position: relative; + order: 3; + padding: 4.5rem 7px 0px 7px; } diff --git a/view/css/mod_connedit.css b/view/css/mod_connedit.css index 67a182c5c..b02f928f0 100644 --- a/view/css/mod_connedit.css +++ b/view/css/mod_connedit.css @@ -71,7 +71,6 @@ width: 32px; height: 32px; border-radius: 4px; - border: 1px solid #ccc; text-align: center; } diff --git a/view/php/default.php b/view/php/default.php index 60f3f6a6f..388c94382 100644 --- a/view/php/default.php +++ b/view/php/default.php @@ -10,12 +10,16 @@
      - -
      +
      +
      + +
      -
      -
      - +
      +
      + + +
      -- cgit v1.2.3 From 37d563c30ed2db7aba04537af8e90324d55c71f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Jim=C3=A9nez=20Friaza?= Date: Mon, 26 Nov 2018 11:43:24 +0000 Subject: Revision 1 doc/es-es/about/about.bb (cherry picked from commit 5ac08ec3aa8ede14141390670a8097a60769e11e) --- doc/es-es/about/about.bb | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/doc/es-es/about/about.bb b/doc/es-es/about/about.bb index 1d5f3a4a2..50d23c778 100644 --- a/doc/es-es/about/about.bb +++ b/doc/es-es/about/about.bb @@ -29,7 +29,7 @@ $Projectname es, básicamente, una aplicación de servidor web relativamente est [*= Identidad nómada] La capacidad de autenticar y migrar fácilmente una identidad a través de hubs y dominios web independientes. La identidad nómada proporciona una verdadera propiedad de una identidad en línea, porque las identidades de los canales controlados por una cuenta en un hub no están vinculadas al propio hub. Un hub es más como un "host" para canales. Con Hubzilla, no tienes una "cuenta" en un servidor como lo haces en sitios web típicos; tienes una identidad que puedes llevarte a través de la rejilla usando clones. -[*= Zot] El novedoso protocolo basado en JSON para la implementación de comunicaciones y servicios descentralizados seguros. Se diferencia de muchos otros protocolos de comunicación en que construye las comunicaciones sobre un marco de identidad y autenticación descentralizado. El componente de autenticación es similar a OpenID conceptualmente pero está aislado de las identidades basadas en DNS. Cuando es posible, la autenticación remota es silenciosa e invisible. Esto proporciona un mecanismo para el control de acceso distribuido a escala de Internet que es discreto. +[*= Zot] El novedoso protocolo basado en JSON para la implementación de comunicaciones y servicios descentralizados seguros. Se diferencia de muchos otros protocolos de comunicación en que construye las comunicaciones sobre un marco de identidad y autenticación descentralizado. El componente de autenticación es similar a OpenID conceptualmente pero está aislado de las identidades basadas en DNS. Cuando es posible, la autenticación remota es silenciosa e invisible. Esto proporciona un mecanismo discreto para el control de acceso distribuido a escala de Internet. [/dl] @@ -41,7 +41,7 @@ Esta página enumera algunas de las características principales de $Projectname [h4]Control deslizante de afinidad[/h4] Cuando se añaden conexiones en $Projectname, los miembros tienen la opción de asignar niveles de "afinidad" (cuán cerca está su amigo). -Por otro lado, al añadir el canal de un amigo, se puede situar bajo el nivel de afinidad de "Amigos". +Por otro lado, al añadir el canal de un amigo, se puede situar bajo el nivel de afinidad, justamente, de "Amigos". En este punto, la herramienta $Projectname [i]Control deslizante de afinidad[/i], que normalmente aparece en la parte superior de la página, ajusta su contenido para incluir aquellos contactos que están dentro del rango de afinidad deseado. Los canales fuera de ese rango no se mostrarán, a menos que ajuste el control deslizante para incluirlos. @@ -62,7 +62,7 @@ Las listas de control de acceso se pueden aplicar a contenido y mensajes, fotos, [h4]Inicio de sesión único[/h4] -Las listas de control de acceso funcionan para todos los canales de la red gracias a nuestra exclusiva tecnología de inicio de sesión único. La mayoría de los enlaces internos proporcionan un token de identidad que puede ser verificado en otros sitios de $Projectname y utilizado para controlar el acceso a recursos privados. Inicie sesión una vez en el hub de su casa. Después de eso, la autenticación de todos los recursos de $Projectname es "mágica". +Las listas de control de acceso funcionan para todos los canales de la red gracias a nuestra exclusiva tecnología de inicio de sesión único. La mayoría de los enlaces internos proporcionan un token de identidad que puede ser verificado en otros sitios de $Projectname y utilizado para controlar el acceso a recursos privados. Inicie sesión una vez en la página principal del hub. Después de eso, la autenticación de todos los recursos de $Projectname es "mágica". [h4]Almacenamiento de Archivos habilitado para WebDAV[/h4] @@ -93,7 +93,7 @@ Las aplicaciones pueden ser construidas y distribuidas por los miembros. Éstas [h4]Diseño[/h4] -El diseño de la página se basa en un lenguaje de descripción llamado comanche. La propia $Projectname está escrito en diseños comanches que se pueden cambiar. Esto permite un nivel de personalización que no se encuentra normalmente en los llamados "entornos multiusuario". +El diseño de la página se basa en un lenguaje de descripción llamado comanche. La propia $Projectname está escrito en plantillas en comanche que se pueden cambiar. Esto permite un nivel de personalización que no se encuentra normalmente en los llamados "entornos multiusuario". [h4]Marcadores[/h4] @@ -111,14 +111,14 @@ Además, los mensajes pueden crearse utilizando "encriptación de extremo a extr Por lo general, los mensajes públicos no se cifran durante el transporte ni durante el almacenamiento. -Los mensajes privados pueden ser revocados (no enviados) aunque no hay garantía de que el destinatario no lo haya leído todavía. +Los mensajes privados pueden ser revocados (no enviados) aunque no hay garantía de que el destinatario no lo haya leído antes. Los mensajes se pueden crear con una fecha de caducidad, en la que se borrarán/quitarán en el sitio del destinatario. [h4]Federación de Servicios[/h4] -Además de añadir "conectores de publicación cruzada" a una variedad de redes alternativas, hay soporte nativo para la importación de contenido desde RSS/Atom feeds y puede utilizarlo para crear canales especiales. Los plugins también están disponibles para comunicarse con otros usando los protocolos Diáspora, GNU-Social (OStatus) o Mastodon (ActivityPub). Estas redes no soportan la identidad nómada ni el control de acceso entre dominios; sin embargo, las comunicaciones básicas son soportadas desde/hacia la diáspora, Friendica, GNU-Social, Mastodon y otros proveedores que utilizan estos protocolos. +Además de añadir "conectores de publicación cruzada" a una variedad de redes alternativas, hay soporte nativo para la importación de contenido desde RSS/Atom feeds y puede utilizarlo para crear canales especiales. Los plugins también están disponibles para comunicarse con otros usando los protocolos Diáspora, GNU-Social (OStatus) o Mastodon (ActivityPub). Estas redes no soportan la identidad nómada ni el control de acceso entre dominios; sin embargo, las comunicaciones básicas son soportadas desde o hacia Diaspora, Friendica, GNU-Social, Mastodon, Pleroma y otros proveedores que utilizan estos protocolos. También existe soporte experimental para la autenticación OpenID que puede utilizarse en las listas de control de acceso. Este es un trabajo en progreso. Su hub $Projectname puede ser utilizado como un proveedor de OpenID para autenticarle en servicios externos que utilizan esta tecnología. @@ -126,7 +126,7 @@ Los canales pueden tener permisos para convertirse en "canales derivados" cuando [h4]Grupos de Privacidad[/h4] -Nuestra implementación de grupos de privacidad es similar a la de Google "Círculos" y "Aspectos" de la Diáspora. Esto le permite filtrar su flujo entrante por grupos seleccionados y establecer automáticamente la Lista de control de acceso saliente sólo para aquellos que se encuentren en ese grupo de privacidad cuando publique. Usted puede anular esto en cualquier momento (antes de enviar el correo). +Nuestra implementación de grupos de privacidad es similar a la de Google "Círculos" y "Aspectos" de Diaspora. Esto le permite filtrar su flujo entrante por grupos seleccionados y establecer automáticamente la Lista de control de acceso saliente sólo para aquellos que se encuentren en ese grupo de privacidad cuando publique. Usted puede anular esto en cualquier momento (antes de enviar el correo). [h4]Servicios de directorio[/h4] @@ -158,19 +158,25 @@ Las opciones son: [h4]Foros Públicos y Privados[/h4] -Los foros son típicamente canales que pueden estar abiertos a la participación de múltiples autores. Actualmente existen dos mecanismos para enviar mensajes a los foros: 1) mensajes de "muro a muro" y 2) a través de las etiquetas @mención del foro. Los foros pueden ser creados por cualquier persona y utilizados para cualquier propósito. El directorio contiene una opción para buscar foros públicos. Los foros privados sólo pueden ser publicados y, a menudo, sólo pueden ser vistos por los miembros. +Los foros son típicamente canales que pueden estar abiertos a la participación de múltiples autores. Actualmente existen dos mecanismos para enviar mensajes a los foros: + +1) mensajes de "muro a muro" y + +2) a través de las etiquetas @mención del foro. + +Los foros pueden ser creados por cualquier persona y utilizados para cualquier propósito. El directorio contiene una opción para buscar foros públicos. Los foros privados sólo pueden ser publicados y, a menudo, sólo pueden ser vistos por los miembros. [h4]Clonación de cuentas[/h4] -Las cuentas en $Projectname se denominan [i]identidades nómadas[/i], porque la identidad de un miembro no está vinculada al hub donde se creó la identidad originalmente. Por ejemplo, cuando creas una cuenta de Facebook o Gmail, está vinculada a esos servicios. No pueden funcionar sin Facebook.com o Gmail.com. +Las cuentas en $Projectname se denominan [i]identidades nómadas[/i], porque la identidad de un miembro no está vinculada al hub donde se creó la identidad originalmente. Por ejemplo, cuando cree una cuenta de Facebook o Gmail, está vinculada a esos servicios. No pueden funcionar sin Facebook.com o Gmail.com. -Por el contrario, digamos que ha creado una identidad $Projectname llamada[b]tina@$Projectnamehub.com[/b]. Puede clonarlo a otro hub $Projectname eligiendo el mismo o un nombre diferente:[b]vivoParasiempre@algún$ProjectnameHub.info[/b] +Por el contrario, digamos que ha creado una identidad $Projectname llamada [b]tina@$Projectnamehub.com[/b]. Puede clonarlo a otro hub $Projectname eligiendo el mismo o un nombre diferente:[b]vivoParasiempre@algún$ProjectnameHub.info[/b] -Ahora ambos canales están sincronizados, lo que significa que todos sus contactos y preferencias se duplicarán en su clon. No importa si envías un mensaje desde su hub original o desde el nuevo hub. Los mensajes se reflejarán en ambas cuentas. +Ahora ambos canales están sincronizados, lo que significa que todos sus contactos y preferencias se duplicarán en su clon. No importa si envía un mensaje desde su hub original o desde el nuevo hub. Los mensajes se reflejarán en ambas cuentas. Esta es una característica bastante revolucionaria, si consideramos algunos escenarios: - ¿Qué ocurre si el hub en el que se basa una identidad se desconecta de repente? Sin clonación, un miembro no podrá comunicarse hasta que el hub vuelva a estar en línea (sin duda muchos de ustedes han visto y maldecido el Twitter "Fail Whale"). Con la clonación, sólo tienesque iniciar sesión en su cuenta clonada y la vida continúa feliz para siempre. + ¿Qué ocurre si el hub en el que se basa una identidad se desconecta de repente? Sin clonación, un miembro no podrá comunicarse hasta que el hub vuelva a estar en línea (sin duda muchos de ustedes han visto y maldecido el Twitter "Fail Whale"). Con la clonación, sólo tiene que iniciar sesión en su cuenta clonada y la vida continúa feliz para siempre. El administrador de su hub ya no puede permitirse el lujo de pagar por su hub gratuito y público $Projectname. Anuncia que el centro cerrará en dos semanas. Esto le da tiempo suficiente para clonar su(s) identidad(es) y preservar las relaciones, amigos y contenido de su $Projectname. @@ -193,9 +199,10 @@ $Projectname ofrece una sencilla copia de seguridad de la cuenta con un solo cli [h4]Borrado de cuenta[/h4] -Las cuentas se pueden eliminar inmediatamente haciendo clic en un enlace. Eso es todo. Todo el contenido asociado se elimina de la rejilla (esto incluye los mensajes y cualquier otro contenido producido por el perfil eliminado). Dependiendo del número de conexiones que tenga, el proceso de eliminación de contenido remoto podría llevar algún tiempo, pero está previsto que ocurra tan rápido como sea posible. +Las cuentas se pueden eliminar inmediatamente haciendo clic en un enlace. Eso es todo. Todo el contenido asociado se elimina de la red (esto incluye los mensajes y cualquier otro contenido producido por el perfil eliminado). Dependiendo del número de conexiones que tenga, el proceso de eliminación de contenido remoto podría llevar algún tiempo, pero está previsto que ocurra tan rápido como sea posible. [h4]Supresión de contenido[/h4] + Cualquier contenido creado en $Projectname permanece bajo el control del miembro (o canal) que lo creó originalmente. En cualquier momento, un miembro puede borrar un mensaje o un rango de mensajes. El proceso de eliminación garantiza que el contenido se elimine, independientemente de si se publicó en el hub principal de un canal o en otro hub, donde el canal se autenticó de forma remota a través de Zot (protocolo de autenticación y comunicación de $Projectname). @@ -221,4 +228,4 @@ $Projectname se puede ampliar de varias maneras, a través de la personalizació [h4]API[/h4] -Una API está disponible para su uso por parte de servicios de terceros. Un plugin también proporciona una implementación básica de Twitter (para los que existen cientos de herramientas de terceros). El acceso puede ser proporcionado por login/contraseña o OAuth, y el registro del cliente de las aplicaciones de OAuth es proporcionado. \ No newline at end of file +Una API está disponible para su uso por parte de servicios de terceros. Un plugin también proporciona una implementación básica de Twitter (para los que existen cientos de herramientas de terceros). El acceso puede ser proporcionado por login/contraseña o OAuth, y el registro del cliente de las aplicaciones de OAuth está disponible. \ No newline at end of file -- cgit v1.2.3 From 19e4f3c2f082278e524c463cce7ce0858a2258f8 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 27 Nov 2018 11:53:02 -0800 Subject: prevent incompatible export files (osada/zap) from being imported. This is to keep your DB from getting trashed. We probably need a similar thing for item import since the object formats aren't compatible --- Zotlabs/Module/Import.php | 9 +++++++++ include/text.php | 23 +++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php index 6016328a5..0daf28aa9 100644 --- a/Zotlabs/Module/Import.php +++ b/Zotlabs/Module/Import.php @@ -127,6 +127,15 @@ class Import extends \Zotlabs\Web\Controller { // // } + + // prevent incompatible osada or zap data from horking your database + + if(array_path_exists('compatibility/codebase',$data)) { + notice('Data export format is not compatible with this software'); + return; + } + + if($moving) $seize = 1; diff --git a/include/text.php b/include/text.php index 646bfe749..edd0f7a5a 100644 --- a/include/text.php +++ b/include/text.php @@ -3467,6 +3467,28 @@ function print_val($v) { } +function array_path_exists($str,$arr) { + + $ptr = $arr; + $search = explode('/', $str); + + if($search) { + foreach($search as $s) { + if(array_key_exists($s,$ptr)) { + $ptr = $ptr[$s]; + } + else { + return false; + } + } + return true; + } + + return false; + +} + + /** * @brief Generate a unique ID. * @@ -3482,3 +3504,4 @@ function new_uuid() { return $hash; } + -- cgit v1.2.3 From 92a5b9ac41b6e60c5250307a2cd6f58802cd0fd5 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 10:34:18 +0100 Subject: Add PHOTO_CACHE photo type --- boot.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boot.php b/boot.php index c74309be0..e49134a55 100755 --- a/boot.php +++ b/boot.php @@ -53,7 +53,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '3.9.5' ); define ( 'ZOT_REVISION', '6.0a' ); -define ( 'DB_UPDATE_VERSION', 1228 ); +define ( 'DB_UPDATE_VERSION', 1229 ); define ( 'PROJECT_BASE', __DIR__ ); @@ -217,6 +217,7 @@ define ( 'PHOTO_PROFILE', 0x0001 ); define ( 'PHOTO_XCHAN', 0x0002 ); define ( 'PHOTO_THING', 0x0004 ); define ( 'PHOTO_COVER', 0x0010 ); +define ( 'PHOTO_CACHE', 0x0020 ); define ( 'PHOTO_ADULT', 0x0008 ); define ( 'PHOTO_FLAG_OS', 0x4000 ); -- cgit v1.2.3 From 72d2fe2fd46ccd37a22b2bda8b25ab366e8ba920 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 10:35:11 +0100 Subject: Add expires for photo --- install/schema_mysql.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 3e3e6fe88..49a2c476a 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -947,6 +947,7 @@ CREATE TABLE IF NOT EXISTS `photo` ( `resource_id` char(191) NOT NULL DEFAULT '', `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', + `expires` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', `title` char(191) NOT NULL DEFAULT '', `description` text NOT NULL, `album` char(191) NOT NULL DEFAULT '', @@ -979,6 +980,7 @@ CREATE TABLE IF NOT EXISTS `photo` ( KEY `xchan` (`xchan`), KEY `filesize` (`filesize`), KEY `resource_id` (`resource_id`), + KEY `expires` (`expires`), KEY `is_nsfw` (`is_nsfw`), KEY `os_storage` (`os_storage`), KEY `photo_usage` (`photo_usage`) -- cgit v1.2.3 From bb91064416e7217553c2caa4e250d0214b6ed2e4 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 10:35:56 +0100 Subject: Add expires for photo --- install/schema_postgres.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 44f98b944..1b6cab51b 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -928,6 +928,7 @@ CREATE TABLE "photo" ( "resource_id" text NOT NULL, "created" timestamp NOT NULL, "edited" timestamp NOT NULL, + "expires" timestamp NOT NULL, "title" text NOT NULL, "description" text NOT NULL, "album" text NOT NULL, @@ -961,6 +962,7 @@ create index "photo_aid" on photo ("aid"); create index "photo_xchan" on photo ("xchan"); create index "photo_filesize" on photo ("filesize"); create index "photo_resource_id" on photo ("resource_id"); +create index "photo_expires_idx" on photo ("expires"); create index "photo_usage" on photo ("photo_usage"); create index "photo_is_nsfw" on photo ("is_nsfw"); create index "photo_os_storage" on photo ("os_storage"); -- cgit v1.2.3 From bd10d48338ef7465d186b44c0982b81503ac861b Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 10:36:56 +0100 Subject: Update database with expires field for photo --- Zotlabs/Update/_1229.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Zotlabs/Update/_1229.php diff --git a/Zotlabs/Update/_1229.php b/Zotlabs/Update/_1229.php new file mode 100644 index 000000000..8e8711644 --- /dev/null +++ b/Zotlabs/Update/_1229.php @@ -0,0 +1,32 @@ + Date: Thu, 29 Nov 2018 10:37:39 +0100 Subject: Add photo cache cleanup --- Zotlabs/Daemon/Cron.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index 25e49b817..8b6b42c8a 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -94,6 +94,29 @@ class Cron { @time_sleep_until(microtime(true) + (float) $interval); } } + + // Clean expired photos from cache + + $age = get_config('system','active_expire_days', '30'); + $r = q("SELECT DISTINCT xchan, content FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s", + intval(PHOTO_CACHE), + db_utcnow(), + db_quoteinterval($age . ' DAY') + ); + if($r) { + foreach($r as $rr) { + $file = dbunescbin($rr['content']); + if(is_file($file)) { + @unlink($file); + logger('info: deleted cached photo file ' . $file, LOGGER_DEBUG); + } + } + } + q("DELETE FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s", + intval(PHOTO_CACHE), + db_utcnow(), + db_quoteinterval($age . ' DAY') + ); // publish any applicable items that were set to be published in the future // (time travel posts). Restrict to items that have come of age in the last -- cgit v1.2.3 From bd0fc8a2d7f71e9b9d6fa768fa30484bcb7e22f2 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 10:38:25 +0100 Subject: Add photo cache hooks --- Zotlabs/Module/Photo.php | 90 ++++++++++++++++++++++++++++++------------------ 1 file changed, 57 insertions(+), 33 deletions(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 30e8340e2..55e92ca04 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -1,19 +1,19 @@ false, // Cache off + 'age' => 86400, // max-age + 'exp' => true, // Use own max-age + 'leak' => false // Do not allow non members use our cache + ); + call_hooks('cache_mode_hook', $cache_mode); + $observer_xchan = get_observer_hash(); $ismodified = $_SERVER['HTTP_IF_MODIFIED_SINCE']; @@ -106,13 +114,14 @@ class Photo extends \Zotlabs\Web\Controller { License link: http://creativecommons.org/licenses/by/3.0/ */ + // @FIXME It seems this part doesn't work because we are not setting such cookie $cookie_value = false; if (isset($_COOKIE['devicePixelRatio'])) { $cookie_value = intval($_COOKIE['devicePixelRatio']); } else { // Force revalidation of cache on next request - $cache_directive = 'no-cache'; + // $prvcachecontrol = 'no-cache'; $status = 'no cookie'; } @@ -129,27 +138,44 @@ class Photo extends \Zotlabs\Web\Controller { $resolution = 1; } - $r = q("SELECT uid, photo_usage FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1", + $r = q("SELECT uid, photo_usage, expires, display_path FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1", dbesc($photo), intval($resolution) ); if($r) { - $allowed = (-1); - if(intval($r[0]['photo_usage'])) { + $u = intval($r[0]['photo_usage']); + if($u) { $allowed = 1; - if(intval($r[0]['photo_usage']) === PHOTO_COVER) + if($u === PHOTO_COVER) if($resolution < PHOTO_RES_COVER_1200) $allowed = (-1); - if(intval($r[0]['photo_usage']) === PHOTO_PROFILE) + if($u === PHOTO_PROFILE) if(! in_array($resolution,[4,5,6])) $allowed = (-1); + if($u === PHOTO_CACHE) { + $origurl = $r[0]['display_path']; + // Cached image leak protection + if(! (local_channel() || $cache_mode['leak'])) { + header("Location: " . $origurl); + killme(); + } + // Revalidate cache + if($cache_mode['on'] && strtotime($r[0]['expires']) - 60 < time()) { + $cache = array( + 'url' => $origurl, + 'uid' => $r[0]['uid'] + ); + call_hooks('cache_url_hook', $cache); + if(! $cache['status']) + http_status_exit(404,'not found'); + } + } } - if($allowed === (-1)) { + if($allowed === (-1)) $allowed = attach_can_view($r[0]['uid'],$observer_xchan,$photo); - } $channel = channelx_by_n($r[0]['uid']); @@ -160,16 +186,19 @@ class Photo extends \Zotlabs\Web\Controller { ); $exists = (($e) ? true : false); - + if($exists && $allowed) { + $expires = strtotime($e[0]['expires'] . 'Z'); $data = dbunescbin($e[0]['content']); $filesize = $e[0]['filesize']; $mimetype = $e[0]['mimetype']; $modified = strtotime($e[0]['edited'] . 'Z'); - if(intval($e[0]['os_storage'])) + + if(intval($e[0]['os_storage'])) { $streaming = $data; + } if($e[0]['allow_cid'] != '' || $e[0]['allow_gid'] != '' || $e[0]['deny_gid'] != '' || $e[0]['deny_gid'] != '') - $prvcachecontrol = true; + $prvcachecontrol = 'no-store, no-cache, must-revalidate'; } else { if(! $allowed) { @@ -180,9 +209,9 @@ class Photo extends \Zotlabs\Web\Controller { } } - } else { + } + else http_status_exit(404,'not found'); - } } header_remove('Pragma'); @@ -225,24 +254,14 @@ class Photo extends \Zotlabs\Web\Controller { $mimetype = $ph->getType(); } } - - // @FIXME Seems never invoked - // Writing in cachefile - if (isset($cachefile) && $cachefile != '') { - file_put_contents($cachefile, $data); - $modified = filemtime($cachefile); - } - - header("Content-type: " . $mimetype); - - if($prvcachecontrol) { + if(isset($prvcachecontrol)) { // it is a private photo that they have no permission to view. // tell the browser not to cache it, in case they authenticate // and subsequently have permission to see it - header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: " . $prvcachecontrol); } else { @@ -255,18 +274,23 @@ class Photo extends \Zotlabs\Web\Controller { // This has performance considerations but we highly recommend you // leave it alone. - $cache = get_config('system','photo_cache_time', 86400); // 1 day by default + $maxage = $cache_mode['age']; - header("Expires: " . gmdate("D, d M Y H:i:s", time() + $cache) . " GMT"); - header("Cache-Control: max-age=" . $cache); + if($cache_mode['exp'] || (! isset($expires)) || (isset($expires) && $expires - 60 < time())) + $expires = time() + $maxage; + else + $maxage = $expires - time(); + + header("Expires: " . gmdate("D, d M Y H:i:s", $expires) . " GMT"); + header("Cache-Control: max-age=" . $maxage); } + header("Content-type: " . $mimetype); header("Last-Modified: " . gmdate("D, d M Y H:i:s", $modified) . " GMT"); header("Content-Length: " . (isset($filesize) ? $filesize : strlen($data))); // If it's a file resource, stream it. - if($streaming && $channel) { if(strpos($streaming,'store') !== false) $istream = fopen($streaming,'rb'); -- cgit v1.2.3 From 48cd5855fe0bb530d3a26ea3a095bd3ab9c2493e Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 11:06:14 +0100 Subject: Add photo cache support using sslify() --- include/text.php | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/include/text.php b/include/text.php index 646bfe749..113448a92 100644 --- a/include/text.php +++ b/include/text.php @@ -1105,12 +1105,33 @@ function linkify($s, $me = false) { * to a local redirector which uses https and which redirects to the selected content * * @param string $s + * @param int $uid * @returns string */ -function sslify($s) { +function sslify($s, $uid) { + + // Local photo cache + if(get_config('system','photo_cache_enable', 0)) { + $matches = null; + $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); + if ($cnt) { + foreach ($matches as $match) { + logger('uid: ' . $uid . '; url: ' . $match[2], LOGGER_DEBUG); + $cache = array( + 'url' => $match[2], + 'uid' => $uid + ); + call_hooks('cache_url_hook', $cache); + logger('cache status: ' . intval($cache['status']) .'; cached as: ' . ($cache['cached'] ? $cache['hash'] : '-'), LOGGER_DEBUG); + if($cache['cached']) + $s = str_replace($match[2], z_root() . '/photo/' . $cache['hash'] . '-' . $cache['res'], $s); + } + } + } + if (strpos(z_root(),'https:') === false) return $s; - + // By default we'll only sslify img tags because media files will probably choke. // You can set sslify_everything if you want - but it will likely white-screen if it hits your php memory limit. // The downside is that http: media files will likely be blocked by your browser @@ -1118,7 +1139,7 @@ function sslify($s) { $allow = get_config('system','sslify_everything'); - $pattern = (($allow) ? "/\<(.*?)src=\"(http\:.*?)\"(.*?)\>/" : "/\/" ); + $pattern = (($allow) ? "/\<(.*?)src=[\"|'](http\:.*?)[\"|'](.*?)\>/" : "/\/" ); $matches = null; $cnt = preg_match_all($pattern,$s,$matches,PREG_SET_ORDER); @@ -1681,7 +1702,7 @@ function prepare_body(&$item,$attach = false,$opts = false) { if(local_channel() == $item['uid']) $filer = format_filer($item); - $s = sslify($s); + $s = sslify($s, $item['uid']); $prep_arr = array( 'item' => $item, @@ -3259,7 +3280,7 @@ function share_unshield($m) { } -function cleanup_bbcode($body) { +function cleanup_bbcode($body, $uid = 0) { /** * fix naked links by passing through a callback to see if this is a hubzilla site @@ -3295,7 +3316,7 @@ function cleanup_bbcode($body) { $body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body); - $body = scale_external_images($body,false); + $body = scale_external_images($body, false, false, $uid); return $body; } -- cgit v1.2.3 From d9faf6c4bb5d26d6eff5e3176b46761ea26dcf63 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 11:48:12 +0100 Subject: Update text.php --- include/text.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/text.php b/include/text.php index 113448a92..5574b9054 100644 --- a/include/text.php +++ b/include/text.php @@ -3280,7 +3280,7 @@ function share_unshield($m) { } -function cleanup_bbcode($body, $uid = 0) { +function cleanup_bbcode($body) { /** * fix naked links by passing through a callback to see if this is a hubzilla site @@ -3316,7 +3316,7 @@ function cleanup_bbcode($body, $uid = 0) { $body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body); - $body = scale_external_images($body, false, false, $uid); + $body = scale_external_images($body, false); return $body; } -- cgit v1.2.3 From 6aa99a903fd221d306c62a807cf3c1a4564f0b4d Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 11:56:56 +0100 Subject: Code cleanup --- Zotlabs/Module/Photo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 55e92ca04..b8d1c36f2 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -5,6 +5,7 @@ namespace Zotlabs\Module; require_once('include/security.php'); require_once('include/attach.php'); +require_once('include/photo/photo_driver.php'); class Photo extends \Zotlabs\Web\Controller { @@ -155,16 +156,15 @@ class Photo extends \Zotlabs\Web\Controller { if(! in_array($resolution,[4,5,6])) $allowed = (-1); if($u === PHOTO_CACHE) { - $origurl = $r[0]['display_path']; // Cached image leak protection if(! (local_channel() || $cache_mode['leak'])) { - header("Location: " . $origurl); + header("Location: " . $r[0]['display_path']); killme(); } // Revalidate cache if($cache_mode['on'] && strtotime($r[0]['expires']) - 60 < time()) { $cache = array( - 'url' => $origurl, + 'url' => $r[0]['display_path'], 'uid' => $r[0]['uid'] ); call_hooks('cache_url_hook', $cache); -- cgit v1.2.3 From d8b5f383f52274e30e02a8cf8ce77aac0a6bd910 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 16:21:50 +0100 Subject: Disable links to cached photos for non logged viewers --- include/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/text.php b/include/text.php index 5574b9054..00e12dc06 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,7 +1111,7 @@ function linkify($s, $me = false) { function sslify($s, $uid) { // Local photo cache - if(get_config('system','photo_cache_enable', 0)) { + if(get_config('system','photo_cache_enable', 0) && local_channel()) { $matches = null; $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); if ($cnt) { -- cgit v1.2.3 From 9de650e17521542d84d9d07e2c3fabfbf1519acc Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 19:13:43 +0100 Subject: Cache for viewer channel --- include/text.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/text.php b/include/text.php index 00e12dc06..a20d9564b 100644 --- a/include/text.php +++ b/include/text.php @@ -1108,18 +1108,17 @@ function linkify($s, $me = false) { * @param int $uid * @returns string */ -function sslify($s, $uid) { +function sslify($s) { // Local photo cache if(get_config('system','photo_cache_enable', 0) && local_channel()) { $matches = null; - $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); + $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); if ($cnt) { foreach ($matches as $match) { logger('uid: ' . $uid . '; url: ' . $match[2], LOGGER_DEBUG); $cache = array( - 'url' => $match[2], - 'uid' => $uid + 'url' => $match[2] ); call_hooks('cache_url_hook', $cache); logger('cache status: ' . intval($cache['status']) .'; cached as: ' . ($cache['cached'] ? $cache['hash'] : '-'), LOGGER_DEBUG); @@ -1702,7 +1701,7 @@ function prepare_body(&$item,$attach = false,$opts = false) { if(local_channel() == $item['uid']) $filer = format_filer($item); - $s = sslify($s, $item['uid']); + $s = sslify($s); $prep_arr = array( 'item' => $item, -- cgit v1.2.3 From 1a9ea6452305c44df285e16f17475a5b16b54a37 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 19:28:54 +0100 Subject: Update text.php --- include/text.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/text.php b/include/text.php index a20d9564b..bb9c6075b 100644 --- a/include/text.php +++ b/include/text.php @@ -1118,7 +1118,8 @@ function sslify($s) { foreach ($matches as $match) { logger('uid: ' . $uid . '; url: ' . $match[2], LOGGER_DEBUG); $cache = array( - 'url' => $match[2] + 'url' => $match[2], + 'uid' => local_channel() ); call_hooks('cache_url_hook', $cache); logger('cache status: ' . intval($cache['status']) .'; cached as: ' . ($cache['cached'] ? $cache['hash'] : '-'), LOGGER_DEBUG); -- cgit v1.2.3 From 3265c2e54305fd46fdb237d716d34b4e77e98e08 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 20:36:21 +0100 Subject: Skip sslify for images if it already were cached with https enabled --- include/text.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/text.php b/include/text.php index bb9c6075b..426229d36 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,7 +1111,8 @@ function linkify($s, $me = false) { function sslify($s) { // Local photo cache - if(get_config('system','photo_cache_enable', 0) && local_channel()) { + $cacheon = get_config('system','photo_cache_enable', 0); + if($cache && local_channel()) { $matches = null; $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); if ($cnt) { @@ -1138,6 +1139,10 @@ function sslify($s) { // Complain to your browser maker $allow = get_config('system','sslify_everything'); + + //We can skip next part if this only images and cache is on + if((! $allow) && $cacheon) + return $s; $pattern = (($allow) ? "/\<(.*?)src=[\"|'](http\:.*?)[\"|'](.*?)\>/" : "/\/" ); -- cgit v1.2.3 From f3831fa77fe62d8696f867259ae9f007a0a3d2ea Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 21:27:06 +0100 Subject: Better cache settings logic --- Zotlabs/Module/Photo.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index b8d1c36f2..d85db7307 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -32,10 +32,10 @@ class Photo extends \Zotlabs\Web\Controller { } $cache_mode = array( - 'on' => false, // Cache off - 'age' => 86400, // max-age - 'exp' => true, // Use own max-age - 'leak' => false // Do not allow non members use our cache + 'on' => get_config('system','photo_cache_enable', 0), + 'age' => 86400, + 'exp' => true, + 'leak' => false ); call_hooks('cache_mode_hook', $cache_mode); -- cgit v1.2.3 From d6442ec99160c1f556d9e5b7bc3b2fec76200aa1 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 23:07:39 +0100 Subject: Update text.php --- include/text.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/text.php b/include/text.php index 426229d36..234747342 100644 --- a/include/text.php +++ b/include/text.php @@ -1139,11 +1139,6 @@ function sslify($s) { // Complain to your browser maker $allow = get_config('system','sslify_everything'); - - //We can skip next part if this only images and cache is on - if((! $allow) && $cacheon) - return $s; - $pattern = (($allow) ? "/\<(.*?)src=[\"|'](http\:.*?)[\"|'](.*?)\>/" : "/\/" ); $matches = null; -- cgit v1.2.3 From 6f2d09eb205f09cdc83225b6fadff316b934e1eb Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 23:28:45 +0100 Subject: Fix wrong parameter --- include/text.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/text.php b/include/text.php index 234747342..7c0610ed9 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,10 +1111,9 @@ function linkify($s, $me = false) { function sslify($s) { // Local photo cache - $cacheon = get_config('system','photo_cache_enable', 0); - if($cache && local_channel()) { + if(get_config('system','photo_cache_enable', 0) && local_channel()) { $matches = null; - $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); + $cnt = preg_match_all("/\/", $s, $matches, PREG_SET_ORDER); if ($cnt) { foreach ($matches as $match) { logger('uid: ' . $uid . '; url: ' . $match[2], LOGGER_DEBUG); @@ -1142,7 +1141,7 @@ function sslify($s) { $pattern = (($allow) ? "/\<(.*?)src=[\"|'](http\:.*?)[\"|'](.*?)\>/" : "/\/" ); $matches = null; - $cnt = preg_match_all($pattern,$s,$matches,PREG_SET_ORDER); + $cnt = preg_match_all($pattern, $s, $matches, PREG_SET_ORDER); if ($cnt) { foreach ($matches as $match) { $filename = basename( parse_url($match[2], PHP_URL_PATH) ); -- cgit v1.2.3 From 0ee403eab3a29a98f85dc9fe304c25c6f037b24a Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 30 Nov 2018 10:50:00 +0100 Subject: Move cache code to addon --- include/text.php | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/include/text.php b/include/text.php index 7c0610ed9..866b3fa2c 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,23 +1111,13 @@ function linkify($s, $me = false) { function sslify($s) { // Local photo cache - if(get_config('system','photo_cache_enable', 0) && local_channel()) { - $matches = null; - $cnt = preg_match_all("/\/", $s, $matches, PREG_SET_ORDER); - if ($cnt) { - foreach ($matches as $match) { - logger('uid: ' . $uid . '; url: ' . $match[2], LOGGER_DEBUG); - $cache = array( - 'url' => $match[2], - 'uid' => local_channel() - ); - call_hooks('cache_url_hook', $cache); - logger('cache status: ' . intval($cache['status']) .'; cached as: ' . ($cache['cached'] ? $cache['hash'] : '-'), LOGGER_DEBUG); - if($cache['cached']) - $s = str_replace($match[2], z_root() . '/photo/' . $cache['hash'] . '-' . $cache['res'], $s); - } - } - } + $str = array( + 'body' => $s, + 'uid' => local_channel() + ); + call_hooks('cache_body_hook', $str); + + $s = $str['body']; if (strpos(z_root(),'https:') === false) return $s; -- cgit v1.2.3 From 53d9cbc69cecc0825c1e8fdc670cfe8ea09b03bf Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 30 Nov 2018 11:38:47 +0100 Subject: Check local_channel() before cache call --- include/text.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/text.php b/include/text.php index 866b3fa2c..6e4402a9f 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,13 +1111,15 @@ function linkify($s, $me = false) { function sslify($s) { // Local photo cache - $str = array( - 'body' => $s, - 'uid' => local_channel() - ); - call_hooks('cache_body_hook', $str); + if(local_channel()) { + $str = array( + 'body' => $s, + 'uid' => local_channel() + ); + call_hooks('cache_body_hook', $str); - $s = $str['body']; + $s = $str['body']; + } if (strpos(z_root(),'https:') === false) return $s; -- cgit v1.2.3 From c857ecab468d50997e3b0280178f387480ecd5a3 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 30 Nov 2018 19:56:49 +0100 Subject: Create plink depending on message id format --- include/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 2cee376d0..33ef6edad 100755 --- a/include/items.php +++ b/include/items.php @@ -420,7 +420,7 @@ function post_activity_item($arr, $allow_code = false, $deliver = true) { $arr['comment_policy'] = map_scope(PermissionLimits::Get($channel['channel_id'],'post_comments')); if ((! $arr['plink']) && (intval($arr['item_thread_top']))) { - $arr['plink'] = substr(z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . urlencode($arr['mid']),0,190); + $arr['plink'] = substr(z_root() . '/channel/' . $channel['channel_address'] . '/' . (filter_var($arr['mid'], FILTER_VALIDATE_URL) === false ? '?f=&mid=' : '') . urlencode($arr['mid']),0,190); } -- cgit v1.2.3 From 6cade7d935a489349c56165139796bd2f9cf9be6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 30 Nov 2018 13:54:17 -0800 Subject: attached photo permissions regression --- include/items.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/items.php b/include/items.php index 4ccc3e01c..8eaeb61b7 100755 --- a/include/items.php +++ b/include/items.php @@ -4631,10 +4631,10 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body, if(! stristr($image,z_root() . '/photo/')) continue; $image_uri = substr($image,strrpos($image,'/') + 1); - if(strpos($image_uri,'-') !== false) - $image_uri = substr($image_uri,0, strpos($image_uri,'-')); - if(strpos($image_uri,'.') !== false) - $image_uri = substr($image_uri,0, strpos($image_uri,'.')); + if(strrpos($image_uri,'-') !== false) + $image_uri = substr($image_uri,0, strrpos($image_uri,'-')); + if(strrpos($image_uri,'.') !== false) + $image_uri = substr($image_uri,0, strrpos($image_uri,'.')); if(! strlen($image_uri)) continue; $srch = '<' . $xchan_hash . '>'; -- cgit v1.2.3 From c6acb6191ca558fce121e7df26a8aba88beac2d9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 30 Nov 2018 19:03:14 -0800 Subject: allow notification filtering by name or addr --- Zotlabs/Lib/Enotify.php | 1 + Zotlabs/Module/Ping.php | 8 +++++++- view/js/main.js | 2 +- view/tpl/notifications_widget.tpl | 13 +++++++------ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 25c96d9cc..523ccf93a 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -828,6 +828,7 @@ class Enotify { $x = array( 'notify_link' => $item['llink'], 'name' => $item['author']['xchan_name'], + 'addr' => $item['author']['xchan_addr'], 'url' => $item['author']['xchan_url'], 'photo' => $item['author']['xchan_photo_s'], 'when' => relative_date(($edit)? $item['edited'] : $item['created']), diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index f660c3b55..12244d88c 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -330,6 +330,7 @@ class Ping extends \Zotlabs\Web\Controller { $notifs[] = array( 'notify_link' => z_root() . '/mail/' . $zz['id'], 'name' => $zz['xchan_name'], + 'addr' => $zz['xchan_addr'], 'url' => $zz['xchan_url'], 'photo' => $zz['xchan_photo_s'], 'when' => relative_date($zz['created']), @@ -383,6 +384,7 @@ class Ping extends \Zotlabs\Web\Controller { $result[] = array( 'notify_link' => z_root() . '/connections/ifpending', 'name' => $rr['xchan_name'], + 'addr' => $rr['xchan_addr'], 'url' => $rr['xchan_url'], 'photo' => $rr['xchan_photo_s'], 'when' => relative_date($rr['abook_created']), @@ -407,6 +409,7 @@ class Ping extends \Zotlabs\Web\Controller { $result[] = array( 'notify_link' => z_root() . '/admin/accounts', 'name' => $rr['account_email'], + 'addr' => $rr['account_email'], 'url' => '', 'photo' => z_root() . '/' . get_default_profile_photo(48), 'when' => relative_date($rr['account_created']), @@ -444,6 +447,7 @@ class Ping extends \Zotlabs\Web\Controller { $result[] = array( 'notify_link' => z_root() . '/events', /// @FIXME this takes you to an edit page and it may not be yours, we really want to just view the single event --> '/events/event/' . $rr['event_hash'], 'name' => $rr['xchan_name'], + 'addr' => $rr['xchan_addr'], 'url' => $rr['xchan_url'], 'photo' => $rr['xchan_photo_s'], 'when' => $when, @@ -460,7 +464,7 @@ class Ping extends \Zotlabs\Web\Controller { if(argc() > 1 && (argv(1) === 'files')) { $result = array(); - $r = q("SELECT item.created, xchan.xchan_name, xchan.xchan_url, xchan.xchan_photo_s FROM item + $r = q("SELECT item.created, xchan.xchan_name, xchan.xchan_addr, xchan.xchan_url, xchan.xchan_photo_s FROM item LEFT JOIN xchan on author_xchan = xchan_hash WHERE item.verb = '%s' AND item.obj_type = '%s' @@ -477,6 +481,7 @@ class Ping extends \Zotlabs\Web\Controller { $result[] = array( 'notify_link' => z_root() . '/sharedwithme', 'name' => $rr['xchan_name'], + 'addr' => $rr['xchan_addr'], 'url' => $rr['xchan_url'], 'photo' => $rr['xchan_photo_s'], 'when' => relative_date($rr['created']), @@ -658,6 +663,7 @@ class Ping extends \Zotlabs\Web\Controller { if($r[0]['unseen']) { $forums[$x]['notify_link'] = (($forums[$x]['private_forum']) ? $forums[$x]['xchan_url'] : z_root() . '/network/?f=&pf=1&unseen=1&cid=' . $forums[$x]['abook_id']); $forums[$x]['name'] = $forums[$x]['xchan_name']; + $forums[$x]['addr'] = $forums[$x]['xchan_addr']; $forums[$x]['url'] = $forums[$x]['xchan_url']; $forums[$x]['photo'] = $forums[$x]['xchan_photo_s']; $forums[$x]['unseen'] = $r[0]['unseen']; diff --git a/view/js/main.js b/view/js/main.js index 085bc8d0d..f4bfd413b 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -544,7 +544,7 @@ function handleNotificationsItems(notifyType, data) { notify_menu.html(''); $(data).each(function() { - html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top,this.unseen,this.private_forum); + html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.addr,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top,this.unseen,this.private_forum); notify_menu.append(html); }); diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index f43d82301..48521c81c 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -105,8 +105,9 @@ $("#nav-{{$notification.type}}-menu .notification").each(function(i, el){ var cn = $(el).data('contact_name').toString().toLowerCase(); + var ca = $(el).data('contact_addr').toString().toLowerCase(); - if(cn.indexOf(val) === -1) + if(cn.indexOf(val) === -1 && ca.indexOf(val) === -1) $(this).addClass('d-none'); else $(this).removeClass('d-none'); @@ -134,18 +135,18 @@ {{$no_notifications}}...
      -
      +
      {{if $tags}}
      -- cgit v1.2.3 From 993db01400be17c5e74dfa895c324a7116a4e97e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 11 Dec 2018 12:21:09 +0100 Subject: return on readImageBlob() exception --- include/photo/photo_imagick.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/photo/photo_imagick.php b/include/photo/photo_imagick.php index f04c00245..cb3ad27fb 100644 --- a/include/photo/photo_imagick.php +++ b/include/photo/photo_imagick.php @@ -36,6 +36,7 @@ class photo_imagick extends photo_driver { } catch (Exception $e) { logger('imagick readImageBlob() exception:' . print_r($e,true)); + return; } /** -- cgit v1.2.3 From 6464099364f3d4e800137a57d3b9ff9e8f7601e4 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 12 Dec 2018 19:11:30 -0800 Subject: regression: the ability to order apps messed up since adding pinned apps to the ordering --- Zotlabs/Lib/Apps.php | 38 +++++++++++++++++++--------- Zotlabs/Module/Appman.php | 6 ++--- Zotlabs/Module/Apporder.php | 33 +++++++++++++------------ include/nav.php | 60 +++++++++++++++++++++++++++++++++------------ view/tpl/app.tpl | 4 +-- 5 files changed, 94 insertions(+), 47 deletions(-) diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index b13658be2..8cf62c01a 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -808,12 +808,14 @@ class Apps { return($r); } - static public function app_order($uid,$apps) { + static public function app_order($uid,$apps,$menu) { if(! $apps) return $apps; - $x = (($uid) ? get_pconfig($uid,'system','app_order') : get_config('system','app_order')); + $conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order'); + + $x = (($uid) ? get_pconfig($uid,'system',$conf) : get_config('system',$conf)); if(($x) && (! is_array($x))) { $y = explode(',',$x); $y = array_map('trim',$y); @@ -850,19 +852,25 @@ class Apps { return false; } - static function moveup($uid,$guid) { + static function moveup($uid,$guid,$menu) { $syslist = array(); - $list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']); + + $conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order'); + + $list = self::app_list($uid, false, [ $menu ]); if($list) { foreach($list as $li) { - $syslist[] = self::app_encode($li); + $papp = self::app_encode($li); + if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false) + continue; + $syslist[] = $papp; } } self::translate_system_apps($syslist); usort($syslist,'self::app_name_compare'); - $syslist = self::app_order($uid,$syslist); + $syslist = self::app_order($uid,$syslist,$menu); if(! $syslist) return; @@ -887,23 +895,29 @@ class Apps { $narr[] = $x['name']; } - set_pconfig($uid,'system','app_order',implode(',',$narr)); + set_pconfig($uid,'system',$conf,implode(',',$narr)); } - static function movedown($uid,$guid) { + static function movedown($uid,$guid,$menu) { $syslist = array(); - $list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']); + + $conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order'); + + $list = self::app_list($uid, false, [ $menu ]); if($list) { foreach($list as $li) { - $syslist[] = self::app_encode($li); + $papp = self::app_encode($li); + if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false) + continue; + $syslist[] = $papp; } } self::translate_system_apps($syslist); usort($syslist,'self::app_name_compare'); - $syslist = self::app_order($uid,$syslist); + $syslist = self::app_order($uid,$syslist,$menu); if(! $syslist) return; @@ -928,7 +942,7 @@ class Apps { $narr[] = $x['name']; } - set_pconfig($uid,'system','app_order',implode(',',$narr)); + set_pconfig($uid,'system',$conf,implode(',',$narr)); } diff --git a/Zotlabs/Module/Appman.php b/Zotlabs/Module/Appman.php index f50dcc2ab..39689665e 100644 --- a/Zotlabs/Module/Appman.php +++ b/Zotlabs/Module/Appman.php @@ -90,12 +90,12 @@ class Appman extends \Zotlabs\Web\Controller { $channel = \App::get_channel(); - if(argc() > 2) { + if(argc() > 3) { if(argv(2) === 'moveup') { - Zlib\Apps::moveup(local_channel(),argv(1)); + Zlib\Apps::moveup(local_channel(),argv(1),argv(3)); } if(argv(2) === 'movedown') { - Zlib\Apps::movedown(local_channel(),argv(1)); + Zlib\Apps::movedown(local_channel(),argv(1),argv(3)); } goaway(z_root() . '/apporder'); } diff --git a/Zotlabs/Module/Apporder.php b/Zotlabs/Module/Apporder.php index a9f66ba69..eac1abc2d 100644 --- a/Zotlabs/Module/Apporder.php +++ b/Zotlabs/Module/Apporder.php @@ -17,25 +17,28 @@ class Apporder extends \Zotlabs\Web\Controller { nav_set_selected('Order Apps'); - $syslist = array(); - $list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']); - if($list) { - foreach($list as $li) { - $syslist[] = Zlib\Apps::app_encode($li); + foreach( [ 'nav_featured_app', 'nav_pinned_app' ] as $l ) { + $syslist = []; + $list = Zlib\Apps::app_list(local_channel(), false, [ $l ]); + if($list) { + foreach($list as $li) { + $syslist[] = Zlib\Apps::app_encode($li); + } } - } - Zlib\Apps::translate_system_apps($syslist); + + Zlib\Apps::translate_system_apps($syslist); - usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare'); + usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare'); - $syslist = Zlib\Apps::app_order(local_channel(),$syslist); + $syslist = Zlib\Apps::app_order(local_channel(),$syslist, $l); - foreach($syslist as $app) { - if(strpos($app['categories'],'nav_pinned_app') !== false) { - $navbar_apps[] = Zlib\Apps::app_render($app,'nav-order'); - } - else { - $nav_apps[] = Zlib\Apps::app_render($app,'nav-order'); + foreach($syslist as $app) { + if($l === 'nav_pinned_app') { + $navbar_apps[] = Zlib\Apps::app_render($app,'nav-order'); + } + elseif(strpos($app['categories'],'nav_pinned_app') === false) { + $nav_apps[] = Zlib\Apps::app_render($app,'nav-order'); + } } } diff --git a/include/nav.php b/include/nav.php index d405b9f06..58e13dd93 100644 --- a/include/nav.php +++ b/include/nav.php @@ -222,6 +222,9 @@ function nav($template = 'default') { if(! $settings_url && isset(App::$nav_sel['settings_url'])) $settings_url = App::$nav_sel['settings_url']; + $pinned_list = []; + $syslist = []; + //app bin if($is_owner) { if(get_pconfig(local_channel(), 'system','import_system_apps') !== datetime_convert('UTC','UTC','now','Y-m-d')) { @@ -234,14 +237,29 @@ function nav($template = 'default') { set_pconfig(local_channel(), 'system','force_import_system_apps', STD_VERSION); } - $syslist = array(); - $list = Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']); + $list = Apps::app_list(local_channel(), false, [ 'nav_pinned_app' ]); + if($list) { + foreach($list as $li) { + $pinned_list[] = Apps::app_encode($li); + } + } + Apps::translate_system_apps($pinned_list); + + usort($pinned_list,'Zotlabs\\Lib\\Apps::app_name_compare'); + + $pinned_list = Apps::app_order(local_channel(),$pinned_list, 'nav_pinned_app'); + + + $syslist = []; + $list = Apps::app_list(local_channel(), false, [ 'nav_featured_app' ]); + if($list) { foreach($list as $li) { $syslist[] = Apps::app_encode($li); } } Apps::translate_system_apps($syslist); + } else { $syslist = Apps::get_system_apps(true); @@ -249,26 +267,38 @@ function nav($template = 'default') { usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare'); - $syslist = Apps::app_order(local_channel(),$syslist); + $syslist = Apps::app_order(local_channel(),$syslist, 'nav_featured_app'); + - foreach($syslist as $app) { - if(\App::$nav_sel['name'] == $app['name']) - $app['active'] = true; + if($pinned_list) { + foreach($pinned_list as $app) { + if(\App::$nav_sel['name'] == $app['name']) + $app['active'] = true; - if($is_owner) { - if(strpos($app['categories'],'nav_pinned_app') !== false) { + if($is_owner) { $navbar_apps[] = Apps::app_render($app,'navbar'); } - else { - $nav_apps[] = Apps::app_render($app,'nav'); + elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) { + $navbar_apps[] = Apps::app_render($app,'navbar'); } } - elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) { - if(strpos($app['categories'],'nav_pinned_app') !== false) { - $navbar_apps[] = Apps::app_render($app,'navbar'); + } + + + if($syslist) { + foreach($syslist as $app) { + if(\App::$nav_sel['name'] == $app['name']) + $app['active'] = true; + + if($is_owner) { + if(strpos($app['categories'],'nav_pinned_app') === false) { + $nav_apps[] = Apps::app_render($app,'nav'); + } } - else { - $nav_apps[] = Apps::app_render($app,'nav'); + elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) { + if(strpos($app['categories'],'nav_pinned_app') === false) { + $nav_apps[] = Apps::app_render($app,'nav'); + } } } } diff --git a/view/tpl/app.tpl b/view/tpl/app.tpl index 6013f9548..cacbf7e64 100644 --- a/view/tpl/app.tpl +++ b/view/tpl/app.tpl @@ -31,8 +31,8 @@ {{if $icon}}{{else}}{{/if}}{{$app.name}} {{/if}} {{if $order}} - - + + {{if $icon}}{{else}}{{/if}}{{$app.name}}
      {{/if}} -- cgit v1.2.3 From f81a3ba45d50c0a0e4da68c17aba73425058e23d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 14 Dec 2018 11:23:08 +0100 Subject: fix issue with linkdropper --- view/tpl/jot-header.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 2670ba9e7..b286b6071 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -219,7 +219,7 @@ var activeCommentText = ''; } function linkdropper(event) { - var linkFound = event.dataTransfer.types.contains("text/uri-list"); + var linkFound = ((event.dataTransfer.types.indexOf("text/uri-list") > -1) ? true : false); if(linkFound) { event.preventDefault(); var editwin = '#' + event.target.id; @@ -256,7 +256,7 @@ var activeCommentText = ''; commentwin = ((editwin.indexOf('comment') >= 0) ? true : false); if(commentwin) { var commentid = editwin.substring(editwin.lastIndexOf('-') + 1); - commentOpen(document.getElementById(event.target.id),commentid); + $("#comment-edit-text-" + commentid).addClass("expanded"); } } -- cgit v1.2.3 From 3f06a857c27344263d4a361e367738e85fc30af6 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Fri, 14 Dec 2018 09:55:27 -0500 Subject: ARTICLES MODULE: Default to local_channel() user when no argv(1) is passed. --- Zotlabs/Module/Articles.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php index 58c16be45..bc6c00483 100644 --- a/Zotlabs/Module/Articles.php +++ b/Zotlabs/Module/Articles.php @@ -17,8 +17,14 @@ class Articles extends Controller { if(argc() > 1) $which = argv(1); - else - return; + + if(! $which) { + if(local_channel()) { + $channel = App::get_channel(); + if($channel && $channel['channel_address']) + $which = $channel['channel_address']; + } + } profile_load($which); -- cgit v1.2.3 From 03a214c8b9e5bac7d14776286208a153a3edcdf7 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Fri, 14 Dec 2018 10:05:41 -0500 Subject: Recreate MR#1419 for dev branch --- util/udall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/udall b/util/udall index f1d52a1d1..44f37e86e 100755 --- a/util/udall +++ b/util/udall @@ -7,7 +7,7 @@ git pull if [ -d extend ] ; then for a in theme addon widget ; do - if [ -d $a ]; then + if [ -d extend/$a ]; then for b in `ls extend/$a` ; do echo Updating $b 'util/update_'$a'_repo' $b -- cgit v1.2.3 From eb297104debfc42fe6f3afee4eae3c2602627aeb Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Fri, 14 Dec 2018 12:52:58 -0500 Subject: Make Affinity Slider (optionally) 'sticky' across page loads. (default is current behavior: reset slider with each page load) --- Zotlabs/Module/Network.php | 7 +++++++ Zotlabs/Module/Settings/Featured.php | 8 ++++++++ Zotlabs/Widget/Affinity.php | 9 +++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index b93faa612..894e5c8b6 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -132,6 +132,13 @@ class Network extends \Zotlabs\Web\Controller { $deftag = ''; + if (feature_enabled(local_channel(),'affinity')) { + $affinity_locked = int(get_pconfig(local_channel(),'affinity','lock',1)); + if ($affinity_locked) { + set_pconfig(local_channel(),'affinity','cmin',$cmin); + set_pconfig(local_channel(),'affinity','cmax',$cmax); + } + } if(x($_GET,'search') || $file || (!$pf && $cid) || $hashtags || $verb || $category || $conv || $unseen) $nouveau = true; diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index 542a05363..1d903fcf7 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -17,8 +17,12 @@ class Featured { $cmin = intval($_POST['affinity_cmin']); if($cmin < 0 || $cmin > 99) $cmin = 0; + + $lock = ($_POST['affinity_lock']) ? intval($_POST['affinity_lock']) : 1; + set_pconfig(local_channel(),'affinity','cmin',$cmin); set_pconfig(local_channel(),'affinity','cmax',$cmax); + set_pconfig(local_channel(),'affinity','lock',$lock); info( t('Affinity Slider settings updated.') . EOL); @@ -49,6 +53,10 @@ class Featured { $setting_fields .= replace_macros(get_markup_template('field_input.tpl'), array( '$field' => array('affinity_cmin', t('Default minimum affinity level'), $cmin, t('0-99 - default 0')) )); + $lock = intval(get_pconfig(local_channel(),'affinity','lock',1)); + $setting_fields .= replace_macros(get_markup_template('field_checkbox.tpl'), array( + '$field' => array('affinity_lock', t('Always reset on new page visit.'), $lock, t('default: yes'), Array('No','Yes')) + )); $settings_addons .= replace_macros(get_markup_template('generic_addon_settings.tpl'), array( '$addon' => array('affinity_slider', '' . t('Affinity Slider Settings'), '', t('Submit')), diff --git a/Zotlabs/Widget/Affinity.php b/Zotlabs/Widget/Affinity.php index 4fb2874ae..e9dac6b27 100644 --- a/Zotlabs/Widget/Affinity.php +++ b/Zotlabs/Widget/Affinity.php @@ -15,9 +15,14 @@ class Affinity { $cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : $default_cmin); $cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : $default_cmax); - if(feature_enabled(local_channel(),'affinity')) { + $affinity_locked = int(get_pconfig(local_channel(),'affinity','lock',1)); + if ($affinity_locked) { + set_pconfig(local_channel(),'affinity','cmin',$cmin); + set_pconfig(local_channel(),'affinity','cmax',$cmax); + } + $labels = array( t('Me'), t('Family'), @@ -53,4 +58,4 @@ class Affinity { return ''; } } - \ No newline at end of file + -- cgit v1.2.3 From de7cb6d6ad7902f28e63759350613ed4b30a055b Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Fri, 14 Dec 2018 13:59:41 -0500 Subject: Fix syntax error --- Zotlabs/Module/Network.php | 2 +- Zotlabs/Widget/Affinity.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 894e5c8b6..d5cc06d09 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -133,7 +133,7 @@ class Network extends \Zotlabs\Web\Controller { $deftag = ''; if (feature_enabled(local_channel(),'affinity')) { - $affinity_locked = int(get_pconfig(local_channel(),'affinity','lock',1)); + $affinity_locked = intval(get_pconfig(local_channel(),'affinity','lock',1)); if ($affinity_locked) { set_pconfig(local_channel(),'affinity','cmin',$cmin); set_pconfig(local_channel(),'affinity','cmax',$cmax); diff --git a/Zotlabs/Widget/Affinity.php b/Zotlabs/Widget/Affinity.php index e9dac6b27..28190e187 100644 --- a/Zotlabs/Widget/Affinity.php +++ b/Zotlabs/Widget/Affinity.php @@ -17,7 +17,7 @@ class Affinity { if(feature_enabled(local_channel(),'affinity')) { - $affinity_locked = int(get_pconfig(local_channel(),'affinity','lock',1)); + $affinity_locked = intval(get_pconfig(local_channel(),'affinity','lock',1)); if ($affinity_locked) { set_pconfig(local_channel(),'affinity','cmin',$cmin); set_pconfig(local_channel(),'affinity','cmax',$cmax); -- cgit v1.2.3 From 3416190e4b8887b91e497529d9e9bb60231beca9 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Fri, 14 Dec 2018 14:22:28 -0500 Subject: Set min/maxversion for plugins to STD_VERSION unless otherwise specified --- include/plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/plugin.php b/include/plugin.php index 8ceb6417e..7eeb39ce8 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -736,8 +736,8 @@ function get_theme_info($theme){ 'description' => '', 'author' => array(), 'version' => '', - 'minversion' => '', - 'maxversion' => '', + 'minversion' => STD_VERSION, + 'maxversion' => STD_VERSION, 'compat' => '', 'credits' => '', 'maintainer' => array(), -- cgit v1.2.3 From 4ff3c57976705ce2b7964536d55dabb308cc25dd Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 14 Dec 2018 21:46:48 +0100 Subject: update changelog --- CHANGELOG | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 444c7b2e4..a3dd1336b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,15 @@ +Hubzilla 3.8.7 (2018-12-14) + - Fix issue with linkdropper in comment area + - Fix regression wit app ordering + - Fix return if readImnageBlob() throws an exception + - Introduce photo_view_filter hook + - Fix home notifications not expanding in certain situations + - Fix for dark schema + - Fix total identities restriction + - Fix article page title not updating if article has no title + - Gallery: the gallery app will now act as the full-size photo viewer in /photos if installed + + Hubzilla 3.8.6 (2018-12-03) - Prevent incompatible export files (osada/zap) from being imported - Catch exception if readImageBlob() receives bogus data -- cgit v1.2.3 From 09b2cdd618217c2dfc0149579ce1780c201a50ea Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Fri, 14 Dec 2018 20:20:26 -0500 Subject: Add ITEM_TYPE_CUSTOM and hooks for processing custom item types --- boot.php | 2 ++ doc/hook/item_custom.bb | 24 ++++++++++++++++++++++++ doc/hook/item_stored.bb | 18 ++++++++++++++++++ doc/hook/item_stored_update.bb | 15 +++++++++++++++ doc/hooklist.bb | 9 +++++++++ include/items.php | 30 ++++++++++++++++++++++++++++++ 6 files changed, 98 insertions(+) create mode 100644 doc/hook/item_custom.bb create mode 100644 doc/hook/item_stored.bb create mode 100644 doc/hook/item_stored_update.bb diff --git a/boot.php b/boot.php index 4087ec006..1d3897114 100755 --- a/boot.php +++ b/boot.php @@ -576,6 +576,8 @@ define ( 'ITEM_TYPE_BUG', 4 ); define ( 'ITEM_TYPE_DOC', 5 ); define ( 'ITEM_TYPE_CARD', 6 ); define ( 'ITEM_TYPE_ARTICLE', 7 ); +//OSADA ITEM_TYPE_MAIL = 8 +define ( 'ITEM_TYPE_CUSTOM', 9 ); define ( 'ITEM_IS_STICKY', 1000 ); diff --git a/doc/hook/item_custom.bb b/doc/hook/item_custom.bb new file mode 100644 index 000000000..d20c7d76c --- /dev/null +++ b/doc/hook/item_custom.bb @@ -0,0 +1,24 @@ +[h2]item_custom[/h2] + +Allow addons to create and process custom item types. + +Addon authors will need to use iconfig meta data (with sharing on) or some other method +to specify and determine whether the custom item is destined for their addon. + +It is fed an array of ['item' => ${item_array}, 'allow_exec' => {true/false}] + +By default $arr['item']['cancel'] is set to TRUE which will abort storage of the +custom item in the item table unless the addon unsets it or sets it to false. + +[code] + if ($arr['item_type']==ITEM_TYPE_CUSTOM) { + /* Custom items are not stored by default + because they require an addon to process. */ + $d['item']['cancel']=true; + + call_hooks('item_custom',$d); + } + +[/code] + +see: include/items.php diff --git a/doc/hook/item_stored.bb b/doc/hook/item_stored.bb new file mode 100644 index 000000000..8d706cb4e --- /dev/null +++ b/doc/hook/item_stored.bb @@ -0,0 +1,18 @@ +[h2]item_stored[/h2] + +Allow addons to continue processing after an item has been stored in the event +that they need access to the item_id or other data that gets assigned during +the storage process. + +It is fed an array of type item (including terms and iconfig data). + +[code] + /** + * @hooks item_stored + * Called after new item is stored in the database. + * (By this time we have an item_id and other frequently needed info.) + */ + call_hooks('item_stored',$arr); +[/code] + +see: include/items.php diff --git a/doc/hook/item_stored_update.bb b/doc/hook/item_stored_update.bb new file mode 100644 index 000000000..4532a347c --- /dev/null +++ b/doc/hook/item_stored_update.bb @@ -0,0 +1,15 @@ +[h2]item_stored_update[/h2] + +Allow addons to continue processing after an item update has been stored + +It is fed an array of type item (including terms and iconfig data). + +[code] + /** + * @hooks item_stored_update + * Called after updated item is stored in the database. + */ + call_hooks('item_stored_update',$arr); +[/code] + +see: include/items.php diff --git a/doc/hooklist.bb b/doc/hooklist.bb index 5d12a139e..08fc587e2 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -343,9 +343,18 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/item_store]item_store[/zrl] Called when item_store() stores a record of type item +[zrl=[baseurl]/help/hook/item_stored]item_stored[/zrl] + Called after item_store() has stored a record of type item in the database. + +[zrl=[baseurl]/help/hook/item_custom]item_custom[/zrl] + Called before item_store() stores a record of type item (allowing addons to process ITEM_TYPE_CUSTOM items). + [zrl=[baseurl]/help/hook/item_store_update]item_store_update[/zrl] Called when item_store_update() is called to update a stored item. +[zrl=[baseurl]/help/hook/item_stored_update]item_stored_update[/zrl] + Called after item_store_update() has updated a stored item. + [zrl=[baseurl]/help/hook/item_translate]item_translate[/zrl] Called from item_store and item_store_update after the post language has been autodetected diff --git a/include/items.php b/include/items.php index 0cbca23fc..02d31fcb5 100755 --- a/include/items.php +++ b/include/items.php @@ -1591,6 +1591,14 @@ function item_store($arr, $allow_exec = false, $deliver = true) { 'item' => $arr, 'allow_exec' => $allow_exec ]; + + if ($arr['item_type']==ITEM_TYPE_CUSTOM) { + /* Custom items are not stored by default + because they require an addon to process. */ + $d['item']['cancel']=true; + + call_hooks('item_custom',$d); + } /** * @hooks item_store * Called when item_store() stores a record of type item. @@ -2016,6 +2024,13 @@ function item_store($arr, $allow_exec = false, $deliver = true) { */ call_hooks('post_remote_end', $arr); + /** + * @hooks item_stored + * Called after new item is stored in the database. + * (By this time we have an item_id and other frequently needed info.) + */ + call_hooks('item_stored',$arr); + item_update_parent_commented($arr); // If _creating_ a deleted item, don't propagate it further or send out notifications. @@ -2049,6 +2064,15 @@ function item_store_update($arr, $allow_exec = false, $deliver = true) { 'item' => $arr, 'allow_exec' => $allow_exec ]; + + if ($arr['item_type']==ITEM_TYPE_CUSTOM) { + /* Custom items are not stored by default + because they require an addon to process. */ + $d['item']['cancel']=true; + + call_hooks('item_custom_update',$d); + } + /** * @hooks item_store_update * Called when item_store_update() is called to update a stored item. It @@ -2339,6 +2363,12 @@ function item_store_update($arr, $allow_exec = false, $deliver = true) { */ call_hooks('post_remote_update_end', $arr); + /** + * @hooks item_stored_update + * Called after updated item is stored in the database. + */ + call_hooks('item_stored_update',$arr); + if($deliver) { send_status_notifications($orig_post_id,$arr); tag_deliver($uid,$orig_post_id); -- cgit v1.2.3 From 919ea9f750fbb665a655cd26ae86c00e424a4318 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 15 Dec 2018 18:19:29 +0100 Subject: fix wiki preview issue with hyperlinks --- Zotlabs/Module/Wiki.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 892810241..502f96a62 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -442,8 +442,8 @@ class Wiki extends Controller { $mimeType = $_POST['mimetype']; if($mimeType === 'text/bbcode') { - $linkconverted = NativeWikiPage::convert_links($content,$wikiURL); - $html = zidify_links(smilies(bbcode($linkconverted))); + $html = zidify_links(smilies(bbcode($content))); + $html = NativeWikiPage::convert_links($html,$wikiURL); } elseif($mimeType === 'text/markdown') { $linkconverted = NativeWikiPage::convert_links($content,$wikiURL); -- cgit v1.2.3 From 6a825cc504901b6c09724e487f43b5012805c6a0 Mon Sep 17 00:00:00 2001 From: Pascal Deklerck Date: Sat, 15 Dec 2018 22:19:18 +0100 Subject: Update OAuth2Storage.php - fix email retrieval in getUser --- Zotlabs/Identity/OAuth2Storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Identity/OAuth2Storage.php b/Zotlabs/Identity/OAuth2Storage.php index bbf61cf2b..a4ba9c526 100644 --- a/Zotlabs/Identity/OAuth2Storage.php +++ b/Zotlabs/Identity/OAuth2Storage.php @@ -64,7 +64,7 @@ class OAuth2Storage extends \OAuth2\Storage\Pdo { return( [ 'webfinger' => channel_reddress($x), 'portable_id' => $x['channel_hash'], - 'email' => $a['account_email'], + 'email' => $a[0]['account_email'], 'username' => $x['channel_address'], 'user_id' => $x['channel_id'], 'name' => $x['channel_name'], -- cgit v1.2.3 From 5bcc379530e6789f59397dc39f4da66cc8c5b2ae Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sat, 15 Dec 2018 19:49:59 -0500 Subject: Add return if no local_channel() --- Zotlabs/Module/Articles.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php index bc6c00483..ca132c01e 100644 --- a/Zotlabs/Module/Articles.php +++ b/Zotlabs/Module/Articles.php @@ -23,7 +23,9 @@ class Articles extends Controller { $channel = App::get_channel(); if($channel && $channel['channel_address']) $which = $channel['channel_address']; - } + } else { + return; + } } profile_load($which); -- cgit v1.2.3 From e0d68664c461f5649c760536c77532ef8c2e4818 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sun, 16 Dec 2018 20:48:36 +0100 Subject: Remove photo_cache_enable variable --- Zotlabs/Module/Photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index ddff3a68e..7365a5f64 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -32,7 +32,7 @@ class Photo extends \Zotlabs\Web\Controller { } $cache_mode = array( - 'on' => get_config('system','photo_cache_enable', 0), + 'on' => false, 'age' => 86400, 'exp' => true, 'leak' => false -- cgit v1.2.3 From 1c07428f8968dc52c0bead76509fcd5400a8c5fd Mon Sep 17 00:00:00 2001 From: phani00 Date: Sun, 16 Dec 2018 20:35:20 +0000 Subject: add warning if upload_filesize < 4MB. --- Zotlabs/Module/Setup.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index c0716ca7c..b2d42418e 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -441,13 +441,19 @@ class Setup extends \Zotlabs\Web\Controller { require_once 'include/environment.php'; $help = ''; + $mem_warning = ''; $result = getPhpiniUploadLimits(); + if($result['post_max_size'] < 4194304 || $result['max_upload_filesize'] < 4194304) { + $mem_warning = '' .t('This is not sufficient to upload larger images or files. You should be able to upload at least 4 MB at once.') . ''; + } $help = sprintf(t('Your max allowed total upload size is set to %s. Maximum size of one file to upload is set to %s. You are allowed to upload up to %d files at once.'), userReadableSize($result['post_max_size']), userReadableSize($result['max_upload_filesize']), $result['max_file_uploads'] ); + $help .= $mem_warning; + $help .= '

      ' . t('You can adjust these settings in the server php.ini file.'); $this->check_add($checks, t('PHP upload limits'), true, false, $help); -- cgit v1.2.3 From 14735e0a48c3df8aef4817dcdee1e5e64de4ccaa Mon Sep 17 00:00:00 2001 From: phani00 Date: Sun, 16 Dec 2018 22:04:28 +0100 Subject: Update Zotlabs/Module/Setup.php --- Zotlabs/Module/Setup.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index b2d42418e..370b7b9f8 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -453,7 +453,6 @@ class Setup extends \Zotlabs\Web\Controller { $result['max_file_uploads'] ); $help .= $mem_warning; - $help .= '

      ' . t('You can adjust these settings in the server php.ini file.'); $this->check_add($checks, t('PHP upload limits'), true, false, $help); -- cgit v1.2.3 From 04a45a407ead8e7afcdd3423b773074207e885df Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 16 Dec 2018 14:38:58 -0800 Subject: default curl to http/1.1 --- include/network.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/network.php b/include/network.php index cd352e7db..df59a30e6 100644 --- a/include/network.php +++ b/include/network.php @@ -120,6 +120,14 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } + if(array_key_exists('http_version',$opts)) { + @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); + } + else { + @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); + } + + if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); if(x($opts,'cookiefile')) @@ -290,6 +298,13 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } + if(array_key_exists('http_version',$opts)) { + @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); + } + else { + @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); + } + if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); if(x($opts,'cookiefile')) -- cgit v1.2.3 From 363ad01bce15313c0536cd5f0e437db0a133ee06 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 17 Dec 2018 00:30:36 +0100 Subject: SSLify cached URL on redirect if needed --- Zotlabs/Module/Photos.php | 1602 +++++++-------------------------------------- 1 file changed, 245 insertions(+), 1357 deletions(-) diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index b87c586da..967a3b703 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -1,1424 +1,312 @@ 1) { - $nick = argv(1); - - profile_load($nick); - - $channelx = channelx_by_nick($nick); - - if(! $channelx) - return; - - \App::$data['channel'] = $channelx; - - $observer = \App::get_observer(); - \App::$data['observer'] = $observer; - - $observer_xchan = (($observer) ? $observer['xchan_hash'] : ''); - - head_set_icon(\App::$data['channel']['xchan_photo_s']); - - \App::$page['htmlhead'] .= "" ; - - } - - return; - } - - - - function post() { - - logger('mod-photos: photos_post: begin' , LOGGER_DEBUG); - - logger('mod_photos: REQUEST ' . print_r($_REQUEST,true), LOGGER_DATA); - logger('mod_photos: FILES ' . print_r($_FILES,true), LOGGER_DATA); - - $ph = photo_factory(''); - - $phototypes = $ph->supportedTypes(); - - $can_post = false; - - $page_owner_uid = \App::$data['channel']['channel_id']; - - if(perm_is_allowed($page_owner_uid,get_observer_hash(),'write_storage')) - $can_post = true; - - if(! $can_post) { - notice( t('Permission denied.') . EOL ); - if(is_ajax()) - killme(); - return; - } - - $s = abook_self($page_owner_uid); - - if(! $s) { - notice( t('Page owner information could not be retrieved.') . EOL); - logger('mod_photos: post: unable to locate contact record for page owner. uid=' . $page_owner_uid); - if(is_ajax()) + + $streaming = null; + $channel = null; + $person = 0; + $renew = false; + + switch(argc()) { + case 4: + $person = argv(3); + $res = argv(2); + $type = argv(1); + break; + case 2: + $photo = argv(1); + break; + case 1: + default: killme(); - return; + // NOTREACHED } - - $owner_record = $s[0]; - - $acl = new \Zotlabs\Access\AccessList(\App::$data['channel']); - - if((argc() > 3) && (argv(2) === 'album')) { - - $album = argv(3); - if(! photos_album_exists($page_owner_uid, get_observer_hash(), $album)) { - notice( t('Album not found.') . EOL); - goaway(z_root() . '/' . $_SESSION['photo_return']); - } - - - /* - * DELETE photo album and all its photos - */ - - if($_REQUEST['dropalbum'] == t('Delete Album')) { - + $cache_mode = array( + 'on' => false, + 'age' => 86400, + 'exp' => true, + 'leak' => false + ); + call_hooks('cache_mode_hook', $cache_mode); - $folder_hash = ''; - - $r = q("select * from attach where is_dir = 1 and uid = %d and hash = '%s'", - intval($page_owner_uid), - dbesc($album) - ); - if(! $r) { - notice( t('Album not found.') . EOL); - return; - } - $folder_hash = $r[0]['hash']; - - - $res = array(); - $admin_delete = false; - - // get the list of photos we are about to delete - - if(remote_channel() && (! local_channel())) { - $str = photos_album_get_db_idstr($page_owner_uid,$album,remote_channel()); - } - elseif(local_channel()) { - $str = photos_album_get_db_idstr(local_channel(),$album); - } - elseif(is_site_admin()) { - $str = photos_album_get_db_idstr_admin($page_owner_uid,$album); - $admin_delete = true; - } - else { - $str = null; - } - if(! $str) { - goaway(z_root() . '/' . $_SESSION['photo_return']); - } - - $r = q("select id from item where resource_id in ( $str ) and resource_type = 'photo' and uid = %d " . item_normal(), - intval($page_owner_uid) - ); - if($r) { - foreach($r as $i) { - attach_delete($page_owner_uid, $i['resource_id'], true ); - } - } - - // remove the associated photos in case they weren't attached to an item - - q("delete from photo where resource_id in ( $str ) and uid = %d", - intval($page_owner_uid) - ); - - // @FIXME do the same for the linked attach - - if($folder_hash) { - attach_delete($page_owner_uid, $folder_hash, true ); + $observer_xchan = get_observer_hash(); + $ismodified = $_SERVER['HTTP_IF_MODIFIED_SINCE']; - if(! $admin_delete) { - $sync = attach_export_data(\App::$data['channel'],$folder_hash, true); + if(isset($type)) { - if($sync) - build_sync_packet($page_owner_uid,array('file' => array($sync))); - } + /** + * Profile photos - Access controls on default profile photos are not honoured since they need to be exchanged with remote sites. + * + */ + + $default = get_default_profile_photo(); + + if($type === 'profile') { + switch($res) { + case 'm': + $resolution = 5; + $default = get_default_profile_photo(80); + break; + case 's': + $resolution = 6; + $default = get_default_profile_photo(48); + break; + case 'l': + default: + $resolution = 4; + break; } - } - - goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address']); - } - if((argc() > 2) && (x($_REQUEST,'delete')) && ($_REQUEST['delete'] === t('Delete Photo'))) { - // same as above but remove single photo - - $ob_hash = get_observer_hash(); - if(! $ob_hash) - goaway(z_root() . '/' . $_SESSION['photo_return']); - - $r = q("SELECT id, resource_id FROM photo WHERE ( xchan = '%s' or uid = %d ) AND resource_id = '%s' LIMIT 1", - dbesc($ob_hash), - intval(local_channel()), - dbesc(argv(2)) - ); - - if($r) { - attach_delete($page_owner_uid, $r[0]['resource_id'], true ); - $sync = attach_export_data(\App::$data['channel'],$r[0]['resource_id'], true); - - if($sync) - build_sync_packet($page_owner_uid,array('file' => array($sync))); - } - elseif(is_site_admin()) { - // If the admin deletes a photo, don't sync - attach_delete($page_owner_uid, argv(2), true); - } + $modified = filemtime($default); + $default = z_root() . '/' . $default; + $uid = $person; + $d = [ 'imgscale' => $resolution, 'channel_id' => $uid, 'default' => $default, 'data' => '', 'mimetype' => '' ]; + call_hooks('get_profile_photo',$d); - goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $_SESSION['album_return']); - } - - if((argc() > 2) && array_key_exists('move_to_album',$_POST)) { - $m = q("select folder from attach where hash = '%s' and uid = %d limit 1", - dbesc(argv(2)), - intval($page_owner_uid) - ); - if(($m) && ($m[0]['folder'] != $_POST['move_to_album'])) { - attach_move($page_owner_uid,argv(2),$_POST['move_to_album']); - - $sync = attach_export_data(\App::$data['channel'],argv(2),true); - if($sync) - build_sync_packet($page_owner_uid,array('file' => array($sync))); - - if(! ($_POST['desc'] && $_POST['newtag'])) - goaway(z_root() . '/' . $_SESSION['photo_return']); - } - } + $resolution = $d['imgscale']; + $uid = $d['channel_id']; + $default = $d['default']; + $data = $d['data']; + $mimetype = $d['mimetype']; - if((argc() > 2) && ((x($_POST,'desc') !== false) || (x($_POST,'newtag') !== false))) { - - $desc = ((x($_POST,'desc')) ? notags(trim($_POST['desc'])) : ''); - $rawtags = ((x($_POST,'newtag')) ? notags(trim($_POST['newtag'])) : ''); - $item_id = ((x($_POST,'item_id')) ? intval($_POST['item_id']) : 0); - - $is_nsfw = ((x($_POST,'adult')) ? intval($_POST['adult']) : 0); - - $acl->set_from_array($_POST); - $perm = $acl->get(); - - $resource_id = argv(2); - - if((x($_POST,'rotate') !== false) && - ( (intval($_POST['rotate']) == 1) || (intval($_POST['rotate']) == 2) )) { - logger('rotate'); - - $r = q("select * from photo where resource_id = '%s' and uid = %d and imgscale = 0 limit 1", - dbesc($resource_id), - intval($page_owner_uid) + if(! $data) { + $r = q("SELECT * FROM photo WHERE imgscale = %d AND uid = %d AND photo_usage = %d LIMIT 1", + intval($resolution), + intval($uid), + intval(PHOTO_PROFILE) ); - if(count($r)) { - $d = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($r[0]['content'])) : dbunescbin($r[0]['content'])); - $ph = photo_factory($d, $r[0]['mimetype']); - if($ph->is_valid()) { - $rotate_deg = ( (intval($_POST['rotate']) == 1) ? 270 : 90 ); - $ph->rotate($rotate_deg); - - $width = $ph->getWidth(); - $height = $ph->getHeight(); - - if(intval($r[0]['os_storage'])) { - @file_put_contents($r[0]['content'],$ph->imageString()); - $data = $r[0]['content']; - $fsize = @filesize($r[0]['content']); - q("update attach set filesize = %d where hash = '%s' and uid = %d", - intval($fsize), - dbesc($resource_id), - intval($page_owner_uid) - ); - } - else { - $data = $ph->imageString(); - $fsize = strlen($data); - } - - $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 0", - dbesc(datetime_convert()), - dbescbin($data), - intval($fsize), - intval($height), - intval($width), - dbesc($resource_id), - intval($page_owner_uid) - ); - - if($width > 1024 || $height > 1024) - $ph->scaleImage(1024); - - $width = $ph->getWidth(); - $height = $ph->getHeight(); - $data = $ph->imageString(); - $fsize = strlen($data); - - $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 1", - dbesc(datetime_convert()), - dbescbin($data), - intval($fsize), - intval($height), - intval($width), - dbesc($resource_id), - intval($page_owner_uid) - ); - - - if($width > 640 || $height > 640) - $ph->scaleImage(640); - - $width = $ph->getWidth(); - $height = $ph->getHeight(); - $data = $ph->imageString(); - $fsize = strlen($data); - - $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 2", - dbesc(datetime_convert()), - dbescbin($data), - intval($fsize), - intval($height), - intval($width), - dbesc($resource_id), - intval($page_owner_uid) - ); - - - if($width > 320 || $height > 320) - $ph->scaleImage(320); - - $width = $ph->getWidth(); - $height = $ph->getHeight(); - $data = $ph->imageString(); - $fsize = strlen($data); - - $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 3", - dbesc(datetime_convert()), - dbescbin($data), - intval($fsize), - intval($height), - intval($width), - dbesc($resource_id), - intval($page_owner_uid) - ); - } - } - } - - $p = q("SELECT mimetype, is_nsfw, description, resource_id, imgscale, allow_cid, allow_gid, deny_cid, deny_gid FROM photo WHERE resource_id = '%s' AND uid = %d ORDER BY imgscale DESC", - dbesc($resource_id), - intval($page_owner_uid) - ); - if($p) { - $ext = $phototypes[$p[0]['mimetype']]; - - $r = q("UPDATE photo SET description = '%s', allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' WHERE resource_id = '%s' AND uid = %d", - dbesc($desc), - dbesc($perm['allow_cid']), - dbesc($perm['allow_gid']), - dbesc($perm['deny_cid']), - dbesc($perm['deny_gid']), - dbesc($resource_id), - intval($page_owner_uid) - ); - } - - $item_private = (($str_contact_allow || $str_group_allow || $str_contact_deny || $str_group_deny) ? true : false); - - $old_is_nsfw = $p[0]['is_nsfw']; - if($old_is_nsfw != $is_nsfw) { - $r = q("update photo set is_nsfw = %d where resource_id = '%s' and uid = %d", - intval($is_nsfw), - dbesc($resource_id), - intval($page_owner_uid) - ); - } - - /* Don't make the item visible if the only change was the album name */ - - $visibility = 0; - if($p[0]['description'] !== $desc || strlen($rawtags)) - $visibility = 1; - - if(! $item_id) { - $item_id = photos_create_item(\App::$data['channel'],get_observer_hash(),$p[0],$visibility); - - } - - if($item_id) { - $r = q("SELECT * FROM item WHERE id = %d AND uid = %d LIMIT 1", - intval($item_id), - intval($page_owner_uid) - ); - - if($r) { - $old_tag = $r[0]['tag']; - $old_inform = $r[0]['inform']; - } - } - - - // make sure the linked item has the same permissions as the photo regardless of any other changes - $x = q("update item set allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s', item_private = %d - where id = %d", - dbesc($perm['allow_cid']), - dbesc($perm['allow_gid']), - dbesc($perm['deny_cid']), - dbesc($perm['deny_gid']), - intval($acl->is_private()), - intval($item_id) - ); - - // make sure the attach has the same permissions as the photo regardless of any other changes - $x = q("update attach set allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' where hash = '%s' and uid = %d and is_photo = 1", - dbesc($perm['allow_cid']), - dbesc($perm['allow_gid']), - dbesc($perm['deny_cid']), - dbesc($perm['deny_gid']), - dbesc($resource_id), - intval($page_owner_uid) - ); - - - - if(strlen($rawtags)) { - - $str_tags = ''; - $inform = ''; - - // if the new tag doesn't have a namespace specifier (@foo or #foo) give it a mention - - $x = substr($rawtags,0,1); - if($x !== '@' && $x !== '#') - $rawtags = '@' . $rawtags; - - require_once('include/text.php'); - $profile_uid = \App::$profile['profile_uid']; - - $results = linkify_tags($a, $rawtags, (local_channel()) ? local_channel() : $profile_uid); - - $success = $results['success']; - $post_tags = array(); - - foreach($results as $result) { - $success = $result['success']; - if($success['replaced']) { - $post_tags[] = array( - 'uid' => $profile_uid, - 'ttype' => $success['termtype'], - 'otype' => TERM_OBJ_POST, - 'term' => $success['term'], - 'url' => $success['url'] - ); - } - } - - $r = q("select * from item where id = %d and uid = %d limit 1", - intval($item_id), - intval($page_owner_uid) - ); - if($r) { - $r = fetch_post_tags($r,true); - $datarray = $r[0]; - if($post_tags) { - if((! array_key_exists('term',$datarray)) || (! is_array($datarray['term']))) - $datarray['term'] = $post_tags; - else - $datarray['term'] = array_merge($datarray['term'],$post_tags); - } - item_store_update($datarray,$execflag); + $modified = strtotime($r[0]['edited'] . "Z"); + $data = dbunescbin($r[0]['content']); + $mimetype = $r[0]['mimetype']; } - + if(intval($r[0]['os_storage'])) + $data = file_get_contents($data); } - $sync = attach_export_data(\App::$data['channel'],$resource_id); - - if($sync) - build_sync_packet($page_owner_uid,array('file' => array($sync))); - - goaway(z_root() . '/' . $_SESSION['photo_return']); - return; // NOTREACHED - - - } - - - /** - * default post action - upload a photo - */ - - $channel = \App::$data['channel']; - $observer = \App::$data['observer']; - - $_REQUEST['source'] = 'photos'; - require_once('include/attach.php'); - - if(! local_channel()) { - $_REQUEST['contact_allow'] = expand_acl($channel['channel_allow_cid']); - $_REQUEST['group_allow'] = expand_acl($channel['channel_allow_gid']); - $_REQUEST['contact_deny'] = expand_acl($channel['channel_deny_cid']); - $_REQUEST['group_deny'] = expand_acl($channel['channel_deny_gid']); - } - - - $matches = []; - $partial = false; - - - - if(array_key_exists('HTTP_CONTENT_RANGE',$_SERVER)) { - $pm = preg_match('/bytes (\d*)\-(\d*)\/(\d*)/',$_SERVER['HTTP_CONTENT_RANGE'],$matches); - if($pm) { - logger('Content-Range: ' . print_r($matches,true)); - $partial = true; - } - } - - if($partial) { - $x = save_chunk($channel,$matches[1],$matches[2],$matches[3]); - - if($x['partial']) { - header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0)); - json_return_and_die($result); - } - else { - header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0)); - - $_FILES['userfile'] = [ - 'name' => $x['name'], - 'type' => $x['type'], - 'tmp_name' => $x['tmp_name'], - 'error' => $x['error'], - 'size' => $x['size'] - ]; - } - } - else { - if(! array_key_exists('userfile',$_FILES)) { - $_FILES['userfile'] = [ - 'name' => $_FILES['files']['name'], - 'type' => $_FILES['files']['type'], - 'tmp_name' => $_FILES['files']['tmp_name'], - 'error' => $_FILES['files']['error'], - 'size' => $_FILES['files']['size'] - ]; + if(! $data) { + $x = z_fetch_url($default,true,0,[ 'novalidate' => true ]); + $data = ($x['success'] ? $x['body'] : EMPTY_STR); + $mimetype = 'image/png'; } } - - $r = attach_store($channel,get_observer_hash(), '', $_REQUEST); - - if(! $r['success']) { - notice($r['message'] . EOL); - goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address']); - } - - goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $r['data']['folder']); - - } - - - - function get() { - - // URLs: - // photos/name - // photos/name/album/xxxxx (xxxxx is album name) - // photos/name/image/xxxxx - - - if(observer_prohibited()) { - notice( t('Public access denied.') . EOL); - return; - } - - $unsafe = ((array_key_exists('unsafe',$_REQUEST) && $_REQUEST['unsafe']) ? 1 : 0); - - require_once('include/bbcode.php'); - require_once('include/security.php'); - require_once('include/conversation.php'); - - if(! x(\App::$data,'channel')) { - notice( t('No photos selected') . EOL ); - return; - } - - $ph = photo_factory(''); - $phototypes = $ph->supportedTypes(); - - $_SESSION['photo_return'] = \App::$cmd; - - // - // Parse arguments - // - - $can_comment = perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),'post_comments'); - - if(argc() > 3) { - $datatype = argv(2); - $datum = argv(3); - } else { - if(argc() > 2) { - $datatype = argv(2); - $datum = ''; - } - else - $datatype = 'summary'; - } - - if(argc() > 4) - $cmd = argv(4); - else - $cmd = 'view'; - - // - // Setup permissions structures - // - - $can_post = false; - $visitor = 0; - - - $owner_uid = \App::$data['channel']['channel_id']; - $owner_aid = \App::$data['channel']['channel_account_id']; - - $observer = \App::get_observer(); - - $can_post = perm_is_allowed($owner_uid,$observer['xchan_hash'],'write_storage'); - $can_view = perm_is_allowed($owner_uid,$observer['xchan_hash'],'view_storage'); - - if(! $can_view) { - notice( t('Access to this item is restricted.') . EOL); - return; - } + else { - $sql_item = item_permissions_sql($owner_uid,get_observer_hash()); - $sql_extra = permissions_sql($owner_uid,get_observer_hash(),'photo'); - $sql_attach = permissions_sql($owner_uid,get_observer_hash(),'attach'); - - nav_set_selected('Photos'); + /** + * Other photos + */ - $o = ' - - '; - + /* Check for a cookie to indicate display pixel density, in order to detect high-resolution + displays. This procedure was derived from the "Retina Images" by Jeremey Worboys, + used in accordance with the Creative Commons Attribution 3.0 Unported License. + Project link: https://github.com/Retina-Images/Retina-Images + License link: http://creativecommons.org/licenses/by/3.0/ + */ - $o .= "\r\n"; - - $_is_owner = (local_channel() && (local_channel() == $owner_uid)); - - /** - * Display upload form - */ - - if( $can_post) { - - $uploader = ''; - - $ret = array('post_url' => z_root() . '/photos/' . \App::$data['channel']['channel_address'], - 'addon_text' => $uploader, - 'default_upload' => true); - - call_hooks('photo_upload_form',$ret); - - /* Show space usage */ - - $r = q("select sum(filesize) as total from photo where aid = %d and imgscale = 0 ", - intval(\App::$data['channel']['channel_account_id']) - ); - - - $limit = engr_units_to_bytes(service_class_fetch(\App::$data['channel']['channel_id'],'photo_upload_limit')); - if($limit !== false) { - $usage_message = sprintf( t("%1$.2f MB of %2$.2f MB photo storage used."), $r[0]['total'] / 1024000, $limit / 1024000 ); + // @FIXME It seems this part doesn't work because we are not setting such cookie + $cookie_value = false; + if (isset($_COOKIE['devicePixelRatio'])) { + $cookie_value = intval($_COOKIE['devicePixelRatio']); } else { - $usage_message = sprintf( t('%1$.2f MB photo storage used.'), $r[0]['total'] / 1024000 ); - } - - if($_is_owner) { - $channel = \App::get_channel(); - - $acl = new \Zotlabs\Access\AccessList($channel); - $channel_acl = $acl->get(); - - $lockstate = (($acl->is_private()) ? 'lock' : 'unlock'); + // Force revalidation of cache on next request + // $prvcachecontrol = 'no-cache'; + $status = 'no cookie'; } - $aclselect = (($_is_owner) ? populate_acl($channel_acl,false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_storage')) : ''); - - // this is wrong but is to work around an issue with js_upload wherein it chokes if these variables - // don't exist. They really should be set to a parseable representation of the channel's default permissions - // which can be processed by getSelected() - - if(! $aclselect) { - $aclselect = ''; - } - - $selname = ''; - - if($datum) { - $h = attach_by_hash_nodata($datum,get_observer_hash()); - $selname = $h['data']['display_path']; - } - - - $albums = ((array_key_exists('albums', \App::$data)) ? \App::$data['albums'] : photos_albums_list(\App::$data['channel'],\App::$data['observer'])); - - if(! $selname) { - $def_album = get_pconfig(\App::$data['channel']['channel_id'],'system','photo_path'); - if($def_album) { - $selname = filepath_macro($def_album); - $albums['album'][] = array('text' => $selname); - } - } - - $tpl = get_markup_template('photos_upload.tpl'); - $upload_form = replace_macros($tpl,array( - '$pagename' => t('Upload Photos'), - '$sessid' => session_id(), - '$usage' => $usage_message, - '$nickname' => \App::$data['channel']['channel_address'], - '$newalbum_label' => t('Enter an album name'), - '$newalbum_placeholder' => t('or select an existing album (doubleclick)'), - '$visible' => array('visible', t('Create a status post for this upload'), 0,'', array(t('No'), t('Yes')), 'onclick="showHideBodyTextarea();"'), - '$caption' => array('description', t('Title (optional)')), - '$body' => array('body', t('Description (optional)'),'', 'Description will only appear in the status post'), - '$albums' => $albums['albums'], - '$selname' => $selname, - '$permissions' => t('Permissions'), - '$aclselect' => $aclselect, - '$allow_cid' => acl2json($channel_acl['allow_cid']), - '$allow_gid' => acl2json($channel_acl['allow_gid']), - '$deny_cid' => acl2json($channel_acl['deny_cid']), - '$deny_gid' => acl2json($channel_acl['deny_gid']), - '$lockstate' => $lockstate, - '$uploader' => $ret['addon_text'], - '$default' => (($ret['default_upload']) ? true : false), - '$uploadurl' => $ret['post_url'], - '$submit' => t('Upload') - - )); - - } - - // - // dispatch request - // - - /* - * Display a single photo album - */ - - if($datatype === 'album') { - - head_add_link([ - 'rel' => 'alternate', - 'type' => 'application/json+oembed', - 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string), - 'title' => 'oembed' - ]); - - if($x = photos_album_exists($owner_uid, get_observer_hash(), $datum)) { - \App::set_pager_itemspage(60); - $album = $x['display_path']; - } - else { - goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address']); - } - - if($_GET['order'] === 'posted') - $order = 'ASC'; - else - $order = 'DESC'; - - $r = q("SELECT p.resource_id, p.id, p.filename, p.mimetype, p.imgscale, p.description, p.created FROM photo p INNER JOIN - (SELECT resource_id, max(imgscale) imgscale FROM photo left join attach on folder = '%s' and photo.resource_id = attach.hash WHERE attach.uid = %d AND imgscale <= 4 AND photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY resource_id) ph - ON (p.resource_id = ph.resource_id AND p.imgscale = ph.imgscale) - ORDER BY created $order LIMIT %d OFFSET %d", - dbesc($x['hash']), - intval($owner_uid), - intval(PHOTO_NORMAL), - intval(PHOTO_PROFILE), - intval($unsafe), - intval(\App::$pager['itemspage']), - intval(\App::$pager['start']) - ); - - // edit album name - $album_edit = null; - - if($can_post) { - $album_e = $album; - $albums = ((array_key_exists('albums', \App::$data)) ? \App::$data['albums'] : photos_albums_list(\App::$data['channel'],\App::$data['observer'])); + $resolution = 0; - // @fixme - syncronise actions with DAV + if(strpos($photo,'.') !== false) + $photo = substr($photo,0,strpos($photo,'.')); - // $edit_tpl = get_markup_template('album_edit.tpl'); - // $album_edit = replace_macros($edit_tpl,array( - // '$nametext' => t('Enter a new album name'), - // '$name_placeholder' => t('or select an existing one (doubleclick)'), - // '$nickname' => \App::$data['channel']['channel_address'], - // '$album' => $album_e, - // '$albums' => $albums['albums'], - // '$hexalbum' => bin2hex($album), - // '$submit' => t('Submit'), - // '$dropsubmit' => t('Delete Album') - // )); - - } - - if($_GET['order'] === 'posted') - $order = array(t('Show Newest First'), z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $datum); - else - $order = array(t('Show Oldest First'), z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $datum . '?f=&order=posted'); - - $photos = array(); - if(count($r)) { - $twist = 'rotright'; - foreach($r as $rr) { - - if($twist == 'rotright') - $twist = 'rotleft'; - else - $twist = 'rotright'; - - $ext = $phototypes[$rr['mimetype']]; - - $imgalt_e = $rr['filename']; - $desc_e = $rr['description']; - - $imagelink = (z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $rr['resource_id'] - . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '')); - - $photos[] = array( - 'id' => $rr['id'], - 'twist' => ' ' . $twist . rand(2,4), - 'link' => $imagelink, - 'title' => t('View Photo'), - 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['imgscale'] . '.' .$ext, - 'alt' => $imgalt_e, - 'desc'=> $desc_e, - 'ext' => $ext, - 'hash'=> $rr['resource_id'], - 'unknown' => t('Unknown') - ); - } - } - - if($_REQUEST['aj']) { - if($photos) { - $o = replace_macros(get_markup_template('photosajax.tpl'),array( - '$photos' => $photos, - '$album_id' => $datum - )); - } - else { - $o = '
      '; - } - echo $o; - killme(); - } - else { - $o .= ""; - $tpl = get_markup_template('photo_album.tpl'); - $o .= replace_macros($tpl, array( - '$photos' => $photos, - '$album' => $album, - '$album_id' => $datum, - '$album_edit' => array(t('Edit Album'), $album_edit), - '$can_post' => $can_post, - '$upload' => array(t('Add Photos'), z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/upload/' . $datum), - '$order' => $order, - '$upload_form' => $upload_form, - '$usage' => $usage_message - )); - - } - - if((! $photos) && ($_REQUEST['aj'])) { - $o .= '
      '; - echo $o; - killme(); + if(substr($photo,-2,1) == '-') { + $resolution = intval(substr($photo,-1,1)); + $photo = substr($photo,0,-2); + // If viewing on a high-res screen, attempt to serve a higher resolution image: + if ($resolution == 2 && ($cookie_value > 1)) + $resolution = 1; } - - return $o; - - } - - /** - * Display one photo - */ - - if($datatype === 'image') { - - \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; - - $x = q("select folder from attach where hash = '%s' and uid = %d $sql_attach limit 1", - dbesc($datum), - intval($owner_uid) + + $r = q("SELECT uid, photo_usage, display_path FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1", + dbesc($photo), + intval($resolution) ); + if($r) { + $allowed = (-1); + + $u = intval($r[0]['photo_usage']); + if($u) { + $allowed = 1; + if($u === PHOTO_COVER) + if($resolution < PHOTO_RES_COVER_1200) + $allowed = (-1); + if($u === PHOTO_PROFILE) + if(! in_array($resolution,[4,5,6])) + $allowed = (-1); + if($u === PHOTO_CACHE) { + // Validate cache + $cache = array( + 'resid' => $photo, + 'uid' => $r[0]['uid'], + 'status' => false + ); + if($cache_mode['on']) + call_hooks('cache_url_hook', $cache); + if(! $cache['status']) { + $url = htmlspecialchars_decode($r[0]['display_path']); + call_hooks('cache_sslify_hook', $url); + header("Location: " . $url); + killme(); + } + } + } - // fetch image, item containing image, then comments - - $ph = q("SELECT id,aid,uid,xchan,resource_id,created,edited,title,description,album,filename,mimetype,height,width,filesize,imgscale,photo_usage,is_nsfw,allow_cid,allow_gid,deny_cid,deny_gid FROM photo WHERE uid = %d AND resource_id = '%s' - $sql_extra ORDER BY imgscale ASC ", - intval($owner_uid), - dbesc($datum) - ); - - if(! ($ph && $x)) { - - /* Check again - this time without specifying permissions */ - - $ph = q("SELECT id FROM photo WHERE uid = %d AND resource_id = '%s' LIMIT 1", - intval($owner_uid), - dbesc($datum) - ); - if($ph) - notice( t('Permission denied. Access to this item may be restricted.') . EOL); - else - notice( t('Photo not available') . EOL ); - return; - } - - - - $prevlink = ''; - $nextlink = ''; - - if($_GET['order'] === 'posted') - $order = 'ASC'; - else - $order = 'DESC'; - + if($allowed === (-1)) + $allowed = attach_can_view($r[0]['uid'],$observer_xchan,$photo); - $prvnxt = q("SELECT hash FROM attach WHERE folder = '%s' AND uid = %d AND is_photo = 1 - $sql_attach ORDER BY created $order ", - dbesc($x[0]['folder']), - intval($owner_uid) - ); + $channel = channelx_by_n($r[0]['uid']); - if(count($prvnxt)) { - for($z = 0; $z < count($prvnxt); $z++) { - if($prvnxt[$z]['hash'] == $ph[0]['resource_id']) { - $prv = $z - 1; - $nxt = $z + 1; - if($prv < 0) - $prv = count($prvnxt) - 1; - if($nxt >= count($prvnxt)) - $nxt = 0; - break; + // Now we'll see if we can access the photo + $e = q("SELECT * FROM photo WHERE resource_id = '%s' AND imgscale = %d $sql_extra LIMIT 1", + dbesc($photo), + intval($resolution) + ); + + $exists = (($e) ? true : false); + + if($exists && $allowed) { + $expires = strtotime($e[0]['expires'] . 'Z'); + $data = dbunescbin($e[0]['content']); + $filesize = $e[0]['filesize']; + $mimetype = $e[0]['mimetype']; + $modified = strtotime($e[0]['edited'] . 'Z'); + + if(intval($e[0]['os_storage'])) { + $streaming = $data; } - } - - $prevlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['hash'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); - $nextlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['hash'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); - } - - - if(count($ph) == 1) - $hires = $lores = $ph[0]; - if(count($ph) > 1) { - if($ph[1]['imgscale'] == 2) { - // original is 640 or less, we can display it directly - $hires = $lores = $ph[0]; + if($e[0]['allow_cid'] != '' || $e[0]['allow_gid'] != '' || $e[0]['deny_gid'] != '' || $e[0]['deny_gid'] != '') + $prvcachecontrol = 'no-store, no-cache, must-revalidate'; } else { - $hires = $ph[0]; - $lores = $ph[1]; - } - } - - $album_link = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $x[0]['folder']; - $tools = Null; - $lock = Null; - - if($can_post && ($ph[0]['uid'] == $owner_uid)) { - $tools = array( - 'profile'=>array(z_root() . '/profile_photo/use/'.$ph[0]['resource_id'], t('Use as profile photo')), - 'cover'=>array(z_root() . '/cover_photo/use/'.$ph[0]['resource_id'], t('Use as cover photo')), - ); - } - - // lockstate - $lockstate = ( ( (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid']) - || strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid'])) ) - ? array('lock', t('Private Photo')) - : array('unlock', Null)); - - \App::$page['htmlhead'] .= ''; - - if($prevlink) - $prevlink = array($prevlink, t('Previous')); - - $photo = array( - 'href' => z_root() . '/photo/' . $hires['resource_id'] . '-' . $hires['imgscale'] . '.' . $phototypes[$hires['mimetype']], - 'title'=> t('View Full Size'), - 'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['imgscale'] . '.' . $phototypes[$lores['mimetype']] . '?f=&_u=' . datetime_convert('','','','ymdhis') - ); - - if($nextlink) - $nextlink = array($nextlink, t('Next')); - - - // Do we have an item for this photo? - - $linked_items = q("SELECT * FROM item WHERE resource_id = '%s' and resource_type = 'photo' - $sql_item LIMIT 1", - dbesc($datum) - ); - - $map = null; - - if($linked_items) { - - xchan_query($linked_items); - $linked_items = fetch_post_tags($linked_items,true); - - $link_item = $linked_items[0]; - $item_normal = item_normal(); - - $r = q("select * from item where parent_mid = '%s' - $item_normal and uid = %d $sql_item ", - dbesc($link_item['mid']), - intval($link_item['uid']) - - ); - - if($r) { - xchan_query($r); - $r = fetch_post_tags($r,true); - $r = conv_sort($r,'commented'); - } - - $tags = array(); - if($link_item['term']) { - $cnt = 0; - foreach($link_item['term'] as $t) { - $tags[$cnt] = array(0 => format_term_for_display($t)); - if($can_post && ($ph[0]['uid'] == $owner_uid)) { - $tags[$cnt][1] = 'tagrm/drop/' . $link_item['id'] . '/' . bin2hex($t['term']); //?f=&item=' . $link_item['id']; - $tags[$cnt][2] = t('Remove'); - } - $cnt ++; + if(! $allowed) { + http_status_exit(403,'forbidden'); } + if(! $exists) { + http_status_exit(404,'not found'); + } + } - - if((local_channel()) && (local_channel() == $link_item['uid'])) { - q("UPDATE item SET item_unseen = 0 WHERE parent = %d and uid = %d and item_unseen = 1", - intval($link_item['parent']), - intval(local_channel()) - ); - } - - if($link_item['coord']) { - $map = generate_map($link_item['coord']); - } - } - - // logger('mod_photo: link_item' . print_r($link_item,true)); - - // FIXME - remove this when we move to conversation module - - $r = $r[0]['children']; + } + else + http_status_exit(404,'not found'); + } - $edit = null; - if($can_post) { + header_remove('Pragma'); - $album_e = $ph[0]['album']; - $caption_e = $ph[0]['description']; - $aclselect_e = (($_is_owner) ? populate_acl($ph[0], true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_storage')) : ''); - $albums = ((array_key_exists('albums', \App::$data)) ? \App::$data['albums'] : photos_albums_list(\App::$data['channel'],\App::$data['observer'])); - - $_SESSION['album_return'] = bin2hex($ph[0]['album']); + if($ismodified === gmdate("D, d M Y H:i:s", $modified) . " GMT") { + header_remove('Expires'); + header_remove('Cache-Control'); + header_remove('Set-Cookie'); + http_status_exit(304,'not modified'); + } - $folder_list = attach_folder_select_list($ph[0]['uid']); - - $edit = [ - 'edit' => t('Edit photo'), - 'id' => $link_item['id'], - 'rotatecw' => t('Rotate CW (right)'), - 'rotateccw' => t('Rotate CCW (left)'), - 'albums' => $albums['albums'], - 'album' => $album_e, - 'album_select' => [ 'move_to_album', t('Move photo to album'), $x[0]['folder'], '', $folder_list ], - 'newalbum_label' => t('Enter a new album name'), - 'newalbum_placeholder' => t('or select an existing one (doubleclick)'), - 'nickname' => \App::$data['channel']['channel_address'], - 'resource_id' => $ph[0]['resource_id'], - 'capt_label' => t('Title (optional)'), - 'caption' => $caption_e, - 'tag_label' => t('Add a Tag'), - 'permissions' => t('Permissions'), - 'aclselect' => $aclselect_e, - 'allow_cid' => acl2json($ph[0]['allow_cid']), - 'allow_gid' => acl2json($ph[0]['allow_gid']), - 'deny_cid' => acl2json($ph[0]['deny_cid']), - 'deny_gid' => acl2json($ph[0]['deny_gid']), - 'lockstate' => $lockstate[0], - 'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com'), - 'item_id' => ((count($linked_items)) ? $link_item['id'] : 0), - 'adult_enabled' => feature_enabled($owner_uid,'adult_photo_flagging'), - 'adult' => array('adult',t('Flag as adult in album view'), intval($ph[0]['is_nsfw']),''), - 'submit' => t('Submit'), - 'delete' => t('Delete Photo') - ]; - } - - if(count($linked_items)) { - - $cmnt_tpl = get_markup_template('comment_item.tpl'); - $tpl = get_markup_template('photo_item.tpl'); - $return_url = \App::$cmd; - - $like_tpl = get_markup_template('like_noshare.tpl'); - - $likebuttons = ''; - - if($observer && ($can_post || $can_comment)) { - $likebuttons = [ - 'id' => $link_item['id'], - 'likethis' => t("I like this \x28toggle\x29"), - 'nolike' => t("I don't like this \x28toggle\x29"), - 'share' => t('Share'), - 'wait' => t('Please wait') - ]; - } - - $comments = ''; - if(! $r) { - if($observer && ($can_post || $can_comment)) { - $feature_auto_save_draft = ((feature_enabled($owner_uid, 'auto_save_draft')) ? "true" : "false"); - $commentbox = replace_macros($cmnt_tpl,array( - '$return_path' => '', - '$mode' => 'photos', - '$jsreload' => $return_url, - '$type' => 'wall-comment', - '$id' => $link_item['id'], - '$parent' => $link_item['id'], - '$profile_uid' => $owner_uid, - '$mylink' => $observer['xchan_url'], - '$mytitle' => t('This is you'), - '$myphoto' => $observer['xchan_photo_s'], - '$comment' => t('Comment'), - '$submit' => t('Submit'), - '$preview' => t('Preview'), - '$ww' => '', - '$feature_encrypt' => false, - '$auto_save_draft' => $feature_auto_save_draft - )); - } + if(! isset($data)) { + if(isset($resolution)) { + switch($resolution) { + case 4: + $default = get_default_profile_photo(); + break; + case 5: + $default = get_default_profile_photo(80); + break; + case 6: + $default = get_default_profile_photo(48); + break; + default: + killme(); + // NOTREACHED + break; } + $x = z_fetch_url(z_root() . '/' . $default,true,0,[ 'novalidate' => true ]); + $data = ($x['success'] ? $x['body'] : EMPTY_STR); + $mimetype = 'image/png'; + } + } - $alike = array(); - $dlike = array(); - - $like = ''; - $dislike = ''; - - $conv_responses = array( - 'like' => array('title' => t('Likes','title')),'dislike' => array('title' => t('Dislikes','title')), - 'agree' => array('title' => t('Agree','title')),'disagree' => array('title' => t('Disagree','title')), 'abstain' => array('title' => t('Abstain','title')), - 'attendyes' => array('title' => t('Attending','title')), 'attendno' => array('title' => t('Not attending','title')), 'attendmaybe' => array('title' => t('Might attend','title')) - ); - - - - - if($r) { - - foreach($r as $item) { - builtin_activity_puller($item, $conv_responses); - } - - $like_count = ((x($alike,$link_item['mid'])) ? $alike[$link_item['mid']] : ''); - $like_list = ((x($alike,$link_item['mid'])) ? $alike[$link_item['mid'] . '-l'] : ''); + if(isset($res) && intval($res) && $res < 500) { + $ph = photo_factory($data, $mimetype); + if($ph->is_valid()) { + $ph->scaleImageSquare($res); + $data = $ph->imageString(); + $mimetype = $ph->getType(); + } + } - if(is_array($like_list) && (count($like_list) > MAX_LIKERS)) { - $like_list_part = array_slice($like_list, 0, MAX_LIKERS); - array_push($like_list_part, '' . t('View all') . ''); - } else { - $like_list_part = ''; - } - $like_button_label = tt('Like','Likes',$like_count,'noun'); + if(isset($prvcachecontrol)) { - //if (feature_enabled($conv->get_profile_owner(),'dislike')) { - $dislike_count = ((x($dlike,$link_item['mid'])) ? $dlike[$link_item['mid']] : ''); - $dislike_list = ((x($dlike,$link_item['mid'])) ? $dlike[$link_item['mid'] . '-l'] : ''); - $dislike_button_label = tt('Dislike','Dislikes',$dislike_count,'noun'); - if (is_array($dislike_list) && (count($dislike_list) > MAX_LIKERS)) { - $dislike_list_part = array_slice($dislike_list, 0, MAX_LIKERS); - array_push($dislike_list_part, '' . t('View all') . ''); - } else { - $dislike_list_part = ''; - } - //} - - - $like = ((isset($alike[$link_item['mid']])) ? format_like($alike[$link_item['mid']],$alike[$link_item['mid'] . '-l'],'like',$link_item['mid']) : ''); - $dislike = ((isset($dlike[$link_item['mid']])) ? format_like($dlike[$link_item['mid']],$dlike[$link_item['mid'] . '-l'],'dislike',$link_item['mid']) : ''); - - // display comments - - foreach($r as $item) { - $comment = ''; - $template = $tpl; - $sparkle = ''; - - if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent'])) - continue; - - $redirect_url = z_root() . '/redir/' . $item['cid'] ; - - - $profile_url = zid($item['author']['xchan_url']); - $sparkle = ''; - - - $profile_name = $item['author']['xchan_name']; - $profile_avatar = $item['author']['xchan_photo_m']; - - $profile_link = $profile_url; - - $drop = ''; - - if($observer['xchan_hash'] === $item['author_xchan'] || $observer['xchan_hash'] === $item['owner_xchan']) - $drop = replace_macros(get_markup_template('photo_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); + // it is a private photo that they have no permission to view. + // tell the browser not to cache it, in case they authenticate + // and subsequently have permission to see it + header("Cache-Control: " . $prvcachecontrol); - $name_e = $profile_name; - $title_e = $item['title']; - unobscure($item); - $body_e = prepare_text($item['body'],$item['mimetype']); - - $comments .= replace_macros($template,array( - '$id' => $item['id'], - '$mode' => 'photos', - '$profile_url' => $profile_link, - '$name' => $name_e, - '$thumb' => $profile_avatar, - '$sparkle' => $sparkle, - '$title' => $title_e, - '$body' => $body_e, - '$ago' => relative_date($item['created']), - '$indent' => (($item['parent'] != $item['id']) ? ' comment' : ''), - '$drop' => $drop, - '$comment' => $comment - )); - - } - - if($observer && ($can_post || $can_comment)) { - $commentbox = replace_macros($cmnt_tpl,array( - '$return_path' => '', - '$jsreload' => $return_url, - '$type' => 'wall-comment', - '$id' => $link_item['id'], - '$parent' => $link_item['id'], - '$profile_uid' => $owner_uid, - '$mylink' => $observer['xchan_url'], - '$mytitle' => t('This is you'), - '$myphoto' => $observer['xchan_photo_s'], - '$comment' => t('Comment'), - '$submit' => t('Submit'), - '$ww' => '' - )); - } - - } - $paginate = paginate($a); - } + } + else { + // The photo cache default is 1 day to provide a privacy trade-off, + // as somebody reducing photo permissions on a photo that is already + // "in the wild" won't be able to stop the photo from being viewed + // for this amount amount of time once it is in the browser cache. + // The privacy expectations of your site members and their perception + // of privacy where it affects the entire project may be affected. + // This has performance considerations but we highly recommend you + // leave it alone. + + $maxage = $cache_mode['age']; + + if($cache_mode['exp'] || (! isset($expires)) || (isset($expires) && $expires - 60 < time())) + $expires = time() + $maxage; + else + $maxage = $expires - time(); - $album_e = array($album_link,$ph[0]['album']); - $like_e = $like; - $dislike_e = $dislike; + header("Expires: " . gmdate("D, d M Y H:i:s", $expires) . " GMT"); + header("Cache-Control: max-age=" . $maxage); - - $response_verbs = array('like'); - if(feature_enabled($owner_uid,'dislike')) - $response_verbs[] = 'dislike'; - - $responses = get_responses($conv_responses,$response_verbs,'',$link_item); - - $hookdata = [ - 'onclick' => '$.colorbox({href: \'' . $photo['href'] . '\'}); return false;', - 'raw_photo' => $ph[0], - 'nickname' => \App::$data['channel']['channel_address'] - ]; - call_hooks('photo_view_filter', $hookdata); - - $photo_tpl = get_markup_template('photo_view.tpl'); - $o .= replace_macros($photo_tpl, array( - '$id' => $ph[0]['id'], - '$album' => $album_e, - '$tools_label' => t('Photo Tools'), - '$tools' => $tools, - '$lock' => $lockstate[1], - '$photo' => $photo, - '$prevlink' => $prevlink, - '$nextlink' => $nextlink, - '$desc' => $ph[0]['description'], - '$filename' => $ph[0]['filename'], - '$unknown' => t('Unknown'), - '$tag_hdr' => t('In This Photo:'), - '$tags' => $tags, - 'responses' => $responses, - '$edit' => $edit, - '$map' => $map, - '$map_text' => t('Map'), - '$likebuttons' => $likebuttons, - '$like' => $like_e, - '$dislike' => $dislike_e, - '$like_count' => $like_count, - '$like_list' => $like_list, - '$like_list_part' => $like_list_part, - '$like_button_label' => $like_button_label, - '$like_modal_title' => t('Likes','noun'), - '$dislike_modal_title' => t('Dislikes','noun'), - '$dislike_count' => $dislike_count, //((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_count : ''), - '$dislike_list' => $dislike_list, //((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_list : ''), - '$dislike_list_part' => $dislike_list_part, //((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_list_part : ''), - '$dislike_button_label' => $dislike_button_label, //((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_button_label : ''), - '$modal_dismiss' => t('Close'), - '$comments' => $comments, - '$commentbox' => $commentbox, - '$paginate' => $paginate, - '$onclick' => $hookdata['onclick'] - )); - - \App::$data['photo_html'] = $o; - - return $o; } - - // Default - show recent photos with upload link (if applicable) - //$o = ''; - - \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; - - - \App::set_pager_itemspage(60); - - $r = q("SELECT p.resource_id, p.id, p.filename, p.mimetype, p.album, p.imgscale, p.created, p.display_path - FROM photo p - INNER JOIN ( SELECT resource_id, max(imgscale) imgscale FROM photo - WHERE photo.uid = %d AND photo_usage IN ( %d, %d ) - AND is_nsfw = %d $sql_extra group by resource_id ) ph - ON (p.resource_id = ph.resource_id and p.imgscale = ph.imgscale) - ORDER by p.created DESC LIMIT %d OFFSET %d", - intval(\App::$data['channel']['channel_id']), - intval(PHOTO_NORMAL), - intval(PHOTO_PROFILE), - intval($unsafe), - intval(\App::$pager['itemspage']), - intval(\App::$pager['start']) - ); - - - - $photos = array(); - if($r) { - $twist = 'rotright'; - foreach($r as $rr) { - - if(! attach_can_view_folder(\App::$data['channel']['channel_id'],get_observer_hash(),$rr['resource_id'])) - continue; - if($twist == 'rotright') - $twist = 'rotleft'; - else - $twist = 'rotright'; - $ext = $phototypes[$rr['mimetype']]; - - $alt_e = $rr['filename']; - $name_e = dirname($rr['display_path']); + header("Content-type: " . $mimetype); + header("Last-Modified: " . gmdate("D, d M Y H:i:s", $modified) . " GMT"); + header("Content-Length: " . (isset($filesize) ? $filesize : strlen($data))); - $photos[] = array( - 'id' => $rr['id'], - 'twist' => ' ' . $twist . rand(2,4), - 'link' => z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $rr['resource_id'], - 'title' => t('View Photo'), - 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . ((($rr['imgscale']) == 6) ? 4 : $rr['imgscale']) . '.' . $ext, - 'alt' => $alt_e, - 'album' => array( - 'name' => $name_e, - ), - - ); - } - } - - if($_REQUEST['aj']) { - if($photos) { - $o = replace_macros(get_markup_template('photosajax.tpl'),array( - '$photos' => $photos, - '$album_id' => bin2hex(t('Recent Photos')) - )); - } - else { - $o = '
      '; + // If it's a file resource, stream it. + if($streaming && $channel) { + if(strpos($streaming,'store') !== false) + $istream = fopen($streaming,'rb'); + else + $istream = fopen('store/' . $channel['channel_address'] . '/' . $streaming,'rb'); + $ostream = fopen('php://output','wb'); + if($istream && $ostream) { + pipe_streams($istream,$ostream); + fclose($istream); + fclose($ostream); } - echo $o; - killme(); } else { - $o .= ""; - $tpl = get_markup_template('photos_recent.tpl'); - $o .= replace_macros($tpl, array( - '$title' => t('Recent Photos'), - '$album_id' => bin2hex(t('Recent Photos')), - '$can_post' => $can_post, - '$upload' => array(t('Add Photos'), z_root().'/photos/'.\App::$data['channel']['channel_address'].'/upload'), - '$photos' => $photos, - '$upload_form' => $upload_form, - '$usage' => $usage_message - )); - - } - - if((! $photos) && ($_REQUEST['aj'])) { - $o .= '
      '; - echo $o; - killme(); + echo $data; } - - // paginate($a); - return $o; + + killme(); } - } -- cgit v1.2.3 From 1b0a6fe9ebe8e5ae8a142745a53e228df2c6bbcf Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 17 Dec 2018 00:58:46 +0100 Subject: SSLify cached URL on redirect if needed --- Zotlabs/Module/Photo.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 7365a5f64..967a3b703 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -165,7 +165,9 @@ class Photo extends \Zotlabs\Web\Controller { if($cache_mode['on']) call_hooks('cache_url_hook', $cache); if(! $cache['status']) { - header("Location: " . htmlspecialchars_decode($r[0]['display_path'])); + $url = htmlspecialchars_decode($r[0]['display_path']); + call_hooks('cache_sslify_hook', $url); + header("Location: " . $url); killme(); } } -- cgit v1.2.3 From 72dc6ea77c0c6aa439ea5f7a47130fbb354175ce Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 17 Dec 2018 01:16:08 +0100 Subject: Revert Photos.php code --- Zotlabs/Module/Photos.php | 1602 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 1357 insertions(+), 245 deletions(-) diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 967a3b703..b87c586da 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -1,312 +1,1424 @@ 1) { + $nick = argv(1); + + profile_load($nick); + + $channelx = channelx_by_nick($nick); + + if(! $channelx) + return; + + \App::$data['channel'] = $channelx; + + $observer = \App::get_observer(); + \App::$data['observer'] = $observer; + + $observer_xchan = (($observer) ? $observer['xchan_hash'] : ''); + + head_set_icon(\App::$data['channel']['xchan_photo_s']); + + \App::$page['htmlhead'] .= "" ; + + } + + return; + } + + + + function post() { + + logger('mod-photos: photos_post: begin' , LOGGER_DEBUG); + + logger('mod_photos: REQUEST ' . print_r($_REQUEST,true), LOGGER_DATA); + logger('mod_photos: FILES ' . print_r($_FILES,true), LOGGER_DATA); + + $ph = photo_factory(''); + + $phototypes = $ph->supportedTypes(); + + $can_post = false; + + $page_owner_uid = \App::$data['channel']['channel_id']; + + if(perm_is_allowed($page_owner_uid,get_observer_hash(),'write_storage')) + $can_post = true; + + if(! $can_post) { + notice( t('Permission denied.') . EOL ); + if(is_ajax()) + killme(); + return; + } + + $s = abook_self($page_owner_uid); + + if(! $s) { + notice( t('Page owner information could not be retrieved.') . EOL); + logger('mod_photos: post: unable to locate contact record for page owner. uid=' . $page_owner_uid); + if(is_ajax()) killme(); - // NOTREACHED + return; } + + $owner_record = $s[0]; + + $acl = new \Zotlabs\Access\AccessList(\App::$data['channel']); + + if((argc() > 3) && (argv(2) === 'album')) { + + $album = argv(3); - $cache_mode = array( - 'on' => false, - 'age' => 86400, - 'exp' => true, - 'leak' => false - ); - call_hooks('cache_mode_hook', $cache_mode); + if(! photos_album_exists($page_owner_uid, get_observer_hash(), $album)) { + notice( t('Album not found.') . EOL); + goaway(z_root() . '/' . $_SESSION['photo_return']); + } + + + /* + * DELETE photo album and all its photos + */ + + if($_REQUEST['dropalbum'] == t('Delete Album')) { + - $observer_xchan = get_observer_hash(); - $ismodified = $_SERVER['HTTP_IF_MODIFIED_SINCE']; + $folder_hash = ''; + + $r = q("select * from attach where is_dir = 1 and uid = %d and hash = '%s'", + intval($page_owner_uid), + dbesc($album) + ); + if(! $r) { + notice( t('Album not found.') . EOL); + return; + } + $folder_hash = $r[0]['hash']; + + + $res = array(); + $admin_delete = false; - if(isset($type)) { + // get the list of photos we are about to delete - /** - * Profile photos - Access controls on default profile photos are not honoured since they need to be exchanged with remote sites. - * - */ - - $default = get_default_profile_photo(); - - if($type === 'profile') { - switch($res) { - case 'm': - $resolution = 5; - $default = get_default_profile_photo(80); - break; - case 's': - $resolution = 6; - $default = get_default_profile_photo(48); - break; - case 'l': - default: - $resolution = 4; - break; + if(remote_channel() && (! local_channel())) { + $str = photos_album_get_db_idstr($page_owner_uid,$album,remote_channel()); + } + elseif(local_channel()) { + $str = photos_album_get_db_idstr(local_channel(),$album); } + elseif(is_site_admin()) { + $str = photos_album_get_db_idstr_admin($page_owner_uid,$album); + $admin_delete = true; + } + else { + $str = null; + } + if(! $str) { + goaway(z_root() . '/' . $_SESSION['photo_return']); + } + + $r = q("select id from item where resource_id in ( $str ) and resource_type = 'photo' and uid = %d " . item_normal(), + intval($page_owner_uid) + ); + if($r) { + foreach($r as $i) { + attach_delete($page_owner_uid, $i['resource_id'], true ); + } + } + + // remove the associated photos in case they weren't attached to an item + + q("delete from photo where resource_id in ( $str ) and uid = %d", + intval($page_owner_uid) + ); + + // @FIXME do the same for the linked attach + + if($folder_hash) { + attach_delete($page_owner_uid, $folder_hash, true ); + + if(! $admin_delete) { + $sync = attach_export_data(\App::$data['channel'],$folder_hash, true); + + if($sync) + build_sync_packet($page_owner_uid,array('file' => array($sync))); + } + } + } + + goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address']); + } - $modified = filemtime($default); - $default = z_root() . '/' . $default; - $uid = $person; + if((argc() > 2) && (x($_REQUEST,'delete')) && ($_REQUEST['delete'] === t('Delete Photo'))) { + // same as above but remove single photo + + $ob_hash = get_observer_hash(); + if(! $ob_hash) + goaway(z_root() . '/' . $_SESSION['photo_return']); + + $r = q("SELECT id, resource_id FROM photo WHERE ( xchan = '%s' or uid = %d ) AND resource_id = '%s' LIMIT 1", + dbesc($ob_hash), + intval(local_channel()), + dbesc(argv(2)) + ); + + if($r) { + attach_delete($page_owner_uid, $r[0]['resource_id'], true ); + $sync = attach_export_data(\App::$data['channel'],$r[0]['resource_id'], true); + + if($sync) + build_sync_packet($page_owner_uid,array('file' => array($sync))); + } + elseif(is_site_admin()) { + // If the admin deletes a photo, don't sync + attach_delete($page_owner_uid, argv(2), true); + } - $d = [ 'imgscale' => $resolution, 'channel_id' => $uid, 'default' => $default, 'data' => '', 'mimetype' => '' ]; - call_hooks('get_profile_photo',$d); - $resolution = $d['imgscale']; - $uid = $d['channel_id']; - $default = $d['default']; - $data = $d['data']; - $mimetype = $d['mimetype']; + goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $_SESSION['album_return']); + } + + if((argc() > 2) && array_key_exists('move_to_album',$_POST)) { + $m = q("select folder from attach where hash = '%s' and uid = %d limit 1", + dbesc(argv(2)), + intval($page_owner_uid) + ); + if(($m) && ($m[0]['folder'] != $_POST['move_to_album'])) { + attach_move($page_owner_uid,argv(2),$_POST['move_to_album']); + + $sync = attach_export_data(\App::$data['channel'],argv(2),true); + if($sync) + build_sync_packet($page_owner_uid,array('file' => array($sync))); + + if(! ($_POST['desc'] && $_POST['newtag'])) + goaway(z_root() . '/' . $_SESSION['photo_return']); + } + } - if(! $data) { - $r = q("SELECT * FROM photo WHERE imgscale = %d AND uid = %d AND photo_usage = %d LIMIT 1", - intval($resolution), - intval($uid), - intval(PHOTO_PROFILE) + if((argc() > 2) && ((x($_POST,'desc') !== false) || (x($_POST,'newtag') !== false))) { + + $desc = ((x($_POST,'desc')) ? notags(trim($_POST['desc'])) : ''); + $rawtags = ((x($_POST,'newtag')) ? notags(trim($_POST['newtag'])) : ''); + $item_id = ((x($_POST,'item_id')) ? intval($_POST['item_id']) : 0); + + $is_nsfw = ((x($_POST,'adult')) ? intval($_POST['adult']) : 0); + + $acl->set_from_array($_POST); + $perm = $acl->get(); + + $resource_id = argv(2); + + if((x($_POST,'rotate') !== false) && + ( (intval($_POST['rotate']) == 1) || (intval($_POST['rotate']) == 2) )) { + logger('rotate'); + + $r = q("select * from photo where resource_id = '%s' and uid = %d and imgscale = 0 limit 1", + dbesc($resource_id), + intval($page_owner_uid) ); + if(count($r)) { + $d = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($r[0]['content'])) : dbunescbin($r[0]['content'])); + $ph = photo_factory($d, $r[0]['mimetype']); + if($ph->is_valid()) { + $rotate_deg = ( (intval($_POST['rotate']) == 1) ? 270 : 90 ); + $ph->rotate($rotate_deg); + + $width = $ph->getWidth(); + $height = $ph->getHeight(); + + if(intval($r[0]['os_storage'])) { + @file_put_contents($r[0]['content'],$ph->imageString()); + $data = $r[0]['content']; + $fsize = @filesize($r[0]['content']); + q("update attach set filesize = %d where hash = '%s' and uid = %d", + intval($fsize), + dbesc($resource_id), + intval($page_owner_uid) + ); + } + else { + $data = $ph->imageString(); + $fsize = strlen($data); + } + + $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 0", + dbesc(datetime_convert()), + dbescbin($data), + intval($fsize), + intval($height), + intval($width), + dbesc($resource_id), + intval($page_owner_uid) + ); + + if($width > 1024 || $height > 1024) + $ph->scaleImage(1024); + + $width = $ph->getWidth(); + $height = $ph->getHeight(); + $data = $ph->imageString(); + $fsize = strlen($data); + + $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 1", + dbesc(datetime_convert()), + dbescbin($data), + intval($fsize), + intval($height), + intval($width), + dbesc($resource_id), + intval($page_owner_uid) + ); + + + if($width > 640 || $height > 640) + $ph->scaleImage(640); + + $width = $ph->getWidth(); + $height = $ph->getHeight(); + $data = $ph->imageString(); + $fsize = strlen($data); + + $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 2", + dbesc(datetime_convert()), + dbescbin($data), + intval($fsize), + intval($height), + intval($width), + dbesc($resource_id), + intval($page_owner_uid) + ); + + + if($width > 320 || $height > 320) + $ph->scaleImage(320); + + $width = $ph->getWidth(); + $height = $ph->getHeight(); + $data = $ph->imageString(); + $fsize = strlen($data); + + $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 3", + dbesc(datetime_convert()), + dbescbin($data), + intval($fsize), + intval($height), + intval($width), + dbesc($resource_id), + intval($page_owner_uid) + ); + } + } + } + + $p = q("SELECT mimetype, is_nsfw, description, resource_id, imgscale, allow_cid, allow_gid, deny_cid, deny_gid FROM photo WHERE resource_id = '%s' AND uid = %d ORDER BY imgscale DESC", + dbesc($resource_id), + intval($page_owner_uid) + ); + if($p) { + $ext = $phototypes[$p[0]['mimetype']]; + + $r = q("UPDATE photo SET description = '%s', allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' WHERE resource_id = '%s' AND uid = %d", + dbesc($desc), + dbesc($perm['allow_cid']), + dbesc($perm['allow_gid']), + dbesc($perm['deny_cid']), + dbesc($perm['deny_gid']), + dbesc($resource_id), + intval($page_owner_uid) + ); + } + + $item_private = (($str_contact_allow || $str_group_allow || $str_contact_deny || $str_group_deny) ? true : false); + + $old_is_nsfw = $p[0]['is_nsfw']; + if($old_is_nsfw != $is_nsfw) { + $r = q("update photo set is_nsfw = %d where resource_id = '%s' and uid = %d", + intval($is_nsfw), + dbesc($resource_id), + intval($page_owner_uid) + ); + } + + /* Don't make the item visible if the only change was the album name */ + + $visibility = 0; + if($p[0]['description'] !== $desc || strlen($rawtags)) + $visibility = 1; + + if(! $item_id) { + $item_id = photos_create_item(\App::$data['channel'],get_observer_hash(),$p[0],$visibility); + + } + + if($item_id) { + $r = q("SELECT * FROM item WHERE id = %d AND uid = %d LIMIT 1", + intval($item_id), + intval($page_owner_uid) + ); + if($r) { - $modified = strtotime($r[0]['edited'] . "Z"); - $data = dbunescbin($r[0]['content']); - $mimetype = $r[0]['mimetype']; + $old_tag = $r[0]['tag']; + $old_inform = $r[0]['inform']; } - if(intval($r[0]['os_storage'])) - $data = file_get_contents($data); } - - if(! $data) { - $x = z_fetch_url($default,true,0,[ 'novalidate' => true ]); - $data = ($x['success'] ? $x['body'] : EMPTY_STR); - $mimetype = 'image/png'; + + + // make sure the linked item has the same permissions as the photo regardless of any other changes + $x = q("update item set allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s', item_private = %d + where id = %d", + dbesc($perm['allow_cid']), + dbesc($perm['allow_gid']), + dbesc($perm['deny_cid']), + dbesc($perm['deny_gid']), + intval($acl->is_private()), + intval($item_id) + ); + + // make sure the attach has the same permissions as the photo regardless of any other changes + $x = q("update attach set allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s' where hash = '%s' and uid = %d and is_photo = 1", + dbesc($perm['allow_cid']), + dbesc($perm['allow_gid']), + dbesc($perm['deny_cid']), + dbesc($perm['deny_gid']), + dbesc($resource_id), + intval($page_owner_uid) + ); + + + + if(strlen($rawtags)) { + + $str_tags = ''; + $inform = ''; + + // if the new tag doesn't have a namespace specifier (@foo or #foo) give it a mention + + $x = substr($rawtags,0,1); + if($x !== '@' && $x !== '#') + $rawtags = '@' . $rawtags; + + require_once('include/text.php'); + $profile_uid = \App::$profile['profile_uid']; + + $results = linkify_tags($a, $rawtags, (local_channel()) ? local_channel() : $profile_uid); + + $success = $results['success']; + $post_tags = array(); + + foreach($results as $result) { + $success = $result['success']; + if($success['replaced']) { + $post_tags[] = array( + 'uid' => $profile_uid, + 'ttype' => $success['termtype'], + 'otype' => TERM_OBJ_POST, + 'term' => $success['term'], + 'url' => $success['url'] + ); + } + } + + $r = q("select * from item where id = %d and uid = %d limit 1", + intval($item_id), + intval($page_owner_uid) + ); + + if($r) { + $r = fetch_post_tags($r,true); + $datarray = $r[0]; + if($post_tags) { + if((! array_key_exists('term',$datarray)) || (! is_array($datarray['term']))) + $datarray['term'] = $post_tags; + else + $datarray['term'] = array_merge($datarray['term'],$post_tags); + } + item_store_update($datarray,$execflag); + } + } + + $sync = attach_export_data(\App::$data['channel'],$resource_id); + + if($sync) + build_sync_packet($page_owner_uid,array('file' => array($sync))); + + goaway(z_root() . '/' . $_SESSION['photo_return']); + return; // NOTREACHED + + } - else { - /** - * Other photos - */ - /* Check for a cookie to indicate display pixel density, in order to detect high-resolution - displays. This procedure was derived from the "Retina Images" by Jeremey Worboys, - used in accordance with the Creative Commons Attribution 3.0 Unported License. - Project link: https://github.com/Retina-Images/Retina-Images - License link: http://creativecommons.org/licenses/by/3.0/ - */ + /** + * default post action - upload a photo + */ + + $channel = \App::$data['channel']; + $observer = \App::$data['observer']; + + $_REQUEST['source'] = 'photos'; + require_once('include/attach.php'); + + if(! local_channel()) { + $_REQUEST['contact_allow'] = expand_acl($channel['channel_allow_cid']); + $_REQUEST['group_allow'] = expand_acl($channel['channel_allow_gid']); + $_REQUEST['contact_deny'] = expand_acl($channel['channel_deny_cid']); + $_REQUEST['group_deny'] = expand_acl($channel['channel_deny_gid']); + } + + + $matches = []; + $partial = false; + - // @FIXME It seems this part doesn't work because we are not setting such cookie - $cookie_value = false; - if (isset($_COOKIE['devicePixelRatio'])) { - $cookie_value = intval($_COOKIE['devicePixelRatio']); + + if(array_key_exists('HTTP_CONTENT_RANGE',$_SERVER)) { + $pm = preg_match('/bytes (\d*)\-(\d*)\/(\d*)/',$_SERVER['HTTP_CONTENT_RANGE'],$matches); + if($pm) { + logger('Content-Range: ' . print_r($matches,true)); + $partial = true; + } + } + + if($partial) { + $x = save_chunk($channel,$matches[1],$matches[2],$matches[3]); + + if($x['partial']) { + header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0)); + json_return_and_die($result); } else { - // Force revalidation of cache on next request - // $prvcachecontrol = 'no-cache'; - $status = 'no cookie'; + header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0)); + + $_FILES['userfile'] = [ + 'name' => $x['name'], + 'type' => $x['type'], + 'tmp_name' => $x['tmp_name'], + 'error' => $x['error'], + 'size' => $x['size'] + ]; + } + } + else { + if(! array_key_exists('userfile',$_FILES)) { + $_FILES['userfile'] = [ + 'name' => $_FILES['files']['name'], + 'type' => $_FILES['files']['type'], + 'tmp_name' => $_FILES['files']['tmp_name'], + 'error' => $_FILES['files']['error'], + 'size' => $_FILES['files']['size'] + ]; } + } + + $r = attach_store($channel,get_observer_hash(), '', $_REQUEST); - $resolution = 0; + if(! $r['success']) { + notice($r['message'] . EOL); + goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address']); + } + + goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $r['data']['folder']); - if(strpos($photo,'.') !== false) - $photo = substr($photo,0,strpos($photo,'.')); - - if(substr($photo,-2,1) == '-') { - $resolution = intval(substr($photo,-1,1)); - $photo = substr($photo,0,-2); - // If viewing on a high-res screen, attempt to serve a higher resolution image: - if ($resolution == 2 && ($cookie_value > 1)) - $resolution = 1; - } + } + + + + function get() { + + // URLs: + // photos/name + // photos/name/album/xxxxx (xxxxx is album name) + // photos/name/image/xxxxx + + + if(observer_prohibited()) { + notice( t('Public access denied.') . EOL); + return; + } + + $unsafe = ((array_key_exists('unsafe',$_REQUEST) && $_REQUEST['unsafe']) ? 1 : 0); - $r = q("SELECT uid, photo_usage, display_path FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1", - dbesc($photo), - intval($resolution) + require_once('include/bbcode.php'); + require_once('include/security.php'); + require_once('include/conversation.php'); + + if(! x(\App::$data,'channel')) { + notice( t('No photos selected') . EOL ); + return; + } + + $ph = photo_factory(''); + $phototypes = $ph->supportedTypes(); + + $_SESSION['photo_return'] = \App::$cmd; + + // + // Parse arguments + // + + $can_comment = perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),'post_comments'); + + if(argc() > 3) { + $datatype = argv(2); + $datum = argv(3); + } else { + if(argc() > 2) { + $datatype = argv(2); + $datum = ''; + } + else + $datatype = 'summary'; + } + + if(argc() > 4) + $cmd = argv(4); + else + $cmd = 'view'; + + // + // Setup permissions structures + // + + $can_post = false; + $visitor = 0; + + + $owner_uid = \App::$data['channel']['channel_id']; + $owner_aid = \App::$data['channel']['channel_account_id']; + + $observer = \App::get_observer(); + + $can_post = perm_is_allowed($owner_uid,$observer['xchan_hash'],'write_storage'); + $can_view = perm_is_allowed($owner_uid,$observer['xchan_hash'],'view_storage'); + + if(! $can_view) { + notice( t('Access to this item is restricted.') . EOL); + return; + } + + $sql_item = item_permissions_sql($owner_uid,get_observer_hash()); + $sql_extra = permissions_sql($owner_uid,get_observer_hash(),'photo'); + $sql_attach = permissions_sql($owner_uid,get_observer_hash(),'attach'); + + nav_set_selected('Photos'); + + $o = ' + + '; + + + $o .= "\r\n"; + + $_is_owner = (local_channel() && (local_channel() == $owner_uid)); + + /** + * Display upload form + */ + + if( $can_post) { + + $uploader = ''; + + $ret = array('post_url' => z_root() . '/photos/' . \App::$data['channel']['channel_address'], + 'addon_text' => $uploader, + 'default_upload' => true); + + call_hooks('photo_upload_form',$ret); + + /* Show space usage */ + + $r = q("select sum(filesize) as total from photo where aid = %d and imgscale = 0 ", + intval(\App::$data['channel']['channel_account_id']) ); - if($r) { - $allowed = (-1); - - $u = intval($r[0]['photo_usage']); - if($u) { - $allowed = 1; - if($u === PHOTO_COVER) - if($resolution < PHOTO_RES_COVER_1200) - $allowed = (-1); - if($u === PHOTO_PROFILE) - if(! in_array($resolution,[4,5,6])) - $allowed = (-1); - if($u === PHOTO_CACHE) { - // Validate cache - $cache = array( - 'resid' => $photo, - 'uid' => $r[0]['uid'], - 'status' => false - ); - if($cache_mode['on']) - call_hooks('cache_url_hook', $cache); - if(! $cache['status']) { - $url = htmlspecialchars_decode($r[0]['display_path']); - call_hooks('cache_sslify_hook', $url); - header("Location: " . $url); - killme(); - } - } - } + + + $limit = engr_units_to_bytes(service_class_fetch(\App::$data['channel']['channel_id'],'photo_upload_limit')); + if($limit !== false) { + $usage_message = sprintf( t("%1$.2f MB of %2$.2f MB photo storage used."), $r[0]['total'] / 1024000, $limit / 1024000 ); + } + else { + $usage_message = sprintf( t('%1$.2f MB photo storage used.'), $r[0]['total'] / 1024000 ); + } + + if($_is_owner) { + $channel = \App::get_channel(); + + $acl = new \Zotlabs\Access\AccessList($channel); + $channel_acl = $acl->get(); + + $lockstate = (($acl->is_private()) ? 'lock' : 'unlock'); + } + + $aclselect = (($_is_owner) ? populate_acl($channel_acl,false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_storage')) : ''); + + // this is wrong but is to work around an issue with js_upload wherein it chokes if these variables + // don't exist. They really should be set to a parseable representation of the channel's default permissions + // which can be processed by getSelected() + + if(! $aclselect) { + $aclselect = ''; + } - if($allowed === (-1)) - $allowed = attach_can_view($r[0]['uid'],$observer_xchan,$photo); + $selname = ''; - $channel = channelx_by_n($r[0]['uid']); + if($datum) { + $h = attach_by_hash_nodata($datum,get_observer_hash()); + $selname = $h['data']['display_path']; + } - // Now we'll see if we can access the photo - $e = q("SELECT * FROM photo WHERE resource_id = '%s' AND imgscale = %d $sql_extra LIMIT 1", - dbesc($photo), - intval($resolution) - ); - - $exists = (($e) ? true : false); - - if($exists && $allowed) { - $expires = strtotime($e[0]['expires'] . 'Z'); - $data = dbunescbin($e[0]['content']); - $filesize = $e[0]['filesize']; - $mimetype = $e[0]['mimetype']; - $modified = strtotime($e[0]['edited'] . 'Z'); - - if(intval($e[0]['os_storage'])) { - $streaming = $data; - } - if($e[0]['allow_cid'] != '' || $e[0]['allow_gid'] != '' || $e[0]['deny_gid'] != '' || $e[0]['deny_gid'] != '') - $prvcachecontrol = 'no-store, no-cache, must-revalidate'; + + $albums = ((array_key_exists('albums', \App::$data)) ? \App::$data['albums'] : photos_albums_list(\App::$data['channel'],\App::$data['observer'])); + + if(! $selname) { + $def_album = get_pconfig(\App::$data['channel']['channel_id'],'system','photo_path'); + if($def_album) { + $selname = filepath_macro($def_album); + $albums['album'][] = array('text' => $selname); } - else { - if(! $allowed) { - http_status_exit(403,'forbidden'); - } - if(! $exists) { - http_status_exit(404,'not found'); - } + } + + $tpl = get_markup_template('photos_upload.tpl'); + $upload_form = replace_macros($tpl,array( + '$pagename' => t('Upload Photos'), + '$sessid' => session_id(), + '$usage' => $usage_message, + '$nickname' => \App::$data['channel']['channel_address'], + '$newalbum_label' => t('Enter an album name'), + '$newalbum_placeholder' => t('or select an existing album (doubleclick)'), + '$visible' => array('visible', t('Create a status post for this upload'), 0,'', array(t('No'), t('Yes')), 'onclick="showHideBodyTextarea();"'), + '$caption' => array('description', t('Title (optional)')), + '$body' => array('body', t('Description (optional)'),'', 'Description will only appear in the status post'), + '$albums' => $albums['albums'], + '$selname' => $selname, + '$permissions' => t('Permissions'), + '$aclselect' => $aclselect, + '$allow_cid' => acl2json($channel_acl['allow_cid']), + '$allow_gid' => acl2json($channel_acl['allow_gid']), + '$deny_cid' => acl2json($channel_acl['deny_cid']), + '$deny_gid' => acl2json($channel_acl['deny_gid']), + '$lockstate' => $lockstate, + '$uploader' => $ret['addon_text'], + '$default' => (($ret['default_upload']) ? true : false), + '$uploadurl' => $ret['post_url'], + '$submit' => t('Upload') + + )); + + } + + // + // dispatch request + // + + /* + * Display a single photo album + */ + + if($datatype === 'album') { - } + head_add_link([ + 'rel' => 'alternate', + 'type' => 'application/json+oembed', + 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string), + 'title' => 'oembed' + ]); + + if($x = photos_album_exists($owner_uid, get_observer_hash(), $datum)) { + \App::set_pager_itemspage(60); + $album = $x['display_path']; } + else { + goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address']); + } + + if($_GET['order'] === 'posted') + $order = 'ASC'; else - http_status_exit(404,'not found'); - } + $order = 'DESC'; - header_remove('Pragma'); + $r = q("SELECT p.resource_id, p.id, p.filename, p.mimetype, p.imgscale, p.description, p.created FROM photo p INNER JOIN + (SELECT resource_id, max(imgscale) imgscale FROM photo left join attach on folder = '%s' and photo.resource_id = attach.hash WHERE attach.uid = %d AND imgscale <= 4 AND photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY resource_id) ph + ON (p.resource_id = ph.resource_id AND p.imgscale = ph.imgscale) + ORDER BY created $order LIMIT %d OFFSET %d", + dbesc($x['hash']), + intval($owner_uid), + intval(PHOTO_NORMAL), + intval(PHOTO_PROFILE), + intval($unsafe), + intval(\App::$pager['itemspage']), + intval(\App::$pager['start']) + ); - if($ismodified === gmdate("D, d M Y H:i:s", $modified) . " GMT") { - header_remove('Expires'); - header_remove('Cache-Control'); - header_remove('Set-Cookie'); - http_status_exit(304,'not modified'); - } + // edit album name + $album_edit = null; - if(! isset($data)) { - if(isset($resolution)) { - switch($resolution) { - case 4: - $default = get_default_profile_photo(); - break; - case 5: - $default = get_default_profile_photo(80); - break; - case 6: - $default = get_default_profile_photo(48); - break; - default: - killme(); - // NOTREACHED - break; + if($can_post) { + $album_e = $album; + $albums = ((array_key_exists('albums', \App::$data)) ? \App::$data['albums'] : photos_albums_list(\App::$data['channel'],\App::$data['observer'])); + + // @fixme - syncronise actions with DAV + + // $edit_tpl = get_markup_template('album_edit.tpl'); + // $album_edit = replace_macros($edit_tpl,array( + // '$nametext' => t('Enter a new album name'), + // '$name_placeholder' => t('or select an existing one (doubleclick)'), + // '$nickname' => \App::$data['channel']['channel_address'], + // '$album' => $album_e, + // '$albums' => $albums['albums'], + // '$hexalbum' => bin2hex($album), + // '$submit' => t('Submit'), + // '$dropsubmit' => t('Delete Album') + // )); + + } + + if($_GET['order'] === 'posted') + $order = array(t('Show Newest First'), z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $datum); + else + $order = array(t('Show Oldest First'), z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $datum . '?f=&order=posted'); + + $photos = array(); + if(count($r)) { + $twist = 'rotright'; + foreach($r as $rr) { + + if($twist == 'rotright') + $twist = 'rotleft'; + else + $twist = 'rotright'; + + $ext = $phototypes[$rr['mimetype']]; + + $imgalt_e = $rr['filename']; + $desc_e = $rr['description']; + + $imagelink = (z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $rr['resource_id'] + . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '')); + + $photos[] = array( + 'id' => $rr['id'], + 'twist' => ' ' . $twist . rand(2,4), + 'link' => $imagelink, + 'title' => t('View Photo'), + 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['imgscale'] . '.' .$ext, + 'alt' => $imgalt_e, + 'desc'=> $desc_e, + 'ext' => $ext, + 'hash'=> $rr['resource_id'], + 'unknown' => t('Unknown') + ); } - $x = z_fetch_url(z_root() . '/' . $default,true,0,[ 'novalidate' => true ]); - $data = ($x['success'] ? $x['body'] : EMPTY_STR); - $mimetype = 'image/png'; } - } - if(isset($res) && intval($res) && $res < 500) { - $ph = photo_factory($data, $mimetype); - if($ph->is_valid()) { - $ph->scaleImageSquare($res); - $data = $ph->imageString(); - $mimetype = $ph->getType(); + if($_REQUEST['aj']) { + if($photos) { + $o = replace_macros(get_markup_template('photosajax.tpl'),array( + '$photos' => $photos, + '$album_id' => $datum + )); + } + else { + $o = '
      '; + } + echo $o; + killme(); } - } + else { + $o .= ""; + $tpl = get_markup_template('photo_album.tpl'); + $o .= replace_macros($tpl, array( + '$photos' => $photos, + '$album' => $album, + '$album_id' => $datum, + '$album_edit' => array(t('Edit Album'), $album_edit), + '$can_post' => $can_post, + '$upload' => array(t('Add Photos'), z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/upload/' . $datum), + '$order' => $order, + '$upload_form' => $upload_form, + '$usage' => $usage_message + )); + + } + + if((! $photos) && ($_REQUEST['aj'])) { + $o .= '
      '; + echo $o; + killme(); + } + + return $o; + + } + + /** + * Display one photo + */ + + if($datatype === 'image') { + + \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; + + $x = q("select folder from attach where hash = '%s' and uid = %d $sql_attach limit 1", + dbesc($datum), + intval($owner_uid) + ); - if(isset($prvcachecontrol)) { + // fetch image, item containing image, then comments - // it is a private photo that they have no permission to view. - // tell the browser not to cache it, in case they authenticate - // and subsequently have permission to see it + $ph = q("SELECT id,aid,uid,xchan,resource_id,created,edited,title,description,album,filename,mimetype,height,width,filesize,imgscale,photo_usage,is_nsfw,allow_cid,allow_gid,deny_cid,deny_gid FROM photo WHERE uid = %d AND resource_id = '%s' + $sql_extra ORDER BY imgscale ASC ", + intval($owner_uid), + dbesc($datum) + ); - header("Cache-Control: " . $prvcachecontrol); + if(! ($ph && $x)) { - } - else { - // The photo cache default is 1 day to provide a privacy trade-off, - // as somebody reducing photo permissions on a photo that is already - // "in the wild" won't be able to stop the photo from being viewed - // for this amount amount of time once it is in the browser cache. - // The privacy expectations of your site members and their perception - // of privacy where it affects the entire project may be affected. - // This has performance considerations but we highly recommend you - // leave it alone. - - $maxage = $cache_mode['age']; - - if($cache_mode['exp'] || (! isset($expires)) || (isset($expires) && $expires - 60 < time())) - $expires = time() + $maxage; + /* Check again - this time without specifying permissions */ + + $ph = q("SELECT id FROM photo WHERE uid = %d AND resource_id = '%s' LIMIT 1", + intval($owner_uid), + dbesc($datum) + ); + if($ph) + notice( t('Permission denied. Access to this item may be restricted.') . EOL); + else + notice( t('Photo not available') . EOL ); + return; + } + + + + $prevlink = ''; + $nextlink = ''; + + if($_GET['order'] === 'posted') + $order = 'ASC'; else - $maxage = $expires - time(); + $order = 'DESC'; + + + $prvnxt = q("SELECT hash FROM attach WHERE folder = '%s' AND uid = %d AND is_photo = 1 + $sql_attach ORDER BY created $order ", + dbesc($x[0]['folder']), + intval($owner_uid) + ); + + if(count($prvnxt)) { + for($z = 0; $z < count($prvnxt); $z++) { + if($prvnxt[$z]['hash'] == $ph[0]['resource_id']) { + $prv = $z - 1; + $nxt = $z + 1; + if($prv < 0) + $prv = count($prvnxt) - 1; + if($nxt >= count($prvnxt)) + $nxt = 0; + break; + } + } + + $prevlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['hash'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); + $nextlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['hash'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); + } + + + if(count($ph) == 1) + $hires = $lores = $ph[0]; + if(count($ph) > 1) { + if($ph[1]['imgscale'] == 2) { + // original is 640 or less, we can display it directly + $hires = $lores = $ph[0]; + } + else { + $hires = $ph[0]; + $lores = $ph[1]; + } + } + + $album_link = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $x[0]['folder']; + $tools = Null; + $lock = Null; + + if($can_post && ($ph[0]['uid'] == $owner_uid)) { + $tools = array( + 'profile'=>array(z_root() . '/profile_photo/use/'.$ph[0]['resource_id'], t('Use as profile photo')), + 'cover'=>array(z_root() . '/cover_photo/use/'.$ph[0]['resource_id'], t('Use as cover photo')), + ); + } + + // lockstate + $lockstate = ( ( (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid']) + || strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid'])) ) + ? array('lock', t('Private Photo')) + : array('unlock', Null)); + + \App::$page['htmlhead'] .= ''; + + if($prevlink) + $prevlink = array($prevlink, t('Previous')); + + $photo = array( + 'href' => z_root() . '/photo/' . $hires['resource_id'] . '-' . $hires['imgscale'] . '.' . $phototypes[$hires['mimetype']], + 'title'=> t('View Full Size'), + 'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['imgscale'] . '.' . $phototypes[$lores['mimetype']] . '?f=&_u=' . datetime_convert('','','','ymdhis') + ); + + if($nextlink) + $nextlink = array($nextlink, t('Next')); + + + // Do we have an item for this photo? + + $linked_items = q("SELECT * FROM item WHERE resource_id = '%s' and resource_type = 'photo' + $sql_item LIMIT 1", + dbesc($datum) + ); + + $map = null; + + if($linked_items) { + + xchan_query($linked_items); + $linked_items = fetch_post_tags($linked_items,true); + + $link_item = $linked_items[0]; + $item_normal = item_normal(); + + $r = q("select * from item where parent_mid = '%s' + $item_normal and uid = %d $sql_item ", + dbesc($link_item['mid']), + intval($link_item['uid']) + + ); + + if($r) { + xchan_query($r); + $r = fetch_post_tags($r,true); + $r = conv_sort($r,'commented'); + } + + $tags = array(); + if($link_item['term']) { + $cnt = 0; + foreach($link_item['term'] as $t) { + $tags[$cnt] = array(0 => format_term_for_display($t)); + if($can_post && ($ph[0]['uid'] == $owner_uid)) { + $tags[$cnt][1] = 'tagrm/drop/' . $link_item['id'] . '/' . bin2hex($t['term']); //?f=&item=' . $link_item['id']; + $tags[$cnt][2] = t('Remove'); + } + $cnt ++; + } + } + + if((local_channel()) && (local_channel() == $link_item['uid'])) { + q("UPDATE item SET item_unseen = 0 WHERE parent = %d and uid = %d and item_unseen = 1", + intval($link_item['parent']), + intval(local_channel()) + ); + } + + if($link_item['coord']) { + $map = generate_map($link_item['coord']); + } + } + + // logger('mod_photo: link_item' . print_r($link_item,true)); + + // FIXME - remove this when we move to conversation module + + $r = $r[0]['children']; + + $edit = null; + if($can_post) { + + $album_e = $ph[0]['album']; + $caption_e = $ph[0]['description']; + $aclselect_e = (($_is_owner) ? populate_acl($ph[0], true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_storage')) : ''); + $albums = ((array_key_exists('albums', \App::$data)) ? \App::$data['albums'] : photos_albums_list(\App::$data['channel'],\App::$data['observer'])); + + $_SESSION['album_return'] = bin2hex($ph[0]['album']); + + $folder_list = attach_folder_select_list($ph[0]['uid']); + + $edit = [ + 'edit' => t('Edit photo'), + 'id' => $link_item['id'], + 'rotatecw' => t('Rotate CW (right)'), + 'rotateccw' => t('Rotate CCW (left)'), + 'albums' => $albums['albums'], + 'album' => $album_e, + 'album_select' => [ 'move_to_album', t('Move photo to album'), $x[0]['folder'], '', $folder_list ], + 'newalbum_label' => t('Enter a new album name'), + 'newalbum_placeholder' => t('or select an existing one (doubleclick)'), + 'nickname' => \App::$data['channel']['channel_address'], + 'resource_id' => $ph[0]['resource_id'], + 'capt_label' => t('Title (optional)'), + 'caption' => $caption_e, + 'tag_label' => t('Add a Tag'), + 'permissions' => t('Permissions'), + 'aclselect' => $aclselect_e, + 'allow_cid' => acl2json($ph[0]['allow_cid']), + 'allow_gid' => acl2json($ph[0]['allow_gid']), + 'deny_cid' => acl2json($ph[0]['deny_cid']), + 'deny_gid' => acl2json($ph[0]['deny_gid']), + 'lockstate' => $lockstate[0], + 'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com'), + 'item_id' => ((count($linked_items)) ? $link_item['id'] : 0), + 'adult_enabled' => feature_enabled($owner_uid,'adult_photo_flagging'), + 'adult' => array('adult',t('Flag as adult in album view'), intval($ph[0]['is_nsfw']),''), + 'submit' => t('Submit'), + 'delete' => t('Delete Photo') + ]; + } + + if(count($linked_items)) { + + $cmnt_tpl = get_markup_template('comment_item.tpl'); + $tpl = get_markup_template('photo_item.tpl'); + $return_url = \App::$cmd; + + $like_tpl = get_markup_template('like_noshare.tpl'); + + $likebuttons = ''; + + if($observer && ($can_post || $can_comment)) { + $likebuttons = [ + 'id' => $link_item['id'], + 'likethis' => t("I like this \x28toggle\x29"), + 'nolike' => t("I don't like this \x28toggle\x29"), + 'share' => t('Share'), + 'wait' => t('Please wait') + ]; + } + + $comments = ''; + if(! $r) { + if($observer && ($can_post || $can_comment)) { + $feature_auto_save_draft = ((feature_enabled($owner_uid, 'auto_save_draft')) ? "true" : "false"); + $commentbox = replace_macros($cmnt_tpl,array( + '$return_path' => '', + '$mode' => 'photos', + '$jsreload' => $return_url, + '$type' => 'wall-comment', + '$id' => $link_item['id'], + '$parent' => $link_item['id'], + '$profile_uid' => $owner_uid, + '$mylink' => $observer['xchan_url'], + '$mytitle' => t('This is you'), + '$myphoto' => $observer['xchan_photo_s'], + '$comment' => t('Comment'), + '$submit' => t('Submit'), + '$preview' => t('Preview'), + '$ww' => '', + '$feature_encrypt' => false, + '$auto_save_draft' => $feature_auto_save_draft + )); + } + } + + $alike = array(); + $dlike = array(); + + $like = ''; + $dislike = ''; + + $conv_responses = array( + 'like' => array('title' => t('Likes','title')),'dislike' => array('title' => t('Dislikes','title')), + 'agree' => array('title' => t('Agree','title')),'disagree' => array('title' => t('Disagree','title')), 'abstain' => array('title' => t('Abstain','title')), + 'attendyes' => array('title' => t('Attending','title')), 'attendno' => array('title' => t('Not attending','title')), 'attendmaybe' => array('title' => t('Might attend','title')) + ); + + + + + if($r) { + + foreach($r as $item) { + builtin_activity_puller($item, $conv_responses); + } + + $like_count = ((x($alike,$link_item['mid'])) ? $alike[$link_item['mid']] : ''); + $like_list = ((x($alike,$link_item['mid'])) ? $alike[$link_item['mid'] . '-l'] : ''); + + if(is_array($like_list) && (count($like_list) > MAX_LIKERS)) { + $like_list_part = array_slice($like_list, 0, MAX_LIKERS); + array_push($like_list_part, '' . t('View all') . ''); + } else { + $like_list_part = ''; + } + $like_button_label = tt('Like','Likes',$like_count,'noun'); + + //if (feature_enabled($conv->get_profile_owner(),'dislike')) { + $dislike_count = ((x($dlike,$link_item['mid'])) ? $dlike[$link_item['mid']] : ''); + $dislike_list = ((x($dlike,$link_item['mid'])) ? $dlike[$link_item['mid'] . '-l'] : ''); + $dislike_button_label = tt('Dislike','Dislikes',$dislike_count,'noun'); + if (is_array($dislike_list) && (count($dislike_list) > MAX_LIKERS)) { + $dislike_list_part = array_slice($dislike_list, 0, MAX_LIKERS); + array_push($dislike_list_part, '' . t('View all') . ''); + } else { + $dislike_list_part = ''; + } + //} + + + $like = ((isset($alike[$link_item['mid']])) ? format_like($alike[$link_item['mid']],$alike[$link_item['mid'] . '-l'],'like',$link_item['mid']) : ''); + $dislike = ((isset($dlike[$link_item['mid']])) ? format_like($dlike[$link_item['mid']],$dlike[$link_item['mid'] . '-l'],'dislike',$link_item['mid']) : ''); + + // display comments + + foreach($r as $item) { + $comment = ''; + $template = $tpl; + $sparkle = ''; + + if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent'])) + continue; + + $redirect_url = z_root() . '/redir/' . $item['cid'] ; + + + $profile_url = zid($item['author']['xchan_url']); + $sparkle = ''; + + + $profile_name = $item['author']['xchan_name']; + $profile_avatar = $item['author']['xchan_photo_m']; + + $profile_link = $profile_url; + + $drop = ''; + + if($observer['xchan_hash'] === $item['author_xchan'] || $observer['xchan_hash'] === $item['owner_xchan']) + $drop = replace_macros(get_markup_template('photo_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); + + + $name_e = $profile_name; + $title_e = $item['title']; + unobscure($item); + $body_e = prepare_text($item['body'],$item['mimetype']); + + $comments .= replace_macros($template,array( + '$id' => $item['id'], + '$mode' => 'photos', + '$profile_url' => $profile_link, + '$name' => $name_e, + '$thumb' => $profile_avatar, + '$sparkle' => $sparkle, + '$title' => $title_e, + '$body' => $body_e, + '$ago' => relative_date($item['created']), + '$indent' => (($item['parent'] != $item['id']) ? ' comment' : ''), + '$drop' => $drop, + '$comment' => $comment + )); + + } + + if($observer && ($can_post || $can_comment)) { + $commentbox = replace_macros($cmnt_tpl,array( + '$return_path' => '', + '$jsreload' => $return_url, + '$type' => 'wall-comment', + '$id' => $link_item['id'], + '$parent' => $link_item['id'], + '$profile_uid' => $owner_uid, + '$mylink' => $observer['xchan_url'], + '$mytitle' => t('This is you'), + '$myphoto' => $observer['xchan_photo_s'], + '$comment' => t('Comment'), + '$submit' => t('Submit'), + '$ww' => '' + )); + } + + } + $paginate = paginate($a); + } - header("Expires: " . gmdate("D, d M Y H:i:s", $expires) . " GMT"); - header("Cache-Control: max-age=" . $maxage); + $album_e = array($album_link,$ph[0]['album']); + $like_e = $like; + $dislike_e = $dislike; + + $response_verbs = array('like'); + if(feature_enabled($owner_uid,'dislike')) + $response_verbs[] = 'dislike'; + + $responses = get_responses($conv_responses,$response_verbs,'',$link_item); + + $hookdata = [ + 'onclick' => '$.colorbox({href: \'' . $photo['href'] . '\'}); return false;', + 'raw_photo' => $ph[0], + 'nickname' => \App::$data['channel']['channel_address'] + ]; + call_hooks('photo_view_filter', $hookdata); + + $photo_tpl = get_markup_template('photo_view.tpl'); + $o .= replace_macros($photo_tpl, array( + '$id' => $ph[0]['id'], + '$album' => $album_e, + '$tools_label' => t('Photo Tools'), + '$tools' => $tools, + '$lock' => $lockstate[1], + '$photo' => $photo, + '$prevlink' => $prevlink, + '$nextlink' => $nextlink, + '$desc' => $ph[0]['description'], + '$filename' => $ph[0]['filename'], + '$unknown' => t('Unknown'), + '$tag_hdr' => t('In This Photo:'), + '$tags' => $tags, + 'responses' => $responses, + '$edit' => $edit, + '$map' => $map, + '$map_text' => t('Map'), + '$likebuttons' => $likebuttons, + '$like' => $like_e, + '$dislike' => $dislike_e, + '$like_count' => $like_count, + '$like_list' => $like_list, + '$like_list_part' => $like_list_part, + '$like_button_label' => $like_button_label, + '$like_modal_title' => t('Likes','noun'), + '$dislike_modal_title' => t('Dislikes','noun'), + '$dislike_count' => $dislike_count, //((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_count : ''), + '$dislike_list' => $dislike_list, //((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_list : ''), + '$dislike_list_part' => $dislike_list_part, //((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_list_part : ''), + '$dislike_button_label' => $dislike_button_label, //((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_button_label : ''), + '$modal_dismiss' => t('Close'), + '$comments' => $comments, + '$commentbox' => $commentbox, + '$paginate' => $paginate, + '$onclick' => $hookdata['onclick'] + )); + + \App::$data['photo_html'] = $o; + + return $o; } + + // Default - show recent photos with upload link (if applicable) + //$o = ''; + + \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; + + + \App::set_pager_itemspage(60); + + $r = q("SELECT p.resource_id, p.id, p.filename, p.mimetype, p.album, p.imgscale, p.created, p.display_path + FROM photo p + INNER JOIN ( SELECT resource_id, max(imgscale) imgscale FROM photo + WHERE photo.uid = %d AND photo_usage IN ( %d, %d ) + AND is_nsfw = %d $sql_extra group by resource_id ) ph + ON (p.resource_id = ph.resource_id and p.imgscale = ph.imgscale) + ORDER by p.created DESC LIMIT %d OFFSET %d", + intval(\App::$data['channel']['channel_id']), + intval(PHOTO_NORMAL), + intval(PHOTO_PROFILE), + intval($unsafe), + intval(\App::$pager['itemspage']), + intval(\App::$pager['start']) + ); + + + + $photos = array(); + if($r) { + $twist = 'rotright'; + foreach($r as $rr) { - header("Content-type: " . $mimetype); - header("Last-Modified: " . gmdate("D, d M Y H:i:s", $modified) . " GMT"); - header("Content-Length: " . (isset($filesize) ? $filesize : strlen($data))); + if(! attach_can_view_folder(\App::$data['channel']['channel_id'],get_observer_hash(),$rr['resource_id'])) + continue; - // If it's a file resource, stream it. - if($streaming && $channel) { - if(strpos($streaming,'store') !== false) - $istream = fopen($streaming,'rb'); - else - $istream = fopen('store/' . $channel['channel_address'] . '/' . $streaming,'rb'); - $ostream = fopen('php://output','wb'); - if($istream && $ostream) { - pipe_streams($istream,$ostream); - fclose($istream); - fclose($ostream); + if($twist == 'rotright') + $twist = 'rotleft'; + else + $twist = 'rotright'; + $ext = $phototypes[$rr['mimetype']]; + + $alt_e = $rr['filename']; + $name_e = dirname($rr['display_path']); + + $photos[] = array( + 'id' => $rr['id'], + 'twist' => ' ' . $twist . rand(2,4), + 'link' => z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $rr['resource_id'], + 'title' => t('View Photo'), + 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . ((($rr['imgscale']) == 6) ? 4 : $rr['imgscale']) . '.' . $ext, + 'alt' => $alt_e, + 'album' => array( + 'name' => $name_e, + ), + + ); + } + } + + if($_REQUEST['aj']) { + if($photos) { + $o = replace_macros(get_markup_template('photosajax.tpl'),array( + '$photos' => $photos, + '$album_id' => bin2hex(t('Recent Photos')) + )); + } + else { + $o = '
      '; } + echo $o; + killme(); } else { - echo $data; + $o .= ""; + $tpl = get_markup_template('photos_recent.tpl'); + $o .= replace_macros($tpl, array( + '$title' => t('Recent Photos'), + '$album_id' => bin2hex(t('Recent Photos')), + '$can_post' => $can_post, + '$upload' => array(t('Add Photos'), z_root().'/photos/'.\App::$data['channel']['channel_address'].'/upload'), + '$photos' => $photos, + '$upload_form' => $upload_form, + '$usage' => $usage_message + )); + } - - killme(); + + if((! $photos) && ($_REQUEST['aj'])) { + $o .= '
      '; + echo $o; + killme(); + } + + // paginate($a); + return $o; } + } -- cgit v1.2.3 From 05cb4fd8971f9c196d21ab21f08e840e471ab804 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 17 Dec 2018 09:13:03 +0100 Subject: Move SSLify code from Photo cache addon --- Zotlabs/Module/Photo.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 967a3b703..e236cc5f4 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -159,15 +159,14 @@ class Photo extends \Zotlabs\Web\Controller { // Validate cache $cache = array( 'resid' => $photo, - 'uid' => $r[0]['uid'], - 'status' => false + 'url' => htmlspecialchars_decode($r[0]['display_path']) ); if($cache_mode['on']) call_hooks('cache_url_hook', $cache); - if(! $cache['status']) { - $url = htmlspecialchars_decode($r[0]['display_path']); - call_hooks('cache_sslify_hook', $url); - header("Location: " . $url); + if($cache['url'] != '') { + if(strpos(z_root(),'https:') !== false && strpos($cache['url'],'https:') === false) + $cache['url'] = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($cache['url']); + header("Location: " . $cache['url']); killme(); } } -- cgit v1.2.3 From 4d8a815932113c87333a4f3e95a7bf1c56d87e73 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 17 Dec 2018 09:34:30 +0100 Subject: Keep remote site headers for caching --- Zotlabs/Module/Sslify.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Module/Sslify.php b/Zotlabs/Module/Sslify.php index 2891f3691..37be4423b 100644 --- a/Zotlabs/Module/Sslify.php +++ b/Zotlabs/Module/Sslify.php @@ -12,10 +12,16 @@ class Sslify extends \Zotlabs\Web\Controller { list($k,$v) = array_map("trim", explode(":", trim($l), 2)); $hdrs[strtolower($k)] = $v; } - if (array_key_exists('content-type', $hdrs)) { - $type = $hdrs['content-type']; - header('Content-Type: ' . $type); - } + + if (array_key_exists('content-type', $hdrs)) + header('Content-Type: ' . $hdrs['content-type']); + if (array_key_exists('last-modified', $hdrs)) + header('Last-Modified: ' . $hdrs['last-modified']); + if (array_key_exists('cache-control', $hdrs)) + header('Cache-Control: ' . $hdrs['cache-control']); + if (array_key_exists('expires', $hdrs)) + header('Expires: ' . $hdrs['expires']); + echo $x['body']; killme(); -- cgit v1.2.3 From 70a766171117fd94c7e0ca228d3b879f7f307e5f Mon Sep 17 00:00:00 2001 From: phani00 Date: Mon, 17 Dec 2018 10:08:45 +0000 Subject: remove my dark theme fixes. --- view/theme/redbasic/schema/dark.css | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/view/theme/redbasic/schema/dark.css b/view/theme/redbasic/schema/dark.css index e958d9ee7..c00ddca90 100644 --- a/view/theme/redbasic/schema/dark.css +++ b/view/theme/redbasic/schema/dark.css @@ -322,7 +322,9 @@ a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link { .text-dark { color: #aaa !important; } -a.text-dark:focus, a.text-dark:hover { + +/* phani: fix 1 */ +/*a.text-dark:focus, a.text-dark:hover { color: #ddd !important; } @@ -335,7 +337,8 @@ a.text-dark:focus, a.text-dark:hover { .badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover { color: red !important; text-decoration: none; -} +}*/ + .group-selected, .fileas-selected, .categories-selected, .search-selected, a.active { color: #fff !important; @@ -492,10 +495,10 @@ pre { background-color: #222; } +/* phani: fix 2 */ /* change color of [hl] tag: */ -div.wall-item-body span /*strong:only-of-type */{ +/*div.wall-item-body span { color: #1212b6; padding: 2px 3px; -/* font-weight: 500; */ white-space: nowrap; -} +}*/ -- cgit v1.2.3 From a2959c6e9e795c0c8c6e87b70d8d0a935ae272f9 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 17 Dec 2018 13:28:18 +0100 Subject: Remove scale_external_images() --- include/markdown.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/markdown.php b/include/markdown.php index 64f0a0854..2513a7d77 100644 --- a/include/markdown.php +++ b/include/markdown.php @@ -91,8 +91,6 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) { // remove duplicate adjacent code tags $s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s); - // Don't show link to full picture (until it is fixed) - $s = scale_external_images($s, false); /** * @hooks markdown_to_bb -- cgit v1.2.3 From 1541f67eab5f541d1f61001fc4e42132a9ac09f8 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 17 Dec 2018 13:28:58 +0100 Subject: Remove scale_external_images() --- include/network.php | 93 ----------------------------------------------------- 1 file changed, 93 deletions(-) diff --git a/include/network.php b/include/network.php index cd352e7db..e07001fa3 100644 --- a/include/network.php +++ b/include/network.php @@ -694,99 +694,6 @@ function sxml2array ( $xmlObject, $out = array () ) } -/** - * @brief Scales an external image. - * - * @param string $s - * @param string $include_link default true - * @param string $scale_replace default false - * @return string - */ -function scale_external_images($s, $include_link = true, $scale_replace = false) { - - // Picture addresses can contain special characters - $s = htmlspecialchars_decode($s, ENT_COMPAT); - - $matches = null; - $c = preg_match_all('/\[([zi])mg(.*?)\](.*?)\[\/[zi]mg\]/ism', $s, $matches, PREG_SET_ORDER); - if($c) { - require_once('include/photo/photo_driver.php'); - - foreach($matches as $mtch) { - logger('data: ' . $mtch[2] . ' ' . $mtch[3]); - - if(substr($mtch[2],0,1) == '=') { - $owidth = intval(substr($mtch[2],1)); - if($owidth > 0 && $owidth < 1024) - continue; - } - - $hostname = str_replace('www.','',substr(z_root(),strpos(z_root(),'://')+3)); - if(stristr($mtch[3],$hostname)) - continue; - - // $scale_replace, if passed, is an array of two elements. The - // first is the name of the full-size image. The second is the - // name of a remote, scaled-down version of the full size image. - // This allows Friendica to display the smaller remote image if - // one exists, while still linking to the full-size image - if($scale_replace) - $scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[3]); - else - $scaled = $mtch[3]; - - if(! strpbrk(substr($scaled, 0, 1), 'zhfmt')) - continue; - - $i = z_fetch_url($scaled, true); - - $cache = get_config('system', 'itemcache'); - if (($cache != '') and is_dir($cache)) { - $cachefile = $cache . '/' . hash('md5', $scaled); - file_put_contents($cachefile, $i['body']); - } - - // guess mimetype from headers or filename - - $type = guess_image_type($mtch[3], $i['header']); - if(strpos($type, 'image') === false) - continue; - - if($i['success']) { - $ph = photo_factory($i['body'], $type); - - if(! is_object($ph)) - continue; - - if($ph->is_valid()) { - $orig_width = $ph->getWidth(); - $orig_height = $ph->getHeight(); - - if($orig_width > 1024 || $orig_height > 1024) { - $tag = (($match[1] == 'z') ? 'zmg' : 'img'); - $linktag = (($match[1] == 'z') ? 'zrl' : 'url'); - $ph->scaleImage(1024); - $new_width = $ph->getWidth(); - $new_height = $ph->getHeight(); - logger('data: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG); - $s = str_replace($mtch[0],'[' . $tag . '=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/' . $tag . ']' - . "\n" . (($include_link) - ? '[' . $linktag . '=' . $mtch[3] . ']' . t('view full size') . '[/' . $linktag . ']' . "\n" - : ''),$s); - logger('new string: ' . $s, LOGGER_DEBUG); - } - } - } - } - } - - // replace the special char encoding - - $s = htmlspecialchars($s, ENT_COMPAT, 'UTF-8'); - - return $s; -} - /** * @brief xml2array() will convert the given XML text to an array in the XML structure. * -- cgit v1.2.3 From 3a662555768840d18c6dbba027af644eda54f20e Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 17 Dec 2018 13:29:37 +0100 Subject: Remove scale_external_images() --- include/text.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/text.php b/include/text.php index bd0d8048d..3cc21e4ce 100644 --- a/include/text.php +++ b/include/text.php @@ -3305,8 +3305,6 @@ function cleanup_bbcode($body) { $body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body); - $body = scale_external_images($body, false); - return $body; } -- cgit v1.2.3 From aace8a14cee2f173b7a11bb2bfcbcebbe0084863 Mon Sep 17 00:00:00 2001 From: phani00 Date: Mon, 17 Dec 2018 15:28:15 +0000 Subject: new fix for dark theme change implementation of hl-tags in include/bbcode.php insert class='default-highlight' instead of background-color: 'yellow' into span add span.default-highlight definition to view/theme/redbasic/css/style.css this works for all schemas incl. dark. --- include/bbcode.php | 3 ++- view/theme/redbasic/css/style.css | 10 ++++++++++ view/theme/redbasic/schema/dark.css | 40 +++++++++++++++---------------------- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index c5d6ef998..a0d41ccf0 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1021,7 +1021,8 @@ function bbcode($Text, $options = []) { } // Check for colored text if (strpos($Text,'[/hl]') !== false) { - $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "$1", $Text); + $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "$1", $Text); +// $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "$1", $Text); $Text = preg_replace("(\[hl=(.*?)\](.*?)\[\/hl\])ism", "$2", $Text); } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index f2c1b7a48..ba0cc7cd2 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1803,3 +1803,13 @@ dl.bb-dl > dd > li { .hover-fx-show:hover .hover-fx-hide { opacity: 1; } + +/* default highlighted text if not specified by schema: */ +span.default-highlight { + background-color: yellow; + color: #111; + margin: 0 2px; + padding: 2px 4px 2px 5px; + border-radius: 4px; + white-space: nowrap; +} diff --git a/view/theme/redbasic/schema/dark.css b/view/theme/redbasic/schema/dark.css index c00ddca90..a0b9b12d3 100644 --- a/view/theme/redbasic/schema/dark.css +++ b/view/theme/redbasic/schema/dark.css @@ -323,23 +323,6 @@ a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link { color: #aaa !important; } -/* phani: fix 1 */ -/*a.text-dark:focus, a.text-dark:hover { - color: #ddd !important; -} - -.badge-warning { - background-color: #ffc927; -} -.badge-warning a.text-dark { - color: #333 !important; -} -.badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover { - color: red !important; - text-decoration: none; -}*/ - - .group-selected, .fileas-selected, .categories-selected, .search-selected, a.active { color: #fff !important; text-decoration: underline !important; @@ -495,10 +478,19 @@ pre { background-color: #222; } -/* phani: fix 2 */ -/* change color of [hl] tag: */ -/*div.wall-item-body span { - color: #1212b6; - padding: 2px 3px; - white-space: nowrap; -}*/ + +/* category badge fix: */ +a.text-dark:focus, a.text-dark:hover { + color: #ddd !important; +} + +.badge-warning { +/* background-color: #ffc927; */ +} +.badge-warning a.text-dark { + color: #333 !important; +} +.badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover { + color: red !important; + text-decoration: none; +} -- cgit v1.2.3 From a33ed05bec38d35131d72e9b3d6d61b5d6a2daaf Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 17 Dec 2018 11:32:59 -0800 Subject: fix default values for affinity tool and other information which could be lost when approving a connection without the entire form provided by connedit. --- Zotlabs/Lib/Libzot.php | 4 +--- Zotlabs/Module/Connedit.php | 27 +++++++++++++++++++-------- Zotlabs/Update/_1230.php | 12 ++++++++++++ boot.php | 2 +- include/follow.php | 4 +--- 5 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 Zotlabs/Update/_1230.php diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 0fbde9765..87a5126f4 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -397,9 +397,7 @@ logger('4'); } } - $closeness = get_pconfig($channel['channel_id'],'system','new_abook_closeness'); - if($closeness === false) - $closeness = 80; + $closeness = get_pconfig($channel['channel_id'],'system','new_abook_closeness',80); $y = abook_store_lowlevel( [ diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index a9f643306..c14bcd0dd 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -101,7 +101,8 @@ class Connedit extends \Zotlabs\Web\Controller { } - $profile_id = $_POST['profile_assign']; + $profile_id = ((array_key_exists('profile_assign',$_POST)) ? $_POST['profile_assign'] : $orig_record[0]['abook_profile']); + if($profile_id) { $r = q("SELECT profile_guid FROM profile WHERE profile_guid = '%s' AND uid = %d LIMIT 1", dbesc($profile_id), @@ -113,18 +114,23 @@ class Connedit extends \Zotlabs\Web\Controller { } } - $abook_incl = escape_tags($_POST['abook_incl']); - $abook_excl = escape_tags($_POST['abook_excl']); - + $abook_incl = ((array_key_exists('abook_incl',$_POST)) ? escape_tags($_POST['abook_incl']) : $orig_record[0]['abook_incl']); + $abook_excl = ((array_key_exists('abook_excl',$_POST)) ? escape_tags($_POST['abook_excl']) : $orig_record[0]['abook_excl']); + + $hidden = intval($_POST['hidden']); $priority = intval($_POST['poll']); if($priority > 5 || $priority < 0) $priority = 0; + if(! array_key_exists('closeness',$_POST)) { + $_POST['closeness'] = 80; + } $closeness = intval($_POST['closeness']); - if($closeness < 0) - $closeness = 99; + if($closeness < 0 || $closeness > 99) { + $closeness = 80; + } $rating = intval($_POST['rating']); if($rating < (-10)) @@ -231,6 +237,8 @@ class Connedit extends \Zotlabs\Web\Controller { } $abook_pending = (($new_friend) ? 0 : $orig_record[0]['abook_pending']); + + $r = q("UPDATE abook SET abook_profile = '%s', abook_closeness = %d, abook_pending = %d, abook_incl = '%s', abook_excl = '%s' @@ -733,9 +741,12 @@ class Connedit extends \Zotlabs\Web\Controller { } $slider_tpl = get_markup_template('contact_slider.tpl'); + + $slideval = intval($contact['abook_closeness']); + $slide = replace_macros($slider_tpl,array( '$min' => 1, - '$val' => (($contact['abook_closeness']) ? $contact['abook_closeness'] : 99), + '$val' => $slideval, '$labels' => $label_str, )); } @@ -892,7 +903,7 @@ class Connedit extends \Zotlabs\Web\Controller { '$inherited' => t('inherited'), '$submit' => t('Submit'), '$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $contact['xchan_name']), - '$close' => $contact['abook_closeness'], + '$close' => (($contact['abook_closeness']) ? $contact['abook_closeness'] : 80), '$them' => t('Their Settings'), '$me' => t('My Settings'), '$perms' => $perms, diff --git a/Zotlabs/Update/_1230.php b/Zotlabs/Update/_1230.php new file mode 100644 index 000000000..fe59f2e08 --- /dev/null +++ b/Zotlabs/Update/_1230.php @@ -0,0 +1,12 @@ + Date: Mon, 17 Dec 2018 18:14:32 -0800 Subject: regression: mail from dev to core not delivering --- Zotlabs/Daemon/Notifier.php | 7 ++++++- include/zot.php | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 8b81c49da..beb30ed96 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -625,7 +625,12 @@ class Notifier { continue; } - $hash = new_uuid(); + // Do not change this to a uuid as long as we have traditional zot servers + // in the loop. The signature verification step can't handle dashes in the + // hashes. + + $hash = random_string(48); + $packet = null; $pmsg = ''; diff --git a/include/zot.php b/include/zot.php index d031b4a96..9934dae07 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1232,6 +1232,7 @@ function zot_fetch($arr) { $datatosend = json_encode(crypto_encapsulate(json_encode($data),$hub['hubloc_sitekey'], $algorithm)); $import = zot_zot($url,$datatosend); + } else { $algorithm = zot_best_algorithm($hub['site_crypto']); @@ -4913,6 +4914,7 @@ function zot_reply_pickup($data) { dbesc($data['secret']), dbesc($data['callback']) ); + if(! $r) { $ret['message'] = 'nothing to pick up'; logger('mod_zot: pickup: ' . $ret['message']); -- cgit v1.2.3 From bc6d384ca91bf754c10ead1d787bf1452c20e9d4 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 18 Dec 2018 10:43:06 +0100 Subject: make mod channel deal with b64 encoded mid\s ; --- Zotlabs/Module/Channel.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 12d87885f..5fdefd805 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -124,6 +124,11 @@ class Channel extends Controller { $mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : ''); + if(strpos($mid,'b64.') === 0) + $decoded = @base64url_decode(substr($mid,4)); + if($decoded) + $mid = $decoded; + $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']) : ''); @@ -375,6 +380,9 @@ class Channel extends Controller { if((! $update) && (! $load)) { + if($decoded) + $mid = 'b64.' . base64url_encode($mid); + // 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. -- cgit v1.2.3 From aaab905e726c126a36453f4ae08c39c3045bf412 Mon Sep 17 00:00:00 2001 From: phani00 Date: Tue, 18 Dec 2018 12:37:51 +0100 Subject: remove some fancy formatting. --- include/bbcode.php | 1 - view/theme/redbasic/css/style.css | 4 ---- 2 files changed, 5 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index a0d41ccf0..817986da0 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1022,7 +1022,6 @@ function bbcode($Text, $options = []) { // Check for colored text if (strpos($Text,'[/hl]') !== false) { $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "$1", $Text); -// $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "$1", $Text); $Text = preg_replace("(\[hl=(.*?)\](.*?)\[\/hl\])ism", "$2", $Text); } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index ba0cc7cd2..c7948cad1 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1808,8 +1808,4 @@ dl.bb-dl > dd > li { span.default-highlight { background-color: yellow; color: #111; - margin: 0 2px; - padding: 2px 4px 2px 5px; - border-radius: 4px; - white-space: nowrap; } -- cgit v1.2.3 From b97143e9db5c002145e2811cad4a1e12a9eaa259 Mon Sep 17 00:00:00 2001 From: phani00 Date: Tue, 18 Dec 2018 14:02:50 +0100 Subject: change hl text color to the default text color in non-dark schema. looks good, except in dark, where i can change it in dark.css. --- view/theme/redbasic/css/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index c7948cad1..303987c53 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1807,5 +1807,5 @@ dl.bb-dl > dd > li { /* default highlighted text if not specified by schema: */ span.default-highlight { background-color: yellow; - color: #111; + color: #4d4d4d; } -- cgit v1.2.3 From 2354bb5427d5d6b384c2e5b0f8fb9e676249e77b Mon Sep 17 00:00:00 2001 From: phani00 Date: Tue, 18 Dec 2018 17:54:39 +0100 Subject: remove color from style.css (default) but add a little padding; add color & border radius to dark.css. --- view/theme/redbasic/css/style.css | 2 +- view/theme/redbasic/schema/dark.css | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 303987c53..b406e710c 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1807,5 +1807,5 @@ dl.bb-dl > dd > li { /* default highlighted text if not specified by schema: */ span.default-highlight { background-color: yellow; - color: #4d4d4d; + padding: 2px 4px; } diff --git a/view/theme/redbasic/schema/dark.css b/view/theme/redbasic/schema/dark.css index a0b9b12d3..bf55fec72 100644 --- a/view/theme/redbasic/schema/dark.css +++ b/view/theme/redbasic/schema/dark.css @@ -494,3 +494,9 @@ a.text-dark:focus, a.text-dark:hover { color: red !important; text-decoration: none; } + +/* fix color for highlithed text */ +span.default-highlight { + color: #333; + border-radius: 4px; +} -- cgit v1.2.3 From 339c9cceeca1e9b54aa320aea48d164d1cc22e36 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 19 Dec 2018 10:05:18 +0100 Subject: check if we deal with an array before sizeof() --- Zotlabs/Module/Linkinfo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 7c7dc0e88..8b7defa39 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -138,8 +138,8 @@ class Linkinfo extends \Zotlabs\Web\Controller { } $image = ""; - - if(sizeof($siteinfo["images"]) > 0){ + + if(is_array($siteinfo["images"]) && (sizeof($siteinfo["images"]) > 0)){ /* Execute below code only if image is present in siteinfo */ $total_images = 0; @@ -161,7 +161,7 @@ class Linkinfo extends \Zotlabs\Web\Controller { $total_images ++; if($max_images && $max_images >= $total_images) break; - } + } } if(strlen($text)) { -- cgit v1.2.3 From 0e5d76e7359d3f38b971138069a239ae4ef171eb Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Wed, 19 Dec 2018 10:12:59 +0100 Subject: Add reload to util/addons --- util/addons | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/util/addons b/util/addons index 3d772bf73..7bd70984e 100755 --- a/util/addons +++ b/util/addons @@ -10,6 +10,7 @@ echo <<< EOT util/addons list all # list all addons (*)= installed, (!)= disabled due to version compatibility util/addons install foo # install addon named 'foo' util/addons uninstall foo # uninstall addon named 'foo' + util/addons reinstall # reinstall all plugins EOT; } @@ -68,6 +69,20 @@ if($argc == 2 && $argv[1] === 'list') { killme(); } +if($argc == 2 && $argv[1] === 'reinstall') { + require_once("include/plugin.php"); + if($plugins) { + foreach($plugins as $p) { + if($p[1]) { + echo "Reinstall: ". $p[0] . "\n"; + uninstall_plugin($p[0]); + install_plugin($p[0]); + } + } + } + killme(); +} + if($argc == 3 && $argv[1] === 'list' && $argv[2] === 'all') { if($plugins) { -- cgit v1.2.3 From 774dd6d5e333ac1988f1f3d830627cd7af68908e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 19 Dec 2018 11:08:28 +0100 Subject: use count() instead of sizeof() --- Zotlabs/Module/Linkinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 8b7defa39..32b4c0281 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -139,7 +139,7 @@ class Linkinfo extends \Zotlabs\Web\Controller { $image = ""; - if(is_array($siteinfo["images"]) && (sizeof($siteinfo["images"]) > 0)){ + if(is_array($siteinfo["images"]) && count($siteinfo["images"])){ /* Execute below code only if image is present in siteinfo */ $total_images = 0; -- cgit v1.2.3 From 7a55dd512a49a8a3c3e7ad1cfec2e42f9825afd1 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 19 Dec 2018 20:03:31 -0800 Subject: reverse activity mapping improvements --- Zotlabs/Lib/Activity.php | 89 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 87 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 8cef41c42..ef6ee6c3e 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -546,6 +546,12 @@ class Activity { } + + + + + + static function activity_mapper($verb) { if(strpos($verb,'/') === false) { @@ -588,6 +594,67 @@ class Activity { } + + static function activity_decode_mapper($verb) { + + $acts = [ + 'http://activitystrea.ms/schema/1.0/post' => 'Create', + 'http://activitystrea.ms/schema/1.0/share' => 'Announce', + 'http://activitystrea.ms/schema/1.0/update' => 'Update', + 'http://activitystrea.ms/schema/1.0/like' => 'Like', + 'http://activitystrea.ms/schema/1.0/favorite' => 'Like', + 'http://purl.org/zot/activity/dislike' => 'Dislike', + 'http://activitystrea.ms/schema/1.0/tag' => 'Add', + 'http://activitystrea.ms/schema/1.0/follow' => 'Follow', + 'http://activitystrea.ms/schema/1.0/unfollow' => 'Unfollow', + ]; + + + foreach($acts as $k => $v) { + if($verb === $v) { + return $k; + } + } + + logger('Unmapped activity: ' . $verb); + return 'Create'; + + } + + static function activity_obj_decode_mapper($obj) { + + $objs = [ + 'http://activitystrea.ms/schema/1.0/note' => 'Note', + 'http://activitystrea.ms/schema/1.0/note' => 'Article', + 'http://activitystrea.ms/schema/1.0/comment' => 'Note', + 'http://activitystrea.ms/schema/1.0/person' => 'Person', + 'http://purl.org/zot/activity/profile' => 'Profile', + 'http://activitystrea.ms/schema/1.0/photo' => 'Image', + 'http://activitystrea.ms/schema/1.0/profile-photo' => 'Icon', + 'http://activitystrea.ms/schema/1.0/event' => 'Event', + 'http://activitystrea.ms/schema/1.0/wiki' => 'Document', + 'http://purl.org/zot/activity/location' => 'Place', + 'http://purl.org/zot/activity/chessgame' => 'Game', + 'http://purl.org/zot/activity/tagterm' => 'zot:Tag', + 'http://purl.org/zot/activity/thing' => 'Object', + 'http://purl.org/zot/activity/file' => 'zot:File', + 'http://purl.org/zot/activity/mood' => 'zot:Mood', + + ]; + + foreach($objs as $k => $v) { + if($obj === $v) { + return $k; + } + } + + logger('Unmapped activity object: ' . $obj); + return 'Note'; + } + + + + static function activity_obj_mapper($obj) { if(strpos($obj,'/') === false) { @@ -1236,6 +1303,20 @@ class Activity { } + static function get_actor_bbmention($id) { + + $x = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where hubloc_hash = '%s' or hubloc_id_url = '%s' limit 1", + dbesc($id), + dbesc($id) + ); + + if($x) { + return sprintf('@[zrl=%s]%s[/zrl]',$x[0]['xchan_url'],$x[0]['xchan_name']); + } + return '@{' . $id . '}'; + + } + static function decode_note($act) { @@ -1320,13 +1401,17 @@ class Activity { $s['summary'] = self::bb_content($content,'summary'); $s['body'] = ((self::bb_content($content,'bbcode') && (! $response_activity)) ? self::bb_content($content,'bbcode') : self::bb_content($content,'content')); - $s['verb'] = self::activity_mapper($act->type); + $s['verb'] = self::activity_decode_mapper($act->type); if($act->type === 'Tombstone') { $s['item_deleted'] = 1; } - $s['obj_type'] = self::activity_obj_mapper($act->obj['type']); + $s['obj_type'] = self::activity_obj_decode_mapper($act->obj['type']); + if($s['obj_type'] === ACTIVITY_OBJ_NOTE && $s['mid'] !== $s['parent_mid']) { + $s['obj_type'] = ACTIVITY_OBJ_COMMENT; + } + $s['obj'] = $act->obj; $instrument = $act->get_property_obj('instrument'); -- cgit v1.2.3 From ec769bc9f948956a8093c675a14970461c5d8304 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 20 Dec 2018 19:45:11 +0100 Subject: missing observer check --- Zotlabs/Module/Like.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index d19154eb4..0455c5265 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -251,6 +251,9 @@ class Like extends \Zotlabs\Web\Controller { } } else { + + if(! $observer) + killme(); // this is used to like an item or comment -- cgit v1.2.3 From 389b4beba47823ebc0549ee8d7c0549c27b73b7a Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 20 Dec 2018 11:06:52 -0800 Subject: like permission issue --- Zotlabs/Module/Like.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index d19154eb4..142d3b499 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -52,7 +52,7 @@ class Like extends \Zotlabs\Web\Controller { $observer = \App::get_observer(); $interactive = $_REQUEST['interactive']; - if($interactive) { + if((! $observer) || ($interactive)) { $o .= '

      ' . t('Like/Dislike') . '

      '; $o .= EOL . EOL; -- cgit v1.2.3 From 090fe394e4733aea9e9ca2e9a93c2c27b266d065 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 20 Dec 2018 20:38:35 +0100 Subject: Fix cURL with HTTP/2 --- include/network.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/include/network.php b/include/network.php index 65770221f..8ac71011e 100644 --- a/include/network.php +++ b/include/network.php @@ -120,13 +120,8 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } - if(array_key_exists('http_version',$opts)) { + if(array_key_exists('http_version',$opts)) @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); - } - else { - @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); - } - if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @@ -165,7 +160,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { // Pull out multiple headers, e.g. proxy and continuation headers // allow for HTTP/2.x without fixing code - while(preg_match('/^HTTP\/[1-3].+? [1-5][0-9][0-9]/',$base)) { + while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) { $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $header .= $chunk; $base = substr($base,strlen($chunk)); @@ -298,12 +293,8 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } - if(array_key_exists('http_version',$opts)) { + if(array_key_exists('http_version',$opts)) @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); - } - else { - @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); - } if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @@ -338,7 +329,7 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { // Pull out multiple headers, e.g. proxy and continuation headers // allow for HTTP/2.x without fixing code - while(preg_match('/^HTTP\/[1-3].+? [1-5][0-9][0-9]/',$base)) { + while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) { $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $header .= $chunk; $base = substr($base,strlen($chunk)); -- cgit v1.2.3 From e4958d5bb94af7880c7560e380f64de4d7f12b22 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 20 Dec 2018 20:58:48 +0100 Subject: Revert "Fix cURL with HTTP/2" This reverts commit 090fe394e4733aea9e9ca2e9a93c2c27b266d065 --- include/network.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/include/network.php b/include/network.php index 8ac71011e..65770221f 100644 --- a/include/network.php +++ b/include/network.php @@ -120,8 +120,13 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } - if(array_key_exists('http_version',$opts)) + if(array_key_exists('http_version',$opts)) { @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); + } + else { + @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); + } + if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @@ -160,7 +165,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { // Pull out multiple headers, e.g. proxy and continuation headers // allow for HTTP/2.x without fixing code - while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) { + while(preg_match('/^HTTP\/[1-3].+? [1-5][0-9][0-9]/',$base)) { $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $header .= $chunk; $base = substr($base,strlen($chunk)); @@ -293,8 +298,12 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } - if(array_key_exists('http_version',$opts)) + if(array_key_exists('http_version',$opts)) { @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); + } + else { + @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); + } if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @@ -329,7 +338,7 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { // Pull out multiple headers, e.g. proxy and continuation headers // allow for HTTP/2.x without fixing code - while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) { + while(preg_match('/^HTTP\/[1-3].+? [1-5][0-9][0-9]/',$base)) { $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $header .= $chunk; $base = substr($base,strlen($chunk)); -- cgit v1.2.3 From 60f890ce0dd95cf3c4f7cb72b61bcd71ec0c170a Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 20 Dec 2018 21:13:05 +0100 Subject: Fix for cURL with default HTTP/2 --- include/network.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/include/network.php b/include/network.php index 65770221f..8ac71011e 100644 --- a/include/network.php +++ b/include/network.php @@ -120,13 +120,8 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } - if(array_key_exists('http_version',$opts)) { + if(array_key_exists('http_version',$opts)) @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); - } - else { - @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); - } - if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @@ -165,7 +160,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { // Pull out multiple headers, e.g. proxy and continuation headers // allow for HTTP/2.x without fixing code - while(preg_match('/^HTTP\/[1-3].+? [1-5][0-9][0-9]/',$base)) { + while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) { $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $header .= $chunk; $base = substr($base,strlen($chunk)); @@ -298,12 +293,8 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } - if(array_key_exists('http_version',$opts)) { + if(array_key_exists('http_version',$opts)) @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); - } - else { - @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); - } if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @@ -338,7 +329,7 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { // Pull out multiple headers, e.g. proxy and continuation headers // allow for HTTP/2.x without fixing code - while(preg_match('/^HTTP\/[1-3].+? [1-5][0-9][0-9]/',$base)) { + while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) { $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $header .= $chunk; $base = substr($base,strlen($chunk)); -- cgit v1.2.3 From e34853e19ea10bde7a4dc2e585da3c26d7032bdb Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 21 Dec 2018 12:51:19 +0100 Subject: do not add timestamp to the photo src. caching is handled in mod photo now. --- Zotlabs/Module/Photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index b87c586da..3833d5088 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -988,7 +988,7 @@ class Photos extends \Zotlabs\Web\Controller { $photo = array( 'href' => z_root() . '/photo/' . $hires['resource_id'] . '-' . $hires['imgscale'] . '.' . $phototypes[$hires['mimetype']], 'title'=> t('View Full Size'), - 'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['imgscale'] . '.' . $phototypes[$lores['mimetype']] . '?f=&_u=' . datetime_convert('','','','ymdhis') + 'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['imgscale'] . '.' . $phototypes[$lores['mimetype']] ); if($nextlink) -- cgit v1.2.3 From fac3579fb0124a13c5066c660e8a2bd89ed1e144 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 22 Dec 2018 19:47:46 +0100 Subject: revert padding for text highlight. It is messing with indent punctuation and decreases legibility of the highlighted text. --- view/theme/redbasic/css/style.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index b406e710c..18c3db665 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1806,6 +1806,5 @@ dl.bb-dl > dd > li { /* default highlighted text if not specified by schema: */ span.default-highlight { - background-color: yellow; - padding: 2px 4px; + background-color: yellow; } -- cgit v1.2.3 From cdb85f130933b2abe9da80119696f5d1d55bebc4 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 22 Dec 2018 21:00:01 +0100 Subject: update changelog --- CHANGELOG | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index a3dd1336b..5d0f35cc1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,21 @@ +Hubzilla 3.8.8 (2018-12-22) + - Fix issue with linkinfo + - Fix cURL with HTTP/2 + - Remove scale_external_images() + - Style highlight bbcode via css + - Make mod channel deal with b64 encoded mid's + - Fix email retrieval in OAuth2Storage + - Add reinstall option to util/addons + - Remove deprecated caching protection from mod photo + - Add missing check for observer in mod like + - Articles: default to logged in channel if channel name is not passed + - Wiki: fix preview issue with hyperlinks + - Cart: backport fixes from osada + - Gallery: provide file extensions for better compatibility + - Hsse: fix issue when linkinfo data was inserted + - Diaspora: remove deprecated scale_external_images() + + Hubzilla 3.8.7 (2018-12-14) - Fix issue with linkdropper in comment area - Fix regression wit app ordering -- cgit v1.2.3 From 37d7d18bb7b1e3bcadbb11c43a761d6953c2dc55 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 24 Dec 2018 09:22:58 +0100 Subject: Faster image processing with photo cache addon --- Zotlabs/Module/Photo.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index e236cc5f4..96a4e1f40 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -159,14 +159,15 @@ class Photo extends \Zotlabs\Web\Controller { // Validate cache $cache = array( 'resid' => $photo, - 'url' => htmlspecialchars_decode($r[0]['display_path']) + 'status' => false ); if($cache_mode['on']) call_hooks('cache_url_hook', $cache); - if($cache['url'] != '') { - if(strpos(z_root(),'https:') !== false && strpos($cache['url'],'https:') === false) - $cache['url'] = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($cache['url']); - header("Location: " . $cache['url']); + if(! $cache['status']) { + $url = htmlspecialchars_decode($r[0]['display_path']); + if(strpos(z_root(),'https:') !== false && strpos($url,'https:') === false) + $url = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($url); + header("Location: " . $url); killme(); } } -- cgit v1.2.3 From a50433dd958ec52eec88867517b3ae6467758618 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sun, 30 Dec 2018 15:05:45 -0500 Subject: Use subselect --- Zotlabs/Daemon/Master.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Daemon/Master.php b/Zotlabs/Daemon/Master.php index 0656ca05b..70d80d75b 100644 --- a/Zotlabs/Daemon/Master.php +++ b/Zotlabs/Daemon/Master.php @@ -89,7 +89,7 @@ class Master { $workersleep = ($workersleep) ? $workersleep : 5; cli_startup(); - $work = q("update config set k='%s' where cat='queuework' and k like '%s' limit 1", + $work = q("update config set k='%s' where id in (select id from config where cat='queuework' and k like '%s' limit 1)", 'workitem_'.self::$queueworker, dbesc('workitem:%')); $jobs = 0; @@ -122,9 +122,9 @@ class Master { break; } sleep ($workersleep); - $work = q("update config set k='%s' where cat='queuework' and k like '%s' limit 1", - 'workitem_'.self::$queueworker, - dbesc('workitem:%')); + $work = q("update config set k='%s' where id in (select id from config where cat='queuework' and k like '%s' limit 1)", + 'workitem_'.self::$queueworker, + dbesc('workitem:%')); } logger('Master: Worker Thread: queue items processed:' . $jobs); -- cgit v1.2.3 From f3f106c21f81cdb297a9f76765df3686eec1d95d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 2 Jan 2019 17:49:21 +0100 Subject: check suppported type if we get content type from header --- include/photo/photo_driver.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 9aeb2ef17..608237ce1 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -482,7 +482,6 @@ function guess_image_type($filename, $headers = '') { // logger('Photo: guess_image_type: '.$filename . ($headers?' from curl headers':''), LOGGER_DEBUG); $type = null; if ($headers) { - $hdrs=array(); $h = explode("\n",$headers); foreach ($h as $l) { @@ -490,11 +489,16 @@ function guess_image_type($filename, $headers = '') { $hdrs[strtolower($k)] = $v; } logger('Curl headers: '.var_export($hdrs, true), LOGGER_DEBUG); - if (array_key_exists('content-type', $hdrs)) + if (array_key_exists('content-type', $hdrs)) { $type = $hdrs['content-type']; + + $ph = photo_factory(''); + $types = $ph->supportedTypes(); + + $type = $types[$type]; + } } if (is_null($type)){ - $ignore_imagick = get_config('system', 'ignore_imagick'); // Guessing from extension? Isn't that... dangerous? if(class_exists('Imagick') && file_exists($filename) && is_readable($filename) && !$ignore_imagick) { @@ -638,7 +642,6 @@ function import_xchan_photo($photo,$xchan,$thing = false,$force = false) { $img_str = $result['body']; $type = guess_image_type($photo, $result['header']); $modified = gmdate('Y-m-d H:i:s', (preg_match('/last-modified: (.+) \S+/i', $result['header'], $o) ? strtotime($o[1] . 'Z') : time())); - if(is_null($type)) $photo_failure = true; } -- cgit v1.2.3 From b0339b848fc28aabee6cdc1b971330afc8e5ca89 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 2 Jan 2019 17:53:28 +0100 Subject: fix preg_match(): Delimiter must not be alphanumeric or backslash warning --- Zotlabs/Module/Pconfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Pconfig.php b/Zotlabs/Module/Pconfig.php index f31d5fdf6..06b94b34f 100644 --- a/Zotlabs/Module/Pconfig.php +++ b/Zotlabs/Module/Pconfig.php @@ -24,7 +24,7 @@ class Pconfig extends \Zotlabs\Web\Controller { $aj = intval($_POST['aj']); // Do not store "serialized" data received in the $_POST - if (preg_match('|^a:[0-9]+:{.*}$|s',$v) || preg_match('O:8:"stdClass":[0-9]+:{.*}$|s',$v)) { + if (preg_match('|^a:[0-9]+:{.*}$|s',$v) || preg_match('|O:8:"stdClass":[0-9]+:{.*}$|s',$v)) { return; } -- cgit v1.2.3 From aae4943e64bc8874be0802ec4faddb77f378b6c2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 2 Jan 2019 19:43:52 +0100 Subject: add zotsite.net to directory fallback servers --- boot.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 410aa91b1..321f1a93b 100755 --- a/boot.php +++ b/boot.php @@ -84,7 +84,8 @@ define ( 'DIRECTORY_FALLBACK_MASTER', 'https://zotadel.net'); $DIRECTORY_FALLBACK_SERVERS = array( 'https://hubzilla.zottel.net', - 'https://zotadel.net' + 'https://zotadel.net', + 'https://zotsite.net' ); -- cgit v1.2.3 From a19563e1396cb882063db3ce3f355b2db48175e9 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 2 Jan 2019 19:56:11 +0100 Subject: Revert "Use subselect" This reverts commit a50433dd958ec52eec88867517b3ae6467758618 --- Zotlabs/Daemon/Master.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Daemon/Master.php b/Zotlabs/Daemon/Master.php index 70d80d75b..0656ca05b 100644 --- a/Zotlabs/Daemon/Master.php +++ b/Zotlabs/Daemon/Master.php @@ -89,7 +89,7 @@ class Master { $workersleep = ($workersleep) ? $workersleep : 5; cli_startup(); - $work = q("update config set k='%s' where id in (select id from config where cat='queuework' and k like '%s' limit 1)", + $work = q("update config set k='%s' where cat='queuework' and k like '%s' limit 1", 'workitem_'.self::$queueworker, dbesc('workitem:%')); $jobs = 0; @@ -122,9 +122,9 @@ class Master { break; } sleep ($workersleep); - $work = q("update config set k='%s' where id in (select id from config where cat='queuework' and k like '%s' limit 1)", - 'workitem_'.self::$queueworker, - dbesc('workitem:%')); + $work = q("update config set k='%s' where cat='queuework' and k like '%s' limit 1", + 'workitem_'.self::$queueworker, + dbesc('workitem:%')); } logger('Master: Worker Thread: queue items processed:' . $jobs); -- cgit v1.2.3 From f660530ef5cce1fab2e7c16daad2239524cb5aac Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 2 Jan 2019 12:49:04 -0800 Subject: allow notification updates when composing comments. This was disabled when it was possible to have liveUpdate run automatically while composing comments, but it seems that live update is no longer possible (however the setting still remains - this should probably be removed). --- include/zid.php | 6 +++--- view/js/main.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/zid.php b/include/zid.php index fe06948ba..a37ebe1f6 100644 --- a/include/zid.php +++ b/include/zid.php @@ -70,9 +70,9 @@ function zid($s, $address = '') { $zurl .= '#' . $fragment; $arr = [ - 'url' => $s, - 'zid' => urlencode($myaddr), - 'result' => $zurl + 'url' => $s, + 'zid' => urlencode($myaddr), + 'result' => $zurl ]; /** * @hooks zid diff --git a/view/js/main.js b/view/js/main.js index a69bcfa64..0169ee54c 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -888,7 +888,7 @@ function liveUpdate(notify_id) { if((src === null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; } - if(($('.comment-edit-text.expanded').length) || (in_progress) || (mediaPlaying)) { + if(in_progress || mediaPlaying) { if(livetime) { clearTimeout(livetime); } -- cgit v1.2.3 From dbd230da7407ac70483c004bc82f4b8619c42760 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 2 Jan 2019 22:41:03 +0100 Subject: update composer libs --- composer.lock | 336 ++++++++++++++------- vendor/bshaffer/oauth2-server-php/CHANGELOG.md | 4 +- vendor/bshaffer/oauth2-server-php/README.md | 2 +- .../oauth2-server-php/src/OAuth2/Request.php | 7 +- .../oauth2-server-php/src/OAuth2/Response.php | 2 +- .../src/OAuth2/ResponseType/JwtAccessToken.php | 18 +- .../oauth2-server-php/src/OAuth2/Server.php | 9 +- .../oauth2-server-php/test/OAuth2/RequestTest.php | 18 ++ .../oauth2-server-php/test/OAuth2/ResponseTest.php | 23 +- .../OAuth2/ResponseType/JwtAccessTokenTest.php | 21 +- .../test/OAuth2/Storage/PdoTest.php | 8 +- .../test/lib/OAuth2/Storage/Bootstrap.php | 2 +- vendor/composer/autoload_classmap.php | 5 +- vendor/composer/autoload_static.php | 5 +- vendor/composer/installed.json | 24 +- vendor/league/html-to-markdown/CHANGELOG.md | 11 +- .../src/Converter/DefaultConverter.php | 8 +- .../src/Converter/HardBreakConverter.php | 5 +- 18 files changed, 362 insertions(+), 146 deletions(-) diff --git a/composer.lock b/composer.lock index bd95e8c78..c4fba0975 100644 --- a/composer.lock +++ b/composer.lock @@ -63,16 +63,16 @@ }, { "name": "bshaffer/oauth2-server-php", - "version": "v1.10.0", + "version": "v1.11.1", "source": { "type": "git", "url": "https://github.com/bshaffer/oauth2-server-php.git", - "reference": "d158878425392fe5a0cc34f15dbaf46315ae0ed9" + "reference": "5a0c8000d4763b276919e2106f54eddda6bc50fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bshaffer/oauth2-server-php/zipball/d158878425392fe5a0cc34f15dbaf46315ae0ed9", - "reference": "d158878425392fe5a0cc34f15dbaf46315ae0ed9", + "url": "https://api.github.com/repos/bshaffer/oauth2-server-php/zipball/5a0c8000d4763b276919e2106f54eddda6bc50fa", + "reference": "5a0c8000d4763b276919e2106f54eddda6bc50fa", "shasum": "" }, "require": { @@ -117,7 +117,7 @@ "oauth", "oauth2" ], - "time": "2017-11-15T01:41:02+00:00" + "time": "2018-12-04T00:29:32+00:00" }, { "name": "commerceguys/intl", @@ -251,16 +251,16 @@ }, { "name": "league/html-to-markdown", - "version": "4.8.0", + "version": "4.8.1", "source": { "type": "git", "url": "https://github.com/thephpleague/html-to-markdown.git", - "reference": "f9a879a068c68ff47b722de63f58bec79e448f9d" + "reference": "250d1bf45f80d15594fb6b316df777d6d4c97ad1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/f9a879a068c68ff47b722de63f58bec79e448f9d", - "reference": "f9a879a068c68ff47b722de63f58bec79e448f9d", + "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/250d1bf45f80d15594fb6b316df777d6d4c97ad1", + "reference": "250d1bf45f80d15594fb6b316df777d6d4c97ad1", "shasum": "" }, "require": { @@ -311,7 +311,7 @@ "html", "markdown" ], - "time": "2018-09-18T12:18:08+00:00" + "time": "2018-12-24T17:21:44+00:00" }, { "name": "lukasreschke/id3parser", @@ -1925,32 +1925,33 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.4.2", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + "reference": "9f83dded91781a01c63574e387eaa769be769115" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0" + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -1980,13 +1981,14 @@ "keywords": [ "http", "message", + "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2018-12-04T20:46:45+00:00" }, { "name": "myclabs/deep-copy", @@ -2571,6 +2573,7 @@ "testing", "xunit" ], + "abandoned": true, "time": "2018-02-07T06:47:59+00:00" }, { @@ -2827,16 +2830,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.4.4", + "version": "7.5.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b1be2c8530c4c29c3519a052c9fb6cee55053bbd" + "reference": "c23d78776ad415d5506e0679723cb461d71f488f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b1be2c8530c4c29c3519a052c9fb6cee55053bbd", - "reference": "b1be2c8530c4c29c3519a052c9fb6cee55053bbd", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c23d78776ad415d5506e0679723cb461d71f488f", + "reference": "c23d78776ad415d5506e0679723cb461d71f488f", "shasum": "" }, "require": { @@ -2857,7 +2860,7 @@ "phpunit/php-timer": "^2.0", "sebastian/comparator": "^3.0", "sebastian/diff": "^3.0", - "sebastian/environment": "^3.1 || ^4.0", + "sebastian/environment": "^4.0", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", @@ -2881,7 +2884,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.4-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -2907,7 +2910,7 @@ "testing", "xunit" ], - "time": "2018-11-14T16:52:02+00:00" + "time": "2018-12-12T07:20:32+00:00" }, { "name": "psr/container", @@ -3008,6 +3011,46 @@ ], "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -3175,28 +3218,28 @@ }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "febd209a219cea7b56ad799b30ebbea34b71eb8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/febd209a219cea7b56ad799b30ebbea34b71eb8f", + "reference": "febd209a219cea7b56ad799b30ebbea34b71eb8f", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^7.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -3221,7 +3264,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2018-11-25T09:31:21+00:00" }, { "name": "sebastian/exporter", @@ -3573,16 +3616,16 @@ }, { "name": "symfony/browser-kit", - "version": "v4.1.7", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd" + "reference": "db7e59fec9c82d45e745eb500e6ede2d96f4a6e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c55fe9257003b2d95c0211b3f6941e8dfd26dffd", - "reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/db7e59fec9c82d45e745eb500e6ede2d96f4a6e9", + "reference": "db7e59fec9c82d45e745eb500e6ede2d96f4a6e9", "shasum": "" }, "require": { @@ -3599,7 +3642,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -3626,20 +3669,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:10:45+00:00" + "time": "2018-11-26T11:49:31+00:00" }, { "name": "symfony/class-loader", - "version": "v3.4.18", + "version": "v3.4.20", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "5605edec7b8f034ead2497ff4aab17bb70d558c1" + "reference": "420458095cf60025eb0841276717e0da7f75e50e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/5605edec7b8f034ead2497ff4aab17bb70d558c1", - "reference": "5605edec7b8f034ead2497ff4aab17bb70d558c1", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/420458095cf60025eb0841276717e0da7f75e50e", + "reference": "420458095cf60025eb0841276717e0da7f75e50e", "shasum": "" }, "require": { @@ -3682,20 +3725,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2018-10-31T09:06:03+00:00" + "time": "2018-11-11T19:48:54+00:00" }, { "name": "symfony/config", - "version": "v4.1.7", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238" + "reference": "005d9a083d03f588677d15391a716b1ac9b887c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", - "reference": "991fec8bbe77367fc8b48ecbaa8a4bd6e905a238", + "url": "https://api.github.com/repos/symfony/config/zipball/005d9a083d03f588677d15391a716b1ac9b887c0", + "reference": "005d9a083d03f588677d15391a716b1ac9b887c0", "shasum": "" }, "require": { @@ -3718,7 +3761,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -3745,24 +3788,25 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-10-31T09:09:42+00:00" + "time": "2018-11-30T22:21:14+00:00" }, { "name": "symfony/console", - "version": "v4.1.7", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "432122af37d8cd52fba1b294b11976e0d20df595" + "reference": "4dff24e5d01e713818805c1862d2e3f901ee7dd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/432122af37d8cd52fba1b294b11976e0d20df595", - "reference": "432122af37d8cd52fba1b294b11976e0d20df595", + "url": "https://api.github.com/repos/symfony/console/zipball/4dff24e5d01e713818805c1862d2e3f901ee7dd0", + "reference": "4dff24e5d01e713818805c1862d2e3f901ee7dd0", "shasum": "" }, "require": { "php": "^7.1.3", + "symfony/contracts": "^1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -3786,7 +3830,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -3813,20 +3857,88 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-31T09:30:44+00:00" + "time": "2018-11-27T07:40:44+00:00" + }, + { + "name": "symfony/contracts", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "exclude-from-classmap": [ + "**/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" }, { "name": "symfony/css-selector", - "version": "v3.4.18", + "version": "v3.4.20", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb" + "reference": "345b9a48595d1ab9630db791dbc3e721bf0233e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/3503415d4aafabc31cd08c3a4ebac7f43fde8feb", - "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/345b9a48595d1ab9630db791dbc3e721bf0233e8", + "reference": "345b9a48595d1ab9630db791dbc3e721bf0233e8", "shasum": "" }, "require": { @@ -3866,37 +3978,39 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-11-11T19:48:54+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.1.7", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483" + "reference": "e4adc57a48d3fa7f394edfffa9e954086d7740e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e72ee2c23d952e4c368ee98610fa22b79b89b483", - "reference": "e72ee2c23d952e4c368ee98610fa22b79b89b483", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e4adc57a48d3fa7f394edfffa9e954086d7740e5", + "reference": "e4adc57a48d3fa7f394edfffa9e954086d7740e5", "shasum": "" }, "require": { "php": "^7.1.3", - "psr/container": "^1.0" + "psr/container": "^1.0", + "symfony/contracts": "^1.0" }, "conflict": { - "symfony/config": "<4.1.1", + "symfony/config": "<4.2", "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" }, "provide": { - "psr/container-implementation": "1.0" + "psr/container-implementation": "1.0", + "symfony/service-contracts-implementation": "1.0" }, "require-dev": { - "symfony/config": "~4.1", + "symfony/config": "~4.2", "symfony/expression-language": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, @@ -3910,7 +4024,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -3937,20 +4051,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-10-31T10:54:16+00:00" + "time": "2018-12-02T15:59:36+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.1.7", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "80e60271bb288de2a2259662cff125cff4f93f95" + "reference": "7438a32108fdd555295f443605d6de2cce473159" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/80e60271bb288de2a2259662cff125cff4f93f95", - "reference": "80e60271bb288de2a2259662cff125cff4f93f95", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/7438a32108fdd555295f443605d6de2cce473159", + "reference": "7438a32108fdd555295f443605d6de2cce473159", "shasum": "" }, "require": { @@ -3967,7 +4081,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -3994,24 +4108,25 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:40:59+00:00" + "time": "2018-11-26T10:55:26+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.1.7", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "552541dad078c85d9414b09c041ede488b456cd5" + "reference": "921f49c3158a276d27c0d770a5a347a3b718b328" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/552541dad078c85d9414b09c041ede488b456cd5", - "reference": "552541dad078c85d9414b09c041ede488b456cd5", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/921f49c3158a276d27c0d770a5a347a3b718b328", + "reference": "921f49c3158a276d27c0d770a5a347a3b718b328", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/contracts": "^1.0" }, "conflict": { "symfony/dependency-injection": "<3.4" @@ -4030,7 +4145,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -4057,20 +4172,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-10-10T13:52:42+00:00" + "time": "2018-12-01T08:52:38+00:00" }, { "name": "symfony/filesystem", - "version": "v4.1.7", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981" + "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd7bd6535beb1f0a0a9e3ee960666d0598546981", - "reference": "fd7bd6535beb1f0a0a9e3ee960666d0598546981", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2f4c8b999b3b7cadb2a69390b01af70886753710", + "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710", "shasum": "" }, "require": { @@ -4080,7 +4195,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -4107,7 +4222,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-10-30T13:18:25+00:00" + "time": "2018-11-11T19:52:12+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -4170,20 +4285,21 @@ }, { "name": "symfony/translation", - "version": "v4.1.7", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "aa04dc1c75b7d3da7bd7003104cd0cfc5dff635c" + "reference": "c0e2191e9bed845946ab3d99767513b56ca7dcd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/aa04dc1c75b7d3da7bd7003104cd0cfc5dff635c", - "reference": "aa04dc1c75b7d3da7bd7003104cd0cfc5dff635c", + "url": "https://api.github.com/repos/symfony/translation/zipball/c0e2191e9bed845946ab3d99767513b56ca7dcd6", + "reference": "c0e2191e9bed845946ab3d99767513b56ca7dcd6", "shasum": "" }, "require": { "php": "^7.1.3", + "symfony/contracts": "^1.0.2", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -4191,6 +4307,9 @@ "symfony/dependency-injection": "<3.4", "symfony/yaml": "<3.4" }, + "provide": { + "symfony/translation-contracts-implementation": "1.0" + }, "require-dev": { "psr/log": "~1.0", "symfony/config": "~3.4|~4.0", @@ -4208,7 +4327,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -4235,20 +4354,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-10-28T18:38:52+00:00" + "time": "2018-12-06T10:45:32+00:00" }, { "name": "symfony/yaml", - "version": "v4.1.7", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "367e689b2fdc19965be435337b50bc8adf2746c9" + "reference": "c41175c801e3edfda90f32e292619d10c27103d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/367e689b2fdc19965be435337b50bc8adf2746c9", - "reference": "367e689b2fdc19965be435337b50bc8adf2746c9", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c41175c801e3edfda90f32e292619d10c27103d7", + "reference": "c41175c801e3edfda90f32e292619d10c27103d7", "shasum": "" }, "require": { @@ -4267,7 +4386,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -4294,7 +4413,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:36:10+00:00" + "time": "2018-11-11T19:52:12+00:00" }, { "name": "theseer/tokenizer", @@ -4338,20 +4457,21 @@ }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -4384,7 +4504,7 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2018-12-25T11:19:39+00:00" } ], "aliases": [], diff --git a/vendor/bshaffer/oauth2-server-php/CHANGELOG.md b/vendor/bshaffer/oauth2-server-php/CHANGELOG.md index 7671b2396..1b87f3da3 100644 --- a/vendor/bshaffer/oauth2-server-php/CHANGELOG.md +++ b/vendor/bshaffer/oauth2-server-php/CHANGELOG.md @@ -8,7 +8,7 @@ To see the files changed for a given bug, go to https://github.com/bshaffer/oaut To get the diff between two versions, go to https://github.com/bshaffer/oauth2-server-php/compare/v1.0...v1.1 To get the diff for a specific change, go to https://github.com/bshaffer/oauth2-server-php/commit/XXX where XXX is the change hash -* 1.10.0 (2017-12-14) +* 1.10.0 (2017-11-15) PR: https://github.com/bshaffer/oauth2-server-php/pull/889 @@ -26,7 +26,7 @@ To get the diff for a specific change, go to https://github.com/bshaffer/oauth2- * #794 - [docs] Fix typo in composer.json * #885 - [testing] Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase -* 1.9.0 (2016-01-06) +* 1.9.0 (2017-01-06) PR: https://github.com/bshaffer/oauth2-server-php/pull/788 diff --git a/vendor/bshaffer/oauth2-server-php/README.md b/vendor/bshaffer/oauth2-server-php/README.md index f1788e9ce..117743d4f 100644 --- a/vendor/bshaffer/oauth2-server-php/README.md +++ b/vendor/bshaffer/oauth2-server-php/README.md @@ -1,7 +1,7 @@ oauth2-server-php ================= -[![Build Status](https://travis-ci.org/bshaffer/oauth2-server-php.svg?branch=develop)](https://travis-ci.org/bshaffer/oauth2-server-php) +[![Build Status](https://travis-ci.org/bshaffer/oauth2-server-php.svg?branch=master)](https://travis-ci.org/bshaffer/oauth2-server-php) [![Total Downloads](https://poser.pugx.org/bshaffer/oauth2-server-php/downloads.png)](https://packagist.org/packages/bshaffer/oauth2-server-php) diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Request.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Request.php index c96cb972f..f547bf6e8 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Request.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Request.php @@ -64,7 +64,12 @@ class Request implements RequestInterface $this->files = $files; $this->server = $server; $this->content = $content; - $this->headers = is_null($headers) ? $this->getHeadersFromServer($this->server) : $headers; + + if ($headers === null) { + $headers = array(); + } + + $this->headers = $headers + $this->getHeadersFromServer($this->server); } /** diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Response.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Response.php index ccd797ae7..88c1ad5f7 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Response.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Response.php @@ -366,7 +366,7 @@ class Response implements ResponseInterface if (count($this->parameters) > 0) { // add parameters to URL redirection $parts = parse_url($url); - $sep = isset($parts['query']) && count($parts['query']) > 0 ? '&' : '?'; + $sep = isset($parts['query']) && !empty($parts['query']) ? '&' : '?'; $url .= $sep . http_build_query($this->parameters); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/JwtAccessToken.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/JwtAccessToken.php index 0af9705ff..0ee3708aa 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/JwtAccessToken.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/JwtAccessToken.php @@ -128,7 +128,7 @@ class JwtAccessToken extends AccessToken $expires = time() + $this->config['access_lifetime']; $id = $this->generateAccessToken(); - return array( + $payload = array( 'id' => $id, // for BC (see #591) 'jti' => $id, 'iss' => $this->config['issuer'], @@ -139,5 +139,21 @@ class JwtAccessToken extends AccessToken 'token_type' => $this->config['token_type'], 'scope' => $scope ); + + if (isset($this->config['jwt_extra_payload_callable'])) { + if (!is_callable($this->config['jwt_extra_payload_callable'])) { + throw new \InvalidArgumentException('jwt_extra_payload_callable is not callable'); + } + + $extra = call_user_func($this->config['jwt_extra_payload_callable'], $client_id, $user_id, $scope); + + if (!is_array($extra)) { + throw new \InvalidArgumentException('jwt_extra_payload_callable must return array'); + } + + $payload = array_merge($extra, $payload); + } + + return $payload; } } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Server.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Server.php index 62ae8970d..cf040c2bc 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Server.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Server.php @@ -88,12 +88,12 @@ class Server implements ResourceControllerInterface, /** * @var array */ - protected $grantTypes = []; + protected $grantTypes = array(); /** * @var array */ - protected $responseTypes = []; + protected $responseTypes = array(); /** * @var TokenTypeInterface @@ -161,6 +161,7 @@ class Server implements ResourceControllerInterface, // merge all config values. These get passed to our controller objects $this->config = array_merge(array( 'use_jwt_access_tokens' => false, + 'jwt_extra_payload_callable' => null, 'store_encrypted_token_string' => true, 'use_openid_connect' => false, 'id_lifetime' => 3600, @@ -840,7 +841,7 @@ class Server implements ResourceControllerInterface, $refreshStorage = $this->storages['refresh_token']; } - $config = array_intersect_key($this->config, array_flip(explode(' ', 'store_encrypted_token_string issuer access_lifetime refresh_token_lifetime'))); + $config = array_intersect_key($this->config, array_flip(explode(' ', 'store_encrypted_token_string issuer access_lifetime refresh_token_lifetime jwt_extra_payload_callable'))); return new JwtAccessToken($this->storages['public_key'], $tokenStorage, $refreshStorage, $config); } @@ -1015,4 +1016,4 @@ class Server implements ResourceControllerInterface, { return isset($this->config[$name]) ? $this->config[$name] : $default; } -} \ No newline at end of file +} diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/RequestTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/RequestTest.php index cbf8f096b..770cd8994 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/RequestTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/RequestTest.php @@ -86,6 +86,24 @@ class RequestTest extends TestCase $this->assertEquals('correct', $request->query('client_id', $request->request('client_id'))); } + public function testRequestHasHeadersAndServerHeaders() + { + $request = new Request( + array(), + array(), + array(), + array(), + array(), + array('CONTENT_TYPE' => 'text/xml', 'PHP_AUTH_USER' => 'client_id', 'PHP_AUTH_PW' => 'client_pass'), + null, + array('CONTENT_TYPE' => 'application/json') + ); + + $this->assertSame('client_id', $request->headers('PHP_AUTH_USER')); + $this->assertSame('client_pass', $request->headers('PHP_AUTH_PW')); + $this->assertSame('application/json', $request->headers('CONTENT_TYPE')); + } + private function getTestServer($config = array()) { $storage = Bootstrap::getInstance()->getMemoryStorage(); diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php index 2d2c57ee6..172bc88fd 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php @@ -1,6 +1,8 @@ getResponseBody('xml'); $this->assertContains('baroates', $string); } + + public function testSetRedirect() + { + $response = new Response(); + $url = 'https://foo/bar'; + $state = 'stateparam'; + $response->setRedirect(301, $url, $state); + $this->assertEquals( + sprintf('%s?state=%s', $url, $state), + $response->getHttpHeader('Location') + ); + + $query = 'query=foo'; + $response->setRedirect(301, $url . '?' . $query, $state); + $this->assertEquals( + sprintf('%s?%s&state=%s', $url, $query, $state), + $response->getHttpHeader('Location') + ); + } } diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseType/JwtAccessTokenTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseType/JwtAccessTokenTest.php index 7e37509ef..6195d557a 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseType/JwtAccessTokenTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseType/JwtAccessTokenTest.php @@ -40,6 +40,23 @@ class JwtAccessTokenTest extends TestCase $this->assertEquals(3600, $delta); $this->assertEquals($decodedAccessToken['id'], $decodedAccessToken['jti']); } + + public function testExtraPayloadCallback() + { + $jwtconfig = array('jwt_extra_payload_callable' => function() { + return array('custom_param' => 'custom_value'); + }); + + $server = $this->getTestServer($jwtconfig); + $jwtResponseType = $server->getResponseType('token'); + + $accessToken = $jwtResponseType->createAccessToken('Test Client ID', 123, 'test', false); + $jwt = new Jwt; + $decodedAccessToken = $jwt->decode($accessToken['access_token'], null, false); + + $this->assertArrayHasKey('custom_param', $decodedAccessToken); + $this->assertEquals('custom_value', $decodedAccessToken['custom_param']); + } public function testGrantJwtAccessToken() { @@ -140,7 +157,7 @@ class JwtAccessTokenTest extends TestCase $this->assertNotNull($response->getParameter('access_token')); } - private function getTestServer() + private function getTestServer($jwtconfig = array()) { $memoryStorage = Bootstrap::getInstance()->getMemoryStorage(); @@ -153,7 +170,7 @@ class JwtAccessTokenTest extends TestCase $server->addGrantType(new ClientCredentials($memoryStorage)); // make the "token" response type a JwtAccessToken - $config = array('issuer' => 'https://api.example.com'); + $config = array_merge(array('issuer' => 'https://api.example.com'), $jwtconfig); $server->addResponseType(new JwtAccessToken($memoryStorage, $memoryStorage, null, $config)); return $server; diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Storage/PdoTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Storage/PdoTest.php index 57eb39072..4599f69bf 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Storage/PdoTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Storage/PdoTest.php @@ -6,7 +6,8 @@ class PdoTest extends BaseTest { public function testCreatePdoStorageUsingPdoClass() { - $pdo = new \PDO(sprintf('sqlite://%s', Bootstrap::getInstance()->getSqliteDir())); + $dsn = sprintf('sqlite:%s', Bootstrap::getInstance()->getSqliteDir()); + $pdo = new \PDO($dsn); $storage = new Pdo($pdo); $this->assertNotNull($storage->getClientDetails('oauth_test_client')); @@ -14,7 +15,7 @@ class PdoTest extends BaseTest public function testCreatePdoStorageUsingDSN() { - $dsn = sprintf('sqlite://%s', Bootstrap::getInstance()->getSqliteDir()); + $dsn = sprintf('sqlite:%s', Bootstrap::getInstance()->getSqliteDir()); $storage = new Pdo($dsn); $this->assertNotNull($storage->getClientDetails('oauth_test_client')); @@ -22,7 +23,8 @@ class PdoTest extends BaseTest public function testCreatePdoStorageUsingConfig() { - $config = array('dsn' => sprintf('sqlite://%s', Bootstrap::getInstance()->getSqliteDir())); + $dsn = sprintf('sqlite:%s', Bootstrap::getInstance()->getSqliteDir()); + $config = array('dsn' => $dsn); $storage = new Pdo($config); $this->assertNotNull($storage->getClientDetails('oauth_test_client')); diff --git a/vendor/bshaffer/oauth2-server-php/test/lib/OAuth2/Storage/Bootstrap.php b/vendor/bshaffer/oauth2-server-php/test/lib/OAuth2/Storage/Bootstrap.php index 3d7bdd4e9..8e428f9b5 100644 --- a/vendor/bshaffer/oauth2-server-php/test/lib/OAuth2/Storage/Bootstrap.php +++ b/vendor/bshaffer/oauth2-server-php/test/lib/OAuth2/Storage/Bootstrap.php @@ -36,7 +36,7 @@ class Bootstrap { if (!$this->sqlite) { $this->removeSqliteDb(); - $pdo = new \PDO(sprintf('sqlite://%s', $this->getSqliteDir())); + $pdo = new \PDO(sprintf('sqlite:%s', $this->getSqliteDir())); $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $this->createSqliteDb($pdo); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 86acbb152..ff64c904f 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -380,9 +380,6 @@ return array( 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', - 'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php', 'Ramsey\\Uuid\\BinaryUtils' => $vendorDir . '/ramsey/uuid/src/BinaryUtils.php', 'Ramsey\\Uuid\\Builder\\DefaultUuidBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/DefaultUuidBuilder.php', 'Ramsey\\Uuid\\Builder\\DegradedUuidBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/DegradedUuidBuilder.php', @@ -1343,6 +1340,8 @@ return array( 'Zotlabs\\Update\\_1226' => $baseDir . '/Zotlabs/Update/_1226.php', 'Zotlabs\\Update\\_1227' => $baseDir . '/Zotlabs/Update/_1227.php', 'Zotlabs\\Update\\_1228' => $baseDir . '/Zotlabs/Update/_1228.php', + 'Zotlabs\\Update\\_1229' => $baseDir . '/Zotlabs/Update/_1229.php', + 'Zotlabs\\Update\\_1230' => $baseDir . '/Zotlabs/Update/_1230.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', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index ea23de753..69c31dd65 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -548,9 +548,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', - 'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php', 'Ramsey\\Uuid\\BinaryUtils' => __DIR__ . '/..' . '/ramsey/uuid/src/BinaryUtils.php', 'Ramsey\\Uuid\\Builder\\DefaultUuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/DefaultUuidBuilder.php', 'Ramsey\\Uuid\\Builder\\DegradedUuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/DegradedUuidBuilder.php', @@ -1511,6 +1508,8 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Zotlabs\\Update\\_1226' => __DIR__ . '/../..' . '/Zotlabs/Update/_1226.php', 'Zotlabs\\Update\\_1227' => __DIR__ . '/../..' . '/Zotlabs/Update/_1227.php', 'Zotlabs\\Update\\_1228' => __DIR__ . '/../..' . '/Zotlabs/Update/_1228.php', + 'Zotlabs\\Update\\_1229' => __DIR__ . '/../..' . '/Zotlabs/Update/_1229.php', + 'Zotlabs\\Update\\_1230' => __DIR__ . '/../..' . '/Zotlabs/Update/_1230.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', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index d2f86ea99..7f829f6a4 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -58,17 +58,17 @@ }, { "name": "bshaffer/oauth2-server-php", - "version": "v1.10.0", - "version_normalized": "1.10.0.0", + "version": "v1.11.1", + "version_normalized": "1.11.1.0", "source": { "type": "git", "url": "https://github.com/bshaffer/oauth2-server-php.git", - "reference": "d158878425392fe5a0cc34f15dbaf46315ae0ed9" + "reference": "5a0c8000d4763b276919e2106f54eddda6bc50fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bshaffer/oauth2-server-php/zipball/d158878425392fe5a0cc34f15dbaf46315ae0ed9", - "reference": "d158878425392fe5a0cc34f15dbaf46315ae0ed9", + "url": "https://api.github.com/repos/bshaffer/oauth2-server-php/zipball/5a0c8000d4763b276919e2106f54eddda6bc50fa", + "reference": "5a0c8000d4763b276919e2106f54eddda6bc50fa", "shasum": "" }, "require": { @@ -89,7 +89,7 @@ "predis/predis": "Required to use Redis storage", "thobbs/phpcassa": "Required to use Cassandra storage" }, - "time": "2017-11-15T01:41:02+00:00", + "time": "2018-12-04T00:29:32+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -254,17 +254,17 @@ }, { "name": "league/html-to-markdown", - "version": "4.8.0", - "version_normalized": "4.8.0.0", + "version": "4.8.1", + "version_normalized": "4.8.1.0", "source": { "type": "git", "url": "https://github.com/thephpleague/html-to-markdown.git", - "reference": "f9a879a068c68ff47b722de63f58bec79e448f9d" + "reference": "250d1bf45f80d15594fb6b316df777d6d4c97ad1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/f9a879a068c68ff47b722de63f58bec79e448f9d", - "reference": "f9a879a068c68ff47b722de63f58bec79e448f9d", + "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/250d1bf45f80d15594fb6b316df777d6d4c97ad1", + "reference": "250d1bf45f80d15594fb6b316df777d6d4c97ad1", "shasum": "" }, "require": { @@ -277,7 +277,7 @@ "phpunit/phpunit": "4.*", "scrutinizer/ocular": "~1.1" }, - "time": "2018-09-18T12:18:08+00:00", + "time": "2018-12-24T17:21:44+00:00", "bin": [ "bin/html-to-markdown" ], diff --git a/vendor/league/html-to-markdown/CHANGELOG.md b/vendor/league/html-to-markdown/CHANGELOG.md index ab07c94f5..e1893be9a 100644 --- a/vendor/league/html-to-markdown/CHANGELOG.md +++ b/vendor/league/html-to-markdown/CHANGELOG.md @@ -4,6 +4,14 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ## [Unreleased][unreleased] +## [4.8.1] - 2018-12-24 +### Added + - Added support for PHP 7.3 + +### Fixed + - Fixed paragraphs following tables (#165, #166) + - Fixed incorrect list item escaping (#168, #169) + ## [4.8.0] - 2018-09-18 ### Added - Added support for email auto-linking @@ -235,7 +243,8 @@ not ideally set, so this releases fixes that. Moving forwards this should reduce ### Added - Initial release -[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/4.8.0...master +[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/4.8.1...master +[4.8.1]: https://github.com/thephpleague/html-to-markdown/compare/4.8.0...4.8.1 [4.8.0]: https://github.com/thephpleague/html-to-markdown/compare/4.7.0...4.8.0 [4.7.0]: https://github.com/thephpleague/html-to-markdown/compare/4.6.2...4.7.0 [4.6.2]: https://github.com/thephpleague/html-to-markdown/compare/4.6.1...4.6.2 diff --git a/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php b/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php index 964a71093..8de0af210 100644 --- a/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php @@ -37,7 +37,13 @@ class DefaultConverter implements ConverterInterface, ConfigurationAwareInterfac return $element->getValue(); } - return html_entity_decode($element->getChildrenAsString()); + $markdown = html_entity_decode($element->getChildrenAsString()); + + if ($element->getTagName() === 'table') { + $markdown .= "\n\n"; + } + + return $markdown; } /** diff --git a/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php b/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php index d079d9127..1be10bd63 100644 --- a/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php @@ -35,7 +35,10 @@ class HardBreakConverter implements ConverterInterface, ConfigurationAwareInterf $next_value = $next->getValue(); if ($next_value) { if (in_array(substr($next_value, 0, 2), array('- ', '* ', '+ '))) { - $return .= '\\'; + $parent = $element->getParent(); + if ($parent && $parent->getTagName() == 'li') { + $return .= '\\'; + } } } } -- cgit v1.2.3 From 8ac541e634838eb83e918f9c04cc0993602c473e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 2 Jan 2019 23:33:33 -0800 Subject: better handling of notification updates while commenting --- view/js/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/view/js/main.js b/view/js/main.js index 0169ee54c..dcd04f053 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -888,7 +888,12 @@ function liveUpdate(notify_id) { if((src === null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; } - if(in_progress || mediaPlaying) { + // 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(livetime) { clearTimeout(livetime); } -- cgit v1.2.3 From 3bf1866f4a7a619cedb445cd3e8a2ef9e827fa46 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 3 Jan 2019 17:13:40 +0100 Subject: Revert "Merge branch 'check_content_type' into 'dev'" This reverts merge request !1453 --- include/photo/photo_driver.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 608237ce1..9aeb2ef17 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -482,6 +482,7 @@ function guess_image_type($filename, $headers = '') { // logger('Photo: guess_image_type: '.$filename . ($headers?' from curl headers':''), LOGGER_DEBUG); $type = null; if ($headers) { + $hdrs=array(); $h = explode("\n",$headers); foreach ($h as $l) { @@ -489,16 +490,11 @@ function guess_image_type($filename, $headers = '') { $hdrs[strtolower($k)] = $v; } logger('Curl headers: '.var_export($hdrs, true), LOGGER_DEBUG); - if (array_key_exists('content-type', $hdrs)) { + if (array_key_exists('content-type', $hdrs)) $type = $hdrs['content-type']; - - $ph = photo_factory(''); - $types = $ph->supportedTypes(); - - $type = $types[$type]; - } } if (is_null($type)){ + $ignore_imagick = get_config('system', 'ignore_imagick'); // Guessing from extension? Isn't that... dangerous? if(class_exists('Imagick') && file_exists($filename) && is_readable($filename) && !$ignore_imagick) { @@ -642,6 +638,7 @@ function import_xchan_photo($photo,$xchan,$thing = false,$force = false) { $img_str = $result['body']; $type = guess_image_type($photo, $result['header']); $modified = gmdate('Y-m-d H:i:s', (preg_match('/last-modified: (.+) \S+/i', $result['header'], $o) ? strtotime($o[1] . 'Z') : time())); + if(is_null($type)) $photo_failure = true; } -- cgit v1.2.3 From ab9b8b8b0aa29c05acc627dac4989244959b9a39 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 3 Jan 2019 19:13:56 +0100 Subject: fix content type check --- include/photo/photo_driver.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 9aeb2ef17..84943bc27 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -482,7 +482,6 @@ function guess_image_type($filename, $headers = '') { // logger('Photo: guess_image_type: '.$filename . ($headers?' from curl headers':''), LOGGER_DEBUG); $type = null; if ($headers) { - $hdrs=array(); $h = explode("\n",$headers); foreach ($h as $l) { @@ -490,11 +489,16 @@ function guess_image_type($filename, $headers = '') { $hdrs[strtolower($k)] = $v; } logger('Curl headers: '.var_export($hdrs, true), LOGGER_DEBUG); - if (array_key_exists('content-type', $hdrs)) - $type = $hdrs['content-type']; + if (array_key_exists('content-type', $hdrs)) { + $ph = photo_factory(''); + $types = $ph->supportedTypes(); + + if(array_key_exists($hdrs['content-type'], $types) + $type = $hdrs['content-type']; + } } - if (is_null($type)){ + if (is_null($type)){ $ignore_imagick = get_config('system', 'ignore_imagick'); // Guessing from extension? Isn't that... dangerous? if(class_exists('Imagick') && file_exists($filename) && is_readable($filename) && !$ignore_imagick) { @@ -638,7 +642,6 @@ function import_xchan_photo($photo,$xchan,$thing = false,$force = false) { $img_str = $result['body']; $type = guess_image_type($photo, $result['header']); $modified = gmdate('Y-m-d H:i:s', (preg_match('/last-modified: (.+) \S+/i', $result['header'], $o) ? strtotime($o[1] . 'Z') : time())); - if(is_null($type)) $photo_failure = true; } -- cgit v1.2.3 From b93bc142d3e6efa050d8cd75b367f607ee88eb2e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 3 Jan 2019 19:18:49 +0100 Subject: missing closing parenthesis --- include/photo/photo_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 84943bc27..5c8ed9bdc 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -493,7 +493,7 @@ function guess_image_type($filename, $headers = '') { $ph = photo_factory(''); $types = $ph->supportedTypes(); - if(array_key_exists($hdrs['content-type'], $types) + if(array_key_exists($hdrs['content-type'], $types)) $type = $hdrs['content-type']; } } -- cgit v1.2.3 From 6f93001658e6c3a6c97f2be325622eb531104392 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 7 Jan 2019 09:47:08 +0100 Subject: fix issue with IE --- view/js/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/view/js/main.js b/view/js/main.js index dcd04f053..ca9ad8ca4 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -239,7 +239,11 @@ function handle_comment_form(e) { },10000); }); - function commentSaveChanges(convId,isFinal = false) { + function commentSaveChanges(convId, isFinal) { + + if(typeof isFinal === 'undefined') + isFinal = false; + if(auto_save_draft) { tmp = $('#' + emptyCommentElm).val(); if(tmp) { -- cgit v1.2.3 From 312e0dcbc813cdeea86e6ad9a0736f32b828c392 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 7 Jan 2019 17:09:00 +0100 Subject: Update bbcode --- include/bbcode.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index 817986da0..7531bd774 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -326,22 +326,11 @@ function bb_ShareAttributes($match) { $auth = is_matrix_url($profile); } - // message_id is never used, do we still need it? - $message_id = ""; - preg_match("/message_id='(.*?)'/ism", $attributes, $matches); - if ($matches[1] != "") - $message_id = $matches[1]; - - if(! $message_id) { - preg_match("/guid='(.*?)'/ism", $attributes, $matches); - if ($matches[1] != "") - $message_id = $matches[1]; - } - + $rnd = mt_rand(); $reldate = '' . datetime_convert('UTC', date_default_timezone_get(), $posted, 'r') . ''; - $headline = '
      '; + $headline = '
      '; if ($avatar != "") $headline .= '' . $author . ''; @@ -363,7 +352,7 @@ function bb_ShareAttributes($match) { $headline .= '' . $fmt . '
      '; - $text = $headline . '
      ' . trim($match[2]) . '
      '; + $text = $headline . '
      ' . trim($match[2]) . '
      '; return $text; } -- cgit v1.2.3 From 563a5088be7e0c439e244ab9513404a97c3d6c44 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Mon, 7 Jan 2019 19:48:14 -0500 Subject: Tweak to deal with changes that may happen within the same second. --- Zotlabs/Lib/PConfig.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php index 5e5954c95..69f4de2db 100644 --- a/Zotlabs/Lib/PConfig.php +++ b/Zotlabs/Lib/PConfig.php @@ -131,14 +131,19 @@ class PConfig { $dbvalue = ((is_array($value)) ? serialize($value) : $value); $dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue); + $now = datetime_convert(); if (! $updated) { - $updated = datetime_convert(); + //Sometimes things happen fast... very fast. + //To make sure legitimate updates aren't rejected + //because not enough time has passed. We say our updates + //happened just a short time in the past rather than right now. + $updated = datetime_convert('UTC','UTC','-2 seconds'); } $hash = hash('sha256',$family.':'.$key); if (self::Get($uid, 'hz_delpconfig', $hash) !== false) { - if (self::Get($uid, 'hz_delpconfig', $hash) > $updated) { + if (self::Get($uid, 'hz_delpconfig', $hash) > $now) { logger('Refusing to update pconfig with outdated info (Item deleted more recently).', LOGGER_NORMAL, LOG_ERR); return self::Get($uid,$family,$key); } else { @@ -173,7 +178,7 @@ class PConfig { } else { - $new = (\App::$config[$uid][$family]['pcfgud:'.$key] < $updated); + $new = (\App::$config[$uid][$family]['pcfgud:'.$key] < $now); if ($new) { @@ -241,9 +246,9 @@ class PConfig { if(is_null($uid) || $uid === false) return false; - $updated = ($updated) ? $updated : datetime_convert(); - - $newer = (\App::$config[$uid][$family]['pcfgud:'.$key] < $updated); + $updated = ($updated) ? $updated : datetime_convert('UTC','UTC','-2 seconds'); + $now = datetime_convert(); + $newer = (\App::$config[$uid][$family]['pcfgud:'.$key] < $now); if (! $newer) { logger('Refusing to delete pconfig with outdated delete request.', LOGGER_NORMAL, LOG_ERR); -- cgit v1.2.3 From 06beb596283ee999e6b95b4a5eec9a6f948af962 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 8 Jan 2019 15:23:08 +0100 Subject: slightly improve item.is_new rendering --- view/tpl/conv_item.tpl | 6 +++--- view/tpl/conv_list.tpl | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 7dddf9c01..69e09b272 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -9,12 +9,12 @@
      {{if $item.photo}} -
      +
      {{$item.photo}}
      {{/if}} {{if $item.event}} -
      +
      {{$item.event}}
      {{/if}} @@ -26,7 +26,7 @@
      {{/if}} {{/if}} -
      +
      {{$item.name}} diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl index c6da3d8a4..28e120d17 100755 --- a/view/tpl/conv_list.tpl +++ b/view/tpl/conv_list.tpl @@ -9,12 +9,12 @@
      {{if $item.photo}} -
      +
      {{$item.photo}}
      {{/if}} {{if $item.event}} -
      +
      {{$item.event}}
      {{/if}} @@ -26,7 +26,7 @@
      {{/if}} {{/if}} -
      +
      {{$item.name}} -- cgit v1.2.3 From 39de8e28da6f24530ee898d6b7a89e96547d283e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 8 Jan 2019 14:14:55 -0800 Subject: make Apps::get_base_apps() pluggable --- Zotlabs/Lib/Apps.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 8cf62c01a..de7439ed7 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -57,7 +57,7 @@ class Apps { } static public function get_base_apps() { - return get_config('system','base_apps',[ + $x = get_config('system','base_apps',[ 'Connections', 'Network', 'Settings', @@ -72,6 +72,8 @@ class Apps { 'Mail', 'Profile Photo' ]); + call_hooks('get_base_apps',$x); + return $x; } static public function import_system_apps() { -- cgit v1.2.3 From 5d88326915790305b5ff6c4f8d6039d4171ac478 Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Wed, 9 Jan 2019 10:16:53 +0100 Subject: Remove Experimental Worker Queue from CORE - add hook 'daemon_master_release' --- Zotlabs/Daemon/Master.php | 129 ++++---------------------------------- doc/hook/daemon_master_release.bb | 5 ++ doc/hooklist.bb | 3 + 3 files changed, 19 insertions(+), 118 deletions(-) create mode 100644 doc/hook/daemon_master_release.bb diff --git a/Zotlabs/Daemon/Master.php b/Zotlabs/Daemon/Master.php index 0656ca05b..857d47243 100644 --- a/Zotlabs/Daemon/Master.php +++ b/Zotlabs/Daemon/Master.php @@ -16,8 +16,6 @@ if(array_search( __file__ , get_included_files()) === 0) { class Master { - static public $queueworker = null; - static public function Summon($arr) { proc_run('php','Zotlabs/Daemon/Master.php',$arr); } @@ -25,126 +23,21 @@ class Master { static public function Release($argc,$argv) { cli_startup(); - $maxworkers = get_config('system','max_queue_workers'); - - if (!$maxworkers || $maxworkers == 0) { - logger('Master: release: ' . print_r($argv,true), LOGGER_ALL,LOG_DEBUG); - $cls = '\\Zotlabs\\Daemon\\' . $argv[0]; - $cls::run($argc,$argv); - self::ClearQueue(); - } else { - logger('Master: enqueue: ' . print_r($argv,true), LOGGER_ALL,LOG_DEBUG); - $workinfo = ['argc'=>$argc,'argv'=>$argv]; - q("insert into config (cat,k,v) values ('queuework','%s','%s')", - dbesc(uniqid('workitem:',true)), - dbesc(serialize($workinfo))); - self::Process(); - } - } - - static public function GetWorkerID() { - $maxworkers = get_config('system','max_queue_workers'); - $maxworkers = ($maxworkers) ? $maxworkers : 3; - - $workermaxage = get_config('system','max_queue_worker_age'); - $workermaxage = ($workermaxage) ? $workermaxage : 300; - - $workers = q("select * from config where cat='queueworkers' and k like '%s'", 'workerstarted_%'); - - if (count($workers) > $maxworkers) { - foreach ($workers as $idx => $worker) { - $curtime = time(); - $age = (intval($curtime) - intval($worker['v'])); - if ( $age > $workermaxage) { - logger("Prune worker: ".$worker['k'], LOGGER_ALL, LOGGER_DEBUG); - $k = explode('_',$worker['k']); - q("delete from config where cat='queueworkers' and k='%s'", - 'workerstarted_'.$k[1]); - q("update config set k='%s' where cat='queuework' and k='%s'", - dbesc(uniqid('workitem:',true)), - 'workitem_'.$k[1]); - unset($workers[$idx]); - } - } - if (count($workers) > $maxworkers) { - return false; - } - } - return uniqid('',true); - - } - - static public function Process() { - - self::$queueworker = self::GetWorkerID(); - - if (!self::$queueworker) { - logger('Master: unable to obtain worker ID.'); - killme(); - } - - set_config('queueworkers','workerstarted_'.self::$queueworker,time()); - - $workersleep = get_config('system','queue_worker_sleep'); - $workersleep = ($workersleep) ? $workersleep : 5; - cli_startup(); - - $work = q("update config set k='%s' where cat='queuework' and k like '%s' limit 1", - 'workitem_'.self::$queueworker, - dbesc('workitem:%')); - $jobs = 0; - while ($work) { - $workitem = q("select * from config where cat='queuework' and k='%s'", - 'workitem_'.self::$queueworker); - - if (isset($workitem[0])) { - $jobs++; - $workinfo = unserialize($workitem[0]['v']); - $argc = $workinfo['argc']; - $argv = $workinfo['argv']; - logger('Master: process: ' . print_r($argv,true), LOGGER_ALL,LOG_DEBUG); - - //Delete unclaimed duplicate workitems. - q("delete from config where cat='queuework' and k='workitem' and v='%s'", - serialize($argv)); - - $cls = '\\Zotlabs\\Daemon\\' . $argv[0]; - $cls::run($argc,$argv); + $hookinfo = [ + 'argv'=>$argv + ]; - //Right now we assume that if we get a return, everything is OK. - //At some point we may want to test whether the run returns true/false - // and requeue the work to be tried again. But we probably want - // to implement some sort of "retry interval" first. + call_hooks ('daemon_master_release',$hookinfo); - q("delete from config where cat='queuework' and k='%s'", - 'workitem_'.self::$queueworker); - } else { - break; - } - sleep ($workersleep); - $work = q("update config set k='%s' where cat='queuework' and k like '%s' limit 1", - 'workitem_'.self::$queueworker, - dbesc('workitem:%')); + $argv = $hookinfo['argv']; + $argc = count($argv); + if ((!is_array($argv) || (count($argv) < 1))) { + return; } - logger('Master: Worker Thread: queue items processed:' . $jobs); - q("delete from config where cat='queueworkers' and k='%s'", - 'workerstarted_'.self::$queueworker); - } - static public function ClearQueue() { - $work = q("select * from config where cat='queuework' and k like '%s'", - dbesc('workitem%')); - foreach ($work as $workitem) { - $workinfo = unserialize($workitem['v']); - $argc = $workinfo['argc']; - $argv = $workinfo['argv']; - logger('Master: process: ' . print_r($argv,true), LOGGER_ALL,LOG_DEBUG); - $cls = '\\Zotlabs\\Daemon\\' . $argv[0]; - $cls::run($argc,$argv); - } - $work = q("delete from config where cat='queuework' and k like '%s'", - dbesc('workitem%')); + logger('Master: release: ' . json_encode($argv), LOGGER_ALL,LOG_DEBUG); + $cls = '\\Zotlabs\\Daemon\\' . $argv[0]; + $cls::run($argc,$argv); } - } diff --git a/doc/hook/daemon_master_release.bb b/doc/hook/daemon_master_release.bb new file mode 100644 index 000000000..a17216d48 --- /dev/null +++ b/doc/hook/daemon_master_release.bb @@ -0,0 +1,5 @@ +[h2]daemon_master_release[/h2] + +Permit filtering or alternate methods of processing of background processes when [code] \Zotlabs\Daemon\Master::Release() [/code] is called. + +Default behavior is for a new PHP process to fire immediately upon a call to Master::Summon(). This hook permits pre-emption and the ability to provide queuing or other alternatives to this procedure. diff --git a/doc/hooklist.bb b/doc/hooklist.bb index 08fc587e2..afb2cebee 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -190,6 +190,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/daemon_addon]daemon_addon[/zrl] Called when invoking the extensible background daemon +[zrl=[baseurl]/help/hook/daemon_master_release]daemon_master_release[/zrl] + Called at the start of processing \Zotlabs\Daemon\Master::Release() + [zrl=[baseurl]/help/hook/directory_item]directory_item[/zrl] Called when generating a directory listing for display -- cgit v1.2.3 From 90b6afe06bacd5377c638c89045801296d69ec44 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 10 Jan 2019 00:29:05 +0100 Subject: we must sslify all possible content variables --- include/text.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/text.php b/include/text.php index 3cc21e4ce..26cb61977 100644 --- a/include/text.php +++ b/include/text.php @@ -1691,7 +1691,14 @@ function prepare_body(&$item,$attach = false,$opts = false) { if(local_channel() == $item['uid']) $filer = format_filer($item); - $s = sslify($s); + if($s) + $s = sslify($s); + + if($photo) + $photo = sslify($photo); + + if($event) + $event = sslify($event); $prep_arr = array( 'item' => $item, -- cgit v1.2.3 From 01f4ce96f1fe835db774acffb65b2553e1b44c0a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 10 Jan 2019 13:35:27 +0100 Subject: do not count removed channels --- Zotlabs/Module/New_channel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php index 73cdf4c8c..98aa480fe 100644 --- a/Zotlabs/Module/New_channel.php +++ b/Zotlabs/Module/New_channel.php @@ -134,7 +134,7 @@ class New_channel extends \Zotlabs\Web\Controller { $default_role = ''; $aid = get_account_id(); if($aid) { - $r = q("select count(channel_id) as total from channel where channel_account_id = %d", + $r = q("select count(channel_id) as total from channel where channel_account_id = %d and channel_removed = 0", intval($aid) ); if($r && (! intval($r[0]['total']))) { -- cgit v1.2.3 From b54ddccd7beece51d78b21b4ba9e98c908fec4c5 Mon Sep 17 00:00:00 2001 From: ZotSocial Admin Date: Wed, 9 Jan 2019 21:23:12 -0500 Subject: FIX: memory exhaustion on exceptionally large message queues & multiple Queue.php invocations duplicate work --- Zotlabs/Daemon/Queue.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Daemon/Queue.php b/Zotlabs/Daemon/Queue.php index 8f529ff13..e041804f0 100644 --- a/Zotlabs/Daemon/Queue.php +++ b/Zotlabs/Daemon/Queue.php @@ -61,10 +61,18 @@ class Queue { // or just prior to this query based on recent and long-term delivery history. If we have good reason to believe // the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once // or twice a day. - - $r = q("SELECT * FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s ", + + $r = q("SELECT *,RAND() as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1", db_utcnow() ); + while ($r) { + foreach($r as $rv) { + queue_deliver($rv); + } + $r = q("SELECT *,RAND() as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1", + db_utcnow() + ); + } } if(! $r) return; -- cgit v1.2.3 From 6791b05a4032a076651f7c8e4790614f0f405a55 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Thu, 10 Jan 2019 15:29:24 -0500 Subject: Fix for PGSQL/MYSQL difference --- Zotlabs/Daemon/Queue.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Daemon/Queue.php b/Zotlabs/Daemon/Queue.php index e041804f0..6b525b8c3 100644 --- a/Zotlabs/Daemon/Queue.php +++ b/Zotlabs/Daemon/Queue.php @@ -12,6 +12,15 @@ class Queue { require_once('include/items.php'); require_once('include/bbcode.php'); + switch (DBTYPE_ACTIVE) { + case DBTYPE_MYSQL: + $sqlrandfunc = "RAND()"; + break; + + case DBTYPE_POSTGRESQL: + $sqlrandfunc = "RANDOM()"; + break; + } if($argc > 1) $queue_id = $argv[1]; @@ -62,14 +71,14 @@ class Queue { // the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once // or twice a day. - $r = q("SELECT *,RAND() as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1", + $r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1", db_utcnow() ); while ($r) { foreach($r as $rv) { queue_deliver($rv); } - $r = q("SELECT *,RAND() as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1", + $r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1", db_utcnow() ); } -- cgit v1.2.3 From 7b30fc4b82da0a64e152cdeb82564f8d52b7177e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 10 Jan 2019 15:02:58 -0800 Subject: failure to import mail --- include/import.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/import.php b/include/import.php index 53b21c317..3bd8b4105 100644 --- a/include/import.php +++ b/include/import.php @@ -1035,8 +1035,9 @@ function import_mail($channel, $mails, $sync = false) { if(! $m) continue; - $m['aid'] = $channel['channel_account_id']; - $m['uid'] = $channel['channel_id']; + $m['account_id'] = $channel['channel_account_id']; + $m['channel_id'] = $channel['channel_id']; + $mail_id = mail_store($m); if($sync && $mail_id) { Zotlabs\Daemon\Master::Summon(array('Notifier','single_mail',$mail_id)); -- cgit v1.2.3 From caf2c0a6c43f3162fc8f4d758eb06cb2f56b3865 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Fri, 11 Jan 2019 07:35:12 -0500 Subject: Use dba_driver.php::db_getfunc() --- Zotlabs/Daemon/Queue.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Zotlabs/Daemon/Queue.php b/Zotlabs/Daemon/Queue.php index 6b525b8c3..814148404 100644 --- a/Zotlabs/Daemon/Queue.php +++ b/Zotlabs/Daemon/Queue.php @@ -12,16 +12,6 @@ class Queue { require_once('include/items.php'); require_once('include/bbcode.php'); - switch (DBTYPE_ACTIVE) { - case DBTYPE_MYSQL: - $sqlrandfunc = "RAND()"; - break; - - case DBTYPE_POSTGRESQL: - $sqlrandfunc = "RANDOM()"; - break; - } - if($argc > 1) $queue_id = $argv[1]; else @@ -71,6 +61,8 @@ class Queue { // the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once // or twice a day. + $sqlrandfunc = db_getfunc('rand'); + $r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1", db_utcnow() ); -- cgit v1.2.3 From 8aa117e4ae550db2c156cec6431098700929ff5f Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Sat, 12 Jan 2019 09:22:37 +0100 Subject: FIX: memory exhaustion on zot message pickup with large message queue --- include/zot.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/include/zot.php b/include/zot.php index 9934dae07..6d9b6aeec 100644 --- a/include/zot.php +++ b/include/zot.php @@ -4924,12 +4924,13 @@ function zot_reply_pickup($data) { /* * Everything is good if we made it here, so find all messages that are going to this location - * and send them all. + * and send them all - or a reasonable number if there are a lot so we don't overflow memory. */ - $r = q("select * from outq where outq_posturl = '%s'", + $r = q("select * from outq where outq_posturl = '%s' limit 100", dbesc($data['callback']) ); + if($r) { logger('mod_zot: successful pickup message received from ' . $data['callback'] . ' ' . count($r) . ' message(s) picked up', LOGGER_DEBUG); @@ -4955,6 +4956,19 @@ function zot_reply_pickup($data) { } } + // It's possible that we have more than 100 messages waiting to be sent. + + // See if there are any more messages in the queue. + $x = q("select *,min(outq_created) as earliest from outq where outq_posturl = '%s'", + dbesc($data['callback']) + ); + + // If so, kick off a new delivery notification for the next batch + if ($x) { + logger("Send additional pickup request.", LOGGER_DEBUG); + queue_deliver($x[0],true); + } + // this is a bit of a hack because we don't have the hubloc_url here, only the callback url. // worst case is we'll end up using aes256cbc if they've got a different post endpoint @@ -4966,6 +4980,8 @@ function zot_reply_pickup($data) { $encrypted = crypto_encapsulate(json_encode($ret),$sitekey,$algorithm); json_return_and_die($encrypted); + // @FIXME: There is a possibility that the transmission will get interrupted + // and fail - in which case this packet of messages will be lost. /* pickup: end */ } -- cgit v1.2.3 From 598cbf2210ed6c978ff30be58f0909aa9f93a049 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sat, 12 Jan 2019 22:37:44 -0500 Subject: Add collect_public_recipients hook --- doc/hook/collect_public_recipients.bb | 42 +++++++++++++++++++++++++++++++++++ doc/hooklist.bb | 3 +++ include/items.php | 19 ++++++++++++++-- 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 doc/hook/collect_public_recipients.bb diff --git a/doc/hook/collect_public_recipients.bb b/doc/hook/collect_public_recipients.bb new file mode 100644 index 000000000..de3f4049e --- /dev/null +++ b/doc/hook/collect_public_recipients.bb @@ -0,0 +1,42 @@ +[h2]collect_public_recipients[/h2] + +Replace the default list of public recipients (i.e., all contacts). + +Allow plugins to create a list of recipients for public messages instead of the default +of all channel connections. + +Called with the following array: + [ + 'recipients' => [], + 'item' => $item, + 'private_envelope' => $private_envelope, + 'include_groups' => $include_groups + ]; + +[code] + if(array_key_exists('public_policy',$item) && $item['public_policy'] !== 'self') { + + $hookinfo = [ + 'recipients' => [], + 'item' => $item, + 'private_envelope' => $private_envelope, + 'include_groups' => $include_groups + ]; + + call_hooks('collect_public_recipients',$hookinfo); + + if ($hookinfo['recipients']) { + $r = $hookinfo['recipients']; + } else { + $r = q("select abook_xchan, xchan_network from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 and abook_pending = 0 and abook_archived = 0 ", + intval($item['uid']) + ); + } + + if($r) { + + . . . + +[/code] + +see: include/item.php diff --git a/doc/hooklist.bb b/doc/hooklist.bb index afb2cebee..f7dbf3fa0 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -136,6 +136,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/check_siteallowed]check_siteallowed[/zrl] Used to over-ride or bypass the site black/white block lists +[zrl=[baseurl]/help/hook/collect_public_recipients]collect_public_recipients[/zrl] + Used to establish a list of recipients to send a public message to. + [zrl=[baseurl]/help/hook/comment_buttons]comment_buttons[/zrl] Called when rendering the edit buttons for comments diff --git a/include/items.php b/include/items.php index 02d31fcb5..e5f2be003 100755 --- a/include/items.php +++ b/include/items.php @@ -95,9 +95,24 @@ function collect_recipients($item, &$private_envelope,$include_groups = true) { //$sys = get_sys_channel(); if(array_key_exists('public_policy',$item) && $item['public_policy'] !== 'self') { - $r = q("select abook_xchan, xchan_network from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 and abook_pending = 0 and abook_archived = 0 ", + + $hookinfo = [ + 'recipients' => [], + 'item' => $item, + 'private_envelope' => $private_envelope, + 'include_groups' => $include_groups + ]; + + call_hooks('collect_public_recipients',$hookinfo); + + if ($hookinfo['recipients']) { + $r = $hookinfo['recipients']; + } else { + $r = q("select abook_xchan, xchan_network from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 and abook_pending = 0 and abook_archived = 0 ", intval($item['uid']) - ); + ); + } + if($r) { // filter out restrictive public_policy settings from remote networks -- cgit v1.2.3 From 121fa834d56ab3496c82d4d6c5fd8ba70743c26a Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sun, 13 Jan 2019 14:06:36 -0500 Subject: FIX: aggregated query error in MYSQL --- include/zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zot.php b/include/zot.php index 6d9b6aeec..f2aa58ee7 100644 --- a/include/zot.php +++ b/include/zot.php @@ -4959,7 +4959,7 @@ function zot_reply_pickup($data) { // It's possible that we have more than 100 messages waiting to be sent. // See if there are any more messages in the queue. - $x = q("select *,min(outq_created) as earliest from outq where outq_posturl = '%s'", + $x = q("select * from outq order by outq_scheduled where outq_posturl = '%s' limit 1", dbesc($data['callback']) ); -- cgit v1.2.3 From ab074f52fece902d1057f531c5289562a7d5343f Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sun, 13 Jan 2019 14:10:35 -0500 Subject: outq_created not outq_scheduled --- include/zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zot.php b/include/zot.php index f2aa58ee7..7467eccde 100644 --- a/include/zot.php +++ b/include/zot.php @@ -4959,7 +4959,7 @@ function zot_reply_pickup($data) { // It's possible that we have more than 100 messages waiting to be sent. // See if there are any more messages in the queue. - $x = q("select * from outq order by outq_scheduled where outq_posturl = '%s' limit 1", + $x = q("select * from outq order by outq_created where outq_posturl = '%s' limit 1", dbesc($data['callback']) ); -- cgit v1.2.3 From dba9c2fbb01c3d9de1d25aeb7c86a9be0e5031cf Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sun, 13 Jan 2019 14:34:04 -0500 Subject: Add pgrp_extras hook & display --- Zotlabs/Module/Group.php | 5 +++++ view/tpl/privacy_groups.tpl | 1 + 2 files changed, 6 insertions(+) diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php index c8ccaa2cb..6f3d09662 100644 --- a/Zotlabs/Module/Group.php +++ b/Zotlabs/Module/Group.php @@ -127,6 +127,10 @@ class Group extends Controller { $i++; } + $hookinfo = [ 'pgrp_extras' => '', 'group'=>$argv(1) ]; + call_hooks ('privacygroup_extras',$hookinfo); + $pgrp_extras = $hookinfo['pgrp_extras']; + $tpl = get_markup_template('privacy_groups.tpl'); $o = replace_macros($tpl, [ '$title' => t('Privacy Groups'), @@ -136,6 +140,7 @@ class Group extends Controller { // new group form '$gname' => array('groupname',t('Privacy group name')), '$public' => array('public',t('Members are visible to other channels'), false), + '$pgrp_extras' => $pgrp_extras, '$form_security_token' => get_form_security_token("group_edit"), '$submit' => t('Submit'), diff --git a/view/tpl/privacy_groups.tpl b/view/tpl/privacy_groups.tpl index b4e27ef2c..327a15aee 100644 --- a/view/tpl/privacy_groups.tpl +++ b/view/tpl/privacy_groups.tpl @@ -8,6 +8,7 @@ {{include file="field_input.tpl" field=$gname}} {{include file="field_checkbox.tpl" field=$public}} + {{$pgrp_extras}}
      -- cgit v1.2.3 From b4c1ca88f32420cc1653e11811bad74d6f0231a5 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sun, 13 Jan 2019 14:41:44 -0500 Subject: move order by and rewrite similar in update_queue_item() --- include/queue_fn.php | 4 ++-- include/zot.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/queue_fn.php b/include/queue_fn.php index f7e2922c6..85f98aaf9 100644 --- a/include/queue_fn.php +++ b/include/queue_fn.php @@ -13,7 +13,7 @@ function update_queue_item($id, $add_priority = 0) { return; - $y = q("select min(outq_created) as earliest from outq where outq_posturl = '%s'", + $y = q("select outq_created as earliest from outq where outq_posturl = '%s' order by earliest limit 1", dbesc($x[0]['outq_posturl']) ); @@ -311,4 +311,4 @@ function queue_deliver($outq, $immediate = false) { return; } -} \ No newline at end of file +} diff --git a/include/zot.php b/include/zot.php index 7467eccde..df54f2b27 100644 --- a/include/zot.php +++ b/include/zot.php @@ -4959,7 +4959,7 @@ function zot_reply_pickup($data) { // It's possible that we have more than 100 messages waiting to be sent. // See if there are any more messages in the queue. - $x = q("select * from outq order by outq_created where outq_posturl = '%s' limit 1", + $x = q("select * from outq where outq_posturl = '%s' order by outq_created limit 1", dbesc($data['callback']) ); -- cgit v1.2.3 From e43331b7a2c0136a9c576b4cc0391f66d469b4cd Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sun, 13 Jan 2019 15:43:25 -0500 Subject: Add privacygroup_extras_post/drop hooks --- Zotlabs/Module/Group.php | 9 ++++++++- doc/hook/privacygroup_extras.bb | 12 ++++++++++++ doc/hook/privacygroup_extras_drop.bb | 11 +++++++++++ doc/hook/privacygroup_extras_post.bb | 11 +++++++++++ doc/hooklist.bb | 9 +++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 doc/hook/privacygroup_extras.bb create mode 100644 doc/hook/privacygroup_extras_drop.bb create mode 100644 doc/hook/privacygroup_extras_post.bb diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php index 6f3d09662..8c5e4f943 100644 --- a/Zotlabs/Module/Group.php +++ b/Zotlabs/Module/Group.php @@ -75,6 +75,10 @@ class Group extends Controller { ); if($r) info( t('Privacy group updated.') . EOL ); + + $hookinfo = [ 'pgrp_extras' => '', 'group'=>$group['id'] ]; + call_hooks ('privacygroup_extras_post',$hookinfo); + build_sync_packet(local_channel(),null,true); } @@ -171,8 +175,11 @@ class Group extends Controller { ); if($r) $result = group_rmv(local_channel(),$r[0]['gname']); - if($result) + if($result) { + $hookinfo = [ 'pgrp_extras' => '', 'group'=>$argv(2) ]; + call_hooks ('privacygroup_extras_drop',$hookinfo); info( t('Privacy group removed.') . EOL); + } else notice( t('Unable to remove privacy group.') . EOL); } diff --git a/doc/hook/privacygroup_extras.bb b/doc/hook/privacygroup_extras.bb new file mode 100644 index 000000000..bd67f2470 --- /dev/null +++ b/doc/hook/privacygroup_extras.bb @@ -0,0 +1,12 @@ +[h2]privacygroup_extras[/h2] + +Add items to the Privacy Group edit form + +[code] + $hookinfo = [ 'pgrp_extras' => '', 'group'=>$argv(1) ]; + call_hooks ('privacygroup_extras',$hookinfo); + $pgrp_extras = $hookinfo['pgrp_extras']; +[/code] + +see: Zotlabs/Module/Group.php +see: view/tpl/privacy_groups.tpl diff --git a/doc/hook/privacygroup_extras_drop.bb b/doc/hook/privacygroup_extras_drop.bb new file mode 100644 index 000000000..fd27ab255 --- /dev/null +++ b/doc/hook/privacygroup_extras_drop.bb @@ -0,0 +1,11 @@ +[h2]privacygroup_extras_drop[/h2] + +Called after privacy group is dropped + +[code] + $hookinfo = [ 'pgrp_extras' => '', 'group'=>$argv(2) ]; + call_hooks ('privacygroup_extras_drop',$hookinfo); +[/code] + +see: Zotlabs/Module/Group.php +see: view/tpl/privacy_groups.tpl diff --git a/doc/hook/privacygroup_extras_post.bb b/doc/hook/privacygroup_extras_post.bb new file mode 100644 index 000000000..704db1997 --- /dev/null +++ b/doc/hook/privacygroup_extras_post.bb @@ -0,0 +1,11 @@ +[h2]privacygroup_extras_post[/h2] + +Called as privacy group edit form is edited. + +[code] + $hookinfo = [ 'pgrp_extras' => '', 'group'=>$group['id'] ]; + call_hooks ('privacygroup_extras_post',$hookinfo); +[/code] + +see: Zotlabs/Module/Group.php +see: view/tpl/privacy_groups.tpl diff --git a/doc/hooklist.bb b/doc/hooklist.bb index afb2cebee..298da5659 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -556,6 +556,15 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/prepare_body_init]prepare_body_init[/zrl] Called before generating the HTML for a displayed conversation item +[zrl=[baseurl]/help/hook/privacygroup_extras]privacygroup_extras[/zrl] + Called before generating the HTML for the Privacy Group edit options + +[zrl=[baseurl]/help/hook/privacygroup_extras_delete]privacygroup_extras_delete[/zrl] + Called after privacy group is dropped. + +[zrl=[baseurl]/help/hook/privacygroup_extras_post]privacygroup_extras_post[/zrl] + Called when privacy group edit form is submitted. + [zrl=[baseurl]/help/hook/proc_run]proc_run[/zrl] Called when invoking PHP sub processes -- cgit v1.2.3 From f5e571ba40a7d3b98158af61b1ab649980bb8e27 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sun, 13 Jan 2019 20:04:12 -0500 Subject: Remove stray $ --- Zotlabs/Module/Group.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php index 8c5e4f943..3dcf903ad 100644 --- a/Zotlabs/Module/Group.php +++ b/Zotlabs/Module/Group.php @@ -131,7 +131,7 @@ class Group extends Controller { $i++; } - $hookinfo = [ 'pgrp_extras' => '', 'group'=>$argv(1) ]; + $hookinfo = [ 'pgrp_extras' => '', 'group'=>argv(1) ]; call_hooks ('privacygroup_extras',$hookinfo); $pgrp_extras = $hookinfo['pgrp_extras']; -- cgit v1.2.3 From f3554804bfe5bf88984bce925470934429567516 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 14 Jan 2019 10:14:37 +0100 Subject: only load new content onpopstate if the mid has actually changed --- view/tpl/notifications_widget.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 98047f1d9..bc7f80906 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -24,7 +24,7 @@ }); window.onpopstate = function(e) { - if(e.state !== null) + if(e.state !== null && e.state.b64mid !== bParam_mid) getData(e.state.b64mid, ''); }; }); -- cgit v1.2.3 From 7daf18b0771abbc483edf3e85c30c5df8bc82839 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 14 Jan 2019 14:07:56 +0100 Subject: fix a new instance of autocomplete created on each conversation update --- view/js/main.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index ca9ad8ca4..017d39353 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -44,6 +44,17 @@ $(document).ready(function() { $(document).on('click', '.conversation-settings-link', getConversationSettings); $(document).on('click', '#settings_module_ajax_submit', postConversationSettings); + $(document).on('click focus', '.comment-edit-form textarea', function(e) { + if(! this.autocomplete_handled) { + /* autocomplete @nicknames */ + $(this).editor_autocomplete(baseurl+"/acl?f=&n=1"); + /* autocomplete bbcode */ + $(this).bbco_autocomplete('bbcode'); + + this.autocomplete_handled = true; + } + }); + var tf = new Function('n', 's', 'var k = s.split("/")['+aStr['plural_func']+']; return (k ? k : s);'); jQuery.timeago.settings.strings = { @@ -755,11 +766,6 @@ function updateConvItems(mode,data) { mediaPlaying = false; }); - /* autocomplete @nicknames */ - $(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1"); - /* autocomplete bbcode */ - $(".comment-edit-form textarea").bbco_autocomplete('bbcode'); - var bimgs = ((preloadImages) ? false : $(".wall-item-body img").not(function() { return this.complete; })); var bimgcount = bimgs.length; -- cgit v1.2.3 From c26e112bee8c57c2a9d7d5f6f24ddca8de033c19 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 14 Jan 2019 15:06:21 +0100 Subject: whitespace --- view/js/autocomplete.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 6b77f0631..278a0a176 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -216,8 +216,6 @@ function string2bb(element) { }); textcomplete.register([contacts,forums,smilies,tags]); }); - - }; })( jQuery ); -- cgit v1.2.3 From ad6eb15eac2297d3ad058a587ad39ce2957ee637 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 15 Jan 2019 22:36:01 +0100 Subject: fix legacy zot dreport not passing the is_storable check --- Zotlabs/Lib/DReport.php | 9 +++++++-- Zotlabs/Lib/Libzot.php | 9 +++++++++ include/zot.php | 9 +++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/DReport.php b/Zotlabs/Lib/DReport.php index 21b320cac..2cda7ce5d 100644 --- a/Zotlabs/Lib/DReport.php +++ b/Zotlabs/Lib/DReport.php @@ -93,11 +93,16 @@ class DReport { if(! $c) return false; + // legacy zot recipients add a space and their name to the xchan. remove it if true. - // is the recipient one of our connections, or do we want to store every report? + $legacy_recipient = strpos($dr['recipient'], ' '); + if($legacy_recipient !== false) + $rxchan = substr($dr['recipient'], 0 , $legacy_recipient); + else + $rxchan = $dr['recipient']; + // is the recipient one of our connections, or do we want to store every report? - $rxchan = $dr['recipient']; $pcf = get_pconfig($c[0]['channel_id'],'system','dreport_store_all'); if($pcf) return true; diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 87a5126f4..268622430 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -998,6 +998,15 @@ logger('4'); foreach($x['delivery_report'] as $xx) { call_hooks('dreport_process',$xx); if(is_array($xx) && array_key_exists('message_id',$xx) && DReport::is_storable($xx)) { + + // legacy recipients add a space and their name to the xchan. split those if true. + $legacy_recipient = strpos($xx['recipient'], ' '); + if($legacy_recipient !== false) { + $legacy_recipient_parts = explode(' ', $xx['recipient'], 2); + $xx['recipient'] = $legacy_recipient_parts[0]; + $xx['name'] = $legacy_recipient_parts[1]; + } + 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']), diff --git a/include/zot.php b/include/zot.php index df54f2b27..1741c1616 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1123,6 +1123,15 @@ function zot_process_response($hub, $arr, $outq) { foreach($x['delivery_report'] as $xx) { call_hooks('dreport_process',$xx); if(is_array($xx) && array_key_exists('message_id',$xx) && DReport::is_storable($xx)) { + + // legacy zot recipients add a space and their name to the xchan. split those if true. + $legacy_recipient = strpos($xx['recipient'], ' '); + if($legacy_recipient !== false) { + $legacy_recipient_parts = explode(' ', $xx['recipient'], 2); + $xx['recipient'] = $legacy_recipient_parts[0]; + $xx['name'] = $legacy_recipient_parts[1]; + } + 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']), -- cgit v1.2.3 From a1ac507a94b52c58c497f22be2b55d8d7b515cca Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 16 Jan 2019 10:02:13 +0100 Subject: change logic for consistency --- Zotlabs/Lib/DReport.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Lib/DReport.php b/Zotlabs/Lib/DReport.php index 2cda7ce5d..ef1ce2678 100644 --- a/Zotlabs/Lib/DReport.php +++ b/Zotlabs/Lib/DReport.php @@ -96,10 +96,13 @@ class DReport { // legacy zot recipients add a space and their name to the xchan. remove it if true. $legacy_recipient = strpos($dr['recipient'], ' '); - if($legacy_recipient !== false) - $rxchan = substr($dr['recipient'], 0 , $legacy_recipient); - else + if($legacy_recipient !== false) { + $legacy_recipient_parts = explode(' ', $dr['recipient'], 2); + $rxchan = $legacy_recipient_parts[0]; + } + else { $rxchan = $dr['recipient']; + } // is the recipient one of our connections, or do we want to store every report? -- cgit v1.2.3 From 4450a01014c15a77c2e086c7d964a578b135cfba Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 16 Jan 2019 15:09:18 +0100 Subject: do not return if delivery report could not bedecrypted --- include/zot.php | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/include/zot.php b/include/zot.php index df54f2b27..bc2187f91 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1100,6 +1100,8 @@ function zot_process_response($hub, $arr, $outq) { return; } + $dreport = true; + $x = json_decode($arr['body'], true); if(! $x) { @@ -1116,31 +1118,44 @@ function zot_process_response($hub, $arr, $outq) { } if(! (is_array($x['delivery_report']) && count($x['delivery_report']))) { logger('encrypted delivery report could not be decrypted'); - return; + $dreport = false; } } - foreach($x['delivery_report'] as $xx) { - call_hooks('dreport_process',$xx); - if(is_array($xx) && array_key_exists('message_id',$xx) && 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']), - dbesc($xx['status']), - dbesc(datetime_convert('UTC','UTC',$xx['date'])), - dbesc($xx['sender']) - ); + if($dreport) { + foreach($x['delivery_report'] as $xx) { + call_hooks('dreport_process',$xx); + if(is_array($xx) && array_key_exists('message_id',$xx) && DReport::is_storable($xx)) { + + // legacy zot recipients add a space and their name to the xchan. split those if true. + $legacy_recipient = strpos($xx['recipient'], ' '); + if($legacy_recipient !== false) { + $legacy_recipient_parts = explode(' ', $xx['recipient'], 2); + $xx['recipient'] = $legacy_recipient_parts[0]; + $xx['name'] = $legacy_recipient_parts[1]; + } + + 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']), + dbesc($xx['status']), + dbesc(datetime_convert('UTC','UTC',$xx['date'])), + dbesc($xx['sender']) + ); + } } } } - // we have a more descriptive delivery report, so discard the per hub 'queued' report. - q("delete from dreport where dreport_queue = '%s' ", - dbesc($outq['outq_hash']) - ); + if($dreport) { + // we have a more descriptive delivery report, so discard the per hub 'queued' report. + q("delete from dreport where dreport_queue = '%s' ", + dbesc($outq['outq_hash']) + ); + } // update the timestamp for this site -- cgit v1.2.3 From eaa375936fc3c23f1b6629cba56fce2eb116a1c6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 16 Jan 2019 15:28:30 -0800 Subject: more z6 compatibility fixes --- Zotlabs/Daemon/Onepoll.php | 2 +- Zotlabs/Daemon/Poller.php | 2 +- Zotlabs/Lib/Activity.php | 6 ++++++ include/follow.php | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Daemon/Onepoll.php b/Zotlabs/Daemon/Onepoll.php index 920916828..1d9fd5f72 100644 --- a/Zotlabs/Daemon/Onepoll.php +++ b/Zotlabs/Daemon/Onepoll.php @@ -69,7 +69,7 @@ class Onepoll { return; } - if($contact['xchan_network'] !== 'zot') + if(! in_array($contact['xchan_network'],['zot','zot6'])) return; // update permissions diff --git a/Zotlabs/Daemon/Poller.php b/Zotlabs/Daemon/Poller.php index 49151437c..a8cf34ce2 100644 --- a/Zotlabs/Daemon/Poller.php +++ b/Zotlabs/Daemon/Poller.php @@ -110,7 +110,7 @@ class Poller { } - if($contact['xchan_network'] !== 'zot') + if(! in_array($contact['xchan_network'],['zot','zot6'])) continue; if($c == $t) { diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index ef6ee6c3e..b4c833594 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -568,6 +568,9 @@ class Activity { 'http://activitystrea.ms/schema/1.0/tag' => 'Add', 'http://activitystrea.ms/schema/1.0/follow' => 'Follow', 'http://activitystrea.ms/schema/1.0/unfollow' => 'Unfollow', + 'http://purl.org/zot/activity/attendyes' => 'Accept', + 'http://purl.org/zot/activity/attendno' => 'Reject', + 'http://purl.org/zot/activity/attendmaybe' => 'TentativeAccept' ]; @@ -607,6 +610,9 @@ class Activity { 'http://activitystrea.ms/schema/1.0/tag' => 'Add', 'http://activitystrea.ms/schema/1.0/follow' => 'Follow', 'http://activitystrea.ms/schema/1.0/unfollow' => 'Unfollow', + 'http://purl.org/zot/activity/attendyes' => 'Accept', + 'http://purl.org/zot/activity/attendno' => 'Reject', + 'http://purl.org/zot/activity/attendmaybe' => 'TentativeAccept' ]; diff --git a/include/follow.php b/include/follow.php index 038e6e9c0..db77a0160 100644 --- a/include/follow.php +++ b/include/follow.php @@ -190,7 +190,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) return $result; } - $allowed = (($is_zot || $r[0]['xchan_network'] === 'rss') ? 1 : 0); + $allowed = (($is_zot || in_array($r[0]['xchan_network'],['rss','zot6'])) ? 1 : 0); $x = array('channel_id' => $uid, 'follow_address' => $url, 'xchan' => $r[0], 'allowed' => $allowed, 'singleton' => 0); -- cgit v1.2.3 From 20eea2184bc1336efb811c29e3fb49262ae02262 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 16 Jan 2019 16:50:44 -0800 Subject: more work on z6 events --- Zotlabs/Lib/Activity.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index b4c833594..b4d78d809 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -32,6 +32,9 @@ class Activity { if($x['type'] === ACTIVITY_OBJ_THING) { return self::fetch_thing($x); } + if($x['type'] === ACTIVITY_OBJ_EVENT) { + return self::fetch_event($x); + } return $x; @@ -99,6 +102,40 @@ class Activity { } } + static function fetch_event($x) { + + // convert old Zot event objects to ActivityStreams Event objects + + if (array_key_exists('content',$x) && array_key_exists('dtstart',$x)) { + $ev = bbtoevent($x['content']); + if($ev) { + + $actor = null; + if(array_key_exists('author',$x) && array_key_exists('link',$x['author'])) { + $actor = $x['author']['link'][0]['href']; + } + $y = [ + 'type' => 'Event', + 'id' => z_root() . '/event/' . $ev['event_hash'], + 'summary' => bbcode($ev['summary']), + // RFC3339 Section 4.3 + 'startTime' => (($ev['adjust']) ? datetime_convert('UTC','UTC',$ev['dtstart'], ATOM_TIME) : datetime_convert('UTC','UTC',$ev['dtstart'],'Y-m-d\\TH:i:s-00:00')), + 'content' => bbcode($ev['description']), + 'location' => [ 'type' => 'Place', 'content' => bbcode($ev['location']) ], + 'source' => [ 'content' => format_event_bbcode($ev), 'mediaType' => 'text/bbcode' ], + 'actor' => $actor, + ]; + if($actor) { + return $y; + } + } + } + + return $x; + + } + + static function encode_item_collection($items,$id,$type,$extra = null) { $ret = [ -- cgit v1.2.3 From e9f709301c64ca0f276e089d643da29fe8aada98 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 16 Jan 2019 17:32:16 -0800 Subject: more z6 event work --- Zotlabs/Lib/Activity.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index b4d78d809..f87dd6b15 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1455,7 +1455,33 @@ class Activity { $s['obj_type'] = ACTIVITY_OBJ_COMMENT; } - $s['obj'] = $act->obj; + + if($s['obj_type'] === 'Event') { + $s['obj'] = []; + $s['obj']['asld'] = $act->obj; + $s['obj']['type'] = ACTIVITY_OBJ_EVENT; + $s['obj']['id'] = $act->obj['id']; + $s['obj']['title'] = $act->obj['summary']; + + if(strpos($act->obj['startTime'],'Z')) + $s['obj']['adjust'] = true; + else + $s['obj']['adjust'] = false; + + $s['obj']['dtstart'] = datetime_convert('UTC','UTC',$act->obj['startTime']); + if($act->obj['endTime']) + $s['obj']['dtend'] = datetime_convert('UTC','UTC',$act->obj['endTime']); + else + $s['obj']['nofinish'] = true; + $s['obj']['description'] = $act->obj['content']; + + if(array_path_exists('location/content',$act->obj)) + $s['obj']['location'] = $act->obj['location']['content']; + + } + else { + $s['obj'] = $act->obj; + } $instrument = $act->get_property_obj('instrument'); if((! $instrument) && (! $response_activity)) { -- cgit v1.2.3 From eda7c5369c0228ed11ef3bddfa33d81b0c6a3747 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 16 Jan 2019 21:09:04 -0800 Subject: event attendance testing continued (now works at a basic level from one direction, more testing needed) --- Zotlabs/Lib/Activity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index f87dd6b15..154421b6a 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1456,7 +1456,7 @@ class Activity { } - if($s['obj_type'] === 'Event') { + if($act->obj['type'] === 'Event') { $s['obj'] = []; $s['obj']['asld'] = $act->obj; $s['obj']['type'] = ACTIVITY_OBJ_EVENT; -- cgit v1.2.3 From 07f6465872e807224e54e3d73f5296d0fa057ca2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 17 Jan 2019 11:39:52 +0100 Subject: fix delivery report for zot6 connections --- Zotlabs/Lib/DReport.php | 6 +++++- Zotlabs/Lib/Libzot.php | 1 + Zotlabs/Module/Dreport.php | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/DReport.php b/Zotlabs/Lib/DReport.php index ef1ce2678..1292e7488 100644 --- a/Zotlabs/Lib/DReport.php +++ b/Zotlabs/Lib/DReport.php @@ -87,9 +87,11 @@ class DReport { // Is the sender one of our channels? - $c = q("select channel_id from channel where channel_hash = '%s' limit 1", + $c = q("select channel_id from channel where channel_hash = '%s' or channel_portable_id = '%s'limit 1", + dbesc($dr['sender']), dbesc($dr['sender']) ); + if(! $c) return false; @@ -104,6 +106,8 @@ class DReport { $rxchan = $dr['recipient']; } + + // is the recipient one of our connections, or do we want to store every report? $pcf = get_pconfig($c[0]['channel_id'],'system','dreport_store_all'); diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 268622430..e66c929bf 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -995,6 +995,7 @@ logger('4'); } if(is_array($x) && array_key_exists('delivery_report',$x) && is_array($x['delivery_report'])) { + foreach($x['delivery_report'] as $xx) { call_hooks('dreport_process',$xx); if(is_array($xx) && array_key_exists('message_id',$xx) && DReport::is_storable($xx)) { diff --git a/Zotlabs/Module/Dreport.php b/Zotlabs/Module/Dreport.php index 16ae7941f..2c125b7a9 100644 --- a/Zotlabs/Module/Dreport.php +++ b/Zotlabs/Module/Dreport.php @@ -80,8 +80,9 @@ class Dreport extends \Zotlabs\Web\Controller { return; } - $r = q("select * from dreport where dreport_xchan = '%s' and dreport_mid = '%s'", + $r = q("select * from dreport where (dreport_xchan = '%s' or dreport_xchan = '%s') and dreport_mid = '%s'", dbesc($channel['channel_hash']), + dbesc($channel['channel_portable_id']), dbesc($mid) ); -- cgit v1.2.3 From b1b1e0eba4f1e698c5f0f4f14b0527741e5b9ffb Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 17 Jan 2019 10:47:04 -0800 Subject: channel connect issue --- Zotlabs/Zot/Finger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Zot/Finger.php b/Zotlabs/Zot/Finger.php index 77634777a..cb38c7f2b 100644 --- a/Zotlabs/Zot/Finger.php +++ b/Zotlabs/Zot/Finger.php @@ -55,7 +55,7 @@ class Finger { $r = q("select xchan.*, hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash - where xchan_addr = '%s' and hubloc_primary = 1 and hubloc_deleted = 0 limit 1", + where xchan_addr = '%s' and hubloc_primary = 1 and hubloc_deleted = 0 and hubloc_network = 'zot' limit 1", dbesc($xchan_addr) ); -- cgit v1.2.3 From 5aa0267936e391e1d1a98de5287546ad5817fb41 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 17 Jan 2019 20:09:19 +0100 Subject: add space --- Zotlabs/Lib/DReport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/DReport.php b/Zotlabs/Lib/DReport.php index 1292e7488..18087e29f 100644 --- a/Zotlabs/Lib/DReport.php +++ b/Zotlabs/Lib/DReport.php @@ -87,7 +87,7 @@ class DReport { // Is the sender one of our channels? - $c = q("select channel_id from channel where channel_hash = '%s' or channel_portable_id = '%s'limit 1", + $c = q("select channel_id from channel where channel_hash = '%s' or channel_portable_id = '%s' limit 1", dbesc($dr['sender']), dbesc($dr['sender']) ); -- cgit v1.2.3 From 96deae43faed34878da136846257e531c3133f46 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 17 Jan 2019 11:47:55 -0800 Subject: this should fix the rest of the event stuff --- include/event.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/include/event.php b/include/event.php index a34250e7a..fdb9e1415 100644 --- a/include/event.php +++ b/include/event.php @@ -6,6 +6,10 @@ use Sabre\VObject; +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; + + require_once('include/bbcode.php'); /** @@ -463,8 +467,13 @@ function event_store_event($arr) { $hash = $arr['external_id']; elseif(array_key_exists('event_hash',$arr)) $hash = $arr['event_hash']; - else - $hash = random_string() . '@' . App::get_hostname(); + else { + try { + $hash = Uuid::uuid4()->toString(); + } catch (UnsatisfiedDependencyException $e) { + $hash = random_string(48); + } + } $r = q("INSERT INTO event ( uid,aid,event_xchan,event_hash,created,edited,dtstart,dtend,summary,description,location,etype, adjust,nofinish, event_status, event_status_date, event_percent, event_repeat, event_sequence, event_priority, event_vdata, allow_cid,allow_gid,deny_cid,deny_gid) @@ -1126,8 +1135,8 @@ function event_store_item($arr, $event) { } if(! $arr['mid']) { - $arr['uuid'] = item_message_id(); - $arr['mid'] = z_root() . '/item/' . $arr['uuid']; + $arr['uuid'] = $event['event_hash']; + $arr['mid'] = z_root() . '/event/' . $event['event_hash']; } $item_arr['aid'] = $z[0]['channel_account_id']; -- cgit v1.2.3 From cc1e1a525f2c928590d1da6e775dc29dddc2166d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 17 Jan 2019 21:42:24 +0100 Subject: possible fix for #1326 --- view/js/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/view/js/main.js b/view/js/main.js index 017d39353..ee11ab1c6 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -468,6 +468,9 @@ function notificationsUpdate(cached_data) { $.get(pingCmd,function(data) { // Put the object into storage + if(! data) + return; + sessionStorage.setItem('notifications_cache', JSON.stringify(data)); var fnotifs = []; -- cgit v1.2.3 From d6167636fab15dfdead2b70dc7ee167dd2c13ddd Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Tue, 15 Jan 2019 01:01:49 +0100 Subject: Add PostgreSQL to gitlab-ci setup. Run our tests against a PostgreSQL again. --- .gitlab-ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++------- tests/phpunit-pgsql.xml | 33 ++++++++++++++++++--------------- 2 files changed, 58 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b8e0430f..d162d57ba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,13 +11,11 @@ variables: MYSQL_DATABASE: hello_world_test MYSQL_ROOT_PASSWORD: mysql - -services: -- mysql:5.7 - before_script: +# prevent error installing buggy postgresql-client package +- mkdir -p /usr/share/man/man1 /usr/share/man/man7 - apt-get update -yqq -- apt-get install -yqq git mysql-server mysql-client libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev +- apt-get install -yqq --no-install-recommends git mysql-client postgresql-client libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libaspell-dev libpcre3-dev libtidy-dev # Install PHP extensions - docker-php-ext-install mbstring mcrypt pdo_mysql pdo_pgsql curl json intl gd xml zip bz2 opcache # Install & enable Xdebug for code coverage reports @@ -25,12 +23,47 @@ before_script: - docker-php-ext-enable xdebug # Install and run Composer - curl -sS https://getcomposer.org/installer | php -- php composer.phar install +# Install dev libraries from composer +- php composer.phar install --no-progress +# Configure PHP values, needed for phpunit code coverage HTML generation +- echo "memory_limit = 256M" > /usr/local/etc/php/conf.d/hubzilla.ini + -# We test PHP7 with MySQL, but we allow it to fail +# We test PHP7 with MySQL test:php:mysql: + services: + - mysql:5.7 script: - echo "USE $MYSQL_DATABASE; $(cat ./install/schema_mysql.sql)" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE" - echo "SHOW DATABASES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE" - echo "USE $MYSQL_DATABASE; SHOW TABLES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE" - vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-text + +# test PHP7 with PostgreSQL +test:php:postgres: + services: + - postgres:latest + variables: + POSTGRES_DB: ci-db + POSTGRES_USER: ci-user + POSTGRES_PASSWORD: ci-pass + script: + - export PGPASSWORD=$POSTGRES_PASSWORD + - psql --version + - psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "SELECT VERSION();" + # Import hubzilla's DB schema + - psql -h "postgres" -U "$POSTGRES_USER" -v ON_ERROR_STOP=1 --quiet "$POSTGRES_DB" < ./install/schema_postgres.sql + # Show databases and relations/tables of hubzilla's database + #- psql -h "postgres" -U "$POSTGRES_USER" -l + #- psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "\dt;" + # Run the actual tests + - vendor/bin/phpunit --configuration tests/phpunit-pgsql.xml --testdox + artifacts: + expire_in: 1 week + # Gitlab should show the results, but has problems parsing PHPUnit's junit file. + reports: + junit: tests/results/junit.xml + # Archive test results (coverage, testdox, junit) + name: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME" + paths: + - tests/results/ diff --git a/tests/phpunit-pgsql.xml b/tests/phpunit-pgsql.xml index 078056d56..8b11aae31 100644 --- a/tests/phpunit-pgsql.xml +++ b/tests/phpunit-pgsql.xml @@ -1,24 +1,26 @@ - - ./unit/ - - - ./unit/ - + + + ./unit/ + + + ./unit/ + + mysql - + ../Zotlabs/ @@ -26,21 +28,22 @@ - - + + - + + - + - - - + + + -- cgit v1.2.3 From 52305ca91b49f8a8f0380234879ac4e5be1705fb Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 17 Jan 2019 14:45:53 -0800 Subject: more specific network checking in several places and remove some old debugging crud --- Zotlabs/Lib/Libzot.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 268622430..7dc6b411d 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -271,7 +271,7 @@ class Libzot { // correct hubloc. If this doesn't work we may have to re-write this section to try them all. if(array_key_exists('xchan_addr',$them) && $them['xchan_addr']) { - $r = q("select hubloc_id_url, hubloc_primary from hubloc where hubloc_addr = '%s' order by hubloc_id desc", + $r = q("select hubloc_id_url, hubloc_primary from hubloc where hubloc_addr = '%s' and hubloc_network = 'zot6' order by hubloc_id desc", dbesc($them['xchan_addr']) ); } @@ -356,7 +356,7 @@ class Libzot { ); if($r) { -logger('4'); + // connection exists // if the dob is the same as what we have stored (disregarding the year), keep the one @@ -1193,7 +1193,7 @@ logger('4'); //logger($AS->debug()); - $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1", + $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($AS->actor['id']) ); @@ -1202,7 +1202,7 @@ logger('4'); } - $s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1", + $s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($env['sender']) ); @@ -1512,10 +1512,12 @@ logger('4'); } } -logger('item: ' . print_r($arr,true), LOGGER_DATA); + logger('item: ' . print_r($arr,true), LOGGER_DATA); if($arr['mid'] !== $arr['parent_mid']) { -logger('checking source: "' . $arr['mid'] . '" != "' . $arr['parent_mid'] . '"'); + + logger('checking source: "' . $arr['mid'] . '" != "' . $arr['parent_mid'] . '"'); + // check source route. // We are only going to accept comments from this sender if the comment has the same route as the top-level-post, // this is so that permissions mismatches between senders apply to the entire conversation @@ -1600,7 +1602,7 @@ logger('checking source: "' . $arr['mid'] . '" != "' . $arr['parent_mid'] . '"') $arr['route'] = $last_prior_route; } } -logger('hey'); + $ab = q("select * from abook where abook_channel = %d and abook_xchan = '%s'", intval($channel['channel_id']), dbesc($arr['owner_xchan']) @@ -1778,14 +1780,14 @@ logger('hey'); logger($AS->debug()); - $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1", + $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($AS->actor['id']) ); if(! $r) { $y = import_author_xchan([ 'url' => $AS->actor['id'] ]); if($y) { - $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1", + $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($AS->actor['id']) ); } @@ -1808,7 +1810,7 @@ logger('hey'); $arr['author_xchan'] = $r[0]['hubloc_hash']; } - $s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1", + $s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($a['signature']['signer']) ); @@ -2593,7 +2595,7 @@ logger('hey'); $feed = ((x($arr,'feed')) ? intval($arr['feed']) : 0); if($ztarget) { - $t = q("select * from hubloc where hubloc_id_url = '%s' limit 1", + $t = q("select * from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($ztarget) ); if($t) { -- cgit v1.2.3 From bba20c27fe01e4f6879969e98b52d5ce2de5ed5f Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Fri, 18 Jan 2019 22:37:05 +0100 Subject: Some fixes in include/help.php. Remove unused variables and a wrong function name. --- include/help.php | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/include/help.php b/include/help.php index f2aa4add3..61dbc7bb3 100644 --- a/include/help.php +++ b/include/help.php @@ -12,12 +12,12 @@ use \Michelf\MarkdownExtra; function get_help_fullpath($path,$suffix=null) { $docroot = (\App::$override_helproot) ? \App::$override_helproot : 'doc/'; - $docroot = (substr($docroot,-1)!='/') ? $docroot .= '/' : $docroot; + $docroot = (substr($docroot,-1)!='/') ? $docroot .= '/' : $docroot; // Determine the language and modify the path accordingly $x = determine_help_language(); $lang = $x['language']; - $url_idx = ($x['from_url'] ? 1 : 0); + // The English translation is at the root of /doc/. Other languages are in // subfolders named by the language code such as "de", "es", etc. if($lang !== 'en') { @@ -53,15 +53,14 @@ function get_help_fullpath($path,$suffix=null) { * @return string|unknown */ function get_help_content($tocpath = false) { - global $lang; $doctype = 'markdown'; $text = ''; $path = (($tocpath !== false) ? $tocpath : ''); - $docroot = (\App::$override_helproot) ? \App::$override_helproot : 'doc/'; - $docroot = (substr($docroot,-1)!='/') ? $docroot .= '/' : $docroot; + $docroot = (\App::$override_helproot) ? \App::$override_helproot : 'doc/'; + $docroot = (substr($docroot,-1)!='/') ? $docroot .= '/' : $docroot; if($tocpath === false && argc() > 1) { $path = ''; @@ -74,7 +73,7 @@ function get_help_content($tocpath = false) { if($path) { - $fullpath = get_help_fullpath($path); + $fullpath = get_help_fullpath($path); $title = basename($path); if(! $tocpath) \App::$page['title'] = t('Help:') . ' ' . ucwords(str_replace('-',' ',notags($title))); @@ -88,10 +87,10 @@ function get_help_content($tocpath = false) { load_doc_file($fullpath . '.md') === '' && load_doc_file($fullpath . '.bb') === '' && load_doc_file($fullpath . '.html') === '' - ) { + ) { $path = $title; } - $fullpath = get_help_fullpath($path); + $fullpath = get_help_fullpath($path); $text = load_doc_file($fullpath . '.md'); if(! $text) { @@ -111,15 +110,15 @@ function get_help_content($tocpath = false) { if($tocpath === false) { if(! $text) { - $path = 'Site'; - $fullpath = get_help_fullpath($path,'.md'); + $path = 'Site'; + $fullpath = get_help_fullpath($path,'.md'); $text = load_doc_file($fullpath . '.md'); \App::$page['title'] = t('Help'); } if(! $text) { $doctype = 'bbcode'; - $path = 'main'; - $fullpath = get_help_fullpath($path,'.md'); + $path = 'main'; + $fullpath = get_help_fullpath($path,'.md'); $text = load_doc_file($fullpath . '.bb'); goaway('/help/about/about'); \App::$page['title'] = t('Help'); @@ -219,7 +218,6 @@ function find_doc_file($s) { */ function search_doc_files($s) { - \App::set_pager_itemspage(60); $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start'])); @@ -351,7 +349,7 @@ function store_doc_file($s) { $x = item_store_update($item); } else { - $item['uuid'] = $item_message_id(); + $item['uuid'] = item_message_id(); $item['mid'] = $item['parent_mid'] = z_root() . '/item/' . $item['uuid']; $x = item_store($item); } -- cgit v1.2.3 From 90a62405ca54a78ec9ce7316812d8d041ec1bed2 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sat, 19 Jan 2019 00:28:01 +0100 Subject: Fix wrong variable name in include/plugin.php. --- include/plugin.php | 72 +++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/include/plugin.php b/include/plugin.php index 7eeb39ce8..ec14fd945 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -213,8 +213,8 @@ function reload_plugins() { try { $func(); } catch (Exception $e) { - handleerrors_plugin($plugin,"","UNLOAD FAILED (uninstalling) : ".$e->getMessage(),true); - continue; + handleerrors_plugin($pl, '', 'UNLOAD FAILED (uninstalling) : ' . $e->getMessage(),true); + continue; } } if(function_exists($pl . '_load')) { @@ -222,8 +222,8 @@ function reload_plugins() { try { $func(); } catch (Exception $e) { - handleerrors_plugin($plugin,"","LOAD FAILED (uninstalling): ".$e->getMessage(),true); - continue; + handleerrors_plugin($pl, '', 'LOAD FAILED (uninstalling): ' . $e->getMessage(),true); + continue; } } q("UPDATE addon SET tstamp = %d WHERE id = %d", @@ -305,7 +305,7 @@ function plugins_sync() { * @return array */ function visible_plugin_list() { - + $r = q("select * from addon where hidden = 0 order by aname asc"); $x = (($r) ? ids_to_array($r,'aname') : array()); $y = []; @@ -315,7 +315,7 @@ function visible_plugin_list() { $y[] = $xv; } } - } + } return $y; } @@ -456,21 +456,21 @@ function insert_hook($hook, $fn, $version = 0, $priority = 0) { function call_hooks($name, &$data = null) { $a = 0; - if (isset(App::$hooks[$name])) { + if (isset(App::$hooks[$name])) { foreach(App::$hooks[$name] as $hook) { if ($name != 'permit_hook') { // avoid looping $checkhook = [ - 'name'=>$name, - 'hook'=>$hook, - 'data'=>$data, + 'name'=>$name, + 'hook'=>$hook, + 'data'=>$data, // Note: Since PHP uses COPY-ON-WRITE - // for variables, there is no cost to + // for variables, there is no cost to // passing the $data structure (unless // the permit_hook processors change the // information it contains. - 'permit'=>true - ]; + 'permit'=>true + ]; call_hooks('permit_hook',$checkhook); if (!$checkhook['permit']) { continue; @@ -618,7 +618,7 @@ function get_widget_info($widget){ } } - if(! ($widget_found && $f)) + if(! ($widget_found && $f)) return $info; $f = escape_tags($f); @@ -1041,7 +1041,7 @@ function get_intltext_template($s, $root = '') { if (isset(\App::$override_intltext_templates[$testroot][$s]["content"])) { return \App::$override_intltext_templates[$testroot][$s]["content"]; } else { - if (isset(\App::$override_intltext_templates[$testroot][$s]["root"]) && + if (isset(\App::$override_intltext_templates[$testroot][$s]["root"]) && isset(\App::$override_intltext_templates[$testroot][$s]["file"])) { $s = \App::$override_intltext_templates[$testroot][$s]["file"]; $root = \App::$override_intltext_templates[$testroot][$s]["root"]; @@ -1058,30 +1058,30 @@ function get_intltext_template($s, $root = '') { } function get_markup_template($s, $root = '') { - $testroot = ($root=='') ? $testroot = "ROOT" : $root; + $testroot = ($root=='') ? $testroot = "ROOT" : $root; - $t = App::template_engine(); + $t = App::template_engine(); - if (isset(\App::$override_markup_templates[$testroot][$s]["content"])) { - return \App::$override_markup_templates[$testroot][$s]["content"]; - } else { - if (isset(\App::$override_markup_templates[$testroot][$s]["root"]) && - isset(\App::$override_markup_templates[$testroot][$s]["file"])) { - $root = \App::$override_markup_templates[$testroot][$s]["root"]; - $s = \App::$override_markup_templates[$testroot][$s]["file"]; - $template = $t->get_markup_template($s, $root); - } elseif (\App::$override_templateroot) { - $newroot = \App::$override_templateroot; - if ($newroot != '' && substr($newroot,-1) != '/' ) { - $newroot .= '/'; - } - $newroot .= $root; - $template = $t->get_markup_template($s, $newroot); - } else { - $template = $t->get_markup_template($s, $root); + if (isset(\App::$override_markup_templates[$testroot][$s]["content"])) { + return \App::$override_markup_templates[$testroot][$s]["content"]; + } else { + if (isset(\App::$override_markup_templates[$testroot][$s]["root"]) && + isset(\App::$override_markup_templates[$testroot][$s]["file"])) { + $root = \App::$override_markup_templates[$testroot][$s]["root"]; + $s = \App::$override_markup_templates[$testroot][$s]["file"]; + $template = $t->get_markup_template($s, $root); + } elseif (\App::$override_templateroot) { + $newroot = \App::$override_templateroot; + if ($newroot != '' && substr($newroot,-1) != '/' ) { + $newroot .= '/'; + } + $newroot .= $root; + $template = $t->get_markup_template($s, $newroot); + } else { + $template = $t->get_markup_template($s, $root); } - return $template; - } + return $template; + } } /** -- cgit v1.2.3 From 1b5dd8bbd7a751cf84f65403197d0dae5be4a8a0 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 20 Jan 2019 15:09:35 -0800 Subject: comment permission fix --- Zotlabs/Lib/Libzot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 7dc6b411d..00dd13afb 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1496,7 +1496,7 @@ class Libzot { intval($channel['channel_id']) ); if ($parent) { - $allowed = can_comment_on_post($d,$parent[0]); + $allowed = can_comment_on_post($sender,$parent[0]); } } if($request) { -- cgit v1.2.3 From b1e05b48327232d45275fb918252e9a3737b86e7 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sat, 19 Jan 2019 23:13:16 +0100 Subject: Try to fix some warnings in Zotlabs\Module\Embedphotos. $phototypes was undefined, hope this is correct selection to fix it. Correct Doxygen and clean up some variables and refactoring. --- Zotlabs/Module/Embedphotos.php | 122 +++++++++++++++++++++++------------------ 1 file changed, 69 insertions(+), 53 deletions(-) diff --git a/Zotlabs/Module/Embedphotos.php b/Zotlabs/Module/Embedphotos.php index bcbb0e116..2df14c239 100644 --- a/Zotlabs/Module/Embedphotos.php +++ b/Zotlabs/Module/Embedphotos.php @@ -3,8 +3,10 @@ namespace Zotlabs\Module; /** - * @brief + * @brief Embedphoto endpoint. * + * Provide an AJAX endpoint to fill the embedPhotoModal with folders and photos + * selection. */ class Embedphotos extends \Zotlabs\Web\Controller { @@ -13,42 +15,42 @@ class Embedphotos extends \Zotlabs\Web\Controller { } /** + * @brief This is the POST destination for the embedphotos button. * - * This is the POST destination for the embedphotos button - * + * @return string A JSON string. */ - function post() { + public function post() { if (argc() > 1 && argv(1) === 'album') { // API: /embedphotos/album - $name = (x($_POST,'name') ? $_POST['name'] : null ); - if(!$name) { + $name = (x($_POST, 'name') ? $_POST['name'] : null ); + if (!$name) { json_return_and_die(array('errormsg' => 'Error retrieving album', 'status' => false)); } $album = $this->embedphotos_widget_album(array('channel' => \App::get_channel(), 'album' => $name)); json_return_and_die(array('status' => true, 'content' => $album)); } - if(argc() > 1 && argv(1) === 'albumlist') { + if (argc() > 1 && argv(1) === 'albumlist') { // API: /embedphotos/albumlist - $album_list = $this->embedphotos_album_list($a); + $album_list = $this->embedphotos_album_list(); json_return_and_die(array('status' => true, 'albumlist' => $album_list)); } - if(argc() > 1 && argv(1) === 'photolink') { + if (argc() > 1 && argv(1) === 'photolink') { // API: /embedphotos/photolink - $href = (x($_POST,'href') ? $_POST['href'] : null ); - if(!$href) { + $href = (x($_POST, 'href') ? $_POST['href'] : null ); + if (!$href) { json_return_and_die(array('errormsg' => 'Error retrieving link ' . $href, 'status' => false)); } - $resource_id = array_pop(explode("/", $href)); + $resource_id = array_pop(explode('/', $href)); $r = q("SELECT obj from item where resource_type = 'photo' and resource_id = '%s' limit 1", dbesc($resource_id) ); - if(!$r) { + if (!$r) { json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false)); } $obj = json_decode($r[0]['obj'], true); - if(x($obj,'body')) { + if (x($obj, 'body')) { $photolink = $obj['body']; - } elseif (x($obj,'bbcode')) { + } elseif (x($obj, 'bbcode')) { $photolink = $obj['bbcode']; } else { json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false)); @@ -58,48 +60,51 @@ class Embedphotos extends \Zotlabs\Web\Controller { } /** - * Copied from include/widgets.php::widget_album() with a modification to get the profile_uid from - * the input array as in widget_item() + * @brief Get photos from an album. + * + * @see \\Zotlabs\\Widget\\Album::widget() * - * @param array $args - * @return string with HTML + * @param array $args associative array with + * * \e array \b channel + * * \e string \b album + * @return string with HTML code from 'photo_album.tpl' */ - function embedphotos_widget_album($args) { - + protected function embedphotos_widget_album($args) { $channel_id = 0; - if(array_key_exists('channel', $args)) + + if (array_key_exists('channel', $args)) { $channel = $args['channel']; - $channel_id = intval($channel['channel_id']); - if(! $channel_id) + $channel_id = intval($channel['channel_id']); + } + if (! $channel_id) $channel_id = \App::$profile_uid; - if(! $channel_id) + if (! $channel_id) return ''; - $owner_uid = $channel_id; require_once('include/security.php'); $sql_extra = permissions_sql($channel_id); - if(! perm_is_allowed($channel_id,get_observer_hash(),'view_storage')) + if (! perm_is_allowed($channel_id, get_observer_hash(), 'view_storage')) return ''; - if($args['album']) + if (isset($args['album'])) $album = (($args['album'] === '/') ? '' : $args['album']); - if($args['title']) + if (isset($args['title'])) $title = $args['title']; /** - * This may return incorrect permissions if you have multiple directories of the same name. + * @note This may return incorrect permissions if you have multiple directories of the same name. * It is a limitation of the photo table using a name for a photo album instead of a folder hash */ - if($album) { + if ($album) { require_once('include/attach.php'); $x = q("select hash from attach where filename = '%s' and uid = %d limit 1", dbesc($album), - intval($owner_uid) + intval($channel_id) ); - if($x) { - $y = attach_can_view_folder($owner_uid,get_observer_hash(),$x[0]['hash']); - if(! $y) + if ($x) { + $y = attach_can_view_folder($channel_id, get_observer_hash(), $x[0]['hash']); + if (! $y) return ''; } } @@ -110,30 +115,33 @@ class Embedphotos extends \Zotlabs\Web\Controller { (SELECT resource_id, max(imgscale) imgscale FROM photo WHERE uid = %d AND album = '%s' AND imgscale <= 4 AND photo_usage IN ( %d, %d ) $sql_extra GROUP BY resource_id) ph ON (p.resource_id = ph.resource_id AND p.imgscale = ph.imgscale) ORDER BY created $order", - intval($owner_uid), + intval($channel_id), dbesc($album), intval(PHOTO_NORMAL), intval(PHOTO_PROFILE) ); - $photos = array(); - if(count($r)) { + $photos = []; + if (count($r)) { $twist = 'rotright'; - foreach($r as $rr) { - if($twist == 'rotright') + foreach ($r as $rr) { + if ($twist == 'rotright') $twist = 'rotleft'; else $twist = 'rotright'; + $ph = photo_factory(''); + $phototypes = $ph->supportedTypes(); + $ext = $phototypes[$rr['mimetype']]; $imgalt_e = $rr['filename']; $desc_e = $rr['description']; - $imagelink = (z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $rr['resource_id'] + $imagelink = (z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $rr['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '')); - $photos[] = array( + $photos[] = [ 'id' => $rr['id'], 'twist' => ' ' . $twist . rand(2,4), 'link' => $imagelink, @@ -143,35 +151,43 @@ class Embedphotos extends \Zotlabs\Web\Controller { 'desc'=> $desc_e, 'ext' => $ext, 'hash'=> $rr['resource_id'], - 'unknown' => t('Unknown') - ); + 'unknown' => t('Unknown'), + ]; } } $tpl = get_markup_template('photo_album.tpl'); - $o .= replace_macros($tpl, array( + $o = replace_macros($tpl, [ '$photos' => $photos, '$album' => (($title) ? $title : $album), '$album_id' => rand(), - '$album_edit' => array(t('Edit Album'), $album_edit), + '$album_edit' => array(t('Edit Album'), false), '$can_post' => false, '$upload' => array(t('Upload'), z_root() . '/photos/' . \App::$profile['channel_address'] . '/upload/' . bin2hex($album)), '$order' => false, - '$upload_form' => $upload_form, - '$no_fullscreen_btn' => true - )); + '$upload_form' => '', + '$no_fullscreen_btn' => true, + ]); return $o; } - function embedphotos_album_list($a) { + /** + * @brief Get albums observer is allowed to see. + * + * @see photos_albums_list() + * + * @return NULL|array + */ + protected function embedphotos_album_list() { require_once('include/photos.php'); $p = photos_albums_list(\App::get_channel(), \App::get_observer()); - if($p['success']) { + + if ($p['success']) { return $p['albums']; - } else { - return null; } + + return null; } } -- cgit v1.2.3 From cd8a0f33b5df4ae556bfcf274cfb3c4bd5fcdbf7 Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Tue, 22 Jan 2019 12:13:16 +0100 Subject: Add remaining hook insertions --- Zotlabs/Module/Group.php | 11 +++++++++-- view/tpl/group_edit.tpl | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php index 3dcf903ad..12edf8428 100644 --- a/Zotlabs/Module/Group.php +++ b/Zotlabs/Module/Group.php @@ -66,6 +66,9 @@ class Group extends Controller { $groupname = notags(trim($_POST['groupname'])); $public = intval($_POST['public']); + $hookinfo = [ 'pgrp_extras' => '', 'group'=>$group['id'] ]; + call_hooks ('privacygroup_extras_post',$hookinfo); + if((strlen($groupname)) && (($groupname != $group['gname']) || ($public != $group['visible']))) { $r = q("UPDATE pgrp SET gname = '%s', visible = %d WHERE uid = %d AND id = %d", dbesc($groupname), @@ -76,8 +79,6 @@ class Group extends Controller { if($r) info( t('Privacy group updated.') . EOL ); - $hookinfo = [ 'pgrp_extras' => '', 'group'=>$group['id'] ]; - call_hooks ('privacygroup_extras_post',$hookinfo); build_sync_packet(local_channel(),null,true); } @@ -242,6 +243,10 @@ class Group extends Controller { } } + $hookinfo = [ 'pgrp_extras' => '', 'group'=>$group['id'] ]; + call_hooks ('privacygroup_extras',$hookinfo); + $pgrp_extras = $hookinfo['pgrp_extras']; + $context = $context + array( '$title' => sprintf(t('Privacy Group: %s'), $group['gname']), '$details_label' => t('Edit'), @@ -252,6 +257,7 @@ class Group extends Controller { '$form_security_token_edit' => get_form_security_token('group_edit'), '$delete' => t('Delete Group'), '$form_security_token_drop' => get_form_security_token("group_drop"), + '$pgrp_extras' => $pgrp_extras, ); } @@ -295,6 +301,7 @@ class Group extends Controller { $context['$groupeditor'] = $groupeditor; $context['$desc'] = t('Click a channel to toggle membership'); + $context['$pgrp_extras'] = $pgrp_extras; if($change) { $tpl = get_markup_template('groupeditor.tpl'); diff --git a/view/tpl/group_edit.tpl b/view/tpl/group_edit.tpl index 88f037abe..60038701e 100755 --- a/view/tpl/group_edit.tpl +++ b/view/tpl/group_edit.tpl @@ -13,6 +13,7 @@ {{include file="field_input.tpl" field=$gname}} {{include file="field_checkbox.tpl" field=$public}} + {{$pgrp_extras}} {{$delete}} -- cgit v1.2.3 From 66f443fd00d3da9df0104e9ed2485d902767fe41 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Tue, 22 Jan 2019 16:23:44 +0100 Subject: Skip tags detection in URL --- include/text.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/text.php b/include/text.php index 3cc21e4ce..7d253e3d7 100644 --- a/include/text.php +++ b/include/text.php @@ -825,6 +825,9 @@ function get_tags($s) { // ignore anything in [color= ], because it may contain color codes which are mistaken for tags $s = preg_replace('/\[color=(.*?)\]/sm','',$s); + + // skip anchors in URL + $s = preg_replace('/\[url=(.*?)\]/sm','',$s); // match any double quoted tags -- cgit v1.2.3 From ae538a225942e61256db246431bb9c6f902ba7fa Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Tue, 22 Jan 2019 23:25:30 +0100 Subject: Correct parameter in include/text.php prepare_text() Also extend documentation. --- include/text.php | 61 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/include/text.php b/include/text.php index 26cb61977..d03d36741 100644 --- a/include/text.php +++ b/include/text.php @@ -983,7 +983,7 @@ function contact_block() { // There is no setting to discover if you are bi-directionally connected // Use the ability to post comments as an indication that this relationship is more - // than wishful thinking; even though soapbox channels and feeds will disable it. + // than wishful thinking; even though soapbox channels and feeds will disable it. if(! intval(get_abconfig(App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_comments'))) { $rr['oneway'] = true; @@ -1109,19 +1109,19 @@ function linkify($s, $me = false) { * @returns string */ function sslify($s) { - + // Local photo cache $str = array( 'body' => $s, 'uid' => local_channel() ); call_hooks('cache_body_hook', $str); - + $s = $str['body']; if (strpos(z_root(),'https:') === false) return $s; - + // By default we'll only sslify img tags because media files will probably choke. // You can set sslify_everything if you want - but it will likely white-screen if it hits your php memory limit. // The downside is that http: media files will likely be blocked by your browser @@ -1452,7 +1452,7 @@ function theme_attachments(&$item) { foreach($arr as $r) { $icon = getIconFromType($r['type']); - + if($r['title']) $label = urldecode(htmlspecialchars($r['title'], ENT_COMPAT, 'UTF-8')); @@ -1729,17 +1729,24 @@ function prepare_binary($item) { /** - * @brief Given a text string, convert from bbcode to html and add smilie icons. + * @brief Given a text string, convert from content_type to HTML. * - * @param string $text - * @param string $content_type (optional) default text/bbcode - * @param boolean $cache (optional) default false + * Take a text in plain text, html, markdown, bbcode, PDL or PHP and prepare + * it to return HTML. + * + * In bbcode this function will add smilie icons. * + * @param string $text + * @param string $content_type (optional) + * default 'text/bbcode', other values are 'text/plain', 'text/html', + * 'text/markdown', 'application/x-pdl', 'application/x-php' + * @param boolean|array $opts (optional) + * default false, otherwise configuration array for bbcode() * @return string + * The parsed $text as prepared HTML. */ function prepare_text($text, $content_type = 'text/bbcode', $opts = false) { - switch($content_type) { case 'text/plain': $s = escape_tags($text); @@ -1779,8 +1786,8 @@ function prepare_text($text, $content_type = 'text/bbcode', $opts = false) { default: require_once('include/bbcode.php'); - if(stristr($text,'[nosmile]')) - $s = bbcode($text, [ 'cache' => $cache ]); + if(stristr($text, '[nosmile]')) + $s = bbcode($text, ((is_array($opts)) ? $opts : [] )); else $s = smilies(bbcode($text, ((is_array($opts)) ? $opts : [] ))); @@ -2140,7 +2147,7 @@ function legal_webbie($s) { return ''; // WARNING: This regex may not work in a federated environment. - // You will probably want something like + // You will probably want something like // preg_replace('/([^a-z0-9\_])/','',strtolower($s)); $r = preg_replace('/([^a-z0-9\-\_])/','',strtolower($s)); @@ -2240,7 +2247,7 @@ function ids_to_querystr($arr,$idx = 'id',$quote = false) { /** * @brief array_elm_to_str($arr,$elm,$delim = ',') extract unique individual elements from an array of arrays and return them as a string separated by a delimiter - * similar to ids_to_querystr, but allows a different delimiter instead of a db-quote option + * similar to ids_to_querystr, but allows a different delimiter instead of a db-quote option * empty elements (evaluated after trim()) are ignored. * @param $arr array * @param $elm array key to extract from sub-array @@ -2666,7 +2673,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $i // get the channel name // First extract the name or name fragment we are going to replace - $name = substr($tag,(($exclusive) ? 2 : 1)); + $name = substr($tag,(($exclusive) ? 2 : 1)); $newname = $name; // make a copy that we can mess with $tagcid = 0; @@ -2709,7 +2716,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $i // select anybody by full hubloc_addr if((! $r) && strpos($newname,'@')) { - $r = q("SELECT * FROM xchan left join hubloc on xchan_hash = hubloc_hash + $r = q("SELECT * FROM xchan left join hubloc on xchan_hash = hubloc_hash WHERE hubloc_addr = '%s' LIMIT 1", dbesc($newname) ); @@ -2730,7 +2737,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $i // $r is set if we found something $channel = App::get_channel(); - + if($r) { $profile = $r[0]['xchan_url']; $newname = $r[0]['xchan_name']; @@ -2875,7 +2882,7 @@ function getIconFromType($type) { 'video/x-matroska' => 'fa-file-video-o' ); - $catMap = [ + $catMap = [ 'application' => 'fa-file-code-o', 'multipart' => 'fa-folder', 'audio' => 'fa-file-audio-o', @@ -2883,7 +2890,7 @@ function getIconFromType($type) { 'text' => 'fa-file-text-o', 'image' => 'fa=file-picture-o', 'message' => 'fa-file-text-o' - ]; + ]; $iconFromType = ''; @@ -2893,7 +2900,7 @@ function getIconFromType($type) { } else { $parts = explode('/',$type); - if($parts[0] && $catMap[$parts[0]]) { + if($parts[0] && $catMap[$parts[0]]) { $iconFromType = $catMap[$parts[0]]; } } @@ -3149,7 +3156,7 @@ function flatten_array_recursive($arr) { * @param string $lang Which language should be highlighted * @return string * Important: The returned text has the text pattern 'http' translated to '%eY9-!' which should be converted back - * after further processing. This was done to prevent oembed links from occurring inside code blocks. + * after further processing. This was done to prevent oembed links from occurring inside code blocks. * See include/bbcode.php */ function text_highlight($s, $lang) { @@ -3383,7 +3390,7 @@ function unique_multidim_array($array, $key) { $temp_array = array(); $i = 0; $key_array = array(); - + foreach($array as $val) { if (!in_array($val[$key], $key_array)) { $key_array[$i] = $val[$key]; @@ -3411,7 +3418,7 @@ function get_forum_channels($uid) { intval($uid) ); - if($x2) { + if($x2) { $xf = ids_to_querystr($x2,'xchan',true); // private forums @@ -3424,7 +3431,7 @@ function get_forum_channels($uid) { } } - $sql_extra = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 "); + $sql_extra = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 "); $r = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_addr, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 and abook_archived = 0 $sql_extra order by xchan_name", intval($uid) @@ -3460,14 +3467,14 @@ function print_array($arr, $level = 0) { $o .= $tabs . '[' . $k . '] => ' . print_array($v, $level + 1) . "\n"; } else { - $o .= $tabs . '[' . $k . '] => ' . print_val($v) . ",\n"; + $o .= $tabs . '[' . $k . '] => ' . print_val($v) . ",\n"; } } } $o .= substr($tabs,0,-1) . ']' . (($level) ? ',' : ';' ). "\n"; return $o; } - + } function print_val($v) { @@ -3494,7 +3501,7 @@ function array_path_exists($str,$arr) { } else { return false; - } + } } return true; } -- cgit v1.2.3 From 54806f6ee882d1d29a800f31eb42508221e59dc3 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 23 Jan 2019 15:36:34 +0100 Subject: fix page jumping when liking a collapsed/expanded post --- view/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index ee11ab1c6..d88133b23 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -845,10 +845,10 @@ function collapseHeight() { }); var collapsedContentHeight = Math.ceil($("#region_2").height()); - contentHeightDiff = origContentHeight - collapsedContentHeight; + contentHeightDiff = liking ? 0 : origContentHeight - collapsedContentHeight; console.log('collapseHeight() - contentHeightDiff: ' + contentHeightDiff + 'px'); - if(i){ + if(i && !liking){ var sval = position - cDiff + ($(".divgrow-showmore").outerHeight() * i); console.log('collapsed above viewport count: ' + i); $(window).scrollTop(sval); -- cgit v1.2.3 From 13e0151cd2569832588cc9a973bcf40d850edd53 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Fri, 18 Jan 2019 22:17:10 +0100 Subject: Correct and extend Doxygen comments. Correct some documentation errors for Doxygen and add more comments. Document some undefined variables with @FIXME. --- Zotlabs/Lib/Libzot.php | 228 ++++++++++++++++++++++--------------------- Zotlabs/Lib/PConfig.php | 9 +- Zotlabs/Module/Cards.php | 16 +-- Zotlabs/Zot6/Zot6Handler.php | 36 +++---- include/attach.php | 60 ++++++++---- include/feedutils.php | 20 ++-- include/help.php | 30 +++--- include/import.php | 9 +- include/items.php | 30 +++--- include/plugin.php | 17 ++-- include/text.php | 147 +++++++++++++++++++--------- include/zot.php | 22 ++--- 12 files changed, 351 insertions(+), 273 deletions(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index a0f6e077a..167e2d67d 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -2,11 +2,6 @@ namespace Zotlabs\Lib; -/** - * @brief lowlevel implementation of Zot6 protocol. - * - */ - use Zotlabs\Zot6\HTTPSig; use Zotlabs\Access\Permissions; use Zotlabs\Access\PermissionLimits; @@ -14,14 +9,17 @@ use Zotlabs\Daemon\Master; require_once('include/crypto.php'); - +/** + * @brief Lowlevel implementation of Zot6 protocol. + * + */ class Libzot { /** * @brief Generates a unique string for use as a zot guid. * - * Generates a unique string for use as a zot guid using our DNS-based url, the - * channel nickname and some entropy. + * Generates a unique string for use as a zot guid using our DNS-based url, + * the channel nickname and some entropy. * The entropy ensures uniqueness against re-installs where the same URL and * nickname are chosen. * @@ -32,9 +30,8 @@ class Libzot { * immediate universe. * * @param string $channel_nick a unique nickname of controlling entity - * @returns string + * @return string */ - static function new_uid($channel_nick) { $rawstr = z_root() . '/' . $channel_nick . '.' . mt_rand(); return(base64url_encode(hash('whirlpool', $rawstr, true), true)); @@ -52,8 +49,8 @@ class Libzot { * * @param string $guid * @param string $pubkey + * @return string */ - static function make_xchan_hash($guid, $pubkey) { return base64url_encode(hash('whirlpool', $guid . $pubkey, true)); } @@ -65,10 +62,8 @@ class Libzot { * should only be used by channels which are defined on this hub. * * @param string $hash - xchan_hash - * @returns array of hubloc (hub location structures) - * + * @return array of hubloc (hub location structures) */ - static function get_hublocs($hash) { /* Only search for active hublocs - e.g. those that haven't been marked deleted */ @@ -92,16 +87,17 @@ class Libzot { * packet type: one of 'ping', 'pickup', 'purge', 'refresh', 'keychange', 'force_refresh', 'notify', 'auth_check' * @param array $recipients * envelope recipients, array of portable_id's; empty for public posts - * @param string msg + * @param string $msg * optional message + * @param string $encoding + * optional encoding, default 'activitystreams' * @param string $remote_key * optional public site key of target hub used to encrypt entire packet * NOTE: remote_key and encrypted packets are required for 'auth_check' packets, optional for all others * @param string $methods - * optional comma separated list of encryption methods @ref self::best_algorithm() + * optional comma separated list of encryption methods @ref best_algorithm() * @returns string json encoded zot packet */ - static function build_packet($channel, $type = 'activity', $recipients = null, $msg = '', $encoding = 'activitystreams', $remote_key = null, $methods = '') { $sig_method = get_config('system','signature_algorithm','sha256'); @@ -146,11 +142,10 @@ class Libzot { * @brief Choose best encryption function from those available on both sites. * * @param string $methods - * comma separated list of encryption methods + * Comma separated list of encryption methods * @return string first match from our site method preferences crypto_methods() array - * of a method which is common to both sites; or 'aes256cbc' if no matches are found. + * of a method which is common to both sites; or 'aes256cbc' if no matches are found. */ - static function best_algorithm($methods) { $x = [ @@ -164,7 +159,6 @@ class Libzot { * * \e string \b methods - comma separated list of encryption methods * * \e string \b result - the algorithm to return */ - call_hooks('zot_best_algorithm', $x); if($x['result']) @@ -190,7 +184,7 @@ class Libzot { /** - * @brief send a zot message + * @brief Send a zot message. * * @see z_post_url() * @@ -200,18 +194,17 @@ class Libzot { * @param array $crypto (required if encrypted httpsig, requires hubloc_sitekey and site_crypto elements) * @return array see z_post_url() for returned data format */ - static function zot($url, $data, $channel = null,$crypto = null) { if($channel) { - $headers = [ - 'X-Zot-Token' => random_string(), - 'Digest' => HTTPSig::generate_digest_header($data), + $headers = [ + 'X-Zot-Token' => random_string(), + 'Digest' => HTTPSig::generate_digest_header($data), 'Content-type' => 'application/x-zot+json', '(request-target)' => 'post ' . get_request_string($url) ]; - $h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),false,'sha512', + $h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),false,'sha512', (($crypto) ? [ 'key' => $crypto['hubloc_sitekey'], 'algorithm' => self::best_algorithm($crypto['site_crypto']) ] : false)); } else { @@ -227,7 +220,6 @@ class Libzot { /** * @brief Refreshes after permission changed or friending, etc. * - * * refresh is typically invoked when somebody has changed permissions of a channel and they are notified * to fetch new permissions via a finger/discovery operation. This may result in a new connection * (abook entry) being added to a local channel and it may result in auto-permissions being granted. @@ -251,7 +243,6 @@ class Libzot { * * \b true if successful * * otherwise \b false */ - static function refresh($them, $channel = null, $force = false) { logger('them: ' . print_r($them,true), LOGGER_DATA, LOG_DEBUG); @@ -265,7 +256,7 @@ class Libzot { } else { $r = null; - + // if they re-installed the server we could end up with the wrong record - pointing to the old install. // We'll order by reverse id to try and pick off the newest one first and hopefully end up with the // correct hubloc. If this doesn't work we may have to re-write this section to try them all. @@ -317,6 +308,7 @@ class Libzot { if(! $hsig_valid) { logger('http signature not valid: ' . print_r($hsig,true)); + /// @FIXME $result is undefined return $result; } @@ -416,7 +408,7 @@ class Libzot { if($y) { logger("New introduction received for {$channel['channel_name']}"); $new_perms = get_all_perms($channel['channel_id'],$x['hash'],false); - + // Send a clone sync packet and a permissions update if permissions have changed $new_connection = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_xchan = '%s' and abook_channel = %d and abook_self = 0 order by abook_created desc limit 1", @@ -524,10 +516,14 @@ class Libzot { return false; } - - - - static function valid_hub($sender,$site_id) { + /** + * @brief + * + * @param string $sender + * @param string $site_id + * @return null|array + */ + static function valid_hub($sender, $site_id) { $r = q("select hubloc.*, site.site_crypto from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and hubloc_site_id = '%s' limit 1", dbesc($sender), @@ -548,7 +544,6 @@ class Libzot { } return $r[0]; - } /** @@ -559,21 +554,14 @@ class Libzot { * origination address. This will fetch the discovery packet of the sender, * which contains the public key we need to verify our guid and url signatures. * - * @param array $arr an associative array which must contain: - * * \e string \b guid => guid of conversant - * * \e string \b guid_sig => guid signed with conversant's private key - * * \e string \b url => URL of the origination hub of this communication - * * \e string \b url_sig => URL signed with conversant's private key + * @param string $id * * @return array An associative array with - * * \b success boolean true or false - * * \b message (optional) error string only if success is false + * * \e boolean \b success + * * \e string \b message (optional, unused) error string only if success is false */ - static function register_hub($id) { - $id_hash = false; - $valid = false; $hsig_valid = false; $result = [ 'success' => false ]; @@ -807,7 +795,7 @@ class Libzot { // If setting for the default profile, unset the profile photo flag from any other photos I own if($is_default_profile) { - q("UPDATE photo SET photo_usage = %d WHERE photo_usage = %d AND resource_id != '%s' AND aid = %d AND uid = %d", + q("UPDATE photo SET photo_usage = %d WHERE photo_usage = %d AND resource_id != '%s' AND aid = %d AND uid = %d", intval(PHOTO_NORMAL), intval(PHOTO_PROFILE), dbesc($hash), @@ -954,8 +942,8 @@ class Libzot { * @param string $hub - url of site we just contacted * @param array $arr - output of z_post_url() * @param array $outq - The queue structure attached to this request + * @return void */ - static function process_response($hub, $arr, $outq) { logger('remote: ' . print_r($arr,true),LOGGER_DATA); @@ -986,7 +974,7 @@ class Libzot { if(! $x['success']) { // handle remote validation issues - + $b = q("update dreport set dreport_result = '%s', dreport_time = '%s' where dreport_queue = '%s'", dbesc(($x['message']) ? $x['message'] : 'unknown delivery error'), dbesc(datetime_convert()), @@ -994,7 +982,7 @@ class Libzot { ); } - if(is_array($x) && array_key_exists('delivery_report',$x) && is_array($x['delivery_report'])) { + if(is_array($x) && array_key_exists('delivery_report',$x) && is_array($x['delivery_report'])) { foreach($x['delivery_report'] as $xx) { call_hooks('dreport_process',$xx); @@ -1083,11 +1071,6 @@ class Libzot { * * @param array $arr * 'pickup' structure returned from remote site - * @param string $sender_url - * the url specified by the sender in the initial communication. - * We will verify the sender and url in each returned message structure and - * also verify that all the messages returned match the site url that we are - * currently processing. * * @returns array * Suitable for logging remotely, enumerating the processing results of each message/recipient combination @@ -1095,7 +1078,6 @@ class Libzot { * * [1] => \e string $delivery_status * * [2] => \e string $address */ - static function import($arr) { $env = $arr; @@ -1117,7 +1099,7 @@ class Libzot { $has_data = array_key_exists('data',$env) && $env['data']; $data = (($has_data) ? $env['data'] : false); - $AS = null; + $AS = null; if($env['encoding'] === 'activitystreams') { @@ -1175,7 +1157,6 @@ class Libzot { $deliveries = self::public_recips($env,$AS); - } $deliveries = array_unique($deliveries); @@ -1196,7 +1177,7 @@ class Libzot { $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($AS->actor['id']) - ); + ); if($r) { $arr['author_xchan'] = $r[0]['hubloc_hash']; @@ -1205,20 +1186,20 @@ class Libzot { $s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($env['sender']) - ); + ); // in individual delivery, change owner if needed if($s) { $arr['owner_xchan'] = $s[0]['hubloc_hash']; } else { - $arr['owner_xchan'] = $env['sender']; + $arr['owner_xchan'] = $env['sender']; } if($private) { $arr['item_private'] = true; } - // @fixme - spoofable + /// @FIXME - spoofable if($AS->data['hubloc']) { $arr['item_verified'] = true; } @@ -1247,12 +1228,19 @@ class Libzot { } if ($result) { $return = array_merge($return, $result); - } + } return $return; } - static function is_top_level($env,$act) { + /** + * @brief + * + * @param array $env + * @param object $act + * @return boolean + */ + static function is_top_level($env, $act) { if($env['encoding'] === 'zot' && array_key_exists('flags',$env) && in_array('thread_parent', $env['flags'])) { return true; } @@ -1295,9 +1283,9 @@ class Libzot { * Some of these will be rejected, but this gives us a place to start. * * @param array $msg - * @return NULL|array + * @param object $act + * @return array */ - static function public_recips($msg, $act) { require_once('include/channel.php'); @@ -1442,7 +1430,7 @@ class Libzot { * will normally arrive first via sync delivery, but this isn't guaranteed. * There's a chance the current delivery could take place before the cloned copy arrives * hence the item could have the wrong ACL and *could* be used in subsequent deliveries or - * access checks. + * access checks. */ if($sender === $channel['channel_portable_id'] && $arr['author_xchan'] === $channel['channel_portable_id'] && $arr['mid'] === $arr['parent_mid']) { @@ -1504,7 +1492,7 @@ class Libzot { $allowed = true; $friendofriend = true; } - + if (! $allowed) { logger("permission denied for delivery to channel {$channel['channel_id']} {$channel['channel_address']}"); $DR->update('permission denied'); @@ -1524,7 +1512,7 @@ class Libzot { // this is so that permissions mismatches between senders apply to the entire conversation // As a side effect we will also do a preliminary check that we have the top-level-post, otherwise // processing it is pointless. - + $r = q("select route, id, owner_xchan, item_private from item where mid = '%s' and uid = %d limit 1", dbesc($arr['parent_mid']), intval($channel['channel_id']) @@ -1553,14 +1541,14 @@ class Libzot { } continue; } - + if($relay || $friendofriend || (intval($r[0]['item_private']) === 0 && intval($arr['item_private']) === 0)) { // reset the route in case it travelled a great distance upstream // use our parent's route so when we go back downstream we'll match // with whatever route our parent has. // Also friend-of-friend conversations may have been imported without a route, // but we are now getting comments via listener delivery - // and if there is no privacy on this or the parent, we don't care about the route, + // and if there is no privacy on this or the parent, we don't care about the route, // so just set the owner and route accordingly. $arr['route'] = $r[0]['route']; $arr['owner_xchan'] = $r[0]['owner_xchan']; @@ -1614,13 +1602,13 @@ class Libzot { // remove_community_tag is a no-op if this isn't a community tag activity self::remove_community_tag($sender,$arr,$channel['channel_id']); - + // set these just in case we need to store a fresh copy of the deleted post. // This could happen if the delete got here before the original post did. $arr['aid'] = $channel['channel_account_id']; $arr['uid'] = $channel['channel_id']; - + $item_id = self::delete_imported_item($sender,$arr,$channel['channel_id'],$relay); $DR->update(($item_id) ? 'deleted' : 'delete_failed'); $result[] = $DR->get(); @@ -1716,7 +1704,7 @@ class Libzot { * * \e array \b item * * \e array \b sender * * \e array \b channel - */ + */ call_hooks('activity_received', $parr); // don't add a source route if it's a relay or later recipients will get a route mismatch if(! $relay) @@ -1783,7 +1771,7 @@ class Libzot { $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($AS->actor['id']) - ); + ); if(! $r) { $y = import_author_xchan([ 'url' => $AS->actor['id'] ]); @@ -1791,7 +1779,7 @@ class Libzot { $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($AS->actor['id']) ); - } + } if(! $r) { logger('FOF Activity: no actor'); continue; @@ -1813,7 +1801,7 @@ class Libzot { $s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($a['signature']['signer']) - ); + ); if($s) { $arr['owner_xchan'] = $s[0]['hubloc_hash']; @@ -1822,7 +1810,7 @@ class Libzot { $arr['owner_xchan'] = $a['signature']['signer']; } - // @fixme - spoofable + /// @FIXME - spoofable if($AS->data['hubloc']) { $arr['item_verified'] = true; } @@ -1836,7 +1824,7 @@ class Libzot { $result = self::process_delivery($arr['owner_xchan'],$arr, [ $channel['channel_portable_id'] ],false,false,true); if ($result) { $ret = array_merge($ret, $result); - } + } } return $ret; @@ -1853,8 +1841,8 @@ class Libzot { * * \e int \b obj_type * * \e int \b mid * @param int $uid + * @return void */ - static function remove_community_tag($sender, $arr, $uid) { if(! (activity_match($arr['verb'], ACTIVITY_TAG) && ($arr['obj_type'] == ACTIVITY_OBJ_TAGTERM))) @@ -1882,7 +1870,7 @@ class Libzot { } $i = $r[0]; - + if($i['target']) $i['target'] = json_decode($i['target'],true); if($i['object']) @@ -1925,8 +1913,8 @@ class Libzot { * @param array $orig * @param int $uid * @param boolean $tag_delivery + * @return void|array */ - static function update_imported_item($sender, $item, $orig, $uid, $tag_delivery) { // If this is a comment being updated, remove any privacy information @@ -2066,7 +2054,7 @@ class Libzot { } foreach($deliveries as $d) { - + $DR = new DReport(z_root(),$sender,$d,$arr['mid']); $r = q("select * from channel where channel_portable_id = '%s' limit 1", @@ -2085,7 +2073,7 @@ class Libzot { if(! perm_is_allowed($channel['channel_id'],$sender,'post_mail')) { - /* + /* * Always allow somebody to reply if you initiated the conversation. It's anti-social * and a bit rude to send a private message to somebody and block their ability to respond. * If you are being harrassed and want to put an end to it, delete the conversation. @@ -2145,12 +2133,13 @@ class Libzot { * @brief Processes delivery of profile. * * @see import_directory_profile() + * * @param array $sender an associative array * * \e string \b hash a xchan_hash * @param array $arr * @param array $deliveries (unused) + * @return void */ - static function process_profile_delivery($sender, $arr, $deliveries) { logger('process_profile_delivery', LOGGER_DEBUG); @@ -2171,6 +2160,7 @@ class Libzot { * * \e string \b hash a xchan_hash * @param array $arr * @param array $deliveries (unused) deliveries is irrelevant + * @return void */ static function process_location_delivery($sender, $arr, $deliveries) { @@ -2188,7 +2178,7 @@ class Libzot { $x = Libsync::sync_locations($xchan,$arr,true); logger('results: ' . print_r($x,true), LOGGER_DEBUG); if($x['changed']) { - $guid = random_string() . '@' . App::get_hostname(); + //$guid = random_string() . '@' . App::get_hostname(); Libzotdir::update_modtime($sender,$r[0]['xchan_guid'],$arr['locations'][0]['address'],UPDATE_FLAGS_UPDATED); } } @@ -2212,8 +2202,8 @@ class Libzot { * * @param string $sender_hash A channel hash * @param array $locations + * @return void */ - static function check_location_move($sender_hash, $locations) { if(! $locations) @@ -2255,7 +2245,6 @@ class Libzot { } - /** * @brief Returns an array with all known distinct hubs for this channel. * @@ -2264,7 +2253,6 @@ class Libzot { * * \e string \b channel_hash the hash of the channel * @return array an array with associative arrays */ - static function encode_locations($channel) { $ret = []; @@ -2305,7 +2293,7 @@ class Libzot { if(! $z['site_id']) { $z['site_id'] = Libzot::make_xchan_hash($z['url'],$z['sitekey']); } - + $ret[] = $z; } } @@ -2318,10 +2306,8 @@ class Libzot { * @brief * * @param array $arr - * @param string $pubkey * @return boolean true if updated or inserted */ - static function import_site($arr) { if( (! is_array($arr)) || (! $arr['url']) || (! $arr['site_sig'])) @@ -2600,16 +2586,16 @@ class Libzot { dbesc($ztarget) ); if($t) { - + $ztarget_hash = $t[0]['hubloc_hash']; } else { - + // should probably perform discovery of the requestor (target) but if they actually had - // permissions we would know about them and we only want to know who they are to + // permissions we would know about them and we only want to know who they are to // enumerate their specific permissions - + $ztarget_hash = EMPTY_STR; } } @@ -2756,7 +2742,7 @@ class Libzot { $ret['id'] = $e['xchan_guid']; $ret['id_sig'] = self::sign($e['xchan_guid'], $e['channel_prvkey']); - $ret['primary_location'] = [ + $ret['primary_location'] = [ 'address' => $e['xchan_addr'], 'url' => $e['xchan_url'], 'connections_url' => $e['xchan_connurl'], @@ -2778,7 +2764,7 @@ class Libzot { $ret['searchable'] = $searchable; $ret['adult_content'] = $adult_channel; $ret['public_forum'] = $public_forum; - + $ret['comments'] = map_scope(PermissionLimits::Get($e['channel_id'],'post_comments')); $ret['mail'] = map_scope(PermissionLimits::Get($e['channel_id'],'post_mail')); @@ -2836,14 +2822,20 @@ class Libzot { $ret['locations'] = $x; $ret['site'] = self::site_info(); + /** + * @hooks zotinfo + * Hook to manipulate the zotinfo array before it is returned. + */ + call_hooks('zotinfo', $ret); - call_hooks('zotinfo',$ret); - - return($ret); - + return $ret; } - + /** + * @brief Get siteinfo. + * + * @return array + */ static function site_info() { $signing_key = get_config('system','prvkey'); @@ -2880,7 +2872,7 @@ class Libzot { if($dirmode != DIRECTORY_MODE_STANDALONE) { $register_policy = intval(get_config('system','register_policy')); - + if($register_policy == REGISTER_CLOSED) $ret['site']['register_policy'] = 'closed'; if($register_policy == REGISTER_APPROVE) @@ -2927,18 +2919,16 @@ class Libzot { } return $ret['site']; - } /** * @brief * * @param array $hub - * @param string $sitekey (optional, default empty) + * @param string $site_id (optional, default empty) * * @return string hubloc_url */ - static function update_hub_connected($hub, $site_id = '') { if ($site_id) { @@ -2997,12 +2987,21 @@ class Libzot { return $hub['hubloc_url']; } - + /** + * @brief + * + * @param string $data + * @param string $key + * @param string $alg (optional) default 'sha256' + * @return string + */ static function sign($data,$key,$alg = 'sha256') { if(! $key) return 'no key'; + $sig = ''; openssl_sign($data,$sig,$key,$alg); + return $alg . '.' . base64url_encode($sig); } @@ -3015,24 +3014,27 @@ class Libzot { if ($key && count($x) === 2) { $alg = $x[0]; $signature = base64url_decode($x[1]); - + $verify = @openssl_verify($data,$signature,$key,$alg); if ($verify === (-1)) { while ($msg = openssl_error_string()) { logger('openssl_verify: ' . $msg,LOGGER_NORMAL,LOG_ERR); } - btlogger('openssl_verify: key: ' . $key, LOGGER_DEBUG, LOG_ERR); + btlogger('openssl_verify: key: ' . $key, LOGGER_DEBUG, LOG_ERR); } } return(($verify > 0) ? true : false); } - - + /** + * @brief + * + * @return boolean + */ static function is_zot_request() { - $x = getBestSupportedMimeType([ 'application/x-zot+json' ]); + return(($x) ? true : false); } diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php index 69f4de2db..95f07d580 100644 --- a/Zotlabs/Lib/PConfig.php +++ b/Zotlabs/Lib/PConfig.php @@ -112,9 +112,11 @@ class PConfig { * The configuration key to set * @param string $value * The value to store + * @param string $updated (optional) + * The datetime to store * @return mixed Stored $value or false */ - static public function Set($uid, $family, $key, $value, $updated=NULL) { + static public function Set($uid, $family, $key, $value, $updated = NULL) { // this catches subtle errors where this function has been called // with local_channel() when not logged in (which returns false) @@ -239,7 +241,9 @@ class PConfig { * The category of the configuration value * @param string $key * The configuration key to delete - * @return mixed + * @param string $updated (optional) + * The datetime to store + * @return boolean */ static public function Delete($uid, $family, $key, $updated = NULL) { @@ -283,6 +287,7 @@ class PConfig { if(! array_key_exists($family, \App::$config[$uid]['transient'])) \App::$config[$uid]['transient'][$family] = array(); + /// @FIXME $new is undefined, so dead code if ($new) { \App::$config[$uid]['transient'][$family]['pcfgdel:'.$key] = $updated; } diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php index b66de158b..3f0e93de5 100644 --- a/Zotlabs/Module/Cards.php +++ b/Zotlabs/Module/Cards.php @@ -10,9 +10,13 @@ require_once('include/channel.php'); require_once('include/conversation.php'); require_once('include/acl_selectors.php'); +/** + * @brief Provides the Cards module. + * + */ class Cards extends Controller { - function init() { + public function init() { if(argc() > 1) $which = argv(1); @@ -20,14 +24,15 @@ class Cards extends Controller { return; profile_load($which); - } /** * {@inheritDoc} - * @see \Zotlabs\Web\Controller::get() + * @see \\Zotlabs\\Web\\Controller::get() + * + * @return string Parsed HTML from template 'cards.tpl' */ - function get($update = 0, $load = false) { + public function get($update = 0, $load = false) { if(observer_prohibited(true)) { return login(); @@ -99,7 +104,6 @@ class Cards extends Controller { } - if(perm_is_allowed($owner, $ob_hash, 'write_pages')) { $x = [ @@ -110,7 +114,7 @@ class Cards extends Controller { 'nickname' => $channel['channel_address'], 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), - 'acl' => (($is_owner) ? populate_acl($channel_acl, false, + 'acl' => (($is_owner) ? populate_acl($channel_acl, false, PermissionDescription::fromGlobalPermission('view_pages')) : ''), 'permissions' => $channel_acl, 'showacl' => (($is_owner) ? true : false), diff --git a/Zotlabs/Zot6/Zot6Handler.php b/Zotlabs/Zot6/Zot6Handler.php index e320e7825..8f8957037 100644 --- a/Zotlabs/Zot6/Zot6Handler.php +++ b/Zotlabs/Zot6/Zot6Handler.php @@ -29,7 +29,7 @@ class Zot6Handler implements IHandler { // Implementation of specific methods follows; - // These generally do a small amout of validation and call Libzot + // These generally do a small amout of validation and call Libzot // to do any heavy lifting static function reply_notify($data,$hub) { @@ -40,7 +40,7 @@ class Zot6Handler implements IHandler { $x = Libzot::fetch($data); $ret['delivery_report'] = $x; - + $ret['success'] = true; return $ret; @@ -58,11 +58,11 @@ class Zot6Handler implements IHandler { * * @param array $sender * @param array $recipients + * @param array $hub * - * @return json_return_and_die() + * @return array */ - - static function reply_refresh($sender, $recipients,$hub) { + static function reply_refresh($sender, $recipients, $hub) { $ret = array('success' => false); if($recipients) { @@ -70,19 +70,18 @@ class Zot6Handler implements IHandler { // This would be a permissions update, typically for one connection foreach ($recipients as $recip) { - $r = q("select channel.*,xchan.* from channel left join xchan on channel_portable_id = xchan_hash where xchan_hash ='%s' limit 1", dbesc($recip) ); - + /// @FIXME $msgtype is undefined $x = Libzot::refresh( [ 'hubloc_id_url' => $hub['hubloc_id_url'] ], $r[0], (($msgtype === 'force_refresh') ? true : false)); } } else { // system wide refresh - + /// @FIXME $msgtype is undefined $x = Libzot::refresh( [ 'hubloc_id_url' => $hub['hubloc_id_url'] ], null, (($msgtype === 'force_refresh') ? true : false)); } @@ -100,17 +99,16 @@ class Zot6Handler implements IHandler { * for that packet. We will create a message_list array of the entire conversation starting with * the missing parent and invoke delivery to the sender of the packet. * - * Zotlabs/Daemon/Deliver.php (for local delivery) and + * Zotlabs/Daemon/Deliver.php (for local delivery) and * mod/post.php???? @fixme (for web delivery) detect the existence of * this 'message_list' at the destination and split it into individual messages which are * processed/delivered in order. * - * * @param array $data + * @param array $hub * @return array */ - - static function reply_message_request($data,$hub) { + static function reply_message_request($data, $hub) { $ret = [ 'success' => false ]; $message_id = EMPTY_STR; @@ -153,11 +151,10 @@ class Zot6Handler implements IHandler { /* * fetch the requested conversation */ - + /// @FIXME $sender_hash is undefined $messages = zot_feed($c[0]['channel_id'],$sender_hash, [ 'message_id' => $data['message_id'], 'encoding' => 'activitystreams' ]); return (($messages) ? : [] ); - } static function rekey_request($sender,$data,$hub) { @@ -183,7 +180,7 @@ class Zot6Handler implements IHandler { dbesc($oldhash) ); } - else + else return $ret; @@ -219,10 +216,10 @@ class Zot6Handler implements IHandler { * * @param array $sender * @param array $recipients + * @param array $hub * - * return json_return_and_die() + * @return array */ - static function reply_purge($sender, $recipients, $hub) { $ret = array('success' => false); @@ -259,9 +256,4 @@ class Zot6Handler implements IHandler { return $ret; } - - - - - } diff --git a/include/attach.php b/include/attach.php index dd718aa14..17a47d9ac 100644 --- a/include/attach.php +++ b/include/attach.php @@ -137,7 +137,7 @@ function z_mime_content_type($filename) { * @param string $hash (optional) * @param string $filename (optional) * @param string $filetype (optional) - * @return associative array with: + * @return array Associative array with: * * \e boolean \b success * * \e int|boolean \b results amount of found results, or false * * \e string \b message with error messages if any @@ -176,15 +176,17 @@ function attach_count_files($channel_id, $observer, $hash = '', $filename = '', /** * @brief Returns a list of files/attachments. * - * @param $channel_id - * @param $observer - * @param $hash (optional) - * @param $filename (optional) - * @param $filetype (optional) - * @param $orderby - * @param $start - * @param $entries - * @return associative array with: + * @param int $channel_id + * @param string $observer + * @param string $hash (optional) + * @param string $filename (optional) + * @param string $filetype (optional) + * @param string $orderby (optional) + * @param int $start (optional) + * @param int $entries (optional) + * @param string $since (optional) + * @param string $until (optional) + * @return array an associative array with: * * \e boolean \b success * * \e array|boolean \b results array with results, or false * * \e string \b message with error messages if any @@ -1428,8 +1430,17 @@ function attach_delete($channel_id, $resource, $is_photo = 0) { if(! $r) { attach_drop_photo($channel_id,$resource); - $arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo'=>$is_photo]; - call_hooks("attach_delete",$arr); + $arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo' => $is_photo]; + + /** + * @hooks attach_delete + * Called when deleting an attachment from channel. + * * \e int \b channel_id - the channel_id + * * \e string \b resource + * * \e int \b is_photo + */ + call_hooks('attach_delete', $arr); + return; } @@ -1488,8 +1499,15 @@ function attach_delete($channel_id, $resource, $is_photo = 0) { intval($channel_id) ); - $arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo'=>$is_photo]; - call_hooks("attach_delete",$arr); + $arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo' => $is_photo]; + /** + * @hooks attach_delete + * Called when deleting an attachment from channel. + * * \e int \b channel_id - the channel_id + * * \e string \b resource + * * \e int \b is_photo + */ + call_hooks('attach_delete', $arr); file_activity($channel_id, $object, $object['allow_cid'], $object['allow_gid'], $object['deny_cid'], $object['deny_gid'], 'update', true); @@ -1868,7 +1886,7 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, * @param int $channel_id * @param string $hash * @param string $url - * @return array An associative array for the specified file. + * @return array Associative array for the specified file. */ function get_file_activity_object($channel_id, $hash, $url) { @@ -2110,7 +2128,7 @@ function attach_export_data($channel, $resource_id, $deleted = false) { if($attach_ptr['is_photo']) { - // This query could potentially result in a few megabytes of data use. + // This query could potentially result in a few megabytes of data use. $r = q("select * from photo where resource_id = '%s' and uid = %d order by imgscale asc", dbesc($resource_id), @@ -2352,7 +2370,7 @@ function attach_move($channel_id, $resource_id, $new_folder_hash) { $filename = $r[0]['filename']; - // don't do duplicate check unless our parent folder has changed. + // don't do duplicate check unless our parent folder has changed. if($r[0]['folder'] !== $new_folder_hash) { @@ -2468,7 +2486,7 @@ function attach_move($channel_id, $resource_id, $new_folder_hash) { /** - * Used to generate a select input box of all your folders + * Used to generate a select input box of all your folders */ @@ -2551,10 +2569,10 @@ function attach_syspaths($channel_id,$attach_hash) { /** * in earlier releases we did not fill in os_path and display_path in the attach DB structure. - * (It was not needed or used). Going forward we intend to make use of these fields. + * (It was not needed or used). Going forward we intend to make use of these fields. * A cron task checks for empty values (as older attachments may have arrived at our site - * in a clone operation) and executes attach_syspaths() to generate these field values and correct - * the attach table entry. The operation is limited to 100 DB entries at a time so as not to + * in a clone operation) and executes attach_syspaths() to generate these field values and correct + * the attach table entry. The operation is limited to 100 DB entries at a time so as not to * overload the system in any cron run. Eventually it will catch up with old attach structures * and switch into maintenance mode to correct any that might arrive in clone packets from older * sites. diff --git a/include/feedutils.php b/include/feedutils.php index afbe4229e..5e52828c3 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -261,13 +261,13 @@ function construct_activity_target($item) { * @param SimplePie $item * @return array $author */ - function get_atom_author($feed, $item) { $author = []; $found_author = $item->get_author(); if($found_author) { + /// @FIXME $rawauthor is undefined here if($rawauthor) { if($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data']) $author['full_name'] = unxmlify($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data']); @@ -398,10 +398,10 @@ function get_atom_author($feed, $item) { 'author' => $author ]; /** - * @hooks parse_atom + * @hooks parse_atom_author * * \e SimplePie \b feed - The original SimplePie feed * * \e SimplePie \b item - * * \e array \b result - the result array that will also get returned + * * \e array \b author - the result array that will also get returned */ call_hooks('parse_atom_author', $arr); @@ -416,10 +416,8 @@ function get_atom_author($feed, $item) { * * @param SimplePie $feed * @param SimplePie $item - * @param[out] array $author * @return array Associative array with the parsed item data */ - function get_atom_elements($feed, $item) { require_once('include/html2bbcode.php'); @@ -669,10 +667,10 @@ function get_atom_elements($feed, $item) { $termterm = notags(trim(unxmlify($term))); // Mastodon auto generates an nsfw category tag for any 'content-warning' message. - // Most people use CW and use both summary/content as a spoiler and we honour that - // construct so the post will already be collapsed. The generated tag is almost + // Most people use CW and use both summary/content as a spoiler and we honour that + // construct so the post will already be collapsed. The generated tag is almost // always wrong and even if it isn't we would already be doing the right thing. - + if($mastodon && $termterm === 'nsfw' && $summary && $res['body']) continue; @@ -1336,7 +1334,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { if( ! \Zotlabs\Lib\MessageFilter::evaluate($datarray,get_config('system','pubstream_incl'),get_config('system','pubstream_excl'))) { continue; } - } + } if(! post_is_importable($datarray, $contact)) continue; @@ -1492,7 +1490,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { if( ! \Zotlabs\Lib\MessageFilter::evaluate($datarray,get_config('system','pubstream_incl'),get_config('system','pubstream_excl'))) { continue; } - } + } if(! post_is_importable($datarray, $contact)) continue; @@ -1900,7 +1898,7 @@ function atom_entry($item, $type, $author, $owner, $comment = false, $cid = 0, $ $body = $item['body']; - if($summary) + if($summary) $body = preg_replace('|^(.*?)\[summary\](.*?)\[/summary\](.*?)$|ism','$1$3',$item['body']); if($compat) diff --git a/include/help.php b/include/help.php index 61dbc7bb3..e82fa96da 100644 --- a/include/help.php +++ b/include/help.php @@ -7,9 +7,10 @@ use \Michelf\MarkdownExtra; * @brief * * @param string $path - * @return string|unknown + * @param string $suffix (optional) default null + * @return string */ -function get_help_fullpath($path,$suffix=null) { +function get_help_fullpath($path, $suffix = null) { $docroot = (\App::$override_helproot) ? \App::$override_helproot : 'doc/'; $docroot = (substr($docroot,-1)!='/') ? $docroot .= '/' : $docroot; @@ -49,8 +50,8 @@ function get_help_fullpath($path,$suffix=null) { /** * @brief * - * @param string $tocpath - * @return string|unknown + * @param string $tocpath (optional) default false + * @return string */ function get_help_content($tocpath = false) { @@ -171,16 +172,20 @@ function preg_callback_help_include($matches) { } /** - * @brief + * @brief Determines help language. + * + * If the language was specified in the URL, override the language preference + * of the browser. Default to English if both of these are absent. * - * @return boolean|array + * @return array Associative array with: + * * \e string \b language - 2-letter ISO 639-1 code ("en") + * * \e boolean \b from_url - true if language from URL overrides browser default */ function determine_help_language() { $lang_detect = new Text_LanguageDetect(); // Set this mode to recognize language by the short code like "en", "ru", etc. $lang_detect->setNameMode(2); - // If the language was specified in the URL, override the language preference - // of the browser. Default to English if both of these are absent. + if($lang_detect->languageExists(argv(1))) { $lang = argv(1); $from_url = true; @@ -211,10 +216,10 @@ function find_doc_file($s) { } /** - * @brief + * @brief Search in doc files. * - * @param string $s - * @return number|mixed|unknown|boolean + * @param string $s The search string to search for + * @return array */ function search_doc_files($s) { @@ -275,7 +280,6 @@ function doc_rank_sort($s1, $s2) { * * @return string */ - function load_context_help() { $path = App::$cmd; @@ -305,7 +309,7 @@ function load_context_help() { * @brief * * @param string $s - * @return void|boolean[]|number[]|string[]|unknown[] + * @return void|array */ function store_doc_file($s) { diff --git a/include/import.php b/include/import.php index 3bd8b4105..f391400bd 100644 --- a/include/import.php +++ b/include/import.php @@ -12,6 +12,7 @@ require_once('include/perm_upgrade.php'); * @param array $channel * @param int $account_id * @param int $seize + * @param string $newname (optional) * @return boolean|array */ function import_channel($channel, $account_id, $seize, $newname = '') { @@ -650,7 +651,7 @@ function import_items($channel, $items, $sync = false, $relocate = null) { // preserve conversations you've been involved in from being expired $stored = $item_result['item']; - if((is_array($stored)) && ($stored['id'] != $stored['parent']) + if((is_array($stored)) && ($stored['id'] != $stored['parent']) && ($stored['author_xchan'] === $channel['channel_hash'])) { retain_item($stored['item']['parent']); } @@ -672,7 +673,7 @@ function import_items($channel, $items, $sync = false, $relocate = null) { /** * @brief Sync items to channel. * - * @see import_items + * @see import_items() * * @param array $channel where to import to * @param array $items @@ -1049,7 +1050,7 @@ function import_mail($channel, $mails, $sync = false) { /** * @brief Synchronise mails. * - * @see import_mail + * @see import_mail() * @param array $channel * @param array $mails */ @@ -1337,7 +1338,7 @@ function sync_files($channel, $files) { if($str) $str .= ","; - + $str .= " " . TQUOT . $k . TQUOT . " = '" . (($k === 'content') ? dbescbin($v) : dbesc($v)) . "' "; } $r = dbq("update photo set " . $str . " where id = " . intval($exists[0]['id']) ); diff --git a/include/items.php b/include/items.php index e5f2be003..ed6fee597 100755 --- a/include/items.php +++ b/include/items.php @@ -25,7 +25,7 @@ require_once('include/permissions.php'); * * @param array $item * @param[out] boolean $private_envelope - * @param boolean $include_groups + * @param boolean $include_groups * @return array containing the recipients */ function collect_recipients($item, &$private_envelope,$include_groups = true) { @@ -97,9 +97,9 @@ function collect_recipients($item, &$private_envelope,$include_groups = true) { if(array_key_exists('public_policy',$item) && $item['public_policy'] !== 'self') { $hookinfo = [ - 'recipients' => [], - 'item' => $item, - 'private_envelope' => $private_envelope, + 'recipients' => [], + 'item' => $item, + 'private_envelope' => $private_envelope, 'include_groups' => $include_groups ]; @@ -410,7 +410,7 @@ function post_activity_item($arr, $allow_code = false, $deliver = true) { if(! $arr['mid']) { - $arr['uuid'] = ((x($arr,'uuid')) ? $arr['uuid'] : item_message_id()); + $arr['uuid'] = ((x($arr,'uuid')) ? $arr['uuid'] : item_message_id()); } $arr['mid'] = ((x($arr,'mid')) ? $arr['mid'] : z_root() . '/item/' . $arr['uuid']); $arr['parent_mid'] = ((x($arr,'parent_mid')) ? $arr['parent_mid'] : $arr['mid']); @@ -2400,15 +2400,15 @@ function item_update_parent_commented($item) { $update_parent = true; - // update the commented timestamp on the parent + // update the commented timestamp on the parent // - unless this is a moderated comment or a potential clone of an older item - // which we don't wish to bring to the surface. As the queue only holds deliveries - // for 3 days, it's suspected of being an older cloned item if the creation time + // which we don't wish to bring to the surface. As the queue only holds deliveries + // for 3 days, it's suspected of being an older cloned item if the creation time //is older than that. if(intval($item['item_blocked']) === ITEM_MODERATED) $update_parent = false; - + if($item['created'] < datetime_convert('','','now - 4 days')) $update_parent = false; @@ -3004,7 +3004,9 @@ function tgroup_check($uid, $item) { * @param array $channel * @param array $item * @param int $item_id - * @param boolean $parent + * @param array $parent + * @param boolean $edit (optional) default false + * @return void */ function start_delivery_chain($channel, $item, $item_id, $parent, $edit = false) { @@ -3039,7 +3041,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $edit = false) } // This will change the author to the post owner. Useful for RSS feeds which are to be syndicated - // to federated platforms which can't verify the identity of the author. + // to federated platforms which can't verify the identity of the author. // This MAY cause you to run afoul of copyright law. $rewrite_author = intval(get_abconfig($channel['channel_id'],$item['owner_xchan'],'system','rself')); @@ -3552,7 +3554,7 @@ function item_expire($uid,$days,$comment_days = 7) { if(! $comment_days) $comment_days = 7; - + // $expire_network_only = save your own wall posts // and just expire conversations started by others // do not enable this until we can pass bulk delete messages through zot @@ -4892,7 +4894,7 @@ function copy_of_pubitem($channel,$mid) { dbesc($mid), intval($syschan['channel_id']) ); - + if($r) { $items = fetch_post_tags($r,true); foreach($items as $rv) { @@ -4918,5 +4920,5 @@ function copy_of_pubitem($channel,$mid) { } } - return $result; + return $result; } diff --git a/include/plugin.php b/include/plugin.php index ec14fd945..c789ad522 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -7,13 +7,15 @@ /** - * @brief Handle errors in plugin calls + * @brief Handle errors in plugin calls. * * @param string $plugin name of the addon - * @param string $error_text text of error - * @param bool $uninstall uninstall plugin + * @param string $notice UI visible text of error + * @param string $log technical error message for logging + * @param bool $uninstall (optional) default false + * uninstall plugin on error */ -function handleerrors_plugin($plugin,$notice,$log,$uninstall=false){ +function handleerrors_plugin($plugin, $notice, $log, $uninstall = false){ logger("Addons: [" . $plugin . "] Error: ".$log, LOGGER_ERROR); if ($notice != '') { notice("[" . $plugin . "] Error: ".$notice, LOGGER_ERROR); @@ -23,7 +25,7 @@ function handleerrors_plugin($plugin,$notice,$log,$uninstall=false){ $idx = array_search($plugin, \App::$plugins); unset(\App::$plugins[$idx]); uninstall_plugin($plugin); - set_config("system","addon", implode(", ",\App::$plugins)); + set_config("system", "addon", implode(", ", \App::$plugins)); } } @@ -381,8 +383,6 @@ function unregister_hook($hook, $file, $function) { * array in their theme_init() and use this to customise the app behaviour. * use insert_hook($hookname,$function_name) to do this. */ - - function load_hooks() { App::$hooks = []; @@ -1085,10 +1085,11 @@ function get_markup_template($s, $root = '') { } /** - * @brief + * @brief Test if a folder exists. * * @param string $folder * @return boolean|string + * False if folder does not exist, or canonicalized absolute pathname */ function folder_exists($folder) { // Get canonicalized absolute pathname diff --git a/include/text.php b/include/text.php index 6ac04f435..925c8e997 100644 --- a/include/text.php +++ b/include/text.php @@ -41,12 +41,12 @@ function replace_macros($s, $r) { $t = App::template_engine(); - try { - $output = $t->replace_macros($arr['template'], $arr['params']); - } catch (Exception $e) { - logger("Unable to render template: ".$e->getMessage()); - $output = "

      ERROR: there was an error creating the output.

      "; - } + try { + $output = $t->replace_macros($arr['template'], $arr['params']); + } catch (Exception $e) { + logger('Unable to render template: ' . $e->getMessage()); + $output = '

      ERROR: there was an error creating the output.

      '; + } return $output; } @@ -539,7 +539,14 @@ function paginate(&$a) { return $o; } - +/** + * @brief + * + * @param int $i + * @param string $more + * @param string $less + * @return string Parsed HTML from template 'alt_pager.tpl' + */ function alt_pager($i, $more = '', $less = '') { if(! $more) @@ -810,7 +817,7 @@ function activity_match($haystack,$needle) { * and strip the period from any tags which end with one. * * @param string $s - * @return Returns array of tags found, or empty array. + * @return array Returns an array of tags found, or empty array. */ function get_tags($s) { $ret = array(); @@ -825,7 +832,7 @@ function get_tags($s) { // ignore anything in [color= ], because it may contain color codes which are mistaken for tags $s = preg_replace('/\[color=(.*?)\]/sm','',$s); - + // skip anchors in URL $s = preg_replace('/\[url=(.*?)\]/sm','',$s); @@ -900,6 +907,7 @@ function tag_sort_length($a,$b) { function total_sort($a,$b) { if($a['total'] == $b['total']) return 0; + return(($b['total'] > $a['total']) ? 1 : (-1)); } @@ -1004,9 +1012,15 @@ function contact_block() { '$micropro' => $micropro, )); - $arr = array('contacts' => $r, 'output' => $o); - + $arr = ['contacts' => $r, 'output' => $o]; + /** + * @hooks contact_block_end + * Called at the end of contact_block(), but can not manipulate the output. + * * \e array \b contacts - Result array from database + * * \e string \b output - the generated output + */ call_hooks('contact_block_end', $arr); + return $o; } @@ -1108,16 +1122,20 @@ function linkify($s, $me = false) { * to a local redirector which uses https and which redirects to the selected content * * @param string $s - * @param int $uid * @returns string */ function sslify($s) { // Local photo cache - $str = array( + $str = [ 'body' => $s, 'uid' => local_channel() - ); + ]; + /** + * @hooks cache_body_hook + * * \e string \b body The content to parse and also the return value + * * \e int|bool \b uid + */ call_hooks('cache_body_hook', $str); $s = $str['body']; @@ -1222,7 +1240,11 @@ function get_mood_verbs() { /** * @brief Function to list all smilies, both internal and from addons. * - * @return Returns array with keys 'texts' and 'icons' + * @param boolean $default_only (optional) default false + * true will prevent that plugins can add smilies + * @return array Returns an associative array with: + * * \e array \b texts + * * \e array \b icons */ function list_smilies($default_only = false) { @@ -1300,6 +1322,11 @@ function list_smilies($default_only = false) { if($default_only) return $params; + /** + * @hooks smile + * * \e array \b texts - default values and also return value + * * \e array \b icons - default values and also return value + */ call_hooks('smilie', $params); return $params; @@ -1625,6 +1652,10 @@ function generate_named_map($location) { function prepare_body(&$item,$attach = false,$opts = false) { + /** + * @hooks prepare_body_init + * * \e array \b item + */ call_hooks('prepare_body_init', $item); $s = ''; @@ -1656,13 +1687,19 @@ function prepare_body(&$item,$attach = false,$opts = false) { $event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event_obj($item['obj']) : false); - $prep_arr = array( + $prep_arr = [ 'item' => $item, 'html' => $event ? $event['content'] : $s, 'event' => $event['header'], 'photo' => $photo - ); - + ]; + /** + * @hooks prepare_body + * * \e array \b item + * * \e string \b html - the parsed HTML to return + * * \e string \b event - the event header to return + * * \e string \b photo - the photo to return + */ call_hooks('prepare_body', $prep_arr); $s = $prep_arr['html']; @@ -2249,19 +2286,24 @@ function ids_to_querystr($arr,$idx = 'id',$quote = false) { } /** - * @brief array_elm_to_str($arr,$elm,$delim = ',') extract unique individual elements from an array of arrays and return them as a string separated by a delimiter - * similar to ids_to_querystr, but allows a different delimiter instead of a db-quote option - * empty elements (evaluated after trim()) are ignored. - * @param $arr array - * @param $elm array key to extract from sub-array - * @param $delim string default ',' - * @param $each filter function to apply to each element before evaluation, default is 'trim'. + * @brief Extract unique individual elements from an array of arrays and return + * them as a string separated by a delimiter. + * + * Similar to ids_to_querystr, but allows a different delimiter instead of a + * db-quote option empty elements (evaluated after trim()) are ignored. + * + * @see ids_to_querystr() + * + * @param array $arr + * @param string $elm key to extract from sub-array + * @param string $delim (optional) default ',' + * @param string $each (optional) default is 'trim' + * Filter function to apply to each element before evaluation. * @returns string */ - -function array_elm_to_str($arr,$elm,$delim = ',',$each = 'trim') { - +function array_elm_to_str($arr, $elm, $delim = ',', $each = 'trim') { $tmp = []; + if($arr && is_array($arr)) { foreach($arr as $x) { if(is_array($x) && array_key_exists($elm,$x)) { @@ -2272,7 +2314,8 @@ function array_elm_to_str($arr,$elm,$delim = ',',$each = 'trim') { } } } - return implode($delim,$tmp); + + return implode($delim, $tmp); } function trim_and_unpunify($s) { @@ -2496,9 +2539,9 @@ function design_tools() { } /** - * @brief Creates website portation tools menu + * @brief Creates website portation tools menu. * - * @return string + * @return string Parsed HTML code from template 'website_portation_tools.tpl' */ function website_portation_tools() { @@ -2511,7 +2554,7 @@ function website_portation_tools() { $sys = true; } - return replace_macros(get_markup_template('website_portation_tools.tpl'), array( + return replace_macros(get_markup_template('website_portation_tools.tpl'), [ '$title' => t('Import'), '$import_label' => t('Import website...'), '$import_placeholder' => t('Select folder to import'), @@ -2528,7 +2571,7 @@ function website_portation_tools() { '$cloud_export_desc' => t('/path/to/export/folder'), '$cloud_export_hint' => t('Enter a path to a cloud files destination.'), '$cloud_export_select' => t('Specify folder'), - )); + ]); } /** @@ -2991,9 +3034,9 @@ function item_url_replace($channel,&$item,$old,$new,$oldnick = '') { json_url_replace('/' . $oldnick . '/' ,'/' . $channel['channel_address'] . '/' ,$item['target']); } - $x = preg_replace("/".preg_quote($old,'/')."\/(search|\w+\/".$channel['channel_address'].")/", $new.'/${1}', $item['body']); - if($x) { - $item['body'] = $x; + $x = preg_replace("/".preg_quote($old,'/')."\/(search|\w+\/".$channel['channel_address'].")/", $new.'/${1}', $item['body']); + if($x) { + $item['body'] = $x; $item['sig'] = base64url_encode(rsa_sign($item['body'],$channel['channel_prvkey'])); $item['item_verified'] = 1; } @@ -3103,7 +3146,13 @@ function pdl_selector($uid, $current='') { intval($uid) ); - $arr = array('channel_id' => $uid, 'current' => $current, 'entries' => $r); + $arr = ['channel_id' => $uid, 'current' => $current, 'entries' => $r]; + /** + * @hooks pdl_selector + * * \e int \b channel_id + * * \e string \b current + * * \e array \b entries - Result from database query + */ call_hooks('pdl_selector', $arr); $entries = $arr['entries']; @@ -3178,7 +3227,6 @@ function text_highlight($s, $lang) { 'language' => $lang, 'success' => false ]; - /** * @hooks text_highlight * * \e string \b text @@ -3379,13 +3427,17 @@ function punify($s) { } -// Be aware that unpunify will only convert domain names and not pathnames - +/** + * Be aware that unpunify() will only convert domain names and not pathnames. + * + * @param string $s + * @return string + */ function unpunify($s) { require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php'); $x = new idna_convert(['encoding' => 'utf8']); - return $x->decode($s); + return $x->decode($s); } @@ -3521,12 +3573,11 @@ function array_path_exists($str,$arr) { */ function new_uuid() { - try { - $hash = Uuid::uuid4()->toString(); - } catch (UnsatisfiedDependencyException $e) { - $hash = random_string(48); - } + try { + $hash = Uuid::uuid4()->toString(); + } catch (UnsatisfiedDependencyException $e) { + $hash = random_string(48); + } - return $hash; + return $hash; } - diff --git a/include/zot.php b/include/zot.php index bc2187f91..3b089831b 100644 --- a/include/zot.php +++ b/include/zot.php @@ -174,7 +174,7 @@ function zot_build_packet($channel, $type = 'notify', $recipients = null, $remot * packet type: one of 'ping', 'pickup', 'purge', 'refresh', 'keychange', 'force_refresh', 'notify', 'auth_check' * @param array $recipients * envelope information, array ( 'guid' => string, 'guid_sig' => string ); empty for public posts - * @param string msg + * @param string $msg * optional message * @param string $remote_key * optional public site key of target hub used to encrypt entire packet @@ -1829,7 +1829,7 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ else { $arr['item_wall'] = 0; } - + if ((! $tag_delivery) && (! $local_public)) { $allowed = (perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)); @@ -1843,7 +1843,7 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ $allowed = can_comment_on_post($d['hash'],$parent[0]); } } - + if (! $allowed) { logger("permission denied for delivery to channel {$channel['channel_id']} {$channel['channel_address']}"); $DR->update('permission denied'); @@ -2330,7 +2330,7 @@ function process_mail_delivery($sender, $arr, $deliveries) { if(! perm_is_allowed($channel['channel_id'],$sender['hash'],'post_mail')) { - /* + /* * Always allow somebody to reply if you initiated the conversation. It's anti-social * and a bit rude to send a private message to somebody and block their ability to respond. * If you are being harrassed and want to put an end to it, delete the conversation. @@ -2358,7 +2358,7 @@ function process_mail_delivery($sender, $arr, $deliveries) { ); if($r) { if(intval($arr['mail_recalled'])) { - msg_drop($r[0]['id'], $channel['channel_id'], $r[0]['conv_guid']); + msg_drop($r[0]['id'], $channel['channel_id'], $r[0]['conv_guid']); $DR->update('mail recalled'); $result[] = $DR->get(); logger('mail_recalled'); @@ -3247,7 +3247,7 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { $channel = $r[0]; - // don't provide these in the export + // don't provide these in the export unset($channel['channel_active']); unset($channel['channel_password']); @@ -3616,7 +3616,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { if(array_key_exists('channel_pageflags',$arr['channel']) && intval($arr['channel']['channel_pageflags'])) { // Several pageflags are site-specific and cannot be sync'd. - // Only allow those bits which are shareable from the remote and then + // Only allow those bits which are shareable from the remote and then // logically OR with the local flags $arr['channel']['channel_pageflags'] = $arr['channel']['channel_pageflags'] & (PAGE_HIDDEN|PAGE_AUTOCONNECT|PAGE_APPLICATION|PAGE_PREMIUM|PAGE_ADULT); @@ -4974,9 +4974,9 @@ function zot_reply_pickup($data) { // It's possible that we have more than 100 messages waiting to be sent. // See if there are any more messages in the queue. - $x = q("select * from outq where outq_posturl = '%s' order by outq_created limit 1", - dbesc($data['callback']) - ); + $x = q("select * from outq where outq_posturl = '%s' order by outq_created limit 1", + dbesc($data['callback']) + ); // If so, kick off a new delivery notification for the next batch if ($x) { @@ -5057,7 +5057,7 @@ function zot_reply_auth_check($data,$encrypted_packet) { } // There should be exactly one recipient, the original auth requestor - + /// @FIXME $recipients is undefined here. $ret['message'] .= 'recipients ' . print_r($recipients,true) . EOL; if ($data['recipients']) { -- cgit v1.2.3 From 0946ac2ff95d54bff36dfcacb7a8553070c9b3b9 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 24 Jan 2019 12:53:38 +0100 Subject: possibly more page jumping fixes --- view/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index d88133b23..fca9d125d 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -769,7 +769,7 @@ function updateConvItems(mode,data) { mediaPlaying = false; }); - var bimgs = ((preloadImages) ? false : $(".wall-item-body img").not(function() { return this.complete; })); + var bimgs = ((preloadImages) ? false : $(".wall-item-body img, .wall-photo-item img").not(function() { return this.complete; })); var bimgcount = bimgs.length; if (bimgcount) { @@ -999,7 +999,7 @@ function liveUpdate(notify_id) { $("#profile-jot-text-loading").hide(); // adjust scroll position if new content was added above viewport - if(update_mode === 'update') { + if(update_mode === 'update' && !justifiedGalleryActive) { $(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight + contentHeightDiff); } -- cgit v1.2.3 From 32acf9cb7283f55338994346fd90c9ef2136fab3 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 24 Jan 2019 18:06:27 +0100 Subject: macke mod chanview aware of zot6 --- Zotlabs/Module/Chanview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Chanview.php b/Zotlabs/Module/Chanview.php index 779c7e646..2e653d030 100644 --- a/Zotlabs/Module/Chanview.php +++ b/Zotlabs/Module/Chanview.php @@ -106,7 +106,7 @@ class Chanview extends \Zotlabs\Web\Controller { if (\App::$poi) { $url = \App::$poi['xchan_url']; - if(\App::$poi['xchan_network'] === 'zot') { + if(in_array(\App::$poi['xchan_network'], ['zot', 'zot6'])) { $is_zot = true; } if(local_channel()) { -- cgit v1.2.3 From 4cc98874a06c2b243d39d1d5e0ea4a44518d50e9 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sat, 12 Jan 2019 18:33:18 +0100 Subject: Publish doxygen API documentation at gitlab pages. Create the API documentation with Doxygen and publish it through gitlab-ci as a Gitlab page at: https://hubzilla.frama.io/core This should only happen when master gets updated. Update Doxyfile configuration. Correct image usage. Replace RedMatrix with Hubzilla icon. --- .gitlab-ci.yml | 26 ++++++++++++++++++++++++++ util/Doxyfile | 4 +++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d162d57ba..bf03c1763 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,10 @@ # Select image from https://hub.docker.com/_/php/ image: php:7.1 +stages: + - test + - deploy + # Select what we should cache cache: paths: @@ -31,6 +35,7 @@ before_script: # We test PHP7 with MySQL test:php:mysql: + stage: test services: - mysql:5.7 script: @@ -41,6 +46,7 @@ test:php:mysql: # test PHP7 with PostgreSQL test:php:postgres: + stage: test services: - postgres:latest variables: @@ -67,3 +73,23 @@ test:php:postgres: name: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME" paths: - tests/results/ + + +# Generate Doxygen API Documentation and deploy it at GitLab pages +pages: + stage: deploy + cache: {} + image: php:7-cli-alpine + before_script: + - apk update + - apk add doxygen ttf-freefont graphviz + script: + - doxygen util/Doxyfile + - mv doc/html/ public/ + - echo "API documentation should be accessible at https://hubzilla.frama.io/core/ soon" + artifacts: + paths: + - public + only: + # Only generate it on main repo's master branch + - master@hubzilla/core diff --git a/util/Doxyfile b/util/Doxyfile index 7be774a81..14464df81 100644 --- a/util/Doxyfile +++ b/util/Doxyfile @@ -1,7 +1,8 @@ INPUT = README.md index.php boot.php include/ install/ util/ view/ Zotlabs/ RECURSIVE = YES PROJECT_NAME = "The Hubzilla" -PROJECT_LOGO = images/rm-64.png +PROJECT_LOGO = images/hz-64.png +IMAGE_PATH = images/ EXCLUDE = .htconfig.php library/ doc/ store/ vendor/ .git/ util/zotsh/easywebdav/ util/generate-hooks-index/ EXCLUDE_PATTERNS = *smarty3* *strings.php *.out *test* OUTPUT_DIRECTORY = doc @@ -33,5 +34,6 @@ INTERACTIVE_SVG = YES CLASS_GRAPH = YES COLLABORATION_GRAPH = NO # fix @var (https://bugzilla.gnome.org/show_bug.cgi?id=626105) +# Should be obsolete with doxygen >= 1.8.15 #INPUT_FILTER = "sed -e 's/@var\s/@see /'" INPUT_FILTER = "php util/Doxygen_phpvarfilter.php" -- cgit v1.2.3 From 2fa274de1e567665c5fd3d25e382557eb4325d83 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 24 Jan 2019 19:08:57 -0800 Subject: support photo items between zot and zot6 --- Zotlabs/Daemon/Notifier.php | 2 ++ Zotlabs/Lib/Activity.php | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index beb30ed96..5ee8843b2 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -434,6 +434,8 @@ class Notifier { $x['body'] = 'private'; logger('notifier: encoded item: ' . print_r($x,true), LOGGER_DATA, LOG_DEBUG); + //logger('notifier: encoded activity: ' . print_r($activity,true), LOGGER_DATA, LOG_DEBUG); + stringify_array_elms($recipients); if(! $recipients) { logger('no recipients'); diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 154421b6a..03f094983 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -35,6 +35,9 @@ class Activity { if($x['type'] === ACTIVITY_OBJ_EVENT) { return self::fetch_event($x); } + if($x['type'] === ACTIVITY_OBJ_PHOTO) { + return self::fetch_image($x); + } return $x; @@ -102,6 +105,29 @@ class Activity { } } + + static function fetch_image($x) { + + + $ret = [ + 'type' => 'Image', + 'id' => $x['id'], + 'name' => $x['title'], + 'content' => bbcode($x['body']), + 'source' => [ 'mediaType' => 'text/bbcode', 'content' => $x['body'] ], + 'published' => datetime_convert('UTC','UTC',$x['created'],ATOM_TIME), + 'updated' => datetime_convert('UTC','UTC', $x['edited'],ATOM_TIME), + 'url' => [ + 'type' => 'Link', + 'mediaType' => $x['link'][0]['type'], + 'href' => $x['link'][0]['href'], + 'width' => $x['link'][0]['width'], + 'height' => $x['link'][0]['height'] + ] + ]; + return $ret; + } + static function fetch_event($x) { // convert old Zot event objects to ActivityStreams Event objects @@ -389,6 +415,8 @@ class Activity { } $ret['type'] = self::activity_mapper($i['verb']); + + $ret['id'] = ((strpos($i['mid'],'http') === 0) ? $i['mid'] : z_root() . '/activity/' . urlencode($i['mid'])); if($i['title']) @@ -460,6 +488,10 @@ class Activity { if(! is_array($i['obj'])) { $i['obj'] = json_decode($i['obj'],true); } + if($i['obj']['type'] === ACTIVITY_OBJ_PHOTO) { + $i['obj']['id'] = $i['id']; + } + $obj = self::encode_object($i['obj']); if($obj) $ret['object'] = $obj; @@ -1609,7 +1641,9 @@ class Activity { } - if($act->obj['type'] === 'Image') { + // avoid double images from hubzilla to zap/osada + + if($act->obj['type'] === 'Image' && strpos($s['body'],'zrl=') === false) { $ptr = null; -- cgit v1.2.3 From 10587e3a842d7870c94bd52c23dedc5abc114bdc Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 25 Jan 2019 10:49:17 +0100 Subject: return false if http signatue is not valid --- Zotlabs/Lib/Libzot.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 167e2d67d..1440a9691 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -308,8 +308,7 @@ class Libzot { if(! $hsig_valid) { logger('http signature not valid: ' . print_r($hsig,true)); - /// @FIXME $result is undefined - return $result; + return false; } -- cgit v1.2.3 From 725652006dfa6d1cab307a05b6d16a33bd99441b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 25 Jan 2019 12:14:17 +0100 Subject: bump version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 321f1a93b..348cea535 100755 --- a/boot.php +++ b/boot.php @@ -50,7 +50,7 @@ require_once('include/attach.php'); require_once('include/bbcode.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '3.9.5' ); +define ( 'STD_VERSION', '3.9.6' ); define ( 'ZOT_REVISION', '6.0a' ); define ( 'DB_UPDATE_VERSION', 1230 ); -- cgit v1.2.3 From b11be320634485562405e2e6bc14fa2840c2faf8 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 25 Jan 2019 19:55:23 +0100 Subject: Update hmessages.po --- view/ru/hmessages.po | 1518 +++++++++++++++++++++++++++----------------------- 1 file changed, 825 insertions(+), 693 deletions(-) diff --git a/view/ru/hmessages.po b/view/ru/hmessages.po index 76c24a404..f8c34f95d 100644 --- a/view/ru/hmessages.po +++ b/view/ru/hmessages.po @@ -11,8 +11,8 @@ msgid "" msgstr "" "Project-Id-Version: hubzilla\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-18 11:03+0200\n" -"PO-Revision-Date: 2018-12-04 12:19+0200\n" +"POT-Creation-Date: 2019-01-25 21:03+0200\n" +"PO-Revision-Date: 2019-01-25 21:07+0200\n" "Last-Translator: Max Kostikov \n" "Language-Team: Russian (http://www.transifex.com/Friendica/hubzilla/language/ru/)\n" "MIME-Version: 1.0\n" @@ -25,7 +25,7 @@ msgstr "" msgid "Source channel not found." msgstr "Канал-источник не найден." -#: ../../view/theme/redbasic/php/config.php:15 ../../include/text.php:3096 +#: ../../view/theme/redbasic/php/config.php:15 ../../include/text.php:3162 #: ../../Zotlabs/Module/Admin/Site.php:187 msgid "Default" msgstr "По умолчанию" @@ -42,7 +42,7 @@ msgstr "Фокус (по умолчанию Hubzilla)" #: ../../Zotlabs/Module/Email_validation.php:40 #: ../../Zotlabs/Module/Poke.php:217 ../../Zotlabs/Module/Appman.php:155 #: ../../Zotlabs/Module/Profiles.php:723 ../../Zotlabs/Module/Photos.php:1097 -#: ../../Zotlabs/Module/Photos.php:1137 ../../Zotlabs/Module/Photos.php:1255 +#: ../../Zotlabs/Module/Photos.php:1138 ../../Zotlabs/Module/Photos.php:1257 #: ../../Zotlabs/Module/Oauth.php:111 ../../Zotlabs/Module/Events.php:495 #: ../../Zotlabs/Module/Rate.php:166 ../../Zotlabs/Module/Locs.php:121 #: ../../Zotlabs/Module/Sources.php:125 ../../Zotlabs/Module/Sources.php:162 @@ -61,7 +61,7 @@ msgstr "Фокус (по умолчанию Hubzilla)" #: ../../Zotlabs/Module/Settings/Directory.php:41 #: ../../Zotlabs/Module/Settings/Photos.php:41 #: ../../Zotlabs/Module/Settings/Profiles.php:50 -#: ../../Zotlabs/Module/Settings/Featured.php:54 +#: ../../Zotlabs/Module/Settings/Featured.php:62 #: ../../Zotlabs/Module/Settings/Connections.php:41 #: ../../Zotlabs/Module/Settings/Channel.php:493 #: ../../Zotlabs/Module/Filestorage.php:183 ../../Zotlabs/Module/Cal.php:344 @@ -79,8 +79,8 @@ msgstr "Фокус (по умолчанию Hubzilla)" #: ../../Zotlabs/Module/Admin/Account_edit.php:73 #: ../../Zotlabs/Module/Tokens.php:188 ../../Zotlabs/Module/Thing.php:326 #: ../../Zotlabs/Module/Thing.php:379 ../../Zotlabs/Module/Editpost.php:85 -#: ../../Zotlabs/Module/Connedit.php:893 ../../Zotlabs/Module/Group.php:140 -#: ../../Zotlabs/Module/Group.php:156 ../../Zotlabs/Module/Mood.php:158 +#: ../../Zotlabs/Module/Connedit.php:904 ../../Zotlabs/Module/Group.php:150 +#: ../../Zotlabs/Module/Group.php:166 ../../Zotlabs/Module/Mood.php:158 #: ../../Zotlabs/Module/Invite.php:168 ../../Zotlabs/Module/Connect.php:124 #: ../../Zotlabs/Module/Pdledit.php:107 ../../Zotlabs/Module/Wiki.php:215 #: ../../Zotlabs/Module/Import.php:574 @@ -118,7 +118,7 @@ msgstr "Фокус (по умолчанию Hubzilla)" #: ../../extend/addon/hzaddons/cart/submodules/subscriptions.php:410 #: ../../extend/addon/hzaddons/cart/submodules/hzservices.php:640 #: ../../extend/addon/hzaddons/cart/submodules/manualcat.php:248 -#: ../../extend/addon/hzaddons/cart/cart.php:1263 +#: ../../extend/addon/hzaddons/cart/cart.php:1264 #: ../../extend/addon/hzaddons/nofed/nofed.php:80 #: ../../extend/addon/hzaddons/planets/planets.php:153 #: ../../extend/addon/hzaddons/pageheader/pageheader.php:48 @@ -151,7 +151,7 @@ msgstr "Узкая панель навигации" #: ../../view/theme/redbasic/php/config.php:99 #: ../../view/theme/redbasic/php/config.php:116 ../../include/dir_fns.php:143 #: ../../include/dir_fns.php:144 ../../include/dir_fns.php:145 -#: ../../boot.php:1630 ../../Zotlabs/Storage/Browser.php:405 +#: ../../boot.php:1634 ../../Zotlabs/Storage/Browser.php:405 #: ../../Zotlabs/Module/Defperms.php:197 ../../Zotlabs/Module/Profiles.php:681 #: ../../Zotlabs/Module/Photos.php:712 ../../Zotlabs/Module/Api.php:99 #: ../../Zotlabs/Module/Events.php:472 ../../Zotlabs/Module/Events.php:473 @@ -164,7 +164,7 @@ msgstr "Узкая панель навигации" #: ../../Zotlabs/Module/Menu.php:221 ../../Zotlabs/Module/Mitem.php:176 #: ../../Zotlabs/Module/Mitem.php:177 ../../Zotlabs/Module/Mitem.php:256 #: ../../Zotlabs/Module/Mitem.php:257 ../../Zotlabs/Module/Admin/Site.php:255 -#: ../../Zotlabs/Module/Connedit.php:398 ../../Zotlabs/Module/Connedit.php:785 +#: ../../Zotlabs/Module/Connedit.php:406 ../../Zotlabs/Module/Connedit.php:796 #: ../../Zotlabs/Module/Wiki.php:227 ../../Zotlabs/Module/Wiki.php:228 #: ../../Zotlabs/Module/Import.php:563 ../../Zotlabs/Module/Import.php:567 #: ../../Zotlabs/Module/Import.php:568 ../../Zotlabs/Lib/Libzotdir.php:162 @@ -206,7 +206,7 @@ msgstr "Узкая панель навигации" #: ../../extend/addon/hzaddons/cart/submodules/manualcat.php:63 #: ../../extend/addon/hzaddons/cart/submodules/manualcat.php:254 #: ../../extend/addon/hzaddons/cart/submodules/manualcat.php:258 -#: ../../extend/addon/hzaddons/cart/cart.php:1257 +#: ../../extend/addon/hzaddons/cart/cart.php:1258 #: ../../extend/addon/hzaddons/nofed/nofed.php:72 #: ../../extend/addon/hzaddons/nofed/nofed.php:76 #: ../../extend/addon/hzaddons/planets/planets.php:149 @@ -226,7 +226,7 @@ msgstr "Нет" #: ../../view/theme/redbasic/php/config.php:99 #: ../../view/theme/redbasic/php/config.php:116 ../../include/dir_fns.php:143 #: ../../include/dir_fns.php:144 ../../include/dir_fns.php:145 -#: ../../boot.php:1630 ../../Zotlabs/Storage/Browser.php:405 +#: ../../boot.php:1634 ../../Zotlabs/Storage/Browser.php:405 #: ../../Zotlabs/Module/Defperms.php:197 ../../Zotlabs/Module/Profiles.php:681 #: ../../Zotlabs/Module/Photos.php:712 ../../Zotlabs/Module/Api.php:98 #: ../../Zotlabs/Module/Events.php:472 ../../Zotlabs/Module/Events.php:473 @@ -239,7 +239,7 @@ msgstr "Нет" #: ../../Zotlabs/Module/Menu.php:221 ../../Zotlabs/Module/Mitem.php:176 #: ../../Zotlabs/Module/Mitem.php:177 ../../Zotlabs/Module/Mitem.php:256 #: ../../Zotlabs/Module/Mitem.php:257 ../../Zotlabs/Module/Admin/Site.php:257 -#: ../../Zotlabs/Module/Connedit.php:398 ../../Zotlabs/Module/Wiki.php:227 +#: ../../Zotlabs/Module/Connedit.php:406 ../../Zotlabs/Module/Wiki.php:227 #: ../../Zotlabs/Module/Wiki.php:228 ../../Zotlabs/Module/Import.php:563 #: ../../Zotlabs/Module/Import.php:567 ../../Zotlabs/Module/Import.php:568 #: ../../Zotlabs/Lib/Libzotdir.php:162 ../../Zotlabs/Lib/Libzotdir.php:163 @@ -281,7 +281,7 @@ msgstr "Нет" #: ../../extend/addon/hzaddons/cart/submodules/manualcat.php:63 #: ../../extend/addon/hzaddons/cart/submodules/manualcat.php:254 #: ../../extend/addon/hzaddons/cart/submodules/manualcat.php:258 -#: ../../extend/addon/hzaddons/cart/cart.php:1257 +#: ../../extend/addon/hzaddons/cart/cart.php:1258 #: ../../extend/addon/hzaddons/nofed/nofed.php:72 #: ../../extend/addon/hzaddons/nofed/nofed.php:76 #: ../../extend/addon/hzaddons/planets/planets.php:149 @@ -461,9 +461,9 @@ msgstr "Неспецифический" #: ../../include/selectors.php:60 ../../include/selectors.php:77 #: ../../include/selectors.php:115 ../../include/selectors.php:151 #: ../../include/connections.php:703 ../../include/connections.php:710 -#: ../../include/event.php:1318 ../../include/event.php:1325 +#: ../../include/event.php:1327 ../../include/event.php:1334 #: ../../Zotlabs/Module/Cdav.php:1227 ../../Zotlabs/Module/Profiles.php:795 -#: ../../Zotlabs/Module/Connedit.php:924 +#: ../../Zotlabs/Module/Connedit.php:935 #: ../../Zotlabs/Access/PermissionRoles.php:306 msgid "Other" msgstr "Другой" @@ -567,7 +567,7 @@ msgstr "Эротоман" #: ../../Zotlabs/Module/Settings/Channel.php:75 #: ../../Zotlabs/Module/Settings/Channel.php:78 #: ../../Zotlabs/Module/Settings/Channel.php:89 -#: ../../Zotlabs/Module/Connedit.php:717 ../../Zotlabs/Widget/Affinity.php:24 +#: ../../Zotlabs/Module/Connedit.php:725 ../../Zotlabs/Widget/Affinity.php:29 msgid "Friends" msgstr "Друзья" @@ -655,18 +655,18 @@ msgstr "Всё равно" msgid "Ask me" msgstr "Спроси меня" -#: ../../include/photos.php:27 ../../include/items.php:3703 -#: ../../include/attach.php:150 ../../include/attach.php:197 -#: ../../include/attach.php:270 ../../include/attach.php:379 -#: ../../include/attach.php:393 ../../include/attach.php:400 -#: ../../include/attach.php:482 ../../include/attach.php:1042 -#: ../../include/attach.php:1116 ../../include/attach.php:1281 +#: ../../include/photos.php:27 ../../include/items.php:3750 +#: ../../include/attach.php:150 ../../include/attach.php:199 +#: ../../include/attach.php:272 ../../include/attach.php:381 +#: ../../include/attach.php:395 ../../include/attach.php:402 +#: ../../include/attach.php:484 ../../include/attach.php:1044 +#: ../../include/attach.php:1118 ../../include/attach.php:1283 #: ../../Zotlabs/Module/Mail.php:146 ../../Zotlabs/Module/Defperms.php:181 #: ../../Zotlabs/Module/Network.php:17 ../../Zotlabs/Module/Common.php:38 #: ../../Zotlabs/Module/Item.php:231 ../../Zotlabs/Module/Item.php:250 #: ../../Zotlabs/Module/Item.php:260 ../../Zotlabs/Module/Item.php:1136 #: ../../Zotlabs/Module/Achievements.php:34 -#: ../../Zotlabs/Module/Display.php:448 ../../Zotlabs/Module/Poke.php:157 +#: ../../Zotlabs/Module/Display.php:447 ../../Zotlabs/Module/Poke.php:157 #: ../../Zotlabs/Module/Profile.php:85 ../../Zotlabs/Module/Profile.php:101 #: ../../Zotlabs/Module/Appman.php:87 ../../Zotlabs/Module/Profiles.php:198 #: ../../Zotlabs/Module/Profiles.php:635 ../../Zotlabs/Module/Photos.php:69 @@ -691,9 +691,9 @@ msgstr "Спроси меня" #: ../../Zotlabs/Module/Filestorage.php:140 #: ../../Zotlabs/Module/Editblock.php:67 #: ../../Zotlabs/Module/Service_limits.php:11 -#: ../../Zotlabs/Module/Message.php:18 ../../Zotlabs/Module/Channel.php:163 -#: ../../Zotlabs/Module/Channel.php:330 ../../Zotlabs/Module/Channel.php:369 -#: ../../Zotlabs/Module/Like.php:185 ../../Zotlabs/Module/Bookmarks.php:70 +#: ../../Zotlabs/Module/Message.php:18 ../../Zotlabs/Module/Channel.php:168 +#: ../../Zotlabs/Module/Channel.php:335 ../../Zotlabs/Module/Channel.php:374 +#: ../../Zotlabs/Module/Like.php:187 ../../Zotlabs/Module/Bookmarks.php:70 #: ../../Zotlabs/Module/Viewsrc.php:19 ../../Zotlabs/Module/Menu.php:129 #: ../../Zotlabs/Module/Menu.php:140 ../../Zotlabs/Module/Setup.php:209 #: ../../Zotlabs/Module/Mitem.php:129 ../../Zotlabs/Module/Notifications.php:11 @@ -706,17 +706,17 @@ msgstr "Спроси меня" #: ../../Zotlabs/Module/Moderate.php:13 ../../Zotlabs/Module/Webpages.php:133 #: ../../Zotlabs/Module/Profile_photo.php:302 #: ../../Zotlabs/Module/Profile_photo.php:315 -#: ../../Zotlabs/Module/Editpost.php:17 ../../Zotlabs/Module/Connedit.php:391 +#: ../../Zotlabs/Module/Editpost.php:17 ../../Zotlabs/Module/Connedit.php:399 #: ../../Zotlabs/Module/Group.php:14 ../../Zotlabs/Module/Group.php:30 #: ../../Zotlabs/Module/Connections.php:32 ../../Zotlabs/Module/Mood.php:126 #: ../../Zotlabs/Module/Card_edit.php:51 #: ../../Zotlabs/Module/Article_edit.php:51 ../../Zotlabs/Module/Blocks.php:73 #: ../../Zotlabs/Module/Blocks.php:80 ../../Zotlabs/Module/Invite.php:21 -#: ../../Zotlabs/Module/Invite.php:102 ../../Zotlabs/Module/Articles.php:80 +#: ../../Zotlabs/Module/Invite.php:102 ../../Zotlabs/Module/Articles.php:88 #: ../../Zotlabs/Module/Cloud.php:40 ../../Zotlabs/Module/Pdledit.php:34 #: ../../Zotlabs/Module/Wiki.php:59 ../../Zotlabs/Module/Wiki.php:285 #: ../../Zotlabs/Module/Wiki.php:428 ../../Zotlabs/Module/Manage.php:10 -#: ../../Zotlabs/Module/Suggest.php:32 ../../Zotlabs/Module/Cards.php:81 +#: ../../Zotlabs/Module/Suggest.php:32 ../../Zotlabs/Module/Cards.php:86 #: ../../Zotlabs/Module/Layouts.php:71 ../../Zotlabs/Module/Layouts.php:78 #: ../../Zotlabs/Module/Layouts.php:89 ../../Zotlabs/Web/WebServer.php:123 #: ../../Zotlabs/Lib/Chatroom.php:133 @@ -755,12 +755,12 @@ msgctxt "photo_upload" msgid "%1$s posted %2$s to %3$s" msgstr "%1$s опубликовал %2$s в %3$s" -#: ../../include/photos.php:669 ../../include/nav.php:417 +#: ../../include/photos.php:669 ../../include/nav.php:447 msgid "Photo Albums" msgstr "Фотоальбомы" -#: ../../include/photos.php:670 ../../Zotlabs/Module/Photos.php:1380 -#: ../../Zotlabs/Module/Photos.php:1393 ../../Zotlabs/Module/Photos.php:1394 +#: ../../include/photos.php:670 ../../Zotlabs/Module/Photos.php:1389 +#: ../../Zotlabs/Module/Photos.php:1402 ../../Zotlabs/Module/Photos.php:1403 msgid "Recent Photos" msgstr "Последние фотографии" @@ -880,7 +880,7 @@ msgstr "Просмотреть все %d общих контактов" #: ../../Zotlabs/Module/Editblock.php:114 ../../Zotlabs/Module/Menu.php:175 #: ../../Zotlabs/Module/Admin/Profs.php:175 #: ../../Zotlabs/Module/Editwebpage.php:142 ../../Zotlabs/Module/Thing.php:266 -#: ../../Zotlabs/Module/Webpages.php:255 ../../Zotlabs/Module/Group.php:235 +#: ../../Zotlabs/Module/Webpages.php:255 ../../Zotlabs/Module/Group.php:252 #: ../../Zotlabs/Module/Connections.php:284 #: ../../Zotlabs/Module/Connections.php:322 #: ../../Zotlabs/Module/Connections.php:342 @@ -888,7 +888,7 @@ msgstr "Просмотреть все %d общих контактов" #: ../../Zotlabs/Module/Article_edit.php:99 ../../Zotlabs/Module/Blocks.php:160 #: ../../Zotlabs/Module/Wiki.php:211 ../../Zotlabs/Module/Wiki.php:384 #: ../../Zotlabs/Module/Layouts.php:193 ../../Zotlabs/Widget/Cdav.php:126 -#: ../../Zotlabs/Widget/Cdav.php:162 ../../Zotlabs/Lib/Apps.php:534 +#: ../../Zotlabs/Widget/Cdav.php:162 ../../Zotlabs/Lib/Apps.php:536 #: ../../Zotlabs/Lib/ThreadItem.php:133 msgid "Edit" msgstr "Изменить" @@ -947,9 +947,9 @@ msgstr "Запрошенный канал не доступен." #: ../../Zotlabs/Module/Editblock.php:31 ../../Zotlabs/Module/Menu.php:91 #: ../../Zotlabs/Module/Hcard.php:12 ../../Zotlabs/Module/Editwebpage.php:32 #: ../../Zotlabs/Module/Webpages.php:39 ../../Zotlabs/Module/Blocks.php:33 -#: ../../Zotlabs/Module/Articles.php:34 ../../Zotlabs/Module/Connect.php:17 -#: ../../Zotlabs/Module/Cards.php:37 ../../Zotlabs/Module/Layouts.php:31 -#: ../../extend/addon/hzaddons/gallery/Mod_Gallery.php:47 +#: ../../Zotlabs/Module/Articles.php:42 ../../Zotlabs/Module/Connect.php:17 +#: ../../Zotlabs/Module/Cards.php:42 ../../Zotlabs/Module/Layouts.php:31 +#: ../../extend/addon/hzaddons/gallery/Mod_Gallery.php:49 msgid "Requested profile is not available." msgstr "Запрашиваемый профиль не доступен." @@ -991,8 +991,8 @@ msgstr "Редактировать видимость" msgid "Connect" msgstr "Подключить" -#: ../../include/channel.php:1447 ../../include/event.php:54 -#: ../../include/event.php:86 ../../Zotlabs/Module/Directory.php:328 +#: ../../include/channel.php:1447 ../../include/event.php:58 +#: ../../include/event.php:90 ../../Zotlabs/Module/Directory.php:328 msgid "Location:" msgstr "Местоположение:" @@ -1030,7 +1030,7 @@ msgid "Like this channel" msgstr "нравится этот канал" #: ../../include/channel.php:1595 ../../include/conversation.php:1693 -#: ../../include/taxonomy.php:661 ../../Zotlabs/Module/Photos.php:1175 +#: ../../include/taxonomy.php:661 ../../Zotlabs/Module/Photos.php:1177 #: ../../Zotlabs/Lib/ThreadItem.php:221 msgctxt "noun" msgid "Like" @@ -1133,7 +1133,7 @@ msgid "School/education:" msgstr "Школа / образование:" #: ../../include/channel.php:1700 ../../Zotlabs/Module/Profperm.php:113 -#: ../../Zotlabs/Lib/Apps.php:337 +#: ../../Zotlabs/Lib/Apps.php:339 msgid "Profile" msgstr "Профиль" @@ -1150,25 +1150,25 @@ msgstr "Экспорт" msgid "cover photo" msgstr "фотография обложки" -#: ../../include/channel.php:2390 ../../boot.php:1626 -#: ../../Zotlabs/Module/Rmagic.php:75 +#: ../../include/channel.php:2405 ../../boot.php:1630 +#: ../../Zotlabs/Module/Rmagic.php:93 msgid "Remote Authentication" msgstr "Удаленная аутентификация" -#: ../../include/channel.php:2391 ../../Zotlabs/Module/Rmagic.php:76 +#: ../../include/channel.php:2406 ../../Zotlabs/Module/Rmagic.php:94 msgid "Enter your channel address (e.g. channel@example.com)" msgstr "Введите адрес вашего канала (например: channel@example.com)" -#: ../../include/channel.php:2392 ../../Zotlabs/Module/Rmagic.php:77 +#: ../../include/channel.php:2407 ../../Zotlabs/Module/Rmagic.php:95 msgid "Authenticate" msgstr "Проверка подлинности" -#: ../../include/channel.php:2547 ../../Zotlabs/Module/Admin/Accounts.php:91 +#: ../../include/channel.php:2562 ../../Zotlabs/Module/Admin/Accounts.php:91 #, php-format msgid "Account '%s' deleted" msgstr "Аккаунт '%s' удален" -#: ../../include/message.php:13 ../../include/text.php:1718 +#: ../../include/message.php:13 ../../include/text.php:1765 msgid "Download binary/encrypted content" msgstr "Загрузить двоичное / зашифрованное содержимое" @@ -1188,20 +1188,20 @@ msgstr "[без темы]" msgid "Stored post could not be verified." msgstr "Сохранённая публикация не может быть проверена." -#: ../../include/markdown.php:200 ../../include/bbcode.php:358 +#: ../../include/markdown.php:198 ../../include/bbcode.php:347 #, php-format msgid "%1$s wrote the following %2$s %3$s" msgstr "%1$s была создана %2$s %3$s" -#: ../../include/markdown.php:202 ../../include/bbcode.php:354 +#: ../../include/markdown.php:200 ../../include/bbcode.php:343 #: ../../Zotlabs/Module/Tagger.php:77 msgid "post" msgstr "публикация" -#: ../../include/items.php:384 ../../Zotlabs/Module/Dreport.php:10 +#: ../../include/items.php:399 ../../Zotlabs/Module/Dreport.php:10 #: ../../Zotlabs/Module/Dreport.php:79 ../../Zotlabs/Module/Profperm.php:28 -#: ../../Zotlabs/Module/Like.php:296 ../../Zotlabs/Module/Subthread.php:86 -#: ../../Zotlabs/Module/Group.php:93 ../../Zotlabs/Module/Cloud.php:126 +#: ../../Zotlabs/Module/Like.php:301 ../../Zotlabs/Module/Subthread.php:86 +#: ../../Zotlabs/Module/Group.php:98 ../../Zotlabs/Module/Cloud.php:126 #: ../../Zotlabs/Module/Import_items.php:120 #: ../../Zotlabs/Web/WebServer.php:122 #: ../../extend/addon/hzaddons/redphotos/redphotos.php:119 @@ -1211,112 +1211,112 @@ msgstr "публикация" msgid "Permission denied" msgstr "Доступ запрещен" -#: ../../include/items.php:921 ../../include/items.php:981 +#: ../../include/items.php:936 ../../include/items.php:996 msgid "(Unknown)" msgstr "(Неизвестный)" -#: ../../include/items.php:1169 +#: ../../include/items.php:1184 msgid "Visible to anybody on the internet." msgstr "Виден всем в интернете." -#: ../../include/items.php:1171 +#: ../../include/items.php:1186 msgid "Visible to you only." msgstr "Видно только вам." -#: ../../include/items.php:1173 +#: ../../include/items.php:1188 msgid "Visible to anybody in this network." msgstr "Видно всем в этой сети." -#: ../../include/items.php:1175 +#: ../../include/items.php:1190 msgid "Visible to anybody authenticated." msgstr "Видно всем аутентифицированным." -#: ../../include/items.php:1177 +#: ../../include/items.php:1192 #, php-format msgid "Visible to anybody on %s." msgstr "Видно всем в %s." -#: ../../include/items.php:1179 +#: ../../include/items.php:1194 msgid "Visible to all connections." msgstr "Видно всем контактам." -#: ../../include/items.php:1181 +#: ../../include/items.php:1196 msgid "Visible to approved connections." msgstr "Видно только одобренным контактам." -#: ../../include/items.php:1183 +#: ../../include/items.php:1198 msgid "Visible to specific connections." msgstr "Видно указанным контактам." -#: ../../include/items.php:3615 ../../Zotlabs/Module/Display.php:45 -#: ../../Zotlabs/Module/Display.php:452 ../../Zotlabs/Module/Admin.php:62 +#: ../../include/items.php:3662 ../../Zotlabs/Module/Display.php:45 +#: ../../Zotlabs/Module/Display.php:451 ../../Zotlabs/Module/Admin.php:62 #: ../../Zotlabs/Module/Filestorage.php:24 ../../Zotlabs/Module/Viewsrc.php:25 #: ../../Zotlabs/Module/Admin/Addons.php:259 #: ../../Zotlabs/Module/Admin/Themes.php:72 ../../Zotlabs/Module/Thing.php:94 msgid "Item not found." msgstr "Элемент не найден." -#: ../../include/items.php:4195 ../../Zotlabs/Module/Group.php:61 -#: ../../Zotlabs/Module/Group.php:200 +#: ../../include/items.php:4242 ../../Zotlabs/Module/Group.php:61 +#: ../../Zotlabs/Module/Group.php:213 msgid "Privacy group not found." msgstr "Группа безопасности не найдена." -#: ../../include/items.php:4211 +#: ../../include/items.php:4258 msgid "Privacy group is empty." msgstr "Группа безопасности пуста" -#: ../../include/items.php:4218 +#: ../../include/items.php:4265 #, php-format msgid "Privacy group: %s" msgstr "Группа безопасности: %s" -#: ../../include/items.php:4228 ../../Zotlabs/Module/Connedit.php:856 +#: ../../include/items.php:4275 ../../Zotlabs/Module/Connedit.php:867 #, php-format msgid "Connection: %s" msgstr "Контакт: %s" -#: ../../include/items.php:4230 +#: ../../include/items.php:4277 msgid "Connection not found." msgstr "Контакт не найден." -#: ../../include/items.php:4572 ../../Zotlabs/Module/Cover_photo.php:269 +#: ../../include/items.php:4619 ../../Zotlabs/Module/Cover_photo.php:269 msgid "female" msgstr "женщина" -#: ../../include/items.php:4573 ../../Zotlabs/Module/Cover_photo.php:270 +#: ../../include/items.php:4620 ../../Zotlabs/Module/Cover_photo.php:270 #, php-format msgid "%1$s updated her %2$s" msgstr "%1$s обновила её %2$s" -#: ../../include/items.php:4574 ../../Zotlabs/Module/Cover_photo.php:271 +#: ../../include/items.php:4621 ../../Zotlabs/Module/Cover_photo.php:271 msgid "male" msgstr "мужчина" -#: ../../include/items.php:4575 ../../Zotlabs/Module/Cover_photo.php:272 +#: ../../include/items.php:4622 ../../Zotlabs/Module/Cover_photo.php:272 #, php-format msgid "%1$s updated his %2$s" msgstr "%1$s обновил его %2$s" -#: ../../include/items.php:4577 ../../Zotlabs/Module/Cover_photo.php:274 +#: ../../include/items.php:4624 ../../Zotlabs/Module/Cover_photo.php:274 #, php-format msgid "%1$s updated their %2$s" msgstr "%1$s обновили их %2$s" -#: ../../include/items.php:4579 +#: ../../include/items.php:4626 msgid "profile photo" msgstr "Фотография профиля" -#: ../../include/items.php:4771 +#: ../../include/items.php:4818 #, php-format msgid "[Edited %s]" msgstr "[Отредактировано %s]" -#: ../../include/items.php:4771 +#: ../../include/items.php:4818 msgctxt "edit_activity" msgid "Post" msgstr "Публикация" -#: ../../include/items.php:4771 +#: ../../include/items.php:4818 msgctxt "edit_activity" msgid "Comment" msgstr "Комментарий" @@ -1356,7 +1356,7 @@ msgstr "Выкл." msgid "On" msgstr "Вкл." -#: ../../include/features.php:82 ../../Zotlabs/Lib/Apps.php:342 +#: ../../include/features.php:82 ../../Zotlabs/Lib/Apps.php:344 msgid "CalDAV" msgstr "" @@ -1368,7 +1368,7 @@ msgstr "Начинать календарную неделю с понедель msgid "Default is Sunday" msgstr "По умолчанию - воскресенье" -#: ../../include/features.php:96 ../../Zotlabs/Lib/Apps.php:318 +#: ../../include/features.php:96 ../../Zotlabs/Lib/Apps.php:320 msgid "Channel Home" msgstr "Главная канала" @@ -1396,8 +1396,8 @@ msgstr "Использовать режим блога / списка" msgid "Comments will be displayed separately" msgstr "Комментарии будут отображаться отдельно" -#: ../../include/features.php:125 ../../include/text.php:980 -#: ../../Zotlabs/Module/Connections.php:334 ../../Zotlabs/Lib/Apps.php:308 +#: ../../include/features.php:125 ../../include/text.php:991 +#: ../../Zotlabs/Module/Connections.php:334 ../../Zotlabs/Lib/Apps.php:310 msgid "Connections" msgstr "Контакты" @@ -1445,7 +1445,7 @@ msgstr "Помечать сообщения" msgid "Ability to mark special posts with a star indicator" msgstr "Возможность отметить специальные сообщения индикатором-звёздочкой" -#: ../../include/features.php:176 ../../Zotlabs/Lib/Apps.php:322 +#: ../../include/features.php:176 ../../Zotlabs/Lib/Apps.php:324 msgid "Directory" msgstr "Каталог" @@ -1540,7 +1540,7 @@ msgid "" "prevent accidental loss of compositions" msgstr "Автоматически сохраняет черновики публикаций и комментариев в локальном хранилище браузера для предотвращения их случайной утраты" -#: ../../include/features.php:269 ../../Zotlabs/Lib/Apps.php:321 +#: ../../include/features.php:269 ../../Zotlabs/Lib/Apps.php:323 msgid "Events" msgstr "События" @@ -1632,7 +1632,7 @@ msgstr "Инструмент сходства / соответствия" msgid "Filter stream activity by depth of relationships" msgstr "Фильтровать потоки активности по глубине отношений" -#: ../../include/features.php:373 ../../Zotlabs/Lib/Apps.php:310 +#: ../../include/features.php:373 ../../Zotlabs/Lib/Apps.php:312 msgid "Suggest Channels" msgstr "Предлагаемые каналы" @@ -1640,8 +1640,8 @@ msgstr "Предлагаемые каналы" msgid "Show friend and connection suggestions" msgstr "Показать предложения в друзья" -#: ../../include/features.php:391 ../../include/nav.php:414 -#: ../../Zotlabs/Module/Fbrowser.php:29 ../../Zotlabs/Lib/Apps.php:320 +#: ../../include/features.php:391 ../../include/nav.php:444 +#: ../../Zotlabs/Module/Fbrowser.php:29 ../../Zotlabs/Lib/Apps.php:322 msgid "Photos" msgstr "Фотографии" @@ -1653,7 +1653,7 @@ msgstr "Местоположение фотографии" msgid "If location data is available on uploaded photos, link this to a map." msgstr "Если данные о местоположении доступны на загруженных фотографий, связать их с картой." -#: ../../include/features.php:405 ../../Zotlabs/Lib/Apps.php:338 +#: ../../include/features.php:405 ../../Zotlabs/Lib/Apps.php:340 msgid "Profiles" msgstr "Редактировать профиль" @@ -1697,465 +1697,466 @@ msgstr "последний" msgid "next" msgstr "следующий" -#: ../../include/text.php:546 +#: ../../include/text.php:553 msgid "older" msgstr "старше" -#: ../../include/text.php:548 +#: ../../include/text.php:555 msgid "newer" msgstr "новее" -#: ../../include/text.php:968 +#: ../../include/text.php:979 msgid "No connections" msgstr "Нет контактов" -#: ../../include/text.php:1000 +#: ../../include/text.php:1011 #, php-format msgid "View all %s connections" msgstr "Просмотреть все %s контактов" -#: ../../include/text.php:1056 +#: ../../include/text.php:1073 #, php-format msgid "Network: %s" msgstr "Сеть: %s" -#: ../../include/text.php:1067 ../../include/text.php:1079 +#: ../../include/text.php:1084 ../../include/text.php:1096 #: ../../include/acl_selectors.php:118 ../../include/nav.php:183 #: ../../Zotlabs/Module/Search.php:44 ../../Zotlabs/Module/Connections.php:338 #: ../../Zotlabs/Widget/Sitesearch.php:31 -#: ../../Zotlabs/Widget/Activity_filter.php:151 ../../Zotlabs/Lib/Apps.php:328 +#: ../../Zotlabs/Widget/Activity_filter.php:151 ../../Zotlabs/Lib/Apps.php:330 msgid "Search" msgstr "Поиск" -#: ../../include/text.php:1068 ../../include/text.php:1080 +#: ../../include/text.php:1085 ../../include/text.php:1097 #: ../../Zotlabs/Module/Admin/Profs.php:94 #: ../../Zotlabs/Module/Admin/Profs.php:114 ../../Zotlabs/Module/Rbmark.php:32 #: ../../Zotlabs/Module/Rbmark.php:104 ../../Zotlabs/Module/Filer.php:53 #: ../../Zotlabs/Widget/Notes.php:23 +#: ../../extend/addon/hzaddons/queueworker/Mod_Queueworker.php:102 msgid "Save" msgstr "Запомнить" -#: ../../include/text.php:1155 ../../include/text.php:1159 +#: ../../include/text.php:1176 ../../include/text.php:1180 msgid "poke" msgstr "Ткнуть" -#: ../../include/text.php:1155 ../../include/text.php:1159 +#: ../../include/text.php:1176 ../../include/text.php:1180 #: ../../include/conversation.php:251 msgid "poked" msgstr "ткнут" -#: ../../include/text.php:1160 +#: ../../include/text.php:1181 msgid "ping" msgstr "Пингануть" -#: ../../include/text.php:1160 +#: ../../include/text.php:1181 msgid "pinged" msgstr "Отпингован" -#: ../../include/text.php:1161 +#: ../../include/text.php:1182 msgid "prod" msgstr "Подтолкнуть" -#: ../../include/text.php:1161 +#: ../../include/text.php:1182 msgid "prodded" msgstr "Подтолкнут" -#: ../../include/text.php:1162 +#: ../../include/text.php:1183 msgid "slap" msgstr "Шлёпнуть" -#: ../../include/text.php:1162 +#: ../../include/text.php:1183 msgid "slapped" msgstr "Шлёпнут" -#: ../../include/text.php:1163 +#: ../../include/text.php:1184 msgid "finger" msgstr "Указать" -#: ../../include/text.php:1163 +#: ../../include/text.php:1184 msgid "fingered" msgstr "Указан" -#: ../../include/text.php:1164 +#: ../../include/text.php:1185 msgid "rebuff" msgstr "Дать отпор" -#: ../../include/text.php:1164 +#: ../../include/text.php:1185 msgid "rebuffed" msgstr "Дан отпор" -#: ../../include/text.php:1187 +#: ../../include/text.php:1208 msgid "happy" msgstr "счастливый" -#: ../../include/text.php:1188 +#: ../../include/text.php:1209 msgid "sad" msgstr "грустный" -#: ../../include/text.php:1189 +#: ../../include/text.php:1210 msgid "mellow" msgstr "спокойный" -#: ../../include/text.php:1190 +#: ../../include/text.php:1211 msgid "tired" msgstr "усталый" -#: ../../include/text.php:1191 +#: ../../include/text.php:1212 msgid "perky" msgstr "весёлый" -#: ../../include/text.php:1192 +#: ../../include/text.php:1213 msgid "angry" msgstr "сердитый" -#: ../../include/text.php:1193 +#: ../../include/text.php:1214 msgid "stupefied" msgstr "отупевший" -#: ../../include/text.php:1194 +#: ../../include/text.php:1215 msgid "puzzled" msgstr "недоумевающий" -#: ../../include/text.php:1195 +#: ../../include/text.php:1216 msgid "interested" msgstr "заинтересованный" -#: ../../include/text.php:1196 +#: ../../include/text.php:1217 msgid "bitter" msgstr "едкий" -#: ../../include/text.php:1197 +#: ../../include/text.php:1218 msgid "cheerful" msgstr "бодрый" -#: ../../include/text.php:1198 +#: ../../include/text.php:1219 msgid "alive" msgstr "энергичный" -#: ../../include/text.php:1199 +#: ../../include/text.php:1220 msgid "annoyed" msgstr "раздражённый" -#: ../../include/text.php:1200 +#: ../../include/text.php:1221 msgid "anxious" msgstr "обеспокоенный" -#: ../../include/text.php:1201 +#: ../../include/text.php:1222 msgid "cranky" msgstr "капризный" -#: ../../include/text.php:1202 +#: ../../include/text.php:1223 msgid "disturbed" msgstr "встревоженный" -#: ../../include/text.php:1203 +#: ../../include/text.php:1224 msgid "frustrated" msgstr "разочарованный" -#: ../../include/text.php:1204 +#: ../../include/text.php:1225 msgid "depressed" msgstr "подавленный" -#: ../../include/text.php:1205 +#: ../../include/text.php:1226 msgid "motivated" msgstr "мотивированный" -#: ../../include/text.php:1206 +#: ../../include/text.php:1227 msgid "relaxed" msgstr "расслабленный" -#: ../../include/text.php:1207 +#: ../../include/text.php:1228 msgid "surprised" msgstr "удивленный" -#: ../../include/text.php:1386 ../../include/js_strings.php:95 +#: ../../include/text.php:1416 ../../include/js_strings.php:95 msgid "Monday" msgstr "Понедельник" -#: ../../include/text.php:1386 ../../include/js_strings.php:96 +#: ../../include/text.php:1416 ../../include/js_strings.php:96 msgid "Tuesday" msgstr "Вторник" -#: ../../include/text.php:1386 ../../include/js_strings.php:97 +#: ../../include/text.php:1416 ../../include/js_strings.php:97 msgid "Wednesday" msgstr "Среда" -#: ../../include/text.php:1386 ../../include/js_strings.php:98 +#: ../../include/text.php:1416 ../../include/js_strings.php:98 msgid "Thursday" msgstr "Четверг" -#: ../../include/text.php:1386 ../../include/js_strings.php:99 +#: ../../include/text.php:1416 ../../include/js_strings.php:99 msgid "Friday" msgstr "Пятница" -#: ../../include/text.php:1386 ../../include/js_strings.php:100 +#: ../../include/text.php:1416 ../../include/js_strings.php:100 msgid "Saturday" msgstr "Суббота" -#: ../../include/text.php:1386 ../../include/js_strings.php:94 +#: ../../include/text.php:1416 ../../include/js_strings.php:94 msgid "Sunday" msgstr "Воскресенье" -#: ../../include/text.php:1390 ../../include/js_strings.php:70 +#: ../../include/text.php:1420 ../../include/js_strings.php:70 msgid "January" msgstr "Январь" -#: ../../include/text.php:1390 ../../include/js_strings.php:71 +#: ../../include/text.php:1420 ../../include/js_strings.php:71 msgid "February" msgstr "Февраль" -#: ../../include/text.php:1390 ../../include/js_strings.php:72 +#: ../../include/text.php:1420 ../../include/js_strings.php:72 msgid "March" msgstr "Март" -#: ../../include/text.php:1390 ../../include/js_strings.php:73 +#: ../../include/text.php:1420 ../../include/js_strings.php:73 msgid "April" msgstr "Апрель" -#: ../../include/text.php:1390 +#: ../../include/text.php:1420 msgid "May" msgstr "Май" -#: ../../include/text.php:1390 ../../include/js_strings.php:75 +#: ../../include/text.php:1420 ../../include/js_strings.php:75 msgid "June" msgstr "Июнь" -#: ../../include/text.php:1390 ../../include/js_strings.php:76 +#: ../../include/text.php:1420 ../../include/js_strings.php:76 msgid "July" msgstr "Июль" -#: ../../include/text.php:1390 ../../include/js_strings.php:77 +#: ../../include/text.php:1420 ../../include/js_strings.php:77 msgid "August" msgstr "Август" -#: ../../include/text.php:1390 ../../include/js_strings.php:78 +#: ../../include/text.php:1420 ../../include/js_strings.php:78 msgid "September" msgstr "Сентябрь" -#: ../../include/text.php:1390 ../../include/js_strings.php:79 +#: ../../include/text.php:1420 ../../include/js_strings.php:79 msgid "October" msgstr "Октябрь" -#: ../../include/text.php:1390 ../../include/js_strings.php:80 +#: ../../include/text.php:1420 ../../include/js_strings.php:80 msgid "November" msgstr "Ноябрь" -#: ../../include/text.php:1390 ../../include/js_strings.php:81 +#: ../../include/text.php:1420 ../../include/js_strings.php:81 msgid "December" msgstr "Декабрь" -#: ../../include/text.php:1464 +#: ../../include/text.php:1494 msgid "Unknown Attachment" msgstr "Неизвестное вложение" -#: ../../include/text.php:1466 ../../Zotlabs/Storage/Browser.php:287 +#: ../../include/text.php:1496 ../../Zotlabs/Storage/Browser.php:287 #: ../../Zotlabs/Module/Sharedwithme.php:106 msgid "Size" msgstr "Размер" -#: ../../include/text.php:1466 ../../include/feedutils.php:860 +#: ../../include/text.php:1496 ../../include/feedutils.php:858 msgid "unknown" msgstr "неизвестный" -#: ../../include/text.php:1502 +#: ../../include/text.php:1532 msgid "remove category" msgstr "удалить категорию" -#: ../../include/text.php:1576 +#: ../../include/text.php:1606 msgid "remove from file" msgstr "удалить из файла" -#: ../../include/text.php:1859 ../../Zotlabs/Module/Events.php:663 +#: ../../include/text.php:1913 ../../Zotlabs/Module/Events.php:663 #: ../../Zotlabs/Module/Cal.php:314 msgid "Link to Source" msgstr "Ссылка на источник" -#: ../../include/text.php:1881 ../../include/language.php:423 +#: ../../include/text.php:1935 ../../include/language.php:423 msgid "default" msgstr "по умолчанию" -#: ../../include/text.php:1889 +#: ../../include/text.php:1943 msgid "Page layout" msgstr "Шаблон страницы" -#: ../../include/text.php:1889 +#: ../../include/text.php:1943 msgid "You can create your own with the layouts tool" msgstr "Вы можете создать свой собственный с помощью инструмента шаблонов" -#: ../../include/text.php:1899 ../../Zotlabs/Module/Wiki.php:217 +#: ../../include/text.php:1953 ../../Zotlabs/Module/Wiki.php:217 #: ../../Zotlabs/Module/Wiki.php:371 ../../Zotlabs/Widget/Wiki_pages.php:38 #: ../../Zotlabs/Widget/Wiki_pages.php:95 msgid "BBcode" msgstr "" -#: ../../include/text.php:1900 +#: ../../include/text.php:1954 msgid "HTML" msgstr "" -#: ../../include/text.php:1901 ../../Zotlabs/Module/Wiki.php:217 +#: ../../include/text.php:1955 ../../Zotlabs/Module/Wiki.php:217 #: ../../Zotlabs/Module/Wiki.php:371 ../../Zotlabs/Widget/Wiki_pages.php:38 #: ../../Zotlabs/Widget/Wiki_pages.php:95 #: ../../extend/addon/hzaddons/mdpost/mdpost.php:41 msgid "Markdown" msgstr "Разметка Markdown" -#: ../../include/text.php:1902 ../../Zotlabs/Module/Wiki.php:217 +#: ../../include/text.php:1956 ../../Zotlabs/Module/Wiki.php:217 #: ../../Zotlabs/Widget/Wiki_pages.php:38 #: ../../Zotlabs/Widget/Wiki_pages.php:95 msgid "Text" msgstr "Текст" -#: ../../include/text.php:1903 +#: ../../include/text.php:1957 msgid "Comanche Layout" msgstr "Шаблон Comanche" -#: ../../include/text.php:1908 +#: ../../include/text.php:1962 msgid "PHP" msgstr "" -#: ../../include/text.php:1917 +#: ../../include/text.php:1971 msgid "Page content type" msgstr "Тип содержимого страницы" -#: ../../include/text.php:2037 ../../include/conversation.php:116 -#: ../../Zotlabs/Module/Tagger.php:69 ../../Zotlabs/Module/Like.php:387 -#: ../../Zotlabs/Module/Subthread.php:112 ../../Zotlabs/Lib/Activity.php:1570 +#: ../../include/text.php:2091 ../../include/conversation.php:116 +#: ../../Zotlabs/Module/Tagger.php:69 ../../Zotlabs/Module/Like.php:392 +#: ../../Zotlabs/Module/Subthread.php:112 ../../Zotlabs/Lib/Activity.php:1951 #: ../../extend/addon/hzaddons/redphotos/redphotohelper.php:71 #: ../../extend/addon/hzaddons/pubcrawl/as.php:1494 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1541 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1545 msgid "photo" msgstr "фото" -#: ../../include/text.php:2040 ../../include/conversation.php:119 -#: ../../include/event.php:1156 ../../Zotlabs/Module/Tagger.php:73 -#: ../../Zotlabs/Module/Events.php:260 ../../Zotlabs/Module/Like.php:389 +#: ../../include/text.php:2094 ../../include/conversation.php:119 +#: ../../include/event.php:1165 ../../Zotlabs/Module/Tagger.php:73 +#: ../../Zotlabs/Module/Events.php:260 ../../Zotlabs/Module/Like.php:394 msgid "event" msgstr "событие" -#: ../../include/text.php:2043 ../../include/conversation.php:144 -#: ../../Zotlabs/Module/Like.php:387 ../../Zotlabs/Module/Subthread.php:112 -#: ../../Zotlabs/Lib/Activity.php:1570 +#: ../../include/text.php:2097 ../../include/conversation.php:144 +#: ../../Zotlabs/Module/Like.php:392 ../../Zotlabs/Module/Subthread.php:112 +#: ../../Zotlabs/Lib/Activity.php:1951 #: ../../extend/addon/hzaddons/pubcrawl/as.php:1494 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1541 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1545 msgid "status" msgstr "статус" -#: ../../include/text.php:2045 ../../include/conversation.php:146 +#: ../../include/text.php:2099 ../../include/conversation.php:146 #: ../../Zotlabs/Module/Tagger.php:79 msgid "comment" msgstr "комментарий" -#: ../../include/text.php:2050 +#: ../../include/text.php:2104 msgid "activity" msgstr "активность" -#: ../../include/text.php:2151 +#: ../../include/text.php:2205 msgid "a-z, 0-9, -, and _ only" msgstr "Только a-z, 0-9, -, и _" -#: ../../include/text.php:2471 +#: ../../include/text.php:2531 msgid "Design Tools" msgstr "Инструменты дизайна" -#: ../../include/text.php:2474 ../../Zotlabs/Module/Blocks.php:154 +#: ../../include/text.php:2534 ../../Zotlabs/Module/Blocks.php:154 msgid "Blocks" msgstr "Блокировки" -#: ../../include/text.php:2475 ../../Zotlabs/Module/Menu.php:170 +#: ../../include/text.php:2535 ../../Zotlabs/Module/Menu.php:170 msgid "Menus" msgstr "Меню" -#: ../../include/text.php:2476 ../../Zotlabs/Module/Layouts.php:184 +#: ../../include/text.php:2536 ../../Zotlabs/Module/Layouts.php:184 msgid "Layouts" msgstr "Шаблоны" -#: ../../include/text.php:2477 +#: ../../include/text.php:2537 msgid "Pages" msgstr "Страницы" -#: ../../include/text.php:2498 ../../Zotlabs/Module/Cal.php:343 +#: ../../include/text.php:2558 ../../Zotlabs/Module/Cal.php:343 msgid "Import" msgstr "Импортировать" -#: ../../include/text.php:2499 +#: ../../include/text.php:2559 msgid "Import website..." msgstr "Импорт веб-сайта..." -#: ../../include/text.php:2500 +#: ../../include/text.php:2560 msgid "Select folder to import" msgstr "Выбрать каталог для импорта" -#: ../../include/text.php:2501 +#: ../../include/text.php:2561 msgid "Import from a zipped folder:" msgstr "Импортировать из каталога в zip-архиве:" -#: ../../include/text.php:2502 +#: ../../include/text.php:2562 msgid "Import from cloud files:" msgstr "Импортировать из сетевых файлов:" -#: ../../include/text.php:2503 +#: ../../include/text.php:2563 msgid "/cloud/channel/path/to/folder" msgstr "" -#: ../../include/text.php:2504 +#: ../../include/text.php:2564 msgid "Enter path to website files" msgstr "Введите путь к файлам веб-сайта" -#: ../../include/text.php:2505 +#: ../../include/text.php:2565 msgid "Select folder" msgstr "Выбрать каталог" -#: ../../include/text.php:2506 +#: ../../include/text.php:2566 msgid "Export website..." msgstr "Экспорт веб-сайта..." -#: ../../include/text.php:2507 +#: ../../include/text.php:2567 msgid "Export to a zip file" msgstr "Экспортировать в ZIP файл." -#: ../../include/text.php:2508 +#: ../../include/text.php:2568 msgid "website.zip" msgstr "" -#: ../../include/text.php:2509 +#: ../../include/text.php:2569 msgid "Enter a name for the zip file." msgstr "Введите имя для ZIP файла." -#: ../../include/text.php:2510 +#: ../../include/text.php:2570 msgid "Export to cloud files" msgstr "Эскпортировать в сетевые файлы:" -#: ../../include/text.php:2511 +#: ../../include/text.php:2571 msgid "/path/to/export/folder" msgstr "" -#: ../../include/text.php:2512 +#: ../../include/text.php:2572 msgid "Enter a path to a cloud files destination." msgstr "Введите путь к расположению сетевых файлов." -#: ../../include/text.php:2513 +#: ../../include/text.php:2573 msgid "Specify folder" msgstr "Указать каталог" -#: ../../include/text.php:2833 ../../Zotlabs/Storage/Browser.php:131 +#: ../../include/text.php:2893 ../../Zotlabs/Storage/Browser.php:131 msgid "Collection" msgstr "Коллекция" -#: ../../include/import.php:25 +#: ../../include/import.php:26 msgid "Unable to import a removed channel." msgstr "Невозможно импортировать удалённый канал." -#: ../../include/import.php:51 +#: ../../include/import.php:52 msgid "" "Cannot create a duplicate channel identifier on this system. Import failed." msgstr "Не удалось создать дублирующийся идентификатор канала. Импорт невозможен." -#: ../../include/import.php:72 +#: ../../include/import.php:73 #: ../../extend/addon/hzaddons/diaspora/import_diaspora.php:43 msgid "Unable to create a unique channel address. Import failed." msgstr "Не удалось создать уникальный адрес канала. Импорт не завершен." -#: ../../include/import.php:116 +#: ../../include/import.php:117 msgid "Cloned channel not found. Import failed." msgstr "Клон канала не найден. Импорт невозможен." @@ -2175,9 +2176,9 @@ msgid "edit" msgstr "редактировать" #: ../../include/group.php:320 ../../include/nav.php:95 -#: ../../Zotlabs/Module/Group.php:132 ../../Zotlabs/Module/Group.php:143 +#: ../../Zotlabs/Module/Group.php:141 ../../Zotlabs/Module/Group.php:153 #: ../../Zotlabs/Widget/Activity_filter.php:41 ../../Zotlabs/Lib/Group.php:324 -#: ../../Zotlabs/Lib/Apps.php:339 +#: ../../Zotlabs/Lib/Apps.php:341 msgid "Privacy Groups" msgstr "Группы безопасности" @@ -2270,16 +2271,16 @@ msgstr "Это действие невозможно из-за ограниче msgid "Invalid data packet" msgstr "Неверный пакет данных" -#: ../../include/zot.php:802 ../../Zotlabs/Lib/Libzot.php:667 +#: ../../include/zot.php:802 ../../Zotlabs/Lib/Libzot.php:653 msgid "Unable to verify channel signature" msgstr "Невозможно проверить подпись канала" -#: ../../include/zot.php:2575 ../../Zotlabs/Lib/Libsync.php:733 +#: ../../include/zot.php:2591 ../../Zotlabs/Lib/Libsync.php:733 #, php-format msgid "Unable to verify site signature for %s" msgstr "Невозможно проверить подпись сайта %s" -#: ../../include/zot.php:4272 +#: ../../include/zot.php:4288 msgid "invalid target signature" msgstr "недопустимая целевая подпись" @@ -2324,8 +2325,8 @@ msgid "Help:" msgstr "Помощь:" #: ../../include/help.php:117 ../../include/help.php:125 -#: ../../include/nav.php:168 ../../include/nav.php:289 -#: ../../Zotlabs/Module/Layouts.php:186 ../../Zotlabs/Lib/Apps.php:323 +#: ../../include/nav.php:168 ../../include/nav.php:319 +#: ../../Zotlabs/Module/Layouts.php:186 ../../Zotlabs/Lib/Apps.php:325 msgid "Help" msgstr "Помощь" @@ -2340,17 +2341,17 @@ msgstr "Не найдено" msgid "Page not found." msgstr "Страница не найдена." -#: ../../include/bbcode.php:200 ../../include/bbcode.php:1201 -#: ../../include/bbcode.php:1204 ../../include/bbcode.php:1209 -#: ../../include/bbcode.php:1212 ../../include/bbcode.php:1215 -#: ../../include/bbcode.php:1218 ../../include/bbcode.php:1223 -#: ../../include/bbcode.php:1226 ../../include/bbcode.php:1231 -#: ../../include/bbcode.php:1234 ../../include/bbcode.php:1237 -#: ../../include/bbcode.php:1240 +#: ../../include/bbcode.php:200 ../../include/bbcode.php:1190 +#: ../../include/bbcode.php:1193 ../../include/bbcode.php:1198 +#: ../../include/bbcode.php:1201 ../../include/bbcode.php:1204 +#: ../../include/bbcode.php:1207 ../../include/bbcode.php:1212 +#: ../../include/bbcode.php:1215 ../../include/bbcode.php:1220 +#: ../../include/bbcode.php:1223 ../../include/bbcode.php:1226 +#: ../../include/bbcode.php:1229 msgid "Image/photo" msgstr "Изображение / фотография" -#: ../../include/bbcode.php:239 ../../include/bbcode.php:1251 +#: ../../include/bbcode.php:239 ../../include/bbcode.php:1240 msgid "Encrypted content" msgstr "Зашифрованное содержание" @@ -2382,54 +2383,54 @@ msgstr "заблокировать" msgid "menu" msgstr "меню" -#: ../../include/bbcode.php:350 +#: ../../include/bbcode.php:339 msgid "card" msgstr "карточка" -#: ../../include/bbcode.php:352 +#: ../../include/bbcode.php:341 msgid "article" msgstr "статья" -#: ../../include/bbcode.php:435 ../../include/bbcode.php:443 +#: ../../include/bbcode.php:424 ../../include/bbcode.php:432 msgid "Click to open/close" msgstr "Нажмите, чтобы открыть/закрыть" -#: ../../include/bbcode.php:443 +#: ../../include/bbcode.php:432 msgid "spoiler" msgstr "спойлер" -#: ../../include/bbcode.php:456 +#: ../../include/bbcode.php:445 msgid "View article" msgstr "Просмотр статьи" -#: ../../include/bbcode.php:456 +#: ../../include/bbcode.php:445 msgid "View summary" msgstr "Просмотр резюме" -#: ../../include/bbcode.php:746 ../../include/bbcode.php:916 +#: ../../include/bbcode.php:735 ../../include/bbcode.php:905 #: ../../Zotlabs/Lib/NativeWikiPage.php:603 msgid "Different viewers will see this text differently" msgstr "Различные зрители увидят этот текст по-разному" -#: ../../include/bbcode.php:1189 +#: ../../include/bbcode.php:1178 msgid "$1 wrote:" msgstr "$1 писал:" -#: ../../include/conversation.php:122 ../../Zotlabs/Module/Like.php:121 +#: ../../include/conversation.php:122 ../../Zotlabs/Module/Like.php:123 msgid "channel" msgstr "канал" -#: ../../include/conversation.php:160 ../../Zotlabs/Module/Like.php:441 -#: ../../Zotlabs/Lib/Activity.php:1605 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:1529 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1570 +#: ../../include/conversation.php:160 ../../Zotlabs/Module/Like.php:447 +#: ../../Zotlabs/Lib/Activity.php:1986 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:1530 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:1575 #, php-format msgid "%1$s likes %2$s's %3$s" msgstr "%1$s нравится %3$s %2$s" -#: ../../include/conversation.php:163 ../../Zotlabs/Module/Like.php:443 -#: ../../Zotlabs/Lib/Activity.php:1607 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:1531 +#: ../../include/conversation.php:163 ../../Zotlabs/Module/Like.php:449 +#: ../../Zotlabs/Lib/Activity.php:1988 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:1532 #, php-format msgid "%1$s doesn't like %2$s's %3$s" msgstr "%1$s не нравится %2$s %3$s" @@ -2464,42 +2465,42 @@ msgstr "%1$s в %2$s" msgid "This is an unsaved preview" msgstr "Это несохранённый просмотр" -#: ../../include/conversation.php:619 ../../Zotlabs/Module/Photos.php:1152 +#: ../../include/conversation.php:619 ../../Zotlabs/Module/Photos.php:1154 msgctxt "title" msgid "Likes" msgstr "Нравится" -#: ../../include/conversation.php:619 ../../Zotlabs/Module/Photos.php:1152 +#: ../../include/conversation.php:619 ../../Zotlabs/Module/Photos.php:1154 msgctxt "title" msgid "Dislikes" msgstr "Не нравится" -#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1153 +#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1155 msgctxt "title" msgid "Agree" msgstr "Согласен" -#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1153 +#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1155 msgctxt "title" msgid "Disagree" msgstr "Не согласен" -#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1153 +#: ../../include/conversation.php:620 ../../Zotlabs/Module/Photos.php:1155 msgctxt "title" msgid "Abstain" msgstr "Воздержался" -#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1154 +#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1156 msgctxt "title" msgid "Attending" msgstr "Посещаю" -#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1154 +#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1156 msgctxt "title" msgid "Not attending" msgstr "Не посещаю" -#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1154 +#: ../../include/conversation.php:621 ../../Zotlabs/Module/Photos.php:1156 msgctxt "title" msgid "Might attend" msgstr "Возможно посещу" @@ -2511,19 +2512,19 @@ msgstr "Выбрать" #: ../../include/conversation.php:691 ../../include/conversation.php:736 #: ../../Zotlabs/Storage/Browser.php:291 ../../Zotlabs/Module/Cdav.php:942 #: ../../Zotlabs/Module/Cdav.php:1232 ../../Zotlabs/Module/Profiles.php:800 -#: ../../Zotlabs/Module/Photos.php:1218 ../../Zotlabs/Module/Oauth.php:174 +#: ../../Zotlabs/Module/Photos.php:1220 ../../Zotlabs/Module/Oauth.php:174 #: ../../Zotlabs/Module/Oauth2.php:195 ../../Zotlabs/Module/Editlayout.php:138 #: ../../Zotlabs/Module/Editblock.php:139 #: ../../Zotlabs/Module/Admin/Channels.php:149 #: ../../Zotlabs/Module/Admin/Profs.php:176 #: ../../Zotlabs/Module/Admin/Accounts.php:175 #: ../../Zotlabs/Module/Editwebpage.php:167 ../../Zotlabs/Module/Thing.php:267 -#: ../../Zotlabs/Module/Webpages.php:257 ../../Zotlabs/Module/Connedit.php:660 -#: ../../Zotlabs/Module/Connedit.php:929 +#: ../../Zotlabs/Module/Webpages.php:257 ../../Zotlabs/Module/Connedit.php:668 +#: ../../Zotlabs/Module/Connedit.php:940 #: ../../Zotlabs/Module/Connections.php:292 #: ../../Zotlabs/Module/Card_edit.php:129 #: ../../Zotlabs/Module/Article_edit.php:129 -#: ../../Zotlabs/Module/Blocks.php:162 ../../Zotlabs/Lib/Apps.php:535 +#: ../../Zotlabs/Module/Blocks.php:162 ../../Zotlabs/Lib/Apps.php:537 #: ../../Zotlabs/Lib/ThreadItem.php:153 msgid "Delete" msgstr "Удалить" @@ -2616,12 +2617,12 @@ msgid "Unfollow Thread" msgstr "Прекратить отслеживать тему" #: ../../include/conversation.php:1038 ../../include/nav.php:106 -#: ../../Zotlabs/Module/Connedit.php:600 ../../Zotlabs/Lib/Apps.php:319 +#: ../../Zotlabs/Module/Connedit.php:608 ../../Zotlabs/Lib/Apps.php:321 #: ../../extend/addon/hzaddons/openclipatar/openclipatar.php:57 msgid "View Profile" msgstr "Просмотреть профиль" -#: ../../include/conversation.php:1048 ../../Zotlabs/Module/Connedit.php:621 +#: ../../include/conversation.php:1048 ../../Zotlabs/Module/Connedit.php:629 msgid "Recent Activity" msgstr "Последние действия" @@ -2639,18 +2640,18 @@ msgid "Ratings" msgstr "Оценки" #: ../../include/conversation.php:1098 ../../Zotlabs/Module/Poke.php:199 -#: ../../Zotlabs/Lib/Apps.php:326 +#: ../../Zotlabs/Lib/Apps.php:328 msgid "Poke" msgstr "Ткнуть" #: ../../include/conversation.php:1166 ../../Zotlabs/Storage/Browser.php:164 #: ../../Zotlabs/Module/Cdav.php:811 ../../Zotlabs/Module/Cdav.php:812 #: ../../Zotlabs/Module/Cdav.php:819 ../../Zotlabs/Module/Photos.php:832 -#: ../../Zotlabs/Module/Photos.php:1288 -#: ../../Zotlabs/Module/Embedphotos.php:146 +#: ../../Zotlabs/Module/Photos.php:1296 +#: ../../Zotlabs/Module/Embedphotos.php:154 #: ../../Zotlabs/Widget/Portfolio.php:95 ../../Zotlabs/Widget/Album.php:84 -#: ../../Zotlabs/Lib/Apps.php:994 ../../Zotlabs/Lib/Apps.php:1078 -#: ../../Zotlabs/Lib/Activity.php:858 +#: ../../Zotlabs/Lib/Apps.php:1010 ../../Zotlabs/Lib/Apps.php:1094 +#: ../../Zotlabs/Lib/Activity.php:1006 #: ../../extend/addon/hzaddons/pubcrawl/as.php:949 msgid "Unknown" msgstr "Неизвестный" @@ -2789,7 +2790,7 @@ msgstr "Комментарии включены" msgid "Comments disabled" msgstr "Комментарии отключены" -#: ../../include/conversation.php:1356 ../../Zotlabs/Module/Photos.php:1138 +#: ../../include/conversation.php:1356 ../../Zotlabs/Module/Photos.php:1139 #: ../../Zotlabs/Module/Events.php:480 ../../Zotlabs/Module/Webpages.php:262 #: ../../Zotlabs/Lib/ThreadItem.php:783 #: ../../extend/addon/hzaddons/hsse/hsse.php:153 @@ -2861,7 +2862,7 @@ msgstr "Встроить изображение из ваших альбомов #: ../../Zotlabs/Module/Admin/Addons.php:423 #: ../../Zotlabs/Module/Editwebpage.php:169 #: ../../Zotlabs/Module/Profile_photo.php:465 -#: ../../Zotlabs/Module/Editpost.php:109 ../../Zotlabs/Module/Connedit.php:930 +#: ../../Zotlabs/Module/Editpost.php:109 ../../Zotlabs/Module/Connedit.php:941 #: ../../Zotlabs/Module/Card_edit.php:131 #: ../../Zotlabs/Module/Article_edit.php:131 ../../Zotlabs/Module/Wiki.php:368 #: ../../Zotlabs/Module/Wiki.php:401 ../../Zotlabs/Module/Filer.php:55 @@ -2934,7 +2935,7 @@ msgstr "Установить дату публикации" msgid "Encrypt text" msgstr "Зашифровать текст" -#: ../../include/conversation.php:1696 ../../Zotlabs/Module/Photos.php:1180 +#: ../../include/conversation.php:1696 ../../Zotlabs/Module/Photos.php:1182 #: ../../Zotlabs/Lib/ThreadItem.php:226 msgctxt "noun" msgid "Dislike" @@ -3042,8 +3043,8 @@ msgstr "Выбор дополнительного языка" msgid "Delete this item?" msgstr "Удалить этот элемент?" -#: ../../include/js_strings.php:6 ../../Zotlabs/Module/Photos.php:1136 -#: ../../Zotlabs/Module/Photos.php:1254 ../../Zotlabs/Lib/ThreadItem.php:772 +#: ../../include/js_strings.php:6 ../../Zotlabs/Module/Photos.php:1137 +#: ../../Zotlabs/Module/Photos.php:1256 ../../Zotlabs/Lib/ThreadItem.php:772 msgid "Comment" msgstr "Комментарий" @@ -3104,7 +3105,7 @@ msgid "Rate This Channel (this is public)" msgstr "Оценкa этoго канала (общедоступно)" #: ../../include/js_strings.php:20 ../../Zotlabs/Module/Rate.php:155 -#: ../../Zotlabs/Module/Connedit.php:876 +#: ../../Zotlabs/Module/Connedit.php:887 msgid "Rating" msgstr "Оценка" @@ -3380,39 +3381,35 @@ msgstr "Только публичные форумы" msgid "This Website Only" msgstr "Только этот веб-сайт" -#: ../../include/network.php:771 -msgid "view full size" -msgstr "посмотреть в полный размер" - -#: ../../include/network.php:1774 ../../include/network.php:1775 +#: ../../include/network.php:1715 ../../include/network.php:1716 msgid "Friendica" msgstr "" -#: ../../include/network.php:1776 +#: ../../include/network.php:1717 msgid "OStatus" msgstr "" -#: ../../include/network.php:1777 +#: ../../include/network.php:1718 msgid "GNU-Social" msgstr "" -#: ../../include/network.php:1778 +#: ../../include/network.php:1719 msgid "RSS/Atom" msgstr "" -#: ../../include/network.php:1779 ../../Zotlabs/Lib/Activity.php:1417 -#: ../../Zotlabs/Lib/Activity.php:1614 +#: ../../include/network.php:1720 ../../Zotlabs/Lib/Activity.php:1798 +#: ../../Zotlabs/Lib/Activity.php:1995 #: ../../extend/addon/hzaddons/pubcrawl/as.php:1204 #: ../../extend/addon/hzaddons/pubcrawl/as.php:1359 -#: ../../extend/addon/hzaddons/pubcrawl/as.php:1538 +#: ../../extend/addon/hzaddons/pubcrawl/as.php:1539 msgid "ActivityPub" msgstr "" -#: ../../include/network.php:1780 ../../Zotlabs/Module/Cdav.php:1219 +#: ../../include/network.php:1721 ../../Zotlabs/Module/Cdav.php:1219 #: ../../Zotlabs/Module/Profiles.php:787 #: ../../Zotlabs/Module/Admin/Accounts.php:171 #: ../../Zotlabs/Module/Admin/Accounts.php:183 -#: ../../Zotlabs/Module/Connedit.php:916 +#: ../../Zotlabs/Module/Connedit.php:927 #: ../../extend/addon/hzaddons/rtof/Mod_Rtof.php:57 #: ../../extend/addon/hzaddons/openid/MysqlProvider.php:56 #: ../../extend/addon/hzaddons/openid/MysqlProvider.php:57 @@ -3420,27 +3417,27 @@ msgstr "" msgid "Email" msgstr "Электронная почта" -#: ../../include/network.php:1781 +#: ../../include/network.php:1722 msgid "Diaspora" msgstr "" -#: ../../include/network.php:1782 +#: ../../include/network.php:1723 msgid "Facebook" msgstr "" -#: ../../include/network.php:1783 +#: ../../include/network.php:1724 msgid "Zot" msgstr "" -#: ../../include/network.php:1784 +#: ../../include/network.php:1725 msgid "LinkedIn" msgstr "" -#: ../../include/network.php:1785 +#: ../../include/network.php:1726 msgid "XMPP/IM" msgstr "" -#: ../../include/network.php:1786 +#: ../../include/network.php:1727 msgid "MySpace" msgstr "" @@ -3468,7 +3465,7 @@ msgstr "YYYY-MM-DD или MM-DD" msgid "Required" msgstr "Требуется" -#: ../../include/datetime.php:238 ../../boot.php:2558 +#: ../../include/datetime.php:238 ../../boot.php:2562 msgid "never" msgstr "никогда" @@ -3589,11 +3586,11 @@ msgstr "Не показывать" #: ../../include/acl_selectors.php:123 ../../Zotlabs/Module/Photos.php:717 #: ../../Zotlabs/Module/Photos.php:1086 ../../Zotlabs/Module/Chat.php:243 #: ../../Zotlabs/Module/Filestorage.php:170 ../../Zotlabs/Module/Thing.php:319 -#: ../../Zotlabs/Module/Thing.php:372 ../../Zotlabs/Module/Connedit.php:682 +#: ../../Zotlabs/Module/Thing.php:372 ../../Zotlabs/Module/Connedit.php:690 msgid "Permissions" msgstr "Разрешения" -#: ../../include/acl_selectors.php:125 ../../Zotlabs/Module/Photos.php:1308 +#: ../../include/acl_selectors.php:125 ../../Zotlabs/Module/Photos.php:1316 #: ../../Zotlabs/Lib/ThreadItem.php:441 msgid "Close" msgstr "Закрыть" @@ -3618,73 +3615,73 @@ msgstr "Новое окно" msgid "Open the selected location in a different window or browser tab" msgstr "Открыть выбранное местоположение в другом окне или вкладке браузера" -#: ../../include/connections.php:696 ../../include/event.php:1311 +#: ../../include/connections.php:696 ../../include/event.php:1320 #: ../../Zotlabs/Module/Cdav.php:1224 ../../Zotlabs/Module/Profiles.php:792 -#: ../../Zotlabs/Module/Connedit.php:921 +#: ../../Zotlabs/Module/Connedit.php:932 msgid "Mobile" msgstr "Мобильный" -#: ../../include/connections.php:697 ../../include/event.php:1312 +#: ../../include/connections.php:697 ../../include/event.php:1321 #: ../../Zotlabs/Module/Cdav.php:1225 ../../Zotlabs/Module/Profiles.php:793 -#: ../../Zotlabs/Module/Connedit.php:922 +#: ../../Zotlabs/Module/Connedit.php:933 msgid "Home" msgstr "Домашний" -#: ../../include/connections.php:698 ../../include/event.php:1313 +#: ../../include/connections.php:698 ../../include/event.php:1322 msgid "Home, Voice" msgstr "Дом, голос" -#: ../../include/connections.php:699 ../../include/event.php:1314 +#: ../../include/connections.php:699 ../../include/event.php:1323 msgid "Home, Fax" msgstr "Дом, факс" -#: ../../include/connections.php:700 ../../include/event.php:1315 +#: ../../include/connections.php:700 ../../include/event.php:1324 #: ../../Zotlabs/Module/Cdav.php:1226 ../../Zotlabs/Module/Profiles.php:794 -#: ../../Zotlabs/Module/Connedit.php:923 +#: ../../Zotlabs/Module/Connedit.php:934 msgid "Work" msgstr "Рабочий" -#: ../../include/connections.php:701 ../../include/event.php:1316 +#: ../../include/connections.php:701 ../../include/event.php:1325 msgid "Work, Voice" msgstr "Работа, голос" -#: ../../include/connections.php:702 ../../include/event.php:1317 +#: ../../include/connections.php:702 ../../include/event.php:1326 msgid "Work, Fax" msgstr "Работа, факс" -#: ../../include/event.php:24 ../../include/event.php:71 +#: ../../include/event.php:28 ../../include/event.php:75 msgid "l F d, Y \\@ g:i A" msgstr "" -#: ../../include/event.php:32 ../../include/event.php:75 +#: ../../include/event.php:36 ../../include/event.php:79 msgid "Starts:" msgstr "Начало:" -#: ../../include/event.php:42 ../../include/event.php:79 +#: ../../include/event.php:46 ../../include/event.php:83 msgid "Finishes:" msgstr "Окончание:" -#: ../../include/event.php:1011 +#: ../../include/event.php:1020 msgid "This event has been added to your calendar." msgstr "Это событие было добавлено в ваш календарь." -#: ../../include/event.php:1230 +#: ../../include/event.php:1239 msgid "Not specified" msgstr "Не указано" -#: ../../include/event.php:1231 +#: ../../include/event.php:1240 msgid "Needs Action" msgstr "Требует действия" -#: ../../include/event.php:1232 +#: ../../include/event.php:1241 msgid "Completed" msgstr "Завершено" -#: ../../include/event.php:1233 +#: ../../include/event.php:1242 msgid "In Process" msgstr "В процессе" -#: ../../include/event.php:1234 +#: ../../include/event.php:1243 msgid "Cancelled" msgstr "Отменено" @@ -3718,7 +3715,7 @@ msgid "Click to authenticate to your home hub" msgstr "Нажмите, чтобы аутентифицировать себя на домашнем узле" #: ../../include/nav.php:92 ../../Zotlabs/Module/Manage.php:170 -#: ../../Zotlabs/Lib/Apps.php:312 +#: ../../Zotlabs/Lib/Apps.php:314 msgid "Channel Manager" msgstr "Менеджер каналов" @@ -3733,7 +3730,7 @@ msgstr "Управление вашим группами безопасност #: ../../include/nav.php:97 ../../Zotlabs/Module/Admin/Addons.php:344 #: ../../Zotlabs/Module/Admin/Themes.php:125 #: ../../Zotlabs/Widget/Newmember.php:53 -#: ../../Zotlabs/Widget/Settings_menu.php:68 ../../Zotlabs/Lib/Apps.php:314 +#: ../../Zotlabs/Widget/Settings_menu.php:68 ../../Zotlabs/Lib/Apps.php:316 msgid "Settings" msgstr "Настройки" @@ -3742,7 +3739,7 @@ msgid "Account/Channel Settings" msgstr "Настройки аккаунта / канала" #: ../../include/nav.php:103 ../../include/nav.php:132 -#: ../../include/nav.php:151 ../../boot.php:1624 +#: ../../include/nav.php:151 ../../boot.php:1628 msgid "Logout" msgstr "Выход" @@ -3762,8 +3759,8 @@ msgstr "Управление / редактирование профилей" msgid "Edit your profile" msgstr "Редактировать профиль" -#: ../../include/nav.php:118 ../../include/nav.php:122 ../../boot.php:1625 -#: ../../Zotlabs/Lib/Apps.php:311 +#: ../../include/nav.php:118 ../../include/nav.php:122 ../../boot.php:1629 +#: ../../Zotlabs/Lib/Apps.php:313 msgid "Login" msgstr "Войти" @@ -3779,7 +3776,7 @@ msgstr "Домой" msgid "Log me out of this site" msgstr "Выйти с этого сайта" -#: ../../include/nav.php:156 ../../boot.php:1605 +#: ../../include/nav.php:156 ../../boot.php:1609 #: ../../Zotlabs/Module/Register.php:289 msgid "Register" msgstr "Регистрация" @@ -3804,110 +3801,110 @@ msgstr "Администрирование" msgid "Site Setup and Configuration" msgstr "Установка и конфигурация сайта" -#: ../../include/nav.php:293 ../../Zotlabs/Module/Defperms.php:256 +#: ../../include/nav.php:323 ../../Zotlabs/Module/Defperms.php:256 #: ../../Zotlabs/Module/New_channel.php:157 #: ../../Zotlabs/Module/New_channel.php:164 -#: ../../Zotlabs/Module/Connedit.php:858 +#: ../../Zotlabs/Module/Connedit.php:869 #: ../../Zotlabs/Widget/Notifications.php:162 msgid "Loading" msgstr "Загрузка" -#: ../../include/nav.php:299 +#: ../../include/nav.php:329 msgid "@name, !forum, #tag, ?doc, content" msgstr "@имя, !форум, #тег, ?документ, содержимое" -#: ../../include/nav.php:300 +#: ../../include/nav.php:330 msgid "Please wait..." msgstr "Подождите пожалуйста ..." -#: ../../include/nav.php:306 +#: ../../include/nav.php:336 msgid "Add Apps" msgstr "Добавить приложения" -#: ../../include/nav.php:307 +#: ../../include/nav.php:337 msgid "Arrange Apps" msgstr "Упорядочить приложения" -#: ../../include/nav.php:308 +#: ../../include/nav.php:338 msgid "Toggle System Apps" msgstr "Показать системные приложения" -#: ../../include/nav.php:391 ../../Zotlabs/Module/Admin/Channels.php:154 +#: ../../include/nav.php:421 ../../Zotlabs/Module/Admin/Channels.php:154 msgid "Channel" msgstr "Канал" -#: ../../include/nav.php:394 +#: ../../include/nav.php:424 msgid "Status Messages and Posts" msgstr "Статусы и публикации" -#: ../../include/nav.php:404 ../../Zotlabs/Module/Help.php:80 +#: ../../include/nav.php:434 ../../Zotlabs/Module/Help.php:80 msgid "About" msgstr "О себе" -#: ../../include/nav.php:407 +#: ../../include/nav.php:437 msgid "Profile Details" msgstr "Информация о профиле" -#: ../../include/nav.php:422 ../../Zotlabs/Storage/Browser.php:272 -#: ../../Zotlabs/Module/Fbrowser.php:85 ../../Zotlabs/Lib/Apps.php:315 +#: ../../include/nav.php:452 ../../Zotlabs/Storage/Browser.php:272 +#: ../../Zotlabs/Module/Fbrowser.php:85 ../../Zotlabs/Lib/Apps.php:317 msgid "Files" msgstr "Файлы" -#: ../../include/nav.php:425 +#: ../../include/nav.php:455 msgid "Files and Storage" msgstr "Файлы и хранилище" -#: ../../include/nav.php:433 ../../include/nav.php:436 +#: ../../include/nav.php:463 ../../include/nav.php:466 #: ../../Zotlabs/Storage/Browser.php:140 msgid "Calendar" msgstr "Календарь" -#: ../../include/nav.php:447 ../../include/nav.php:450 -#: ../../Zotlabs/Widget/Chatroom_list.php:16 ../../Zotlabs/Lib/Apps.php:307 +#: ../../include/nav.php:477 ../../include/nav.php:480 +#: ../../Zotlabs/Widget/Chatroom_list.php:16 ../../Zotlabs/Lib/Apps.php:309 msgid "Chatrooms" msgstr "Чаты" -#: ../../include/nav.php:460 ../../Zotlabs/Lib/Apps.php:306 +#: ../../include/nav.php:490 ../../Zotlabs/Lib/Apps.php:308 msgid "Bookmarks" msgstr "Закладки" -#: ../../include/nav.php:463 +#: ../../include/nav.php:493 msgid "Saved Bookmarks" msgstr "Сохранённые закладки" -#: ../../include/nav.php:471 ../../Zotlabs/Module/Cards.php:203 -#: ../../Zotlabs/Lib/Apps.php:303 +#: ../../include/nav.php:501 ../../Zotlabs/Module/Cards.php:207 +#: ../../Zotlabs/Lib/Apps.php:305 msgid "Cards" msgstr "Карточки" -#: ../../include/nav.php:474 +#: ../../include/nav.php:504 msgid "View Cards" msgstr "Просмотреть карточки" -#: ../../include/nav.php:482 ../../Zotlabs/Module/Articles.php:214 -#: ../../Zotlabs/Lib/Apps.php:302 +#: ../../include/nav.php:512 ../../Zotlabs/Module/Articles.php:222 +#: ../../Zotlabs/Lib/Apps.php:304 msgid "Articles" msgstr "Статьи" -#: ../../include/nav.php:485 +#: ../../include/nav.php:515 msgid "View Articles" msgstr "Просмотр статей" -#: ../../include/nav.php:494 ../../Zotlabs/Module/Webpages.php:252 -#: ../../Zotlabs/Lib/Apps.php:316 +#: ../../include/nav.php:524 ../../Zotlabs/Module/Webpages.php:252 +#: ../../Zotlabs/Lib/Apps.php:318 msgid "Webpages" msgstr "Веб-страницы" -#: ../../include/nav.php:497 +#: ../../include/nav.php:527 msgid "View Webpages" msgstr "Просмотр веб-страниц" -#: ../../include/nav.php:506 ../../Zotlabs/Module/Wiki.php:206 +#: ../../include/nav.php:536 ../../Zotlabs/Module/Wiki.php:206 #: ../../Zotlabs/Widget/Wiki_list.php:15 msgid "Wikis" msgstr "" -#: ../../include/nav.php:509 ../../Zotlabs/Lib/Apps.php:317 +#: ../../include/nav.php:539 ../../Zotlabs/Lib/Apps.php:319 msgid "Wiki" msgstr "" @@ -3916,117 +3913,117 @@ msgstr "" msgid "%1$s's bookmarks" msgstr "Закладки пользователя %1$s" -#: ../../include/attach.php:265 ../../include/attach.php:374 +#: ../../include/attach.php:267 ../../include/attach.php:376 msgid "Item was not found." msgstr "Элемент не найден." -#: ../../include/attach.php:282 +#: ../../include/attach.php:284 msgid "Unknown error." msgstr "Неизвестная ошибка." -#: ../../include/attach.php:567 +#: ../../include/attach.php:569 msgid "No source file." msgstr "Нет исходного файла." -#: ../../include/attach.php:589 +#: ../../include/attach.php:591 msgid "Cannot locate file to replace" msgstr "Не удается найти файл для замены" -#: ../../include/attach.php:608 +#: ../../include/attach.php:610 msgid "Cannot locate file to revise/update" msgstr "Не удается найти файл для пересмотра / обновления" -#: ../../include/attach.php:750 +#: ../../include/attach.php:752 #, php-format msgid "File exceeds size limit of %d" msgstr "Файл превышает предельный размер %d" -#: ../../include/attach.php:771 +#: ../../include/attach.php:773 #, php-format msgid "You have reached your limit of %1$.0f Mbytes attachment storage." msgstr "Вы достигли предела %1$.0f Мбайт для хранения вложений." -#: ../../include/attach.php:953 +#: ../../include/attach.php:955 msgid "File upload failed. Possible system limit or action terminated." msgstr "Загрузка файла не удалась. Возможно система перегружена или попытка прекращена." -#: ../../include/attach.php:982 +#: ../../include/attach.php:984 msgid "Stored file could not be verified. Upload failed." msgstr "Файл для сохранения не может быть проверен. Загрузка не удалась." -#: ../../include/attach.php:1056 ../../include/attach.php:1072 +#: ../../include/attach.php:1058 ../../include/attach.php:1074 msgid "Path not available." msgstr "Путь недоступен." -#: ../../include/attach.php:1121 ../../include/attach.php:1286 +#: ../../include/attach.php:1123 ../../include/attach.php:1288 msgid "Empty pathname" msgstr "Пустое имя пути" -#: ../../include/attach.php:1147 +#: ../../include/attach.php:1149 msgid "duplicate filename or path" msgstr "дублирующееся имя файла или пути" -#: ../../include/attach.php:1172 +#: ../../include/attach.php:1174 msgid "Path not found." msgstr "Путь не найден." -#: ../../include/attach.php:1240 +#: ../../include/attach.php:1242 msgid "mkdir failed." msgstr "mkdir не удался" -#: ../../include/attach.php:1244 +#: ../../include/attach.php:1246 msgid "database storage failed." msgstr "ошибка при записи базы данных." -#: ../../include/attach.php:1292 +#: ../../include/attach.php:1294 msgid "Empty path" msgstr "Пустое имя пути" -#: ../../include/photo/photo_driver.php:779 +#: ../../include/photo/photo_driver.php:782 #: ../../Zotlabs/Module/Profile_photo.php:120 #: ../../Zotlabs/Module/Profile_photo.php:248 msgid "Profile Photos" msgstr "Фотографии профиля" -#: ../../boot.php:1604 +#: ../../boot.php:1608 msgid "Create an account to access services and applications" msgstr "Создайте аккаунт для доступа к службам и приложениям" -#: ../../boot.php:1628 +#: ../../boot.php:1632 msgid "Login/Email" msgstr "Пользователь / email" -#: ../../boot.php:1629 +#: ../../boot.php:1633 msgid "Password" msgstr "Пароль" -#: ../../boot.php:1630 +#: ../../boot.php:1634 msgid "Remember me" msgstr "Запомнить меня" -#: ../../boot.php:1633 +#: ../../boot.php:1637 msgid "Forgot your password?" msgstr "Забыли пароль или логин?" -#: ../../boot.php:1634 ../../Zotlabs/Module/Lostpass.php:91 +#: ../../boot.php:1638 ../../Zotlabs/Module/Lostpass.php:91 msgid "Password Reset" msgstr "Сбросить пароль" -#: ../../boot.php:2431 +#: ../../boot.php:2435 #, php-format msgid "[$Projectname] Website SSL error for %s" msgstr "[$Projectname] Ошибка SSL/TLS веб-сайта для %s" -#: ../../boot.php:2436 +#: ../../boot.php:2440 msgid "Website SSL certificate is not valid. Please correct." msgstr "SSL/TLS сертификат веб-сайт недействителен. Исправьте это." -#: ../../boot.php:2552 +#: ../../boot.php:2556 #, php-format msgid "[$Projectname] Cron tasks not running on %s" msgstr "[$Projectname] Задания Cron не запущены на %s" -#: ../../boot.php:2557 +#: ../../boot.php:2561 msgid "Cron/Scheduled tasks not running." msgstr "Задания Cron / планировщика не запущены." @@ -4061,9 +4058,9 @@ msgstr "Общие" #: ../../Zotlabs/Storage/Browser.php:276 ../../Zotlabs/Storage/Browser.php:390 #: ../../Zotlabs/Module/Cdav.php:1230 ../../Zotlabs/Module/Profiles.php:798 #: ../../Zotlabs/Module/New_channel.php:189 ../../Zotlabs/Module/Menu.php:181 -#: ../../Zotlabs/Module/Webpages.php:254 ../../Zotlabs/Module/Connedit.php:927 -#: ../../Zotlabs/Module/Blocks.php:159 ../../Zotlabs/Module/Articles.php:108 -#: ../../Zotlabs/Module/Cards.php:109 ../../Zotlabs/Module/Layouts.php:185 +#: ../../Zotlabs/Module/Webpages.php:254 ../../Zotlabs/Module/Connedit.php:938 +#: ../../Zotlabs/Module/Blocks.php:159 ../../Zotlabs/Module/Articles.php:116 +#: ../../Zotlabs/Module/Cards.php:113 ../../Zotlabs/Module/Layouts.php:185 #: ../../Zotlabs/Widget/Cdav.php:128 ../../Zotlabs/Widget/Cdav.php:165 msgid "Create" msgstr "Создать" @@ -4081,7 +4078,7 @@ msgstr "Удалено администратором" #: ../../Zotlabs/Module/Sharedwithme.php:104 ../../Zotlabs/Module/Chat.php:259 #: ../../Zotlabs/Module/Oauth2.php:118 ../../Zotlabs/Module/Oauth2.php:146 #: ../../Zotlabs/Module/Admin/Channels.php:159 -#: ../../Zotlabs/Module/Connedit.php:912 ../../Zotlabs/Module/Group.php:144 +#: ../../Zotlabs/Module/Connedit.php:923 ../../Zotlabs/Module/Group.php:154 #: ../../Zotlabs/Module/Wiki.php:218 #: ../../Zotlabs/Widget/Wiki_page_history.php:22 #: ../../Zotlabs/Lib/NativeWikiPage.php:561 @@ -4122,7 +4119,7 @@ msgstr "Загрузить файл" #: ../../Zotlabs/Storage/Browser.php:392 ../../Zotlabs/Module/Photos.php:727 #: ../../Zotlabs/Module/Cover_photo.php:395 -#: ../../Zotlabs/Module/Embedphotos.php:158 +#: ../../Zotlabs/Module/Embedphotos.php:166 #: ../../Zotlabs/Module/Profile_photo.php:459 #: ../../Zotlabs/Widget/Portfolio.php:110 ../../Zotlabs/Widget/Cdav.php:133 #: ../../Zotlabs/Widget/Cdav.php:169 ../../Zotlabs/Widget/Album.php:97 @@ -4297,12 +4294,12 @@ msgstr "Приложение \"Разрешения по умолчанию\"" #: ../../Zotlabs/Module/Uexport.php:61 ../../Zotlabs/Module/Bookmarks.php:78 #: ../../Zotlabs/Module/Probe.php:18 ../../Zotlabs/Module/Tokens.php:99 #: ../../Zotlabs/Module/Notes.php:55 ../../Zotlabs/Module/Webpages.php:48 -#: ../../Zotlabs/Module/Group.php:101 ../../Zotlabs/Module/Mood.php:134 +#: ../../Zotlabs/Module/Group.php:106 ../../Zotlabs/Module/Mood.php:134 #: ../../Zotlabs/Module/Lang.php:17 ../../Zotlabs/Module/Randprof.php:29 -#: ../../Zotlabs/Module/Invite.php:110 ../../Zotlabs/Module/Articles.php:43 +#: ../../Zotlabs/Module/Invite.php:110 ../../Zotlabs/Module/Articles.php:51 #: ../../Zotlabs/Module/Connect.php:104 ../../Zotlabs/Module/Pdledit.php:42 #: ../../Zotlabs/Module/Wiki.php:52 ../../Zotlabs/Module/Suggest.php:40 -#: ../../Zotlabs/Module/Cards.php:46 +#: ../../Zotlabs/Module/Cards.php:51 msgid "Not Installed" msgstr "не установлено" @@ -4310,11 +4307,11 @@ msgstr "не установлено" msgid "Set custom default permissions for new connections" msgstr "Настройка пользовательских разрешений по умолчанию для новых подключений " -#: ../../Zotlabs/Module/Defperms.php:254 ../../Zotlabs/Module/Connedit.php:856 +#: ../../Zotlabs/Module/Defperms.php:254 ../../Zotlabs/Module/Connedit.php:867 msgid "Connection Default Permissions" msgstr "Разрешения по умолчанию для контакта" -#: ../../Zotlabs/Module/Defperms.php:255 ../../Zotlabs/Module/Connedit.php:857 +#: ../../Zotlabs/Module/Defperms.php:255 ../../Zotlabs/Module/Connedit.php:868 msgid "Apply these permissions automatically" msgstr "Применить эти разрешения автоматически" @@ -4324,15 +4321,15 @@ msgid "" "If enabled, connection requests will be approved without your interaction" msgstr "Если включено, запросы контактов будут одобрены без вашего участия" -#: ../../Zotlabs/Module/Defperms.php:256 ../../Zotlabs/Module/Connedit.php:858 +#: ../../Zotlabs/Module/Defperms.php:256 ../../Zotlabs/Module/Connedit.php:869 msgid "Permission role" msgstr "Роль разрешения" -#: ../../Zotlabs/Module/Defperms.php:257 ../../Zotlabs/Module/Connedit.php:859 +#: ../../Zotlabs/Module/Defperms.php:257 ../../Zotlabs/Module/Connedit.php:870 msgid "Add permission role" msgstr "Добавить роль разрешения" -#: ../../Zotlabs/Module/Defperms.php:261 ../../Zotlabs/Module/Connedit.php:872 +#: ../../Zotlabs/Module/Defperms.php:261 ../../Zotlabs/Module/Connedit.php:883 msgid "" "The permissions indicated on this page will be applied to all new " "connections." @@ -4343,17 +4340,17 @@ msgid "Automatic approval settings" msgstr "Настройки автоматического одобрения" #: ../../Zotlabs/Module/Defperms.php:264 ../../Zotlabs/Module/Permcats.php:123 -#: ../../Zotlabs/Module/Tokens.php:183 ../../Zotlabs/Module/Connedit.php:892 +#: ../../Zotlabs/Module/Tokens.php:183 ../../Zotlabs/Module/Connedit.php:903 msgid "inherited" msgstr "наследуется" #: ../../Zotlabs/Module/Defperms.php:266 ../../Zotlabs/Module/Permcats.php:121 -#: ../../Zotlabs/Module/Tokens.php:181 ../../Zotlabs/Module/Connedit.php:897 +#: ../../Zotlabs/Module/Tokens.php:181 ../../Zotlabs/Module/Connedit.php:908 msgid "My Settings" msgstr "Мои настройки" #: ../../Zotlabs/Module/Defperms.php:269 ../../Zotlabs/Module/Permcats.php:126 -#: ../../Zotlabs/Module/Tokens.php:186 ../../Zotlabs/Module/Connedit.php:899 +#: ../../Zotlabs/Module/Tokens.php:186 ../../Zotlabs/Module/Connedit.php:910 msgid "Individual Permissions" msgstr "Индивидуальные разрешения" @@ -4385,7 +4382,7 @@ msgid "" "connections." msgstr "Используйте эту форму для создания правил разрешений для различных групп людей и контактов." -#: ../../Zotlabs/Module/Permcats.php:112 ../../Zotlabs/Lib/Apps.php:350 +#: ../../Zotlabs/Module/Permcats.php:112 ../../Zotlabs/Lib/Apps.php:352 msgid "Permission Categories" msgstr "Категории разрешений" @@ -4394,7 +4391,7 @@ msgid "Permission category name" msgstr "Наименование категории разрешений" #: ../../Zotlabs/Module/Permcats.php:127 ../../Zotlabs/Module/Tokens.php:187 -#: ../../Zotlabs/Module/Connedit.php:900 +#: ../../Zotlabs/Module/Connedit.php:911 msgid "" "Some permissions may be inherited from your channel's privacy settings, which have higher priority than " @@ -4418,65 +4415,65 @@ msgstr "Не найдено." msgid "Invalid message" msgstr "Неверное сообщение" -#: ../../Zotlabs/Module/Dreport.php:89 +#: ../../Zotlabs/Module/Dreport.php:90 msgid "no results" msgstr "Ничего не найдено." -#: ../../Zotlabs/Module/Dreport.php:103 +#: ../../Zotlabs/Module/Dreport.php:104 msgid "channel sync processed" msgstr "синхронизация канала завершена" -#: ../../Zotlabs/Module/Dreport.php:107 +#: ../../Zotlabs/Module/Dreport.php:108 msgid "queued" msgstr "в очереди" -#: ../../Zotlabs/Module/Dreport.php:111 +#: ../../Zotlabs/Module/Dreport.php:112 msgid "posted" msgstr "опубликовано" -#: ../../Zotlabs/Module/Dreport.php:115 +#: ../../Zotlabs/Module/Dreport.php:116 msgid "accepted for delivery" msgstr "принято к доставке" -#: ../../Zotlabs/Module/Dreport.php:119 +#: ../../Zotlabs/Module/Dreport.php:120 msgid "updated" msgstr "обновлено" -#: ../../Zotlabs/Module/Dreport.php:122 +#: ../../Zotlabs/Module/Dreport.php:123 msgid "update ignored" msgstr "обновление игнорируется" -#: ../../Zotlabs/Module/Dreport.php:125 +#: ../../Zotlabs/Module/Dreport.php:126 msgid "permission denied" msgstr "доступ запрещен" -#: ../../Zotlabs/Module/Dreport.php:129 +#: ../../Zotlabs/Module/Dreport.php:130 msgid "recipient not found" msgstr "получатель не найден" -#: ../../Zotlabs/Module/Dreport.php:132 +#: ../../Zotlabs/Module/Dreport.php:133 msgid "mail recalled" msgstr "почта отозвана" -#: ../../Zotlabs/Module/Dreport.php:135 +#: ../../Zotlabs/Module/Dreport.php:136 msgid "duplicate mail received" msgstr "получено дублирующее сообщение" -#: ../../Zotlabs/Module/Dreport.php:138 +#: ../../Zotlabs/Module/Dreport.php:139 msgid "mail delivered" msgstr "почта доставлен" -#: ../../Zotlabs/Module/Dreport.php:158 +#: ../../Zotlabs/Module/Dreport.php:159 #, php-format msgid "Delivery report for %1$s" msgstr "Отчёт о доставке для %1$s" -#: ../../Zotlabs/Module/Dreport.php:161 ../../Zotlabs/Widget/Wiki_pages.php:41 +#: ../../Zotlabs/Module/Dreport.php:162 ../../Zotlabs/Widget/Wiki_pages.php:41 #: ../../Zotlabs/Widget/Wiki_pages.php:98 msgid "Options" msgstr "Параметры" -#: ../../Zotlabs/Module/Dreport.php:162 +#: ../../Zotlabs/Module/Dreport.php:163 msgid "Redeliver" msgstr "Доставить повторно" @@ -4484,29 +4481,29 @@ msgstr "Доставить повторно" msgid "No such group" msgstr "Нет такой группы" -#: ../../Zotlabs/Module/Network.php:149 +#: ../../Zotlabs/Module/Network.php:156 msgid "No such channel" msgstr "Нет такого канала" -#: ../../Zotlabs/Module/Network.php:164 ../../Zotlabs/Module/Channel.php:177 +#: ../../Zotlabs/Module/Network.php:171 ../../Zotlabs/Module/Channel.php:182 msgid "Search Results For:" msgstr "Результаты поиска для:" -#: ../../Zotlabs/Module/Network.php:194 ../../Zotlabs/Module/Display.php:80 -#: ../../Zotlabs/Module/Pubstream.php:94 ../../Zotlabs/Module/Channel.php:212 +#: ../../Zotlabs/Module/Network.php:201 ../../Zotlabs/Module/Display.php:80 +#: ../../Zotlabs/Module/Pubstream.php:94 ../../Zotlabs/Module/Channel.php:217 #: ../../Zotlabs/Module/Hq.php:134 msgid "Reset form" msgstr "Очистить форму" -#: ../../Zotlabs/Module/Network.php:233 +#: ../../Zotlabs/Module/Network.php:240 msgid "Privacy group is empty" msgstr "Группа безопасности пуста" -#: ../../Zotlabs/Module/Network.php:243 +#: ../../Zotlabs/Module/Network.php:250 msgid "Privacy group: " msgstr "Группа безопасности: " -#: ../../Zotlabs/Module/Network.php:316 +#: ../../Zotlabs/Module/Network.php:323 #: ../../extend/addon/hzaddons/redred/Mod_Redred.php:29 msgid "Invalid channel." msgstr "Недействительный канал." @@ -4597,16 +4594,16 @@ msgstr "Некоторые предложения о том, что делать msgid "Public access denied." msgstr "Публичный доступ запрещен." -#: ../../Zotlabs/Module/Display.php:374 ../../Zotlabs/Module/Channel.php:468 +#: ../../Zotlabs/Module/Display.php:374 ../../Zotlabs/Module/Channel.php:476 msgid "" "You must enable javascript for your browser to be able to view this content." msgstr "Для просмотра этого содержимого в вашем браузере должен быть включён JavaScript" -#: ../../Zotlabs/Module/Display.php:393 +#: ../../Zotlabs/Module/Display.php:392 msgid "Article" msgstr "Статья" -#: ../../Zotlabs/Module/Display.php:445 +#: ../../Zotlabs/Module/Display.php:444 msgid "Item has been removed." msgstr "Элемент был удалён." @@ -4614,35 +4611,35 @@ msgstr "Элемент был удалён." msgid "sent you a private message" msgstr "отправил вам личное сообщение" -#: ../../Zotlabs/Module/Ping.php:392 +#: ../../Zotlabs/Module/Ping.php:394 msgid "added your channel" msgstr "добавил ваш канал" -#: ../../Zotlabs/Module/Ping.php:417 +#: ../../Zotlabs/Module/Ping.php:419 msgid "requires approval" msgstr "Требуется подтверждение" -#: ../../Zotlabs/Module/Ping.php:427 +#: ../../Zotlabs/Module/Ping.php:429 msgid "g A l F d" msgstr "g A l F d" -#: ../../Zotlabs/Module/Ping.php:445 +#: ../../Zotlabs/Module/Ping.php:447 msgid "[today]" msgstr "[сегодня]" -#: ../../Zotlabs/Module/Ping.php:455 +#: ../../Zotlabs/Module/Ping.php:457 msgid "posted an event" msgstr "событие опубликовано" -#: ../../Zotlabs/Module/Ping.php:489 +#: ../../Zotlabs/Module/Ping.php:491 msgid "shared a file with you" msgstr "с вами поделились файлом" -#: ../../Zotlabs/Module/Ping.php:671 +#: ../../Zotlabs/Module/Ping.php:673 msgid "Private forum" msgstr "Частный форум" -#: ../../Zotlabs/Module/Ping.php:671 +#: ../../Zotlabs/Module/Ping.php:673 msgid "Public forum" msgstr "Публичный форум" @@ -4909,49 +4906,49 @@ msgstr "Удалить всё" msgid "Sorry! Editing of recurrent events is not yet implemented." msgstr "Простите, но редактирование повторяющихся событий пока не реализовано." -#: ../../Zotlabs/Module/Cdav.php:1216 ../../Zotlabs/Module/Connedit.php:913 +#: ../../Zotlabs/Module/Cdav.php:1216 ../../Zotlabs/Module/Connedit.php:924 msgid "Organisation" msgstr "Организация" -#: ../../Zotlabs/Module/Cdav.php:1217 ../../Zotlabs/Module/Connedit.php:914 +#: ../../Zotlabs/Module/Cdav.php:1217 ../../Zotlabs/Module/Connedit.php:925 msgid "Title" msgstr "Наименование" #: ../../Zotlabs/Module/Cdav.php:1218 ../../Zotlabs/Module/Profiles.php:786 -#: ../../Zotlabs/Module/Connedit.php:915 +#: ../../Zotlabs/Module/Connedit.php:926 msgid "Phone" msgstr "Телефон" #: ../../Zotlabs/Module/Cdav.php:1220 ../../Zotlabs/Module/Profiles.php:788 -#: ../../Zotlabs/Module/Connedit.php:917 +#: ../../Zotlabs/Module/Connedit.php:928 msgid "Instant messenger" msgstr "Мессенджер" #: ../../Zotlabs/Module/Cdav.php:1221 ../../Zotlabs/Module/Profiles.php:789 -#: ../../Zotlabs/Module/Connedit.php:918 +#: ../../Zotlabs/Module/Connedit.php:929 msgid "Website" msgstr "Веб-сайт" #: ../../Zotlabs/Module/Cdav.php:1222 ../../Zotlabs/Module/Profiles.php:502 #: ../../Zotlabs/Module/Profiles.php:790 ../../Zotlabs/Module/Locs.php:118 #: ../../Zotlabs/Module/Admin/Channels.php:160 -#: ../../Zotlabs/Module/Connedit.php:919 +#: ../../Zotlabs/Module/Connedit.php:930 msgid "Address" msgstr "Адрес" #: ../../Zotlabs/Module/Cdav.php:1223 ../../Zotlabs/Module/Profiles.php:791 -#: ../../Zotlabs/Module/Connedit.php:920 +#: ../../Zotlabs/Module/Connedit.php:931 msgid "Note" msgstr "Заметка" #: ../../Zotlabs/Module/Cdav.php:1228 ../../Zotlabs/Module/Profiles.php:796 -#: ../../Zotlabs/Module/Connedit.php:925 +#: ../../Zotlabs/Module/Connedit.php:936 #: ../../extend/addon/hzaddons/jappixmini/jappixmini.php:368 msgid "Add Contact" msgstr "Добавить контакт" #: ../../Zotlabs/Module/Cdav.php:1229 ../../Zotlabs/Module/Profiles.php:797 -#: ../../Zotlabs/Module/Connedit.php:926 +#: ../../Zotlabs/Module/Connedit.php:937 msgid "Add Field" msgstr "Добавить поле" @@ -4959,36 +4956,36 @@ msgstr "Добавить поле" #: ../../Zotlabs/Module/Oauth.php:53 ../../Zotlabs/Module/Oauth.php:137 #: ../../Zotlabs/Module/Oauth2.php:58 ../../Zotlabs/Module/Oauth2.php:144 #: ../../Zotlabs/Module/Admin/Addons.php:453 -#: ../../Zotlabs/Module/Connedit.php:928 ../../Zotlabs/Lib/Apps.php:513 +#: ../../Zotlabs/Module/Connedit.php:939 ../../Zotlabs/Lib/Apps.php:515 msgid "Update" msgstr "Обновить" -#: ../../Zotlabs/Module/Cdav.php:1234 ../../Zotlabs/Module/Connedit.php:931 +#: ../../Zotlabs/Module/Cdav.php:1234 ../../Zotlabs/Module/Connedit.php:942 msgid "P.O. Box" msgstr "абонентский ящик" -#: ../../Zotlabs/Module/Cdav.php:1235 ../../Zotlabs/Module/Connedit.php:932 +#: ../../Zotlabs/Module/Cdav.php:1235 ../../Zotlabs/Module/Connedit.php:943 msgid "Additional" msgstr "Дополнительно" -#: ../../Zotlabs/Module/Cdav.php:1236 ../../Zotlabs/Module/Connedit.php:933 +#: ../../Zotlabs/Module/Cdav.php:1236 ../../Zotlabs/Module/Connedit.php:944 msgid "Street" msgstr "Улица" -#: ../../Zotlabs/Module/Cdav.php:1237 ../../Zotlabs/Module/Connedit.php:934 +#: ../../Zotlabs/Module/Cdav.php:1237 ../../Zotlabs/Module/Connedit.php:945 msgid "Locality" msgstr "Населённый пункт" -#: ../../Zotlabs/Module/Cdav.php:1238 ../../Zotlabs/Module/Connedit.php:935 +#: ../../Zotlabs/Module/Cdav.php:1238 ../../Zotlabs/Module/Connedit.php:946 msgid "Region" msgstr "Регион" -#: ../../Zotlabs/Module/Cdav.php:1239 ../../Zotlabs/Module/Connedit.php:936 +#: ../../Zotlabs/Module/Cdav.php:1239 ../../Zotlabs/Module/Connedit.php:947 msgid "ZIP Code" msgstr "Индекс" #: ../../Zotlabs/Module/Cdav.php:1240 ../../Zotlabs/Module/Profiles.php:757 -#: ../../Zotlabs/Module/Connedit.php:937 +#: ../../Zotlabs/Module/Connedit.php:948 msgid "Country" msgstr "Страна" @@ -5542,18 +5539,18 @@ msgstr "Показать новые первыми" msgid "Show Oldest First" msgstr "Показать старые первыми" -#: ../../Zotlabs/Module/Photos.php:826 ../../Zotlabs/Module/Photos.php:1365 -#: ../../Zotlabs/Module/Embedphotos.php:140 +#: ../../Zotlabs/Module/Photos.php:826 ../../Zotlabs/Module/Photos.php:1374 +#: ../../Zotlabs/Module/Embedphotos.php:148 #: ../../Zotlabs/Widget/Portfolio.php:87 ../../Zotlabs/Widget/Album.php:78 msgid "View Photo" msgstr "Посмотреть фотографию" -#: ../../Zotlabs/Module/Photos.php:857 ../../Zotlabs/Module/Embedphotos.php:156 +#: ../../Zotlabs/Module/Photos.php:857 ../../Zotlabs/Module/Embedphotos.php:164 #: ../../Zotlabs/Widget/Portfolio.php:108 ../../Zotlabs/Widget/Album.php:95 msgid "Edit Album" msgstr "Редактировать Фотоальбом" -#: ../../Zotlabs/Module/Photos.php:859 ../../Zotlabs/Module/Photos.php:1396 +#: ../../Zotlabs/Module/Photos.php:859 ../../Zotlabs/Module/Photos.php:1405 msgid "Add Photos" msgstr "Добавить фотографии" @@ -5631,34 +5628,34 @@ msgstr "мне это нравится (переключение)" msgid "I don't like this (toggle)" msgstr "мне это не нравится (переключение)" -#: ../../Zotlabs/Module/Photos.php:1134 ../../Zotlabs/Module/Photos.php:1252 +#: ../../Zotlabs/Module/Photos.php:1135 ../../Zotlabs/Module/Photos.php:1254 #: ../../Zotlabs/Lib/ThreadItem.php:770 msgid "This is you" msgstr "Это вы" -#: ../../Zotlabs/Module/Photos.php:1171 ../../Zotlabs/Module/Photos.php:1183 +#: ../../Zotlabs/Module/Photos.php:1173 ../../Zotlabs/Module/Photos.php:1185 #: ../../Zotlabs/Lib/ThreadItem.php:217 ../../Zotlabs/Lib/ThreadItem.php:229 msgid "View all" msgstr "Просмотреть все" -#: ../../Zotlabs/Module/Photos.php:1280 +#: ../../Zotlabs/Module/Photos.php:1288 msgid "Photo Tools" msgstr "Фото-Инструменты" -#: ../../Zotlabs/Module/Photos.php:1289 +#: ../../Zotlabs/Module/Photos.php:1297 msgid "In This Photo:" msgstr "На этой фотографии:" -#: ../../Zotlabs/Module/Photos.php:1294 +#: ../../Zotlabs/Module/Photos.php:1302 msgid "Map" msgstr "Карта" -#: ../../Zotlabs/Module/Photos.php:1302 ../../Zotlabs/Lib/ThreadItem.php:435 +#: ../../Zotlabs/Module/Photos.php:1310 ../../Zotlabs/Lib/ThreadItem.php:435 msgctxt "noun" msgid "Likes" msgstr "Нравится" -#: ../../Zotlabs/Module/Photos.php:1303 ../../Zotlabs/Lib/ThreadItem.php:436 +#: ../../Zotlabs/Module/Photos.php:1311 ../../Zotlabs/Lib/ThreadItem.php:436 msgctxt "noun" msgid "Dislikes" msgstr "Не нравится" @@ -6025,7 +6022,7 @@ msgid "The unmoderated public stream of this hub" msgstr "Немодерируемый публичный поток с этого хаба" #: ../../Zotlabs/Module/Pubstream.php:109 -#: ../../Zotlabs/Widget/Notifications.php:142 ../../Zotlabs/Lib/Apps.php:352 +#: ../../Zotlabs/Widget/Notifications.php:142 ../../Zotlabs/Lib/Apps.php:354 msgid "Public Stream" msgstr "Публичный поток" @@ -6319,21 +6316,21 @@ msgid "" "check your email for further instructions." msgstr "Этот сайт требует проверку адреса электронной почты. После заполнения этой формы, пожалуйста, проверьте ваш почтовый ящик для дальнейших инструкций." -#: ../../Zotlabs/Module/Apporder.php:44 +#: ../../Zotlabs/Module/Apporder.php:47 msgid "Change Order of Pinned Navbar Apps" msgstr "Изменить порядок приложений на панели навигации" -#: ../../Zotlabs/Module/Apporder.php:44 +#: ../../Zotlabs/Module/Apporder.php:47 msgid "Change Order of App Tray Apps" msgstr "Изменить порядок приложений в лотке" -#: ../../Zotlabs/Module/Apporder.php:45 +#: ../../Zotlabs/Module/Apporder.php:48 msgid "" "Use arrows to move the corresponding app left (top) or right (bottom) in the " "navbar" msgstr "Используйте стрелки для перемещения приложения влево (вверх) или вправо (вниз) в панели навигации" -#: ../../Zotlabs/Module/Apporder.php:45 +#: ../../Zotlabs/Module/Apporder.php:48 msgid "Use arrows to move the corresponding app up or down in the app tray" msgstr "Используйте стрелки для перемещения приложения вверх или вниз в лотке" @@ -6341,7 +6338,7 @@ msgstr "Используйте стрелки для перемещения пр msgid "Documentation Search" msgstr "Поиск документации" -#: ../../Zotlabs/Module/Help.php:81 ../../Zotlabs/Module/Group.php:145 +#: ../../Zotlabs/Module/Help.php:81 ../../Zotlabs/Module/Group.php:155 msgid "Members" msgstr "Участники" @@ -6475,7 +6472,7 @@ msgstr "Автоматический импорт контента из друг msgid "*" msgstr "" -#: ../../Zotlabs/Module/Sources.php:107 ../../Zotlabs/Lib/Apps.php:344 +#: ../../Zotlabs/Module/Sources.php:107 ../../Zotlabs/Lib/Apps.php:346 msgid "Channel Sources" msgstr "Источники канала" @@ -6870,39 +6867,47 @@ msgstr "Настройки фотографий" msgid "Profiles Settings" msgstr "Настройки профилей" -#: ../../Zotlabs/Module/Settings/Featured.php:23 +#: ../../Zotlabs/Module/Settings/Featured.php:27 msgid "Affinity Slider settings updated." msgstr "Обновлены настройки слайдера cходства." -#: ../../Zotlabs/Module/Settings/Featured.php:38 +#: ../../Zotlabs/Module/Settings/Featured.php:42 msgid "No feature settings configured" msgstr "Параметры функций не настроены" -#: ../../Zotlabs/Module/Settings/Featured.php:45 +#: ../../Zotlabs/Module/Settings/Featured.php:49 msgid "Default maximum affinity level" msgstr "Максимальный уровень сходства по умолчанию." -#: ../../Zotlabs/Module/Settings/Featured.php:45 +#: ../../Zotlabs/Module/Settings/Featured.php:49 msgid "0-99 default 99" msgstr "0-99 (по умолчанию 99)" -#: ../../Zotlabs/Module/Settings/Featured.php:50 +#: ../../Zotlabs/Module/Settings/Featured.php:54 msgid "Default minimum affinity level" msgstr "Минимальный уровень сходства по умолчанию." -#: ../../Zotlabs/Module/Settings/Featured.php:50 +#: ../../Zotlabs/Module/Settings/Featured.php:54 msgid "0-99 - default 0" msgstr "0-99 (по умолчанию 0)" -#: ../../Zotlabs/Module/Settings/Featured.php:54 +#: ../../Zotlabs/Module/Settings/Featured.php:58 +msgid "Always reset on new page visit." +msgstr "Всегда сбрасывать при посещении новой страницы." + +#: ../../Zotlabs/Module/Settings/Featured.php:58 +msgid "default: yes" +msgstr "по-умолчанию: да" + +#: ../../Zotlabs/Module/Settings/Featured.php:62 msgid "Affinity Slider Settings" msgstr "Настройки слайдера сходства" -#: ../../Zotlabs/Module/Settings/Featured.php:67 +#: ../../Zotlabs/Module/Settings/Featured.php:75 msgid "Addon Settings" msgstr "Настройки расширений" -#: ../../Zotlabs/Module/Settings/Featured.php:68 +#: ../../Zotlabs/Module/Settings/Featured.php:76 msgid "Please save/submit changes to any panel before opening another." msgstr "Пожалуйста сохраните / отправьте изменения на панели прежде чем открывать другую." @@ -7395,7 +7400,7 @@ msgstr "Редактировать блок" msgid "No service class restrictions found." msgstr "Ограничений класса обслуживание не найдено." -#: ../../Zotlabs/Module/Channel.php:160 +#: ../../Zotlabs/Module/Channel.php:165 msgid "Insufficient permissions. Request redirected to profile page." msgstr "Недостаточно прав. Запрос перенаправлен на страницу профиля." @@ -7473,75 +7478,75 @@ msgstr "Нет на месте" msgid "Online" msgstr "В сети" -#: ../../Zotlabs/Module/Like.php:54 +#: ../../Zotlabs/Module/Like.php:56 msgid "Like/Dislike" msgstr "Нравится / не нравится" -#: ../../Zotlabs/Module/Like.php:59 +#: ../../Zotlabs/Module/Like.php:61 msgid "This action is restricted to members." msgstr "Это действие доступно только участникам." -#: ../../Zotlabs/Module/Like.php:60 +#: ../../Zotlabs/Module/Like.php:62 msgid "" "Please login with your $Projectname ID or register as a new $Projectname member to continue." msgstr "Пожалуйста, для продолжения войдите с вашим $Projectname ID или зарегистрируйтесь как новый участник $Projectname." -#: ../../Zotlabs/Module/Like.php:109 ../../Zotlabs/Module/Like.php:135 -#: ../../Zotlabs/Module/Like.php:173 +#: ../../Zotlabs/Module/Like.php:111 ../../Zotlabs/Module/Like.php:137 +#: ../../Zotlabs/Module/Like.php:175 msgid "Invalid request." msgstr "Неверный запрос." -#: ../../Zotlabs/Module/Like.php:150 +#: ../../Zotlabs/Module/Like.php:152 msgid "thing" msgstr "предмет" -#: ../../Zotlabs/Module/Like.php:196 +#: ../../Zotlabs/Module/Like.php:198 msgid "Channel unavailable." msgstr "Канал недоступен." -#: ../../Zotlabs/Module/Like.php:244 +#: ../../Zotlabs/Module/Like.php:246 msgid "Previous action reversed." msgstr "Предыдущее действие отменено." -#: ../../Zotlabs/Module/Like.php:445 +#: ../../Zotlabs/Module/Like.php:451 #, php-format msgid "%1$s agrees with %2$s's %3$s" msgstr "%1$s согласен с %2$s %3$s" -#: ../../Zotlabs/Module/Like.php:447 +#: ../../Zotlabs/Module/Like.php:453 #, php-format msgid "%1$s doesn't agree with %2$s's %3$s" msgstr "%1$s не согласен с %2$s %3$s" -#: ../../Zotlabs/Module/Like.php:449 +#: ../../Zotlabs/Module/Like.php:455 #, php-format msgid "%1$s abstains from a decision on %2$s's %3$s" msgstr "%1$s воздерживается от решения по %2$s%3$s" -#: ../../Zotlabs/Module/Like.php:451 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2120 +#: ../../Zotlabs/Module/Like.php:457 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2133 #, php-format msgid "%1$s is attending %2$s's %3$s" msgstr "%1$s посещает %2$s%3$s" -#: ../../Zotlabs/Module/Like.php:453 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2122 +#: ../../Zotlabs/Module/Like.php:459 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2135 #, php-format msgid "%1$s is not attending %2$s's %3$s" msgstr "%1$s не посещает %2$s%3$s" -#: ../../Zotlabs/Module/Like.php:455 -#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2124 +#: ../../Zotlabs/Module/Like.php:461 +#: ../../extend/addon/hzaddons/diaspora/Receiver.php:2137 #, php-format msgid "%1$s may attend %2$s's %3$s" msgstr "%1$s может посетить %2$s%3$s" -#: ../../Zotlabs/Module/Like.php:566 +#: ../../Zotlabs/Module/Like.php:572 msgid "Action completed." msgstr "Действие завершено." -#: ../../Zotlabs/Module/Like.php:567 +#: ../../Zotlabs/Module/Like.php:573 msgid "Thank you." msgstr "Спасибо." @@ -7800,7 +7805,7 @@ msgid "" msgstr "Вам может понадобится импортировать файл \"install/schema_xxx.sql\" вручную используя клиент базы данных." #: ../../Zotlabs/Module/Setup.php:198 ../../Zotlabs/Module/Setup.php:262 -#: ../../Zotlabs/Module/Setup.php:756 +#: ../../Zotlabs/Module/Setup.php:761 msgid "Please see the file \"install/INSTALL.txt\"." msgstr "Пожалуйста, обратитесь к файлу \"install/INSTALL.txt\"." @@ -7944,229 +7949,235 @@ msgstr "Это необходимо для функционирования до msgid "PHP register_argc_argv" msgstr "" -#: ../../Zotlabs/Module/Setup.php:446 +#: ../../Zotlabs/Module/Setup.php:448 +msgid "" +"This is not sufficient to upload larger images or files. You should be able " +"to upload at least 4 MB at once." +msgstr "Этого недостаточно для загрузки больших изображений или файлов. Вы должны иметь возможность загрузить как минимум 4 Мб за раз." + +#: ../../Zotlabs/Module/Setup.php:450 #, php-format msgid "" "Your max allowed total upload size is set to %s. Maximum size of one file to " "upload is set to %s. You are allowed to upload up to %d files at once." msgstr "Максимально разрешённый общий размер загрузок установлен в %s. Максимальный размер одной загрузки установлен в %s. Вам разрешено загружать до %d файлов за один приём." -#: ../../Zotlabs/Module/Setup.php:451 +#: ../../Zotlabs/Module/Setup.php:456 msgid "You can adjust these settings in the server php.ini file." msgstr "Вы можете изменить эти настройки в файле php.ini на сервере." -#: ../../Zotlabs/Module/Setup.php:453 +#: ../../Zotlabs/Module/Setup.php:458 msgid "PHP upload limits" msgstr "Максимальный размер загрузки в PHP" -#: ../../Zotlabs/Module/Setup.php:476 +#: ../../Zotlabs/Module/Setup.php:481 msgid "" "Error: the \"openssl_pkey_new\" function on this system is not able to " "generate encryption keys" msgstr "Ошибка: функция \"openssl_pkey_new\" не может сгенерировать ключи шифрования" -#: ../../Zotlabs/Module/Setup.php:477 +#: ../../Zotlabs/Module/Setup.php:482 msgid "" "If running under Windows, please see \"http://www.php.net/manual/en/openssl." "installation.php\"." msgstr "Если работаете под Windows, см. \"http://www.php.net/manual/en/openssl.installation.php\"." -#: ../../Zotlabs/Module/Setup.php:480 +#: ../../Zotlabs/Module/Setup.php:485 msgid "Generate encryption keys" msgstr "Генерация ключей шифрования" -#: ../../Zotlabs/Module/Setup.php:497 +#: ../../Zotlabs/Module/Setup.php:502 msgid "libCurl PHP module" msgstr "модуль PHP libcURL" -#: ../../Zotlabs/Module/Setup.php:498 +#: ../../Zotlabs/Module/Setup.php:503 msgid "GD graphics PHP module" msgstr "модуль графики PHP GD" -#: ../../Zotlabs/Module/Setup.php:499 +#: ../../Zotlabs/Module/Setup.php:504 msgid "OpenSSL PHP module" msgstr "модуль PHP OpenSSL" -#: ../../Zotlabs/Module/Setup.php:500 +#: ../../Zotlabs/Module/Setup.php:505 msgid "PDO database PHP module" msgstr "модуль баз данных PHP PDO" -#: ../../Zotlabs/Module/Setup.php:501 +#: ../../Zotlabs/Module/Setup.php:506 msgid "mb_string PHP module" msgstr "модуль PHP mb_string" -#: ../../Zotlabs/Module/Setup.php:502 +#: ../../Zotlabs/Module/Setup.php:507 msgid "xml PHP module" msgstr "модуль PHP xml" -#: ../../Zotlabs/Module/Setup.php:503 +#: ../../Zotlabs/Module/Setup.php:508 msgid "zip PHP module" msgstr "модуль PHP zip" -#: ../../Zotlabs/Module/Setup.php:507 ../../Zotlabs/Module/Setup.php:509 +#: ../../Zotlabs/Module/Setup.php:512 ../../Zotlabs/Module/Setup.php:514 msgid "Apache mod_rewrite module" msgstr "модуль Apache mod_rewrite" -#: ../../Zotlabs/Module/Setup.php:507 +#: ../../Zotlabs/Module/Setup.php:512 msgid "" "Error: Apache webserver mod-rewrite module is required but not installed." msgstr "Ошибка: требуемый модуль mod_rewrite веб-сервера Apache не установлен." -#: ../../Zotlabs/Module/Setup.php:513 ../../Zotlabs/Module/Setup.php:516 +#: ../../Zotlabs/Module/Setup.php:518 ../../Zotlabs/Module/Setup.php:521 msgid "exec" msgstr "" -#: ../../Zotlabs/Module/Setup.php:513 +#: ../../Zotlabs/Module/Setup.php:518 msgid "" "Error: exec is required but is either not installed or has been disabled in " "php.ini" msgstr "Ошибка: exec требуется, однако не установлен или был отключён в php.ini" -#: ../../Zotlabs/Module/Setup.php:519 ../../Zotlabs/Module/Setup.php:522 +#: ../../Zotlabs/Module/Setup.php:524 ../../Zotlabs/Module/Setup.php:527 msgid "shell_exec" msgstr "" -#: ../../Zotlabs/Module/Setup.php:519 +#: ../../Zotlabs/Module/Setup.php:524 msgid "" "Error: shell_exec is required but is either not installed or has been " "disabled in php.ini" msgstr "Ошибка: shell_exec требуется, однако не установлен или был отключён в php.ini" -#: ../../Zotlabs/Module/Setup.php:527 +#: ../../Zotlabs/Module/Setup.php:532 msgid "Error: libCURL PHP module required but not installed." msgstr "Ошибка: модуль PHP libсURL требуется, однако не установлен" -#: ../../Zotlabs/Module/Setup.php:531 +#: ../../Zotlabs/Module/Setup.php:536 msgid "" "Error: GD PHP module with JPEG support or ImageMagick graphics library " "required but not installed." msgstr "Ошибка: модуль PHP GD с поддержкой JPEG или графическая библиотека ImageMagick требуется, однако не установлена" -#: ../../Zotlabs/Module/Setup.php:535 +#: ../../Zotlabs/Module/Setup.php:540 msgid "Error: openssl PHP module required but not installed." msgstr "Ошибка: модуль PHP OpenSSL требуется, однако не установлен" -#: ../../Zotlabs/Module/Setup.php:541 +#: ../../Zotlabs/Module/Setup.php:546 msgid "" "Error: PDO database PHP module missing a driver for either mysql or pgsql." msgstr "Ошибка: отсутствует драйвер MySQL или PgSQL в модуле баз данных PHP PDO" -#: ../../Zotlabs/Module/Setup.php:546 +#: ../../Zotlabs/Module/Setup.php:551 msgid "Error: PDO database PHP module required but not installed." msgstr "Ошибка: модуль баз данных PHP PDO требуется, однако не установлен" -#: ../../Zotlabs/Module/Setup.php:550 +#: ../../Zotlabs/Module/Setup.php:555 msgid "Error: mb_string PHP module required but not installed." msgstr "Ошибка: модуль PHP mb_string требуется, однако не установлен" -#: ../../Zotlabs/Module/Setup.php:554 +#: ../../Zotlabs/Module/Setup.php:559 msgid "Error: xml PHP module required for DAV but not installed." msgstr "Ошибка: модуль PHP xml требуется для DAV, однако не установлен" -#: ../../Zotlabs/Module/Setup.php:558 +#: ../../Zotlabs/Module/Setup.php:563 msgid "Error: zip PHP module required but not installed." msgstr "Ошибка: модуль PHP zip требуется, однако не установлен" -#: ../../Zotlabs/Module/Setup.php:577 ../../Zotlabs/Module/Setup.php:586 +#: ../../Zotlabs/Module/Setup.php:582 ../../Zotlabs/Module/Setup.php:591 msgid ".htconfig.php is writable" msgstr ".htconfig.php доступен для записи" -#: ../../Zotlabs/Module/Setup.php:582 +#: ../../Zotlabs/Module/Setup.php:587 msgid "" "The web installer needs to be able to create a file called \".htconfig.php\" " "in the top folder of your web server and it is unable to do so." msgstr "Инсталлятор требует возможности создать файл с именем \".htconfig.php\" в корневом каталоге вашего веб-сервера но не может этого сделать." -#: ../../Zotlabs/Module/Setup.php:583 +#: ../../Zotlabs/Module/Setup.php:588 msgid "" "This is most often a permission setting, as the web server may not be able " "to write files in your folder - even if you can." msgstr "В большинстве случаев это проблема прав доступа. Веб-сервер может не иметь возможности записывать файлы в этот каталог даже если вы можете это делать." -#: ../../Zotlabs/Module/Setup.php:584 +#: ../../Zotlabs/Module/Setup.php:589 msgid "Please see install/INSTALL.txt for additional information." msgstr "Пожалуйста, ознакомьтесь с install/INSTALL.txt для дополнительных сведений." -#: ../../Zotlabs/Module/Setup.php:600 +#: ../../Zotlabs/Module/Setup.php:605 msgid "" "This software uses the Smarty3 template engine to render its web views. " "Smarty3 compiles templates to PHP to speed up rendering." msgstr "Это программное обеспечение использует шаблонизатор Smarty3 для отображения своих веб-страниц. Smarty3 компилирует шаблоны для PHP для ускорения рендеринга." -#: ../../Zotlabs/Module/Setup.php:601 +#: ../../Zotlabs/Module/Setup.php:606 #, php-format msgid "" "In order to store these compiled templates, the web server needs to have " "write access to the directory %s under the top level web folder." msgstr "Для хранения этих скомпилированных шаблонов веб-сервер должен иметь доступ на запись к каталогу %s в каталоге верхнего уровня." -#: ../../Zotlabs/Module/Setup.php:602 ../../Zotlabs/Module/Setup.php:623 +#: ../../Zotlabs/Module/Setup.php:607 ../../Zotlabs/Module/Setup.php:628 msgid "" "Please ensure that the user that your web server runs as (e.g. www-data) has " "write access to this folder." msgstr "Убедитесь, что пользователь от имени которого работает ваш веб-сервер (например, www-data), имеет доступ на запись в этот каталог." -#: ../../Zotlabs/Module/Setup.php:603 +#: ../../Zotlabs/Module/Setup.php:608 #, php-format msgid "" "Note: as a security measure, you should give the web server write access to " "%s only--not the template files (.tpl) that it contains." msgstr "Примечание. В качестве меры безопасности вы должны предоставить доступ веб-серверу для записи только к %s но не к содержащимися в нём файлами шаблонов (.tpl)." -#: ../../Zotlabs/Module/Setup.php:606 +#: ../../Zotlabs/Module/Setup.php:611 #, php-format msgid "%s is writable" msgstr "%s доступен для записи" -#: ../../Zotlabs/Module/Setup.php:622 +#: ../../Zotlabs/Module/Setup.php:627 msgid "" "This software uses the store directory to save uploaded files. The web " "server needs to have write access to the store directory under the top level " "web folder" msgstr "Эта программа использует каталог хранения для загруженных файлов. Для веб-сервера требуется доступ на запись начиная с верхнего уровня каталога хранения." -#: ../../Zotlabs/Module/Setup.php:626 +#: ../../Zotlabs/Module/Setup.php:631 msgid "store is writable" msgstr "хранилище доступно для записи" -#: ../../Zotlabs/Module/Setup.php:658 +#: ../../Zotlabs/Module/Setup.php:663 msgid "" "SSL certificate cannot be validated. Fix certificate or disable https access " "to this site." msgstr "SSL certificate cannot be validated. Замените его или отключите https доступ к этому сайту." -#: ../../Zotlabs/Module/Setup.php:659 +#: ../../Zotlabs/Module/Setup.php:664 msgid "" "If you have https access to your website or allow connections to TCP port " "443 (the https: port), you MUST use a browser-valid certificate. You MUST " "NOT use self-signed certificates!" msgstr "Если у вас есть https-доступ к вашему сайту или разрешено подключение к TCP-порту 443 (порт https), вы ДОЛЖНЫ использовать сертификат, действительный для браузера. Вы НЕ ДОЛЖНЫ использовать самоподписанные сертификаты!" -#: ../../Zotlabs/Module/Setup.php:660 +#: ../../Zotlabs/Module/Setup.php:665 msgid "" "This restriction is incorporated because public posts from you may for " "example contain references to images on your own hub." msgstr "Эти ограничения приняты поскольку ваши общедоступные публикации могут, например, содержать ссылки на изображения на вашем собственном хабе." -#: ../../Zotlabs/Module/Setup.php:661 +#: ../../Zotlabs/Module/Setup.php:666 msgid "" "If your certificate is not recognized, members of other sites (who may " "themselves have valid certificates) will get a warning message on their own " "site complaining about security issues." msgstr "Если ваш сертификат не признан, пользователи других сайтов (которые могут сами иметь действительные сертификаты) получат предупреждающее сообщение о проблемах с безопасностью." -#: ../../Zotlabs/Module/Setup.php:662 +#: ../../Zotlabs/Module/Setup.php:667 msgid "" "This can cause usability issues elsewhere (not just on your own site) so we " "must insist on this requirement." msgstr "Это может привести к проблемам удобства использования из других мест (не только на вашем собственном сайте), поэтому мы настаиваем на этом требовании." -#: ../../Zotlabs/Module/Setup.php:663 +#: ../../Zotlabs/Module/Setup.php:668 msgid "" "Providers are available that issue free certificates which are browser-valid." msgstr "Доступны поставщики, которые выдают действительные для браузера бесплатные сертификаты." -#: ../../Zotlabs/Module/Setup.php:665 +#: ../../Zotlabs/Module/Setup.php:670 msgid "" "If you are confident that the certificate is valid and signed by a trusted " "authority, check to see if you have failed to install an intermediate cert. " @@ -8174,37 +8185,37 @@ msgid "" "server communications." msgstr "Если вы уверены, что сертификат действителен и подписан доверенным органом, проверьте, установлен ли промежуточные сертификаты. Обычно они не требуются браузерами, но бывают необходимы для связи между серверами." -#: ../../Zotlabs/Module/Setup.php:667 +#: ../../Zotlabs/Module/Setup.php:672 msgid "SSL certificate validation" msgstr "Проверка SSL сертификата" -#: ../../Zotlabs/Module/Setup.php:673 +#: ../../Zotlabs/Module/Setup.php:678 msgid "" "Url rewrite in .htaccess is not working. Check your server configuration." "Test: " msgstr "Перезапись URL в .htaccess не работает. Проверьте настройки вашего сервера." -#: ../../Zotlabs/Module/Setup.php:676 +#: ../../Zotlabs/Module/Setup.php:681 msgid "Url rewrite is working" msgstr "Перезапись URL работает" -#: ../../Zotlabs/Module/Setup.php:690 +#: ../../Zotlabs/Module/Setup.php:695 msgid "" "The database configuration file \".htconfig.php\" could not be written. " "Please use the enclosed text to create a configuration file in your web " "server root." msgstr "Файл конфигурации базы данных \".htconfig.php\" не может быть записан. Используйте прилагаемый текст для создания файла конфигурации в корневом каталоге веб-сервера." -#: ../../Zotlabs/Module/Setup.php:714 +#: ../../Zotlabs/Module/Setup.php:719 #: ../../extend/addon/hzaddons/rendezvous/rendezvous.php:401 msgid "Errors encountered creating database tables." msgstr "При создании базы данных возникли ошибки." -#: ../../Zotlabs/Module/Setup.php:754 +#: ../../Zotlabs/Module/Setup.php:759 msgid "

      What next?

      " msgstr "

      Что дальше?

      " -#: ../../Zotlabs/Module/Setup.php:755 +#: ../../Zotlabs/Module/Setup.php:760 msgid "" "IMPORTANT: You will need to [manually] setup a scheduled task for the poller." msgstr "Вам понадобится [вручную] настроить запланированную задачу для опрашивателя." @@ -8664,7 +8675,7 @@ msgstr "Загрузить репозиторий расширений" msgid "Install new repo" msgstr "Установить новый репозиторий" -#: ../../Zotlabs/Module/Admin/Addons.php:422 ../../Zotlabs/Lib/Apps.php:513 +#: ../../Zotlabs/Module/Admin/Addons.php:422 ../../Zotlabs/Lib/Apps.php:515 msgid "Install" msgstr "Установить" @@ -8938,7 +8949,7 @@ msgstr "Импортировать только публичные потоки #: ../../Zotlabs/Module/Admin/Site.php:323 #: ../../Zotlabs/Module/Admin/Site.php:324 -#: ../../Zotlabs/Module/Connedit.php:881 ../../Zotlabs/Module/Connedit.php:882 +#: ../../Zotlabs/Module/Connedit.php:892 ../../Zotlabs/Module/Connedit.php:893 msgid "" "words one per line or #tags or /patterns/ or lang=xx, leave blank to import " "all posts" @@ -9283,12 +9294,12 @@ msgid "No registrations." msgstr "Нет новых регистраций." #: ../../Zotlabs/Module/Admin/Accounts.php:176 -#: ../../Zotlabs/Module/Connedit.php:628 +#: ../../Zotlabs/Module/Connedit.php:636 msgid "Block" msgstr "Блокировать" #: ../../Zotlabs/Module/Admin/Accounts.php:177 -#: ../../Zotlabs/Module/Connedit.php:628 +#: ../../Zotlabs/Module/Connedit.php:636 msgid "Unblock" msgstr "Разблокировать" @@ -9452,7 +9463,7 @@ msgstr "Пароль" msgid "Expires (yyyy-mm-dd)" msgstr "Срок действия (yyyy-mm-dd)" -#: ../../Zotlabs/Module/Tokens.php:180 ../../Zotlabs/Module/Connedit.php:896 +#: ../../Zotlabs/Module/Tokens.php:180 ../../Zotlabs/Module/Connedit.php:907 msgid "Their Settings" msgstr "Их настройки" @@ -9696,268 +9707,268 @@ msgstr "Контакт добавлен." msgid "Item is not editable" msgstr "Элемент нельзя редактировать" -#: ../../Zotlabs/Module/Connedit.php:111 +#: ../../Zotlabs/Module/Connedit.php:112 msgid "Could not locate selected profile." msgstr "Не удалось обнаружить выбранный профиль." -#: ../../Zotlabs/Module/Connedit.php:248 +#: ../../Zotlabs/Module/Connedit.php:256 msgid "Connection updated." msgstr "Контакты обновлены." -#: ../../Zotlabs/Module/Connedit.php:250 +#: ../../Zotlabs/Module/Connedit.php:258 msgid "Failed to update connection record." msgstr "Не удалось обновить запись контакта." -#: ../../Zotlabs/Module/Connedit.php:304 +#: ../../Zotlabs/Module/Connedit.php:312 msgid "is now connected to" msgstr "теперь подключён к" -#: ../../Zotlabs/Module/Connedit.php:429 +#: ../../Zotlabs/Module/Connedit.php:437 msgid "Could not access address book record." msgstr "Не удалось получить доступ к записи адресной книги." -#: ../../Zotlabs/Module/Connedit.php:477 ../../Zotlabs/Module/Connedit.php:481 +#: ../../Zotlabs/Module/Connedit.php:485 ../../Zotlabs/Module/Connedit.php:489 msgid "Refresh failed - channel is currently unavailable." msgstr "Обновление невозможно - в настоящее время канал недоступен." -#: ../../Zotlabs/Module/Connedit.php:496 ../../Zotlabs/Module/Connedit.php:505 -#: ../../Zotlabs/Module/Connedit.php:514 ../../Zotlabs/Module/Connedit.php:523 -#: ../../Zotlabs/Module/Connedit.php:536 +#: ../../Zotlabs/Module/Connedit.php:504 ../../Zotlabs/Module/Connedit.php:513 +#: ../../Zotlabs/Module/Connedit.php:522 ../../Zotlabs/Module/Connedit.php:531 +#: ../../Zotlabs/Module/Connedit.php:544 msgid "Unable to set address book parameters." msgstr "Не удалось получить доступ к параметрам адресной книги." -#: ../../Zotlabs/Module/Connedit.php:560 +#: ../../Zotlabs/Module/Connedit.php:568 msgid "Connection has been removed." msgstr "Контакт был удалён." -#: ../../Zotlabs/Module/Connedit.php:603 +#: ../../Zotlabs/Module/Connedit.php:611 #, php-format msgid "View %s's profile" msgstr "Просмотр %s профиля" -#: ../../Zotlabs/Module/Connedit.php:607 +#: ../../Zotlabs/Module/Connedit.php:615 msgid "Refresh Permissions" msgstr "Обновить разрешения" -#: ../../Zotlabs/Module/Connedit.php:610 +#: ../../Zotlabs/Module/Connedit.php:618 msgid "Fetch updated permissions" msgstr "Получить обновлённые разрешения" -#: ../../Zotlabs/Module/Connedit.php:614 +#: ../../Zotlabs/Module/Connedit.php:622 msgid "Refresh Photo" msgstr "Обновить фотографию" -#: ../../Zotlabs/Module/Connedit.php:617 +#: ../../Zotlabs/Module/Connedit.php:625 msgid "Fetch updated photo" msgstr "Получить обновлённую фотографию" -#: ../../Zotlabs/Module/Connedit.php:624 +#: ../../Zotlabs/Module/Connedit.php:632 msgid "View recent posts and comments" msgstr "Просмотреть последние публикации и комментарии" -#: ../../Zotlabs/Module/Connedit.php:631 +#: ../../Zotlabs/Module/Connedit.php:639 msgid "Block (or Unblock) all communications with this connection" msgstr "Блокировать (или разблокировать) связи с этим контактом" -#: ../../Zotlabs/Module/Connedit.php:632 +#: ../../Zotlabs/Module/Connedit.php:640 msgid "This connection is blocked!" msgstr "Этот контакт заблокирован!" -#: ../../Zotlabs/Module/Connedit.php:636 +#: ../../Zotlabs/Module/Connedit.php:644 msgid "Unignore" msgstr "Не игнорировать" -#: ../../Zotlabs/Module/Connedit.php:636 +#: ../../Zotlabs/Module/Connedit.php:644 #: ../../Zotlabs/Module/Connections.php:308 msgid "Ignore" msgstr "Игнорировать" -#: ../../Zotlabs/Module/Connedit.php:639 +#: ../../Zotlabs/Module/Connedit.php:647 msgid "Ignore (or Unignore) all inbound communications from this connection" msgstr "Игнорировать (или не игнорировать) все связи для этого контакта" -#: ../../Zotlabs/Module/Connedit.php:640 +#: ../../Zotlabs/Module/Connedit.php:648 msgid "This connection is ignored!" msgstr "Этот контакт игнорируется!" -#: ../../Zotlabs/Module/Connedit.php:644 +#: ../../Zotlabs/Module/Connedit.php:652 msgid "Unarchive" msgstr "Разархивировать" -#: ../../Zotlabs/Module/Connedit.php:644 +#: ../../Zotlabs/Module/Connedit.php:652 msgid "Archive" msgstr "Заархивировать" -#: ../../Zotlabs/Module/Connedit.php:647 +#: ../../Zotlabs/Module/Connedit.php:655 msgid "" "Archive (or Unarchive) this connection - mark channel dead but keep content" msgstr "Заархивировать (или разархивировать) этот контакт - пометить канал отключённым но сохранить содержимое" -#: ../../Zotlabs/Module/Connedit.php:648 +#: ../../Zotlabs/Module/Connedit.php:656 msgid "This connection is archived!" msgstr "Этот контакт заархивирован!" -#: ../../Zotlabs/Module/Connedit.php:652 +#: ../../Zotlabs/Module/Connedit.php:660 msgid "Unhide" msgstr "Показать" -#: ../../Zotlabs/Module/Connedit.php:652 +#: ../../Zotlabs/Module/Connedit.php:660 msgid "Hide" msgstr "Скрыть" -#: ../../Zotlabs/Module/Connedit.php:655 +#: ../../Zotlabs/Module/Connedit.php:663 msgid "Hide or Unhide this connection from your other connections" msgstr "Скрыть или показать этот контакт от / для остальных" -#: ../../Zotlabs/Module/Connedit.php:656 +#: ../../Zotlabs/Module/Connedit.php:664 msgid "This connection is hidden!" msgstr "Этот контакт скрыт!" -#: ../../Zotlabs/Module/Connedit.php:663 +#: ../../Zotlabs/Module/Connedit.php:671 msgid "Delete this connection" msgstr "Удалить этот контакт" -#: ../../Zotlabs/Module/Connedit.php:671 +#: ../../Zotlabs/Module/Connedit.php:679 msgid "Fetch Vcard" msgstr "Получить vCard" -#: ../../Zotlabs/Module/Connedit.php:674 +#: ../../Zotlabs/Module/Connedit.php:682 msgid "Fetch electronic calling card for this connection" msgstr "Получить электронную телефонную карточку для этого контакта" -#: ../../Zotlabs/Module/Connedit.php:685 +#: ../../Zotlabs/Module/Connedit.php:693 msgid "Open Individual Permissions section by default" msgstr "Открывать раздел \"Индивидуальные разрешения\" по умолчанию" -#: ../../Zotlabs/Module/Connedit.php:708 +#: ../../Zotlabs/Module/Connedit.php:716 msgid "Affinity" msgstr "Сходство" -#: ../../Zotlabs/Module/Connedit.php:711 +#: ../../Zotlabs/Module/Connedit.php:719 msgid "Open Set Affinity section by default" msgstr "Открыть секцию установления сходства по умолчанию" -#: ../../Zotlabs/Module/Connedit.php:715 ../../Zotlabs/Widget/Affinity.php:22 +#: ../../Zotlabs/Module/Connedit.php:723 ../../Zotlabs/Widget/Affinity.php:27 msgid "Me" msgstr "Я" -#: ../../Zotlabs/Module/Connedit.php:716 ../../Zotlabs/Widget/Affinity.php:23 +#: ../../Zotlabs/Module/Connedit.php:724 ../../Zotlabs/Widget/Affinity.php:28 msgid "Family" msgstr "Семья" -#: ../../Zotlabs/Module/Connedit.php:718 ../../Zotlabs/Widget/Affinity.php:25 +#: ../../Zotlabs/Module/Connedit.php:726 ../../Zotlabs/Widget/Affinity.php:30 msgid "Acquaintances" msgstr "Знакомые" -#: ../../Zotlabs/Module/Connedit.php:719 +#: ../../Zotlabs/Module/Connedit.php:727 #: ../../Zotlabs/Module/Connections.php:97 #: ../../Zotlabs/Module/Connections.php:111 -#: ../../Zotlabs/Widget/Affinity.php:26 +#: ../../Zotlabs/Widget/Affinity.php:31 msgid "All" msgstr "Все" -#: ../../Zotlabs/Module/Connedit.php:745 +#: ../../Zotlabs/Module/Connedit.php:756 msgid "Filter" msgstr "Фильтр" -#: ../../Zotlabs/Module/Connedit.php:748 +#: ../../Zotlabs/Module/Connedit.php:759 msgid "Open Custom Filter section by default" msgstr "Открывать секцию \"Настраиваемый фильтр\" по умолчанию" -#: ../../Zotlabs/Module/Connedit.php:785 +#: ../../Zotlabs/Module/Connedit.php:796 msgid "Approve this connection" msgstr "Утвердить этот контакт" -#: ../../Zotlabs/Module/Connedit.php:785 +#: ../../Zotlabs/Module/Connedit.php:796 msgid "Accept connection to allow communication" msgstr "Принять контакт чтобы разрешить связь" -#: ../../Zotlabs/Module/Connedit.php:790 +#: ../../Zotlabs/Module/Connedit.php:801 msgid "Set Affinity" msgstr "Установить сходство" -#: ../../Zotlabs/Module/Connedit.php:793 +#: ../../Zotlabs/Module/Connedit.php:804 msgid "Set Profile" msgstr "Установить профиль" -#: ../../Zotlabs/Module/Connedit.php:796 +#: ../../Zotlabs/Module/Connedit.php:807 msgid "Set Affinity & Profile" msgstr "Установить сходство и профиль" -#: ../../Zotlabs/Module/Connedit.php:844 +#: ../../Zotlabs/Module/Connedit.php:855 msgid "This connection is unreachable from this location." msgstr "Этот контакт недоступен для данного местоположения" -#: ../../Zotlabs/Module/Connedit.php:845 +#: ../../Zotlabs/Module/Connedit.php:856 msgid "This connection may be unreachable from other channel locations." msgstr "Этот контакт может быть недоступен из других мест размещения канала" -#: ../../Zotlabs/Module/Connedit.php:847 +#: ../../Zotlabs/Module/Connedit.php:858 msgid "Location independence is not supported by their network." msgstr "Независимое местоположение не поддерживается их сетью." -#: ../../Zotlabs/Module/Connedit.php:853 +#: ../../Zotlabs/Module/Connedit.php:864 msgid "" "This connection is unreachable from this location. Location independence is " "not supported by their network." msgstr "Этот контакт недоступен из данного местоположения. Независимое местоположение не поддерживается их сетью." -#: ../../Zotlabs/Module/Connedit.php:857 +#: ../../Zotlabs/Module/Connedit.php:868 msgid "Connection requests will be approved without your interaction" msgstr "Запросы контактов будут одобрены без вашего участия" -#: ../../Zotlabs/Module/Connedit.php:866 +#: ../../Zotlabs/Module/Connedit.php:877 msgid "This connection's primary address is" msgstr "Главный адрес это контакта" -#: ../../Zotlabs/Module/Connedit.php:867 +#: ../../Zotlabs/Module/Connedit.php:878 msgid "Available locations:" msgstr "Доступные расположения:" -#: ../../Zotlabs/Module/Connedit.php:873 +#: ../../Zotlabs/Module/Connedit.php:884 msgid "Connection Tools" msgstr "Инструменты контактов" -#: ../../Zotlabs/Module/Connedit.php:875 +#: ../../Zotlabs/Module/Connedit.php:886 msgid "Slide to adjust your degree of friendship" msgstr "Прокрутить для настройки степени дружбы" -#: ../../Zotlabs/Module/Connedit.php:877 +#: ../../Zotlabs/Module/Connedit.php:888 msgid "Slide to adjust your rating" msgstr "Прокрутить для настройки оценки" -#: ../../Zotlabs/Module/Connedit.php:878 ../../Zotlabs/Module/Connedit.php:883 +#: ../../Zotlabs/Module/Connedit.php:889 ../../Zotlabs/Module/Connedit.php:894 msgid "Optionally explain your rating" msgstr "Объясните свою оценку (не обязательно)" -#: ../../Zotlabs/Module/Connedit.php:880 +#: ../../Zotlabs/Module/Connedit.php:891 msgid "Custom Filter" msgstr "Настраиваемый фильтр" -#: ../../Zotlabs/Module/Connedit.php:881 +#: ../../Zotlabs/Module/Connedit.php:892 msgid "Only import posts with this text" msgstr "Импортировать публикации только с этим текстом" -#: ../../Zotlabs/Module/Connedit.php:882 +#: ../../Zotlabs/Module/Connedit.php:893 msgid "Do not import posts with this text" msgstr "Не импортировать публикации с этим текстом" -#: ../../Zotlabs/Module/Connedit.php:884 +#: ../../Zotlabs/Module/Connedit.php:895 msgid "This information is public!" msgstr "Эта информация общедоступна!" -#: ../../Zotlabs/Module/Connedit.php:889 +#: ../../Zotlabs/Module/Connedit.php:900 msgid "Connection Pending Approval" msgstr "Ожидающие подтверждения контактов" -#: ../../Zotlabs/Module/Connedit.php:894 +#: ../../Zotlabs/Module/Connedit.php:905 #, php-format msgid "" "Please choose the profile you would like to display to %s when viewing your " "profile securely." msgstr "Пожалуйста, выберите профиль который вы хотит показывать в %s при безопасном просмотре." -#: ../../Zotlabs/Module/Connedit.php:901 +#: ../../Zotlabs/Module/Connedit.php:912 msgid "" "Some permissions may be inherited from your channel's privacy settings, which have higher priority than " @@ -9965,11 +9976,11 @@ msgid "" "any impact unless the inherited setting changes." msgstr "Некоторые разрешения могут быть унаследованы из настроек приватности вашего канала, которые могут иметь более высокий приоритет чем индивидуальные. Вы можете изменить эти настройки, однако они не будут применены до изменения переданных по наследству настроек." -#: ../../Zotlabs/Module/Connedit.php:902 +#: ../../Zotlabs/Module/Connedit.php:913 msgid "Last update:" msgstr "Последнее обновление:" -#: ../../Zotlabs/Module/Connedit.php:910 +#: ../../Zotlabs/Module/Connedit.php:921 msgid "Details" msgstr "Сведения" @@ -9981,60 +9992,60 @@ msgstr "Группа безопасности создана." msgid "Could not create privacy group." msgstr "Не удалось создать группу безопасности." -#: ../../Zotlabs/Module/Group.php:77 +#: ../../Zotlabs/Module/Group.php:80 msgid "Privacy group updated." msgstr "Группа безопасности обновлена." -#: ../../Zotlabs/Module/Group.php:101 +#: ../../Zotlabs/Module/Group.php:106 msgid "Privacy Groups App" msgstr "Приложение \"Группы безопасности\"" -#: ../../Zotlabs/Module/Group.php:102 +#: ../../Zotlabs/Module/Group.php:107 msgid "Management of privacy groups" msgstr "Управление группами безопасности." -#: ../../Zotlabs/Module/Group.php:133 +#: ../../Zotlabs/Module/Group.php:142 msgid "Add Group" msgstr "Добавить группу" -#: ../../Zotlabs/Module/Group.php:137 +#: ../../Zotlabs/Module/Group.php:146 msgid "Privacy group name" msgstr "Имя группы безопасности" -#: ../../Zotlabs/Module/Group.php:138 ../../Zotlabs/Module/Group.php:239 +#: ../../Zotlabs/Module/Group.php:147 ../../Zotlabs/Module/Group.php:256 msgid "Members are visible to other channels" msgstr "Участники канала видимые для остальных" -#: ../../Zotlabs/Module/Group.php:170 +#: ../../Zotlabs/Module/Group.php:182 msgid "Privacy group removed." msgstr "Группа безопасности удалена." -#: ../../Zotlabs/Module/Group.php:172 +#: ../../Zotlabs/Module/Group.php:185 msgid "Unable to remove privacy group." msgstr "Ну удалось удалить группу безопасности." -#: ../../Zotlabs/Module/Group.php:234 +#: ../../Zotlabs/Module/Group.php:251 #, php-format msgid "Privacy Group: %s" msgstr "Группа безопасности: %s" -#: ../../Zotlabs/Module/Group.php:236 +#: ../../Zotlabs/Module/Group.php:253 msgid "Privacy group name: " msgstr "Название группы безопасности: " -#: ../../Zotlabs/Module/Group.php:241 +#: ../../Zotlabs/Module/Group.php:258 msgid "Delete Group" msgstr "Удалить группу" -#: ../../Zotlabs/Module/Group.php:251 +#: ../../Zotlabs/Module/Group.php:269 msgid "Group members" msgstr "Члены группы" -#: ../../Zotlabs/Module/Group.php:253 +#: ../../Zotlabs/Module/Group.php:271 msgid "Not in this group" msgstr "Не в этой группе" -#: ../../Zotlabs/Module/Group.php:285 +#: ../../Zotlabs/Module/Group.php:303 msgid "Click a channel to toggle membership" msgstr "Нажмите на канал для просмотра членства" @@ -10173,7 +10184,7 @@ msgstr "Приложение \"Настроение\"" msgid "Set your current mood and tell your friends" msgstr "Установить текущее настроение и рассказать друзьям" -#: ../../Zotlabs/Module/Mood.php:154 ../../Zotlabs/Lib/Apps.php:325 +#: ../../Zotlabs/Module/Mood.php:154 ../../Zotlabs/Lib/Apps.php:327 msgid "Mood" msgstr "Настроение" @@ -10280,15 +10291,15 @@ msgstr "или посетите" msgid "3. Click [Connect]" msgstr "Нажать [Подключиться]" -#: ../../Zotlabs/Module/Articles.php:43 +#: ../../Zotlabs/Module/Articles.php:51 msgid "Articles App" msgstr "Приложение \"Статьи\"" -#: ../../Zotlabs/Module/Articles.php:44 +#: ../../Zotlabs/Module/Articles.php:52 msgid "Create interactive articles" msgstr "Создать интерактивные статьи" -#: ../../Zotlabs/Module/Articles.php:107 +#: ../../Zotlabs/Module/Articles.php:115 msgid "Add Article" msgstr "Добавить статью" @@ -10399,7 +10410,7 @@ msgstr "Системный шаблон" #: ../../Zotlabs/Module/Wiki.php:35 #: ../../extend/addon/hzaddons/flashcards/Mod_Flashcards.php:34 -#: ../../extend/addon/hzaddons/cart/cart.php:1297 +#: ../../extend/addon/hzaddons/cart/cart.php:1298 msgid "Profile Unavailable." msgstr "Профиль недоступен." @@ -10415,7 +10426,7 @@ msgstr "Предоставьте Wiki для вашего канала" #: ../../extend/addon/hzaddons/cart/submodules/paypalbutton.php:456 #: ../../extend/addon/hzaddons/cart/myshop.php:37 #: ../../extend/addon/hzaddons/cart/manual_payments.php:93 -#: ../../extend/addon/hzaddons/cart/cart.php:1443 +#: ../../extend/addon/hzaddons/cart/cart.php:1444 msgid "Invalid channel" msgstr "Недействительный канал" @@ -10793,15 +10804,15 @@ msgstr "Домашняя страница проекта" msgid "Developer homepage" msgstr "Домашняя страница разработчика" -#: ../../Zotlabs/Module/Cards.php:46 +#: ../../Zotlabs/Module/Cards.php:51 msgid "Cards App" msgstr "Приложение \"Карточки\"" -#: ../../Zotlabs/Module/Cards.php:47 +#: ../../Zotlabs/Module/Cards.php:52 msgid "Create personal planning cards" msgstr "Создать личные карточки планирования" -#: ../../Zotlabs/Module/Cards.php:108 +#: ../../Zotlabs/Module/Cards.php:112 msgid "Add Card" msgstr "Добавить карточку" @@ -10841,7 +10852,7 @@ msgstr "Невозможно найти ваш сервер" msgid "Post successful." msgstr "Успешно опубликовано." -#: ../../Zotlabs/Module/Rmagic.php:35 +#: ../../Zotlabs/Module/Rmagic.php:44 msgid "Authentication failed." msgstr "Ошибка аутентификации." @@ -10927,7 +10938,7 @@ msgstr "Просмотр публичного потока. Предупрежд msgid "Forums" msgstr "Форумы" -#: ../../Zotlabs/Widget/Notes.php:21 ../../Zotlabs/Lib/Apps.php:346 +#: ../../Zotlabs/Widget/Notes.php:21 ../../Zotlabs/Lib/Apps.php:348 msgid "Notes" msgstr "Заметки" @@ -11329,7 +11340,7 @@ msgstr "Управление местоположением" msgid "Member registrations waiting for confirmation" msgstr "Регистрации участников, ожидающие подверждения" -#: ../../Zotlabs/Widget/Admin.php:26 ../../Zotlabs/Lib/Apps.php:333 +#: ../../Zotlabs/Widget/Admin.php:26 ../../Zotlabs/Lib/Apps.php:335 msgid "Features" msgstr "Функции" @@ -11423,7 +11434,7 @@ msgstr "Участники чата" msgid "Click to show more" msgstr "Нажмите чтобы показать больше" -#: ../../Zotlabs/Widget/Affinity.php:45 +#: ../../Zotlabs/Widget/Affinity.php:50 msgid "Refresh" msgstr "Обновить" @@ -11988,138 +11999,138 @@ msgctxt "permcat" msgid "publisher" msgstr "издатель" -#: ../../Zotlabs/Lib/Apps.php:301 +#: ../../Zotlabs/Lib/Apps.php:303 msgid "Apps" msgstr "Приложения" -#: ../../Zotlabs/Lib/Apps.php:304 +#: ../../Zotlabs/Lib/Apps.php:306 msgid "Site Admin" msgstr "Администратор сайта" -#: ../../Zotlabs/Lib/Apps.php:305 +#: ../../Zotlabs/Lib/Apps.php:307 #: ../../extend/addon/hzaddons/buglink/buglink.php:16 msgid "Report Bug" msgstr "Сообщить об ошибке" -#: ../../Zotlabs/Lib/Apps.php:309 +#: ../../Zotlabs/Lib/Apps.php:311 msgid "Remote Diagnostics" msgstr "Удалённая диагностика" -#: ../../Zotlabs/Lib/Apps.php:313 +#: ../../Zotlabs/Lib/Apps.php:315 msgid "Stream" msgstr "Поток" -#: ../../Zotlabs/Lib/Apps.php:324 +#: ../../Zotlabs/Lib/Apps.php:326 msgid "Mail" msgstr "Переписка" -#: ../../Zotlabs/Lib/Apps.php:327 +#: ../../Zotlabs/Lib/Apps.php:329 msgid "Chat" msgstr "Чат" -#: ../../Zotlabs/Lib/Apps.php:329 +#: ../../Zotlabs/Lib/Apps.php:331 msgid "Probe" msgstr "Проба" -#: ../../Zotlabs/Lib/Apps.php:330 +#: ../../Zotlabs/Lib/Apps.php:332 msgid "Suggest" msgstr "Предложить" -#: ../../Zotlabs/Lib/Apps.php:331 +#: ../../Zotlabs/Lib/Apps.php:333 msgid "Random Channel" msgstr "Случайный канал" -#: ../../Zotlabs/Lib/Apps.php:332 +#: ../../Zotlabs/Lib/Apps.php:334 msgid "Invite" msgstr "Пригласить" -#: ../../Zotlabs/Lib/Apps.php:334 +#: ../../Zotlabs/Lib/Apps.php:336 #: ../../extend/addon/hzaddons/openid/MysqlProvider.php:69 msgid "Language" msgstr "Язык" -#: ../../Zotlabs/Lib/Apps.php:335 +#: ../../Zotlabs/Lib/Apps.php:337 msgid "Post" msgstr "Публикация" -#: ../../Zotlabs/Lib/Apps.php:336 +#: ../../Zotlabs/Lib/Apps.php:338 #: ../../extend/addon/hzaddons/openid/MysqlProvider.php:58 #: ../../extend/addon/hzaddons/openid/MysqlProvider.php:59 #: ../../extend/addon/hzaddons/openid/MysqlProvider.php:60 msgid "Profile Photo" msgstr "Фотография профиля" -#: ../../Zotlabs/Lib/Apps.php:340 +#: ../../Zotlabs/Lib/Apps.php:342 msgid "Notifications" msgstr "Оповещения" -#: ../../Zotlabs/Lib/Apps.php:341 +#: ../../Zotlabs/Lib/Apps.php:343 msgid "Order Apps" msgstr "Порядок приложений" -#: ../../Zotlabs/Lib/Apps.php:343 +#: ../../Zotlabs/Lib/Apps.php:345 msgid "CardDAV" msgstr "" -#: ../../Zotlabs/Lib/Apps.php:345 +#: ../../Zotlabs/Lib/Apps.php:347 msgid "Guest Access" msgstr "Гостевой доступ" -#: ../../Zotlabs/Lib/Apps.php:347 +#: ../../Zotlabs/Lib/Apps.php:349 msgid "OAuth Apps Manager" msgstr "Менеджер OAuth" -#: ../../Zotlabs/Lib/Apps.php:348 +#: ../../Zotlabs/Lib/Apps.php:350 msgid "OAuth2 Apps Manager" msgstr "Менеджер OAuth2" -#: ../../Zotlabs/Lib/Apps.php:349 +#: ../../Zotlabs/Lib/Apps.php:351 msgid "PDL Editor" msgstr "Редактор PDL" -#: ../../Zotlabs/Lib/Apps.php:351 +#: ../../Zotlabs/Lib/Apps.php:353 msgid "Premium Channel" msgstr "Премиальный канал" -#: ../../Zotlabs/Lib/Apps.php:353 +#: ../../Zotlabs/Lib/Apps.php:355 msgid "My Chatrooms" msgstr "Мои чаты" -#: ../../Zotlabs/Lib/Apps.php:354 +#: ../../Zotlabs/Lib/Apps.php:356 msgid "Channel Export" msgstr "Экспорт канала" -#: ../../Zotlabs/Lib/Apps.php:531 +#: ../../Zotlabs/Lib/Apps.php:533 msgid "Purchase" msgstr "Купить" -#: ../../Zotlabs/Lib/Apps.php:536 +#: ../../Zotlabs/Lib/Apps.php:538 msgid "Undelete" msgstr "Восстановить" -#: ../../Zotlabs/Lib/Apps.php:545 +#: ../../Zotlabs/Lib/Apps.php:547 msgid "Add to app-tray" msgstr "Добавить в app-tray" -#: ../../Zotlabs/Lib/Apps.php:546 +#: ../../Zotlabs/Lib/Apps.php:548 msgid "Remove from app-tray" msgstr "Удалить из app-tray" -#: ../../Zotlabs/Lib/Apps.php:547 +#: ../../Zotlabs/Lib/Apps.php:549 msgid "Pin to navbar" msgstr "Добавить на панель навигации" -#: ../../Zotlabs/Lib/Apps.php:548 +#: ../../Zotlabs/Lib/Apps.php:550 msgid "Unpin from navbar" msgstr "Удалить с панели навигации" #: ../../Zotlabs/Lib/ThreadItem.php:188 msgid "I will attend" -msgstr "Я буду присутствовать" +msgstr "Я буду участвовать" #: ../../Zotlabs/Lib/ThreadItem.php:188 msgid "I will not attend" -msgstr "Я не буду присутствовать" +msgstr "Я не буду участвовать" #: ../../Zotlabs/Lib/ThreadItem.php:188 msgid "I might attend" @@ -12304,6 +12315,36 @@ msgstr "Это настройка по умолчанию для тех, кто msgid "This is your default setting for the audience of your webpages" msgstr "Это настройка по умолчанию для аудитории ваших веб-страниц" +#: ../../Zotlabs/Lib/Activity.php:1450 +#, php-format +msgid "Likes %1$s's %2$s" +msgstr "Нравится %1$s %2$s" + +#: ../../Zotlabs/Lib/Activity.php:1453 +#, php-format +msgid "Doesn't like %1$s's %2$s" +msgstr "Не нравится %1$s %2$s" + +#: ../../Zotlabs/Lib/Activity.php:1456 +#, php-format +msgid "Will attend %1$s's %2$s" +msgstr "Примет участие %1$s %2$s" + +#: ../../Zotlabs/Lib/Activity.php:1459 +#, php-format +msgid "Will not attend %1$s's %2$s" +msgstr "Не примет участие %1$s %2$s" + +#: ../../Zotlabs/Lib/Activity.php:1462 +#, php-format +msgid "May attend %1$s's %2$s" +msgstr "Возможно примет участие %1$s %2$s" + +#: ../../Zotlabs/Lib/Activity.php:1465 +#, php-format +msgid "🔁 Repeated %1$s's %2$s" +msgstr "🔁 Повторил %1$s %2$s" + #: ../../Zotlabs/Lib/Techlevels.php:10 msgid "0. Beginner/Basic" msgstr "Начинающий / Базовый" @@ -12515,16 +12556,16 @@ msgstr "Максимальное количество для импорта" msgid "0 or blank to import all available" msgstr "0 или пусто для импорта всех доступных" -#: ../../extend/addon/hzaddons/gallery/Mod_Gallery.php:57 +#: ../../extend/addon/hzaddons/gallery/Mod_Gallery.php:59 msgid "A simple gallery for your photo albums" msgstr "Простая галлерея для ваших фотоальбомов" -#: ../../extend/addon/hzaddons/gallery/Mod_Gallery.php:115 -#: ../../extend/addon/hzaddons/gallery/gallery.php:28 +#: ../../extend/addon/hzaddons/gallery/Mod_Gallery.php:135 +#: ../../extend/addon/hzaddons/gallery/gallery.php:38 msgid "Gallery" msgstr "Галерея" -#: ../../extend/addon/hzaddons/gallery/gallery.php:31 +#: ../../extend/addon/hzaddons/gallery/gallery.php:41 msgid "Photo Gallery" msgstr "Фотогалерея" @@ -13742,7 +13783,7 @@ msgstr "Если включено, ваши общедоступные публ #: ../../extend/addon/hzaddons/statusnet/Mod_Statusnet.php:303 msgid "GNU-Social Crosspost Connector" -msgstr "" +msgstr "Подключение пересылки публикаций GNU Social" #: ../../extend/addon/hzaddons/statusnet/statusnet.php:145 msgid "Post to GNU social" @@ -14006,7 +14047,7 @@ msgid "Base Merchant Currency" msgstr "Основная торговая валюта" #: ../../extend/addon/hzaddons/cart/Settings/Cart.php:111 -#: ../../extend/addon/hzaddons/cart/cart.php:1262 +#: ../../extend/addon/hzaddons/cart/cart.php:1263 msgid "Cart Settings" msgstr "Настройки карточек" @@ -14160,7 +14201,7 @@ msgstr "Кнопка Paypal для платежей настроена непр #: ../../extend/addon/hzaddons/cart/submodules/paypalbutton.php:392 #: ../../extend/addon/hzaddons/cart/manual_payments.php:68 -#: ../../extend/addon/hzaddons/cart/cart.php:1465 +#: ../../extend/addon/hzaddons/cart/cart.php:1466 msgid "Order not found." msgstr "Заказ не найден." @@ -14173,7 +14214,7 @@ msgid "Access Denied." msgstr "Доступ запрещён." #: ../../extend/addon/hzaddons/cart/myshop.php:111 -#: ../../extend/addon/hzaddons/cart/cart.php:1333 +#: ../../extend/addon/hzaddons/cart/cart.php:1334 msgid "Order Not Found" msgstr "Заказ не найден" @@ -14200,49 +14241,49 @@ msgstr "Завершено" msgid "DB Cleanup Failure" msgstr "Сбой очистки базы данных" -#: ../../extend/addon/hzaddons/cart/cart.php:564 +#: ../../extend/addon/hzaddons/cart/cart.php:565 msgid "[cart] Item Added" msgstr "[cart] Элемент добавлен" -#: ../../extend/addon/hzaddons/cart/cart.php:952 +#: ../../extend/addon/hzaddons/cart/cart.php:953 msgid "Order already checked out." msgstr "Заказ уже проверен." -#: ../../extend/addon/hzaddons/cart/cart.php:1255 +#: ../../extend/addon/hzaddons/cart/cart.php:1256 msgid "Drop database tables when uninstalling." msgstr "Сбросить таблицы базы данных при деинсталляции" -#: ../../extend/addon/hzaddons/cart/cart.php:1274 -#: ../../extend/addon/hzaddons/cart/cart.php:1277 +#: ../../extend/addon/hzaddons/cart/cart.php:1275 +#: ../../extend/addon/hzaddons/cart/cart.php:1278 msgid "Shop" msgstr "Магазин" -#: ../../extend/addon/hzaddons/cart/cart.php:1394 +#: ../../extend/addon/hzaddons/cart/cart.php:1395 msgid "Cart utilities for orders and payments" msgstr "Утилиты карточек для заказов и платежей" -#: ../../extend/addon/hzaddons/cart/cart.php:1432 +#: ../../extend/addon/hzaddons/cart/cart.php:1433 msgid "You must be logged into the Grid to shop." msgstr "Вы должны быть в сети для доступа к магазину" -#: ../../extend/addon/hzaddons/cart/cart.php:1473 +#: ../../extend/addon/hzaddons/cart/cart.php:1474 msgid "Access denied." msgstr "Доступ запрещён." -#: ../../extend/addon/hzaddons/cart/cart.php:1525 -#: ../../extend/addon/hzaddons/cart/cart.php:1668 +#: ../../extend/addon/hzaddons/cart/cart.php:1526 +#: ../../extend/addon/hzaddons/cart/cart.php:1669 msgid "No Order Found" msgstr "Нет найденных заказов" -#: ../../extend/addon/hzaddons/cart/cart.php:1534 +#: ../../extend/addon/hzaddons/cart/cart.php:1535 msgid "An unknown error has occurred Please start again." msgstr "Произошла неизвестная ошибка. Пожалуйста, начните снова." -#: ../../extend/addon/hzaddons/cart/cart.php:1701 +#: ../../extend/addon/hzaddons/cart/cart.php:1702 msgid "Invalid Payment Type. Please start again." msgstr "Недействительный тип платежа. Пожалуйста, начните снова." -#: ../../extend/addon/hzaddons/cart/cart.php:1708 +#: ../../extend/addon/hzaddons/cart/cart.php:1709 msgid "Order not found" msgstr "Заказ не найден" @@ -14439,6 +14480,89 @@ msgstr "Протокол GNU-Social не поддерживает независ msgid "GNU-Social Protocol" msgstr "Протокол GNU-Social" +#: ../../extend/addon/hzaddons/totp/Mod_Totp.php:23 +msgid "TOTP Two-Step Verification" +msgstr "Двухэтапная верификация TOTP" + +#: ../../extend/addon/hzaddons/totp/Mod_Totp.php:24 +msgid "Enter the 2-step verification generated by your authenticator app:" +msgstr "Введите код проверки, созданный вашим приложением для аутентификации" + +#: ../../extend/addon/hzaddons/totp/Mod_Totp.php:25 +msgid "Success!" +msgstr "Успех!" + +#: ../../extend/addon/hzaddons/totp/Mod_Totp.php:26 +msgid "Invalid code, please try again." +msgstr "Неверный код. Пожалуйста, попробуйте ещё раз." + +#: ../../extend/addon/hzaddons/totp/Mod_Totp.php:27 +msgid "Too many invalid codes..." +msgstr "Слишком много неверных кодов..." + +#: ../../extend/addon/hzaddons/totp/Mod_Totp.php:28 +msgid "Verify" +msgstr "Проверить" + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:90 +msgid "" +"You haven't set a TOTP secret yet.\n" +"Please click the button below to generate one and register this site\n" +"with your preferred authenticator app." +msgstr "Вы еще не установили секретный код TOTP. Пожалуйста, нажмите на кнопку ниже, чтобы сгенерировать его и зарегистрировать этот сайт в предпочитаемом вами приложении для аутентификации." + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:93 +msgid "Your TOTP secret is" +msgstr "Ваш секретный код TOTP" + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:94 +msgid "" +"Be sure to save it somewhere in case you lose or replace your mobile " +"device.\n" +"Use your mobile device to scan the QR code below to register this site\n" +"with your preferred authenticator app." +msgstr "Обязательно сохраните его где-нибудь на случай потери или замены мобильного устройства. С помощью мобильного устройства отсканируйте приведенный ниже QR-код, чтобы зарегистрировать этот сайт в предпочитаемом вами приложении для аутентификации." + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:99 +msgid "Test" +msgstr "Тест" + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:100 +msgid "Generate New Secret" +msgstr "Сгенерировать новый секретный код" + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:101 +msgid "Go" +msgstr "Вперёд" + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:102 +msgid "Enter your password" +msgstr "Введите ваш пароль" + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:103 +msgid "enter TOTP code from your device" +msgstr "введите код TOTP из вашего устройства" + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:104 +msgid "Pass!" +msgstr "Принято!" + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:105 +msgid "Fail" +msgstr "Отказано" + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:106 +msgid "Incorrect password, try again." +msgstr "Неверный пароль, попробуйте снова." + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:107 +msgid "Record your new TOTP secret and rescan the QR code above." +msgstr "Запишите ваш секретный код TOTP и повторно отсканируйте приведенный ниже QR-код." + +#: ../../extend/addon/hzaddons/totp/Settings/Totp.php:115 +msgid "TOTP Settings" +msgstr "Настройки TOTP" + #: ../../extend/addon/hzaddons/pageheader/pageheader.php:43 msgid "Message to display on every page on this server" msgstr "Отображаемое сообщение на каждой странице на этом сервере." @@ -14695,6 +14819,18 @@ msgstr "Отправить ZID" msgid "Who likes me?" msgstr "Кому я нравлюсь?" +#: ../../extend/addon/hzaddons/queueworker/Mod_Queueworker.php:73 +msgid "Max queueworker threads" +msgstr "Макс. количество обработчиков очереди" + +#: ../../extend/addon/hzaddons/queueworker/Mod_Queueworker.php:87 +msgid "Assume workers dead after ___ seconds" +msgstr "Считать обработчики неактивными через секунд" + +#: ../../extend/addon/hzaddons/queueworker/Mod_Queueworker.php:99 +msgid "Queueworker Settings" +msgstr "Настройки обработчика очереди" + #: ../../extend/addon/hzaddons/moremoods/moremoods.php:19 msgid "lonely" msgstr "одинокий" @@ -14918,7 +15054,7 @@ msgstr "Необходим канал." #: ../../extend/addon/hzaddons/redred/Mod_Redred.php:38 msgid "Hubzilla Crosspost Connector Settings saved." -msgstr "" +msgstr "Настройки пересылки публикаций Hubzilla сохранены." #: ../../extend/addon/hzaddons/redred/Mod_Redred.php:51 msgid "Relay public postings to another Hubzilla channel" @@ -14942,11 +15078,11 @@ msgstr "Название канала Hubzilla" #: ../../extend/addon/hzaddons/redred/Mod_Redred.php:87 msgid "Hubzilla Crosspost Connector" -msgstr "" +msgstr "Пересылка публикаций Hubzilla" #: ../../extend/addon/hzaddons/redred/redred.php:50 msgid "Post to Hubzilla" -msgstr "" +msgstr "Опубликовать в Hubzilla" #: ../../extend/addon/hzaddons/pubcrawl/Mod_Pubcrawl.php:25 msgid "ActivityPub Protocol Settings updated." @@ -15129,7 +15265,3 @@ msgstr "" #: ../../extend/addon/hzaddons/opensearch/opensearch.php:43 msgid "Search $Projectname" msgstr "Поиск $Projectname" - -#: ../../store/[data]/smarty3/compiled/3fbe720b52221cc66640ba6ea030406a047aa52a_0.file.cover_photo.tpl.php:127 -msgid "Cover Photo" -msgstr "" -- cgit v1.2.3 From 3277595366afb36e779f140145dc76e0080fa906 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 25 Jan 2019 19:56:15 +0100 Subject: Update hstrings.php --- view/ru/hstrings.php | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/view/ru/hstrings.php b/view/ru/hstrings.php index 30dd01269..ee4c31619 100644 --- a/view/ru/hstrings.php +++ b/view/ru/hstrings.php @@ -729,7 +729,6 @@ App::$strings["Directory Options"] = "Параметры каталога"; App::$strings["Safe Mode"] = "Безопасный режим"; App::$strings["Public Forums Only"] = "Только публичные форумы"; App::$strings["This Website Only"] = "Только этот веб-сайт"; -App::$strings["view full size"] = "посмотреть в полный размер"; App::$strings["Friendica"] = ""; App::$strings["OStatus"] = ""; App::$strings["GNU-Social"] = ""; @@ -1549,6 +1548,8 @@ App::$strings["Default maximum affinity level"] = "Максимальный ур App::$strings["0-99 default 99"] = "0-99 (по умолчанию 99)"; App::$strings["Default minimum affinity level"] = "Минимальный уровень сходства по умолчанию."; App::$strings["0-99 - default 0"] = "0-99 (по умолчанию 0)"; +App::$strings["Always reset on new page visit."] = "Всегда сбрасывать при посещении новой страницы."; +App::$strings["default: yes"] = "по-умолчанию: да"; App::$strings["Affinity Slider Settings"] = "Настройки слайдера сходства"; App::$strings["Addon Settings"] = "Настройки расширений"; App::$strings["Please save/submit changes to any panel before opening another."] = "Пожалуйста сохраните / отправьте изменения на панели прежде чем открывать другую."; @@ -1788,6 +1789,7 @@ App::$strings["Unable to check command line PHP, as shell_exec() is disabled. Th App::$strings["The command line version of PHP on your system does not have \"register_argc_argv\" enabled."] = "В консольной версии PHP в вашей системе отключена опция \"register_argc_argv\"."; App::$strings["This is required for message delivery to work."] = "Это необходимо для функционирования доставки сообщений."; App::$strings["PHP register_argc_argv"] = ""; +App::$strings["This is not sufficient to upload larger images or files. You should be able to upload at least 4 MB at once."] = "Этого недостаточно для загрузки больших изображений или файлов. Вы должны иметь возможность загрузить как минимум 4 Мб за раз."; App::$strings["Your max allowed total upload size is set to %s. Maximum size of one file to upload is set to %s. You are allowed to upload up to %d files at once."] = "Максимально разрешённый общий размер загрузок установлен в %s. Максимальный размер одной загрузки установлен в %s. Вам разрешено загружать до %d файлов за один приём."; App::$strings["You can adjust these settings in the server php.ini file."] = "Вы можете изменить эти настройки в файле php.ini на сервере."; App::$strings["PHP upload limits"] = "Максимальный размер загрузки в PHP"; @@ -2757,8 +2759,8 @@ App::$strings["Add to app-tray"] = "Добавить в app-tray"; App::$strings["Remove from app-tray"] = "Удалить из app-tray"; App::$strings["Pin to navbar"] = "Добавить на панель навигации"; App::$strings["Unpin from navbar"] = "Удалить с панели навигации"; -App::$strings["I will attend"] = "Я буду присутствовать"; -App::$strings["I will not attend"] = "Я не буду присутствовать"; +App::$strings["I will attend"] = "Я буду участвовать"; +App::$strings["I will not attend"] = "Я не буду участвовать"; App::$strings["I might attend"] = "Я возможно буду присутствовать"; App::$strings["I agree"] = "Я согласен"; App::$strings["I disagree"] = "Я не согласен"; @@ -2806,6 +2808,12 @@ App::$strings["This is your default setting for who can view your default channe App::$strings["This is your default setting for who can view your connections"] = "Это настройка по умолчанию для тех, кто может просматривать ваши контакты"; App::$strings["This is your default setting for who can view your file storage and photos"] = "Это настройка по умолчанию для тех, кто может просматривать ваше хранилище файлов и фотографий"; App::$strings["This is your default setting for the audience of your webpages"] = "Это настройка по умолчанию для аудитории ваших веб-страниц"; +App::$strings["Likes %1\$s's %2\$s"] = "Нравится %1\$s %2\$s"; +App::$strings["Doesn't like %1\$s's %2\$s"] = "Не нравится %1\$s %2\$s"; +App::$strings["Will attend %1\$s's %2\$s"] = "Примет участие %1\$s %2\$s"; +App::$strings["Will not attend %1\$s's %2\$s"] = "Не примет участие %1\$s %2\$s"; +App::$strings["May attend %1\$s's %2\$s"] = "Возможно примет участие %1\$s %2\$s"; +App::$strings["🔁 Repeated %1\$s's %2\$s"] = "🔁 Повторил %1\$s %2\$s"; App::$strings["0. Beginner/Basic"] = "Начинающий / Базовый"; App::$strings["1. Novice - not skilled but willing to learn"] = "1. Новичок - не опытный, но желающий учиться"; App::$strings["2. Intermediate - somewhat comfortable"] = "2. Промежуточный - более удобный"; @@ -3133,7 +3141,7 @@ App::$strings["Cancel GNU social Connection"] = "Отменить подключ App::$strings["Note: Due your privacy settings (Hide your profile details from unknown viewers?) the link potentially included in public postings relayed to GNU social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted."] = "Замечание: Из-за настроек конфиденциальности (скрыть данные своего профиля от неизвестных зрителей?) cсылка, потенциально включенная в общедоступные публикации, переданные в GNU social, приведет посетителя к пустой странице, информирующей его о том, что доступ к вашему профилю был ограничен."; App::$strings["Post to GNU social by default"] = "Публиковать в GNU social по умолчанию"; App::$strings["If enabled your public postings will be posted to the associated GNU-social account by default"] = "Если включено, ваши общедоступные публикации будут опубликованы в связанной учётной записи GNU social по умолчанию"; -App::$strings["GNU-Social Crosspost Connector"] = ""; +App::$strings["GNU-Social Crosspost Connector"] = "Подключение пересылки публикаций GNU Social"; App::$strings["Post to GNU social"] = "Опубликовать в GNU Social"; App::$strings["API URL"] = ""; App::$strings["Application name"] = "Название приложения"; @@ -3293,6 +3301,25 @@ App::$strings["Follow"] = "Отслеживать"; App::$strings["%1\$s is now following %2\$s"] = "%1\$s сейчас отслеживает %2\$s"; App::$strings["The GNU-Social protocol does not support location independence. Connections you make within that network may be unreachable from alternate channel locations."] = "Протокол GNU-Social не поддерживает независимость от расположения. Ваши контакты установленные в этой сети могут быть недоступны из альтернативных мест размещения канала."; App::$strings["GNU-Social Protocol"] = "Протокол GNU-Social"; +App::$strings["TOTP Two-Step Verification"] = "Двухэтапная верификация TOTP"; +App::$strings["Enter the 2-step verification generated by your authenticator app:"] = "Введите код проверки, созданный вашим приложением для аутентификации"; +App::$strings["Success!"] = "Успех!"; +App::$strings["Invalid code, please try again."] = "Неверный код. Пожалуйста, попробуйте ещё раз."; +App::$strings["Too many invalid codes..."] = "Слишком много неверных кодов..."; +App::$strings["Verify"] = "Проверить"; +App::$strings["You haven't set a TOTP secret yet.\nPlease click the button below to generate one and register this site\nwith your preferred authenticator app."] = "Вы еще не установили секретный код TOTP. Пожалуйста, нажмите на кнопку ниже, чтобы сгенерировать его и зарегистрировать этот сайт в предпочитаемом вами приложении для аутентификации."; +App::$strings["Your TOTP secret is"] = "Ваш секретный код TOTP"; +App::$strings["Be sure to save it somewhere in case you lose or replace your mobile device.\nUse your mobile device to scan the QR code below to register this site\nwith your preferred authenticator app."] = "Обязательно сохраните его где-нибудь на случай потери или замены мобильного устройства. С помощью мобильного устройства отсканируйте приведенный ниже QR-код, чтобы зарегистрировать этот сайт в предпочитаемом вами приложении для аутентификации."; +App::$strings["Test"] = "Тест"; +App::$strings["Generate New Secret"] = "Сгенерировать новый секретный код"; +App::$strings["Go"] = "Вперёд"; +App::$strings["Enter your password"] = "Введите ваш пароль"; +App::$strings["enter TOTP code from your device"] = "введите код TOTP из вашего устройства"; +App::$strings["Pass!"] = "Принято!"; +App::$strings["Fail"] = "Отказано"; +App::$strings["Incorrect password, try again."] = "Неверный пароль, попробуйте снова."; +App::$strings["Record your new TOTP secret and rescan the QR code above."] = "Запишите ваш секретный код TOTP и повторно отсканируйте приведенный ниже QR-код."; +App::$strings["TOTP Settings"] = "Настройки TOTP"; App::$strings["Message to display on every page on this server"] = "Отображаемое сообщение на каждой странице на этом сервере."; App::$strings["Pageheader Settings"] = "Настройки шапки страницы"; App::$strings["pageheader Settings saved."] = "Настройки шапки страницы сохранены."; @@ -3354,6 +3381,9 @@ App::$strings["Message sent to %s. New account registration: %s"] = "Сообщ App::$strings["Send your identity to all websites"] = "Отправить ваши данные на все веб-сайты"; App::$strings["Send ZID"] = "Отправить ZID"; App::$strings["Who likes me?"] = "Кому я нравлюсь?"; +App::$strings["Max queueworker threads"] = "Макс. количество обработчиков очереди"; +App::$strings["Assume workers dead after ___ seconds"] = "Считать обработчики неактивными через секунд"; +App::$strings["Queueworker Settings"] = "Настройки обработчика очереди"; App::$strings["lonely"] = "одинокий"; App::$strings["drunk"] = "пьяный"; App::$strings["horny"] = "возбуждённый"; @@ -3406,14 +3436,14 @@ App::$strings["Post to Libertree by default"] = "Публиковать в Liber App::$strings["Libertree Post Settings"] = "Настройки публикаций в Libertree"; App::$strings["Libertree Settings saved."] = "Настройки Libertree сохранены."; App::$strings["Channel is required."] = "Необходим канал."; -App::$strings["Hubzilla Crosspost Connector Settings saved."] = ""; +App::$strings["Hubzilla Crosspost Connector Settings saved."] = "Настройки пересылки публикаций Hubzilla сохранены."; App::$strings["Relay public postings to another Hubzilla channel"] = "Ретранслировать общедоступные публикации в другой канал Hubzilla"; App::$strings["Send public postings to Hubzilla channel by default"] = "Отправлять общедоступные публикации в канал Hubzilla по умолчанию"; App::$strings["Hubzilla API Path"] = "Путь к Hubzilla API"; App::$strings["Hubzilla login name"] = "Имя входа Hubzilla"; App::$strings["Hubzilla channel name"] = "Название канала Hubzilla"; -App::$strings["Hubzilla Crosspost Connector"] = ""; -App::$strings["Post to Hubzilla"] = ""; +App::$strings["Hubzilla Crosspost Connector"] = "Пересылка публикаций Hubzilla"; +App::$strings["Post to Hubzilla"] = "Опубликовать в Hubzilla"; App::$strings["ActivityPub Protocol Settings updated."] = "Настройки протокола ActivityPub обновлены."; App::$strings["The activitypub protocol does not support location independence. Connections you make within that network may be unreachable from alternate channel locations."] = "Протокол ActivityPub не поддерживает независимость от расположения. Ваши контакты установленные в этой сети могут быть недоступны из альтернативных мест размещения канала."; App::$strings["Deliver to ActivityPub recipients in privacy groups"] = "Доставить получателям ActivityPub в группах безопасности"; @@ -3455,4 +3485,3 @@ App::$strings["Skeleton Settings"] = "Настройки скелета"; App::$strings["__ctx:opensearch__ Search %1\$s (%2\$s)"] = "Искать %1\$s (%2\$s)"; App::$strings["__ctx:opensearch__ \$Projectname"] = ""; App::$strings["Search \$Projectname"] = "Поиск \$Projectname"; -App::$strings["Cover Photo"] = ""; -- cgit v1.2.3 From b9cef2f38f87c2fab51c28af33fa688f30d39138 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 26 Jan 2019 12:17:52 -0800 Subject: command line tool for managing site admins --- util/admins | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 util/admins diff --git a/util/admins b/util/admins new file mode 100755 index 000000000..22fd2fb4f --- /dev/null +++ b/util/admins @@ -0,0 +1,64 @@ +#!/usr/bin/env php +' . PHP_EOL; + exit(1); +} + + + +require_once('include/cli_startup.php'); +require_once('include/zot.php'); + +cli_startup(); + +$helpArgs = getopt('h', array('help')); +if (count($helpArgs) === 1) { + echo <<<'EndOfOutput' +adds, removes, or lists admins + +Usage: util/admins + util/admins list + util/admins add + util/admins remove + +EndOfOutput; + return; +} + +if($argc == 1) { + $r = q("select account_id, account_roles, account_email from account"); + if($r) { + foreach($r as $rr) { + echo sprintf('%4u %s %s', $rr['account_id'], $rr['account_email'],(($rr['account_roles'] & 4096) ? '*' : '')) . PHP_EOL; + } + } +} + + + +if($argc > 1 && $argv[1] === 'list') { + $r = q("select account_id, account_roles, account_email from account where (account_roles & 4096) > 0"); + if($r) { + foreach($r as $rr) { + echo sprintf('%4u %s %s', $rr['account_id'], $rr['account_email'],(($rr['account_roles'] & 4096) ? '*' : '')) . PHP_EOL; + } + } +} + + +if($argc > 2 && $argv[1] === 'add' && intval($argv[2])) { + $r = q("update account set account_roles = (account_roles | 4096) where account_id = %d", + intval($argv[2]) + ); +} + +if($argc > 2 && $argv[1] === 'remove' && intval($argv[2])) { + $r = q("update account set account_roles = (account_roles - 4096) where account_id = %d and (account_roles & 4096) > 0", + intval($argv[2]) + ); +} -- cgit v1.2.3 From 535f0f45c9dbeb737d5bc888ccbd95fd01fb6e43 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 26 Jan 2019 12:55:12 -0800 Subject: cleanup of cli admin tool --- util/admins | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/util/admins b/util/admins index 22fd2fb4f..3c7f0e83e 100755 --- a/util/admins +++ b/util/admins @@ -1,18 +1,14 @@ #!/usr/bin/env php ' . PHP_EOL; + echo 'Run admins from the top level Hubzilla web directory, as util/admins ' . PHP_EOL; exit(1); } require_once('include/cli_startup.php'); -require_once('include/zot.php'); cli_startup(); -- cgit v1.2.3 From 37b7dc8e7c10870021c835168a441788f0fcb351 Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Sun, 27 Jan 2019 17:36:56 +0100 Subject: Remove extraneous sync logic --- Zotlabs/Lib/PConfig.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php index 95f07d580..c08c11e75 100644 --- a/Zotlabs/Lib/PConfig.php +++ b/Zotlabs/Lib/PConfig.php @@ -275,23 +275,13 @@ class PConfig { dbesc($key) ); + // Synchronize delete with clones. + if ($family != 'hz_delpconfig') { $hash = hash('sha256',$family.':'.$key); set_pconfig($uid,'hz_delpconfig',$hash,$updated); } - // Synchronize delete with clones. - - if(! array_key_exists('transient', \App::$config[$uid])) - \App::$config[$uid]['transient'] = array(); - if(! array_key_exists($family, \App::$config[$uid]['transient'])) - \App::$config[$uid]['transient'][$family] = array(); - - /// @FIXME $new is undefined, so dead code - if ($new) { - \App::$config[$uid]['transient'][$family]['pcfgdel:'.$key] = $updated; - } - return $ret; } -- cgit v1.2.3 From e262de9b2ddb48d618f45a1b28619b068f76ebac Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 27 Jan 2019 18:05:46 +0100 Subject: update nginx and lighttpd sample server configs to explicit dissalow access to util --- install/sample-lighttpd.conf | 2 +- install/sample-nginx.conf | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/install/sample-lighttpd.conf b/install/sample-lighttpd.conf index db26c3b64..b65d86645 100644 --- a/install/sample-lighttpd.conf +++ b/install/sample-lighttpd.conf @@ -79,7 +79,7 @@ $HTTP["url"] =~ "\.(out|log|htaccess)$" { url.access-deny = ("") } -$HTTP["url"] =~ "(^|/)\.git|(^|/)store" { +$HTTP["url"] =~ "(^|/)\.git|(^|/)store|(^|/)util" { url.access-deny = ("") } diff --git a/install/sample-nginx.conf b/install/sample-nginx.conf index 839f208ae..6a986d426 100644 --- a/install/sample-nginx.conf +++ b/install/sample-nginx.conf @@ -141,5 +141,10 @@ server { deny all; } +#deny access to util + location ~ /util { + deny all; + } + } -- cgit v1.2.3 From 94cbc8bd3160bf644b02ef97268244869b7a9f5b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 27 Jan 2019 12:38:51 -0800 Subject: share fixes --- Zotlabs/Lib/Activity.php | 5 +++++ Zotlabs/Lib/Share.php | 1 + 2 files changed, 6 insertions(+) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 03f094983..8cfa18997 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -411,6 +411,11 @@ class Activity { $ret['type'] = 'Tombstone'; $ret['formerType'] = self::activity_obj_mapper($i['obj_type']); $ret['id'] = ((strpos($i['mid'],'http') === 0) ? $i['mid'] : z_root() . '/item/' . urlencode($i['mid'])); + $actor = self::encode_person($i['author'],false); + if($actor) + $ret['actor'] = $actor; + else + return []; return $ret; } diff --git a/Zotlabs/Lib/Share.php b/Zotlabs/Lib/Share.php index d3ecbf7fa..3a2ab1783 100644 --- a/Zotlabs/Lib/Share.php +++ b/Zotlabs/Lib/Share.php @@ -54,6 +54,7 @@ class Share { if(! $this->item) return $obj; + $obj['asld'] = $this->item['mid']; $obj['type'] = $this->item['obj_type']; $obj['id'] = $this->item['mid']; $obj['content'] = $this->item['body']; -- cgit v1.2.3 From 625cdde9a40d13b47a794c6202add2c8f647aebe Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 28 Jan 2019 02:46:45 -0800 Subject: block private reshares from zot6 due to different parents --- Zotlabs/Daemon/Notifier.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 5ee8843b2..df73d977d 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -679,6 +679,17 @@ class Notifier { } $packet_type = (($upstream || $uplink) ? 'response' : 'activity'); + + // block zot private reshares from zot6, as this could cause a number of privacy issues + // due to parenting differences between the reshare implementations. In zot a reshare is + // a standalone parent activity and in zot6 it is a followup/child of the original activity. + // For public reshares, some comments to the reshare on the zot fork will not make it to zot6 + // due to these different message models. This cannot be prevented at this time. + + if($packet_type === 'activity' && $activity['type'] === 'Announce' && intval($target_item['item_private'])) { + continue; + } + $packet = Libzot::build_packet($channel,$packet_type,$zenv,$activity,'activitystreams',(($private) ? $hub['hubloc_sitekey'] : null),$hub['site_crypto']); } else { -- cgit v1.2.3 From 8972ca8134c16039c03ad83d26b75b9e9e21d7ea Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Mon, 28 Jan 2019 14:20:46 -0500 Subject: Make session handler pluggable --- Zotlabs/Web/Session.php | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Zotlabs/Web/Session.php b/Zotlabs/Web/Session.php index 4f2a3f1f7..1ba120fa9 100644 --- a/Zotlabs/Web/Session.php +++ b/Zotlabs/Web/Session.php @@ -15,6 +15,7 @@ class Session { private $handler = null; private $session_started = false; + private $custom_handler = false; public function init() { @@ -28,13 +29,20 @@ class Session { * Set our session storage functions. */ - $handler = new \Zotlabs\Web\SessionHandler(); + $custom_handler = $this->custom_handler; + call_hook('custom_session_handler',$custom_handler); + $this->custom_handler = $custom_handler; - $this->handler = $handler; - $x = session_set_save_handler($handler,false); - if(! $x) - logger('Session save handler initialisation failed.',LOGGER_NORMAL,LOG_ERR); + if (!$this->custom_handler) { + $handler = new \Zotlabs\Web\SessionHandler(); + + $this->handler = $handler; + + $x = session_set_save_handler($handler,false); + if(! $x) + logger('Session save handler initialisation failed.',LOGGER_NORMAL,LOG_ERR); + } // Force cookies to be secure (https only) if this site is SSL enabled. // Must be done before session_start(). @@ -86,14 +94,17 @@ class Session { $arr = session_get_cookie_params(); - if($this->handler && $this->session_started) { + if(($this->handler || $this->custom_handler) && $this->session_started) { session_regenerate_id(true); - // force SessionHandler record creation with the new session_id - // which occurs as a side effect of read() + if (!$this->custom_handler) { + // force SessionHandler record creation with the new session_id + // which occurs as a side effect of read() since not all implementations + // of session_regenerate_id() call read(). - $this->handler->read(session_id()); + $this->handler->read(session_id()); + } } else logger('no session handler'); -- cgit v1.2.3 From ec6e130eb3da6765b24caa1235d5b53ba8342aeb Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Mon, 28 Jan 2019 23:10:36 +0100 Subject: Correct variable in boot.php --- boot.php | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/boot.php b/boot.php index 348cea535..14458cd4f 100755 --- a/boot.php +++ b/boot.php @@ -733,11 +733,11 @@ class App { private static $perms = null; // observer permissions private static $widgets = array(); // widgets for this page public static $config = array(); // config cache - public static $override_intltext_templates = array(); - public static $override_markup_templates = array(); - public static $override_templateroot = null; - public static $override_helproot = null; - public static $override_helpfiles = array(); + public static $override_intltext_templates = array(); + public static $override_markup_templates = array(); + public static $override_templateroot = null; + public static $override_helproot = null; + public static $override_helpfiles = array(); public static $session = null; public static $groups; @@ -888,7 +888,7 @@ class App { // removing trailing / - maybe a nginx problem if (substr(self::$query_string, 0, 1) == "/") self::$query_string = substr(self::$query_string, 1); - // change the first & to ? + // change the first & to ? self::$query_string = preg_replace('/&/','?',self::$query_string,1); } @@ -1579,7 +1579,7 @@ function login($register = false, $form_id = 'main-login', $hiddens = false, $lo // Here's the current description of how the register link works (2018-05-15) - // Register links are enabled on the site home page and login page and navbar. + // Register links are enabled on the site home page and login page and navbar. // They are not shown by default on other pages which may require login. // If the register link is enabled and registration is closed, the request is directed @@ -1591,10 +1591,10 @@ function login($register = false, $form_id = 'main-login', $hiddens = false, $lo // system.register_link may or may not be the same destination as system.sellpage - // system.sellpage is the destination linked from the /pubsites page on other sites. If + // system.sellpage is the destination linked from the /pubsites page on other sites. If // system.sellpage is not set, the 'register' link in /pubsites will go to 'register' on your - // site. - + // site. + // If system.register_link is set to the word 'none', no registration link will be shown on // your site. @@ -1833,8 +1833,6 @@ function proc_run(){ $args = func_get_args(); - $newargs = array(); - if(! count($args)) return; @@ -2282,7 +2280,7 @@ function construct_page() { $cspheader = "Content-Security-Policy:"; foreach ($cspsettings as $cspdirective => $csp) { if (!in_array($cspdirective,$validcspdirectives)) { - logger("INVALID CSP DIRECTIVE: ".$cspdirective,LOGGER_DEBUG); + logger("INVALID CSP DIRECTIVE: ".$cspdirective,LOGGER_DEBUG); continue; } $cspsettingsarray=array_unique($cspsettings[$cspdirective]); @@ -2401,7 +2399,7 @@ function z_get_temp_dir() { if(! $temp_dir) $temp_dir = sys_get_temp_dir(); - return $upload_dir; + return $temp_dir; } -- cgit v1.2.3 From 728788e3b9ce351b7eab0fba00e97ba59215e975 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Sat, 26 Jan 2019 00:47:39 +0100 Subject: Extend documentation. --- Zotlabs/Lib/Apps.php | 375 +++++++++++++++++++++++-------------- Zotlabs/Module/Notes.php | 20 +- include/contact_widgets.php | 40 ++-- view/tpl/remote_friends_common.tpl | 3 +- 4 files changed, 266 insertions(+), 172 deletions(-) diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index de7439ed7..9edd00667 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -1,32 +1,34 @@ - t('Remote Diagnostics'), 'Suggest Channels' => t('Suggest Channels'), 'Login' => t('Login'), - 'Channel Manager' => t('Channel Manager'), + 'Channel Manager' => t('Channel Manager'), 'Network' => t('Stream'), 'Settings' => t('Settings'), 'Files' => t('Files'), 'Webpages' => t('Webpages'), 'Wiki' => t('Wiki'), - 'Channel Home' => t('Channel Home'), + 'Channel Home' => t('Channel Home'), 'View Profile' => t('View Profile'), - 'Photos' => t('Photos'), - 'Events' => t('Events'), - 'Directory' => t('Directory'), + 'Photos' => t('Photos'), + 'Events' => t('Events'), + 'Directory' => t('Directory'), 'Help' => t('Help'), 'Mail' => t('Mail'), 'Mood' => t('Mood'), @@ -366,30 +385,31 @@ class Apps { if(array_key_exists($arr[$x]['name'],$apps)) { $arr[$x]['name'] = $apps[$arr[$x]['name']]; } else { - // Try to guess by app name if not in list - $arr[$x]['name'] = t(trim($arr[$x]['name'])); + // Try to guess by app name if not in list + $arr[$x]['name'] = t(trim($arr[$x]['name'])); } } } - } - - // papp is a portable app - - static public function app_render($papp,$mode = 'view') { - - /** - * modes: - * view: normal mode for viewing an app via bbcode from a conversation or page - * provides install/update button if you're logged in locally - * install: like view but does not display app-bin options if they are present - * list: normal mode for viewing an app on the app page - * no buttons are shown - * edit: viewing the app page in editing mode provides a delete button - * nav: render apps for app-bin - */ - + /** + * @brief + * + * @param array $papp + * papp is a portable app + * @param string $mode (optional) default 'view' + * Render modes: + * * \b view: normal mode for viewing an app via bbcode from a conversation or page + * provides install/update button if you're logged in locally + * * \b install: like view but does not display app-bin options if they are present + * * \b list: normal mode for viewing an app on the app page + * no buttons are shown + * * \b edit: viewing the app page in editing mode provides a delete button + * * \b nav: render apps for app-bin + * + * @return void|string Parsed HTML + */ + static public function app_render($papp, $mode = 'view') { $installed = false; if(! $papp) @@ -414,7 +434,7 @@ class Apps { $sys = get_sys_channel(); $view_channel = $sys['channel_id']; } - self::app_macros($view_channel,$papp); + self::app_macros($view_channel,$papp); } if(strpos($papp['url'], ',')) { @@ -427,7 +447,6 @@ class Apps { $papp['url'] = z_root() . ((strpos($papp['url'],'/') === 0) ? '' : '/') . $papp['url']; - foreach($papp as $k => $v) { if(strpos($v,'http') === 0 && $k != 'papp') { if(! (local_channel() && strpos($v,z_root()) === 0)) { @@ -509,7 +528,7 @@ class Apps { if($x) { $hosturl = $x['scheme'] . '://' . $x['host'] . '/'; } - } + } } $install_action = (($installed) ? t('Update') : t('Install')); @@ -592,8 +611,14 @@ class Apps { return false; } - - static public function can_delete($uid,$app) { + /** + * @brief + * + * @param mixed $uid If not set return false, otherwise no influence + * @param array $app + * @return boolean + */ + static public function can_delete($uid, $app) { if(! $uid) { return false; } @@ -601,7 +626,7 @@ class Apps { $base_apps = self::get_base_apps(); if($base_apps) { foreach($base_apps as $b) { - if($app['guid'] === hash('whirlpool',$b)) { + if($app['guid'] === hash('whirlpool', $b)) { return false; } } @@ -613,7 +638,6 @@ class Apps { static public function app_destroy($uid,$app) { if($uid && $app['guid']) { - $x = q("select * from app where app_id = '%s' and app_channel = %d limit 1", dbesc($app['guid']), intval($uid) @@ -622,7 +646,7 @@ class Apps { if(! intval($x[0]['app_deleted'])) { $x[0]['app_deleted'] = 1; if(self::can_delete($uid,$app)) { - $r = q("delete from app where app_id = '%s' and app_channel = %d", + q("delete from app where app_id = '%s' and app_channel = %d", dbesc($app['guid']), intval($uid) ); @@ -630,10 +654,15 @@ class Apps { intval(TERM_OBJ_APP), intval($x[0]['id']) ); + /** + * @hooks app_destroy + * Called after app entry got removed from database + * and provide app array from database. + */ call_hooks('app_destroy', $x[0]); } else { - $r = q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d", + q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d", dbesc($app['guid']), intval($uid) ); @@ -647,22 +676,23 @@ class Apps { } } } - } - static public function app_undestroy($uid,$app) { - - // undelete a system app - + /** + * @brief Undelete a system app. + * + * @param int $uid + * @param array $app + */ + static public function app_undestroy($uid, $app) { if($uid && $app['guid']) { - $x = q("select * from app where app_id = '%s' and app_channel = %d limit 1", dbesc($app['guid']), intval($uid) ); if($x) { if($x[0]['app_system']) { - $r = q("update app set app_deleted = 0 where app_id = '%s' and app_channel = %d", + q("update app set app_deleted = 0 where app_id = '%s' and app_channel = %d", dbesc($app['guid']), intval($uid) ); @@ -671,7 +701,15 @@ class Apps { } } - static public function app_feature($uid,$app,$term) { + /** + * @brief + * + * @param int $uid + * @param array $app + * @param string $term + * @return void + */ + static public function app_feature($uid, $app, $term) { $r = q("select id from app where app_id = '%s' and app_channel = %d limit 1", dbesc($app['guid']), intval($uid) @@ -695,23 +733,37 @@ class Apps { } } - static public function app_installed($uid,$app,$bypass_filter=false) { + /** + * @brief + * + * @param int $uid + * @param array $app + * @param boolean $bypass_filter (optional) default false + * @return boolean + */ + static public function app_installed($uid, $app, $bypass_filter = false) { $r = q("select id from app where app_id = '%s' and app_channel = %d limit 1", - dbesc((array_key_exists('guid',$app)) ? $app['guid'] : ''), + dbesc((array_key_exists('guid', $app)) ? $app['guid'] : ''), intval($uid) ); - if (!$bypass_filter) { + if(!$bypass_filter) { $filter_arr = [ - 'uid'=>$uid, - 'app'=>$app, - 'installed'=>$r + 'uid' => $uid, + 'app' => $app, + 'installed' => $r ]; - call_hooks('app_installed_filter',$filter_arr); + /** + * @hooks app_installed_filter + * * \e int \b uid + * * \e array \b app + * * \e mixed \b installed - return value + */ + call_hooks('app_installed_filter', $filter_arr); $r = $filter_arr['installed']; } - return(($r) ? true : false); + return(($r) ? true : false); } @@ -727,11 +779,17 @@ class Apps { 'app'=>$app, 'installed'=>$r ]; - call_hooks('addon_app_installed_filter',$filter_arr); + /** + * @hooks addon_app_installed_filter + * * \e int \b uid + * * \e array \b app + * * \e mixed \b installed - return value + */ + call_hooks('addon_app_installed_filter', $filter_arr); $r = $filter_arr['installed']; } - return(($r) ? true : false); + return(($r) ? true : false); } static public function system_app_installed($uid,$app,$bypass_filter=false) { @@ -746,28 +804,39 @@ class Apps { 'app'=>$app, 'installed'=>$r ]; - call_hooks('system_app_installed_filter',$filter_arr); + /** + * @hooks system_app_installed_filter + * * \e int \b uid + * * \e array \b app + * * \e mixed \b installed - return value + */ + call_hooks('system_app_installed_filter', $filter_arr); $r = $filter_arr['installed']; } - return(($r) ? true : false); + return(($r) ? true : false); } - - + /** + * @brief + * + * @param int $uid + * @param boolean $deleted + * @param array $cats + * @return boolean|array + */ static public function app_list($uid, $deleted = false, $cats = []) { - if($deleted) - $sql_extra = ""; + if($deleted) + $sql_extra = ''; else - $sql_extra = " and app_deleted = 0 "; + $sql_extra = ' and app_deleted = 0 '; if($cats) { - - $cat_sql_extra = " and ( "; + $cat_sql_extra = ' and ( '; foreach($cats as $cat) { if(strpos($cat_sql_extra, 'term')) - $cat_sql_extra .= "or "; + $cat_sql_extra .= 'or '; $cat_sql_extra .= "term = '" . dbesc($cat) . "' "; } @@ -779,11 +848,13 @@ class Apps { ); if(! $r) return $r; - $sql_extra .= " and app.id in ( "; + + $sql_extra .= ' and app.id in ( '; $s = ''; foreach($r as $rr) { if($s) $s .= ','; + $s .= intval($rr['oid']); } $sql_extra .= $s . ') '; @@ -794,12 +865,26 @@ class Apps { ); if($r) { - $hookinfo = Array('uid'=>$uid,'deleted'=>$deleted,'cats'=>$cats,'apps'=>$r); - call_hooks('app_list',$hookinfo); + $hookinfo = [ + 'uid' => $uid, + 'deleted' => $deleted, + 'cats' => $cats, + 'apps' => $r, + ]; + /** + * @hooks app_list + * * \e int \b uid + * * \e boolean \b deleted + * * \e array \b cats + * * \e array \b apps - return value + */ + call_hooks('app_list', $hookinfo); $r = $hookinfo['apps']; - for($x = 0; $x < count($r); $x ++) { + + for($x = 0; $x < count($r); $x++) { if(! $r[$x]['app_system']) $r[$x]['type'] = 'personal'; + $r[$x]['term'] = q("select * from term where otype = %d and oid = %d", intval(TERM_OBJ_APP), intval($r[$x]['id']) @@ -807,7 +892,7 @@ class Apps { } } - return($r); + return $r; } static public function app_order($uid,$apps,$menu) { @@ -839,13 +924,14 @@ class Apps { $ret[] = $ap; } } - return $ret; + return $ret; } static function find_app_in_array($name,$arr) { if(! $arr) return false; + foreach($arr as $x) { if($x['name'] === $name) { return $x; @@ -854,8 +940,16 @@ class Apps { return false; } - static function moveup($uid,$guid,$menu) { - $syslist = array(); + /** + * @brief + * + * @param int $uid + * @param int $guid + * @param string $menu + * @return void + */ + static function moveup($uid, $guid, $menu) { + $syslist = []; $conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order'); @@ -865,6 +959,7 @@ class Apps { $papp = self::app_encode($li); if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false) continue; + $syslist[] = $papp; } } @@ -877,8 +972,6 @@ class Apps { if(! $syslist) return; - $newlist = []; - foreach($syslist as $k => $li) { if($li['guid'] === $guid) { $position = $k; @@ -887,6 +980,7 @@ class Apps { } if(! $position) return; + $dest_position = $position - 1; $saved = $syslist[$dest_position]; $syslist[$dest_position] = $syslist[$position]; @@ -898,11 +992,18 @@ class Apps { } set_pconfig($uid,'system',$conf,implode(',',$narr)); - } - static function movedown($uid,$guid,$menu) { - $syslist = array(); + /** + * @brief + * + * @param int $uid + * @param int $guid + * @param string $menu + * @return void + */ + static function movedown($uid, $guid, $menu) { + $syslist = []; $conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order'); @@ -912,6 +1013,7 @@ class Apps { $papp = self::app_encode($li); if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false) continue; + $syslist[] = $papp; } } @@ -924,8 +1026,6 @@ class Apps { if(! $syslist) return; - $newlist = []; - foreach($syslist as $k => $li) { if($li['guid'] === $guid) { $position = $k; @@ -934,6 +1034,7 @@ class Apps { } if($position >= count($syslist) - 1) return; + $dest_position = $position + 1; $saved = $syslist[$dest_position]; $syslist[$dest_position] = $syslist[$position]; @@ -945,7 +1046,6 @@ class Apps { } set_pconfig($uid,'system',$conf,implode(',',$narr)); - } static public function app_decode($s) { @@ -953,8 +1053,14 @@ class Apps { return json_decode($x,true); } - - static public function app_macros($uid,&$arr) { + /** + * @brief + * + * @param int $uid + * @param[in,out] array $arr + * @return void + */ + static public function app_macros($uid, &$arr) { if(! intval($uid)) return; @@ -962,21 +1068,17 @@ class Apps { $baseurl = z_root(); $channel = channelx_by_n($uid); $address = (($channel) ? $channel['channel_address'] : ''); - + //future expansion - $observer = \App::get_observer(); - + //$observer = \App::get_observer(); + $arr['url'] = str_replace(array('$baseurl','$nick'),array($baseurl,$address),$arr['url']); $arr['photo'] = str_replace(array('$baseurl','$nick'),array($baseurl,$address),$arr['photo']); - } - - - static public function app_store($arr) { //logger('app_store: ' . print_r($arr,true)); @@ -1160,16 +1262,20 @@ class Apps { } return $ret; - } - - static public function app_encode($app,$embed = false) { - - $ret = array(); + /** + * @brief + * + * @param array $app + * @param boolean $embed (optional) default false + * @return array|string + */ + static public function app_encode($app, $embed = false) { + $ret = []; $ret['type'] = 'personal'; - + if($app['app_id']) $ret['guid'] = $app['app_id']; @@ -1202,7 +1308,7 @@ class Apps { if($app['app_price']) $ret['price'] = $app['app_price']; - + if($app['app_page']) $ret['page'] = $app['app_page']; @@ -1226,12 +1332,12 @@ class Apps { foreach($app['term'] as $t) { if($s) $s .= ','; + $s .= $t['term']; } $ret['categories'] = $s; } - if(! $embed) return $ret; @@ -1239,18 +1345,15 @@ class Apps { if(array_key_exists('categories',$ret)) unset($ret['categories']); - + $j = json_encode($ret); - return '[app]' . chunk_split(base64_encode($j),72,"\n") . '[/app]'; + return '[app]' . chunk_split(base64_encode($j),72,"\n") . '[/app]'; } static public function papp_encode($papp) { return chunk_split(base64_encode(json_encode($papp)),72,"\n"); - } } - - diff --git a/Zotlabs/Module/Notes.php b/Zotlabs/Module/Notes.php index 178a6bce0..7572f7420 100644 --- a/Zotlabs/Module/Notes.php +++ b/Zotlabs/Module/Notes.php @@ -1,28 +1,31 @@ true); if(array_key_exists('note_text',$_REQUEST)) { $body = escape_tags($_REQUEST['note_text']); - + // I've had my notes vanish into thin air twice in four years. - // Provide a backup copy if there were contents previously + // Provide a backup copy if there were contents previously // and there are none being saved now. - + if(! $body) { $old_text = get_pconfig(local_channel(),'notes','text'); if($old_text) @@ -40,11 +43,9 @@ class Notes extends Controller { logger('notes saved.', LOGGER_DEBUG); json_return_and_die($ret); - } function get() { - if(! local_channel()) return EMPTY_STR; @@ -61,7 +62,6 @@ class Notes extends Controller { $arr = ['app' => true]; return $w->widget($arr); - } - + } diff --git a/include/contact_widgets.php b/include/contact_widgets.php index a105bca19..6ad276b00 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -7,14 +7,14 @@ function findpeople_widget() { if(get_config('system','invitation_only')) { $x = get_pconfig(local_channel(),'system','invites_remaining'); if($x || is_site_admin()) { - App::$page['aside'] .= '' . $inv; + App::$page['aside'] .= ''; } } $advanced_search = ((local_channel() && feature_enabled(local_channel(),'advanced_dirsearch')) ? t('Advanced') : false); - + return replace_macros(get_markup_template('peoplefind.tpl'),array( '$findpeople' => t('Find Channels'), '$desc' => t('Enter name or interest'), @@ -22,7 +22,7 @@ function findpeople_widget() { '$hint' => t('Examples: Robert Morgenstein, Fishing'), '$findthem' => t('Find'), '$suggest' => t('Channel Suggestions'), - '$similar' => '', // FIXME and uncomment when mod/match working // t('Similar Interests'), + '$similar' => '', /// @FIXME fixme and uncomment when mod/match working // t('Similar Interests'), '$random' => t('Random Profile'), '$inv' => t('Invite Friends'), '$advanced_search' => $advanced_search, @@ -56,12 +56,11 @@ function fileas_widget($baseurl,$selected = '') { '$all' => t('Everything'), '$terms' => $terms, '$base' => $baseurl, - )); } function categories_widget($baseurl,$selected = '') { - + if(! feature_enabled(App::$profile['profile_uid'],'categories')) return ''; @@ -100,14 +99,13 @@ function categories_widget($baseurl,$selected = '') { '$all' => t('Everything'), '$terms' => $terms, '$base' => $baseurl, - )); } return ''; } function cardcategories_widget($baseurl,$selected = '') { - + if(! feature_enabled(App::$profile['profile_uid'],'categories')) return ''; @@ -128,7 +126,7 @@ function cardcategories_widget($baseurl,$selected = '') { $item_normal $sql_extra order by term.term asc", - intval(App::$profile['profile_uid']), + intval(App::$profile['profile_uid']), intval(TERM_CATEGORY), intval(TERM_OBJ_POST), dbesc(App::$profile['channel_hash']) @@ -144,15 +142,15 @@ function cardcategories_widget($baseurl,$selected = '') { '$all' => t('Everything'), '$terms' => $terms, '$base' => $baseurl, - )); } + return ''; } function articlecategories_widget($baseurl,$selected = '') { - + if(! feature_enabled(App::$profile['profile_uid'],'categories')) return ''; @@ -173,7 +171,7 @@ function articlecategories_widget($baseurl,$selected = '') { $item_normal $sql_extra order by term.term asc", - intval(App::$profile['profile_uid']), + intval(App::$profile['profile_uid']), intval(TERM_CATEGORY), intval(TERM_OBJ_POST), dbesc(App::$profile['channel_hash']) @@ -189,17 +187,14 @@ function articlecategories_widget($baseurl,$selected = '') { '$all' => t('Everything'), '$terms' => $terms, '$base' => $baseurl, - )); } + return ''; } - - - function common_friends_visitor_widget($profile_uid,$cnt = 25) { if(local_channel() == $profile_uid) @@ -218,17 +213,14 @@ function common_friends_visitor_widget($profile_uid,$cnt = 25) { return; $r = common_friends($profile_uid,$observer_hash,0,$cnt,true); - - return replace_macros(get_markup_template('remote_friends_common.tpl'), array( + + return replace_macros(get_markup_template('remote_friends_common.tpl'), [ '$desc' => t('Common Connections'), '$base' => z_root(), '$uid' => $profile_uid, - '$cid' => $observer, '$linkmore' => (($t > $cnt) ? 'true' : ''), '$more' => sprintf( t('View all %d common connections'), $t), - '$items' => $r - )); + '$items' => $r, + ]); }; - - diff --git a/view/tpl/remote_friends_common.tpl b/view/tpl/remote_friends_common.tpl index efc0ab49a..6ef3a7dde 100755 --- a/view/tpl/remote_friends_common.tpl +++ b/view/tpl/remote_friends_common.tpl @@ -7,10 +7,9 @@
      {{foreach $items as $item}}
      - {{$item.xchan_name}} + {{$item.xchan_name}}
      {{/foreach}}
      {{/if}}
      - -- cgit v1.2.3 From 753f137575674a4fb1cfb16753baced6ed21145a Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 28 Jan 2019 15:29:39 -0800 Subject: disable hyperdrive in hubzilla --- Zotlabs/Lib/Libzot.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 1440a9691..27502009c 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1534,6 +1534,11 @@ class Libzot { // the top level post is unlikely to be imported and // this is just an exercise in futility. + + if((! get_pconfig($channel['channel_id'],'system','hyperdrive',false)) || (! $arr['verb'] === 'Announce')) { + continue; + } + if((! $relay) && (! $request) && (! $local_public) && perm_is_allowed($channel['channel_id'],$sender,'send_stream')) { self::fetch_conversation($channel,$arr['parent_mid']); -- cgit v1.2.3 From 456207b4e75ee4b28b60e90b44ef758dc95b2ebc Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 29 Jan 2019 10:13:49 +0100 Subject: fix wrong function name and coding style --- Zotlabs/Web/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Web/Session.php b/Zotlabs/Web/Session.php index 1ba120fa9..648f6b720 100644 --- a/Zotlabs/Web/Session.php +++ b/Zotlabs/Web/Session.php @@ -30,7 +30,7 @@ class Session { */ $custom_handler = $this->custom_handler; - call_hook('custom_session_handler',$custom_handler); + call_hooks('custom_session_handler', $custom_handler); $this->custom_handler = $custom_handler; -- cgit v1.2.3 From cd4d90c6479dad05e08faca2e9bbedc9b7710858 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 29 Jan 2019 21:16:16 +0100 Subject: Revert "fix wrong function name and coding style" This reverts commit 456207b4e75ee4b28b60e90b44ef758dc95b2ebc --- Zotlabs/Web/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Web/Session.php b/Zotlabs/Web/Session.php index 648f6b720..1ba120fa9 100644 --- a/Zotlabs/Web/Session.php +++ b/Zotlabs/Web/Session.php @@ -30,7 +30,7 @@ class Session { */ $custom_handler = $this->custom_handler; - call_hooks('custom_session_handler', $custom_handler); + call_hook('custom_session_handler',$custom_handler); $this->custom_handler = $custom_handler; -- cgit v1.2.3 From 913b620c66f32a4c89acbadfc4fdf751d3a34b17 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 29 Jan 2019 21:16:38 +0100 Subject: Revert "Make session handler pluggable" This reverts commit 8972ca8134c16039c03ad83d26b75b9e9e21d7ea --- Zotlabs/Web/Session.php | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/Zotlabs/Web/Session.php b/Zotlabs/Web/Session.php index 1ba120fa9..4f2a3f1f7 100644 --- a/Zotlabs/Web/Session.php +++ b/Zotlabs/Web/Session.php @@ -15,7 +15,6 @@ class Session { private $handler = null; private $session_started = false; - private $custom_handler = false; public function init() { @@ -29,20 +28,13 @@ class Session { * Set our session storage functions. */ - $custom_handler = $this->custom_handler; - call_hook('custom_session_handler',$custom_handler); - $this->custom_handler = $custom_handler; + $handler = new \Zotlabs\Web\SessionHandler(); + $this->handler = $handler; - if (!$this->custom_handler) { - $handler = new \Zotlabs\Web\SessionHandler(); - - $this->handler = $handler; - - $x = session_set_save_handler($handler,false); - if(! $x) - logger('Session save handler initialisation failed.',LOGGER_NORMAL,LOG_ERR); - } + $x = session_set_save_handler($handler,false); + if(! $x) + logger('Session save handler initialisation failed.',LOGGER_NORMAL,LOG_ERR); // Force cookies to be secure (https only) if this site is SSL enabled. // Must be done before session_start(). @@ -94,17 +86,14 @@ class Session { $arr = session_get_cookie_params(); - if(($this->handler || $this->custom_handler) && $this->session_started) { + if($this->handler && $this->session_started) { session_regenerate_id(true); - if (!$this->custom_handler) { - // force SessionHandler record creation with the new session_id - // which occurs as a side effect of read() since not all implementations - // of session_regenerate_id() call read(). + // force SessionHandler record creation with the new session_id + // which occurs as a side effect of read() - $this->handler->read(session_id()); - } + $this->handler->read(session_id()); } else logger('no session handler'); -- cgit v1.2.3 From 4b516fdb0927021dc4ebb38513127699e48b87f9 Mon Sep 17 00:00:00 2001 From: Mark Nowiasz Date: Tue, 29 Jan 2019 21:41:23 +0100 Subject: Custom sessionhandler support, as requested --- Zotlabs/Web/Session.php | 50 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/Zotlabs/Web/Session.php b/Zotlabs/Web/Session.php index 4f2a3f1f7..31979c3f6 100644 --- a/Zotlabs/Web/Session.php +++ b/Zotlabs/Web/Session.php @@ -15,7 +15,7 @@ class Session { private $handler = null; private $session_started = false; - + private $custom_handler = false; public function init() { $gc_probability = 50; @@ -23,25 +23,44 @@ class Session { ini_set('session.gc_probability', $gc_probability); ini_set('session.use_only_cookies', 1); ini_set('session.cookie_httponly', 1); - + + $this->custom_handler = boolval(get_config('system', 'session_custom', false)); + /* * Set our session storage functions. */ - - $handler = new \Zotlabs\Web\SessionHandler(); - - $this->handler = $handler; - - $x = session_set_save_handler($handler,false); - if(! $x) - logger('Session save handler initialisation failed.',LOGGER_NORMAL,LOG_ERR); - + + if ($this->custom_handler) { + /* Custom handler (files, memached, redis..) */ + + $session_save_handler = strval(get_config('system', 'session_save_handler', Null)); + $session_save_path = strval(get_config('system', 'session_save_path', Null)); + $session_gc_probability = intval(get_config('system', 'session_gc_probability', 1)); + $session_gc_divisor = intval(get_config('system', 'session_gc_divisor', 100)); + if (!$session_save_handler || !$session_save_path) { + logger('Session save handler or path not set.',LOGGER_NORMAL,LOG_ERR); + } else { + ini_set('session.save_handler', $session_save_handler); + ini_set('session.save_path', $session_save_path); + ini_set('session.gc_probability', $session_gc_probability); + ini_set('session.gc_divisor', $session_gc_divisor); + + } + } else { + $handler = new \Zotlabs\Web\SessionHandler(); + + $this->handler = $handler; + + $x = session_set_save_handler($handler,false); + if(! $x) + logger('Session save handler initialisation failed.',LOGGER_NORMAL,LOG_ERR); + }; // Force cookies to be secure (https only) if this site is SSL enabled. // Must be done before session_start(). $arr = session_get_cookie_params(); - + // Note when setting cookies: set the domain to false which creates a single domain // cookie. If you use a hostname it will create a .domain.com wildcard which will // have some nasty side effects if you have any other subdomains running hubzilla. @@ -86,14 +105,15 @@ class Session { $arr = session_get_cookie_params(); - if($this->handler && $this->session_started) { + if(($this->handler || $this->custom_handler) && $this->session_started) { session_regenerate_id(true); // force SessionHandler record creation with the new session_id // which occurs as a side effect of read() - - $this->handler->read(session_id()); + if (! $this->custom_handler) { + $this->handler->read(session_id()); + } } else logger('no session handler'); -- cgit v1.2.3 From 3b31dbaa169345e95580e40c809d3cf3f0b642c2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 29 Jan 2019 22:37:30 +0100 Subject: clean up whitespace and remove superfluous semicolon --- Zotlabs/Web/Session.php | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/Zotlabs/Web/Session.php b/Zotlabs/Web/Session.php index 31979c3f6..fe0a3fbf9 100644 --- a/Zotlabs/Web/Session.php +++ b/Zotlabs/Web/Session.php @@ -30,23 +30,24 @@ class Session { * Set our session storage functions. */ - if ($this->custom_handler) { - /* Custom handler (files, memached, redis..) */ - - $session_save_handler = strval(get_config('system', 'session_save_handler', Null)); - $session_save_path = strval(get_config('system', 'session_save_path', Null)); - $session_gc_probability = intval(get_config('system', 'session_gc_probability', 1)); - $session_gc_divisor = intval(get_config('system', 'session_gc_divisor', 100)); - if (!$session_save_handler || !$session_save_path) { - logger('Session save handler or path not set.',LOGGER_NORMAL,LOG_ERR); - } else { - ini_set('session.save_handler', $session_save_handler); - ini_set('session.save_path', $session_save_path); - ini_set('session.gc_probability', $session_gc_probability); - ini_set('session.gc_divisor', $session_gc_divisor); - - } - } else { + if($this->custom_handler) { + /* Custom handler (files, memached, redis..) */ + + $session_save_handler = strval(get_config('system', 'session_save_handler', Null)); + $session_save_path = strval(get_config('system', 'session_save_path', Null)); + $session_gc_probability = intval(get_config('system', 'session_gc_probability', 1)); + $session_gc_divisor = intval(get_config('system', 'session_gc_divisor', 100)); + if(!$session_save_handler || !$session_save_path) { + logger('Session save handler or path not set.',LOGGER_NORMAL,LOG_ERR); + } + else { + ini_set('session.save_handler', $session_save_handler); + ini_set('session.save_path', $session_save_path); + ini_set('session.gc_probability', $session_gc_probability); + ini_set('session.gc_divisor', $session_gc_divisor); + } + } + else { $handler = new \Zotlabs\Web\SessionHandler(); $this->handler = $handler; @@ -54,7 +55,8 @@ class Session { $x = session_set_save_handler($handler,false); if(! $x) logger('Session save handler initialisation failed.',LOGGER_NORMAL,LOG_ERR); - }; + } + // Force cookies to be secure (https only) if this site is SSL enabled. // Must be done before session_start(). -- cgit v1.2.3 From b15421826d91d7344ad28a16f0be047c191d5ec4 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 29 Jan 2019 15:14:49 -0800 Subject: cache embeds in the background on initial storage rather than on first access --- Zotlabs/Daemon/Cache_embeds.php | 27 +++++++++++++++++++++++++++ include/items.php | 12 ++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Zotlabs/Daemon/Cache_embeds.php diff --git a/Zotlabs/Daemon/Cache_embeds.php b/Zotlabs/Daemon/Cache_embeds.php new file mode 100644 index 000000000..08088abd6 --- /dev/null +++ b/Zotlabs/Daemon/Cache_embeds.php @@ -0,0 +1,27 @@ + Date: Wed, 30 Jan 2019 18:33:10 -0800 Subject: set document title when title changes on a page update --- view/js/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/view/js/main.js b/view/js/main.js index fca9d125d..4718fb98f 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -734,6 +734,7 @@ function updateConvItems(mode,data) { title.replace(/\s+$/, ''); if (title) { savedTitle = title + " " + savedTitle; + document.title = title; } } } -- cgit v1.2.3 From 71adbd7c39760359e5b172812a53f398b8abb072 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 31 Jan 2019 18:06:09 +0100 Subject: Update hmessages.po --- view/ru/hmessages.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/ru/hmessages.po b/view/ru/hmessages.po index f8c34f95d..79808438a 100644 --- a/view/ru/hmessages.po +++ b/view/ru/hmessages.po @@ -2230,7 +2230,7 @@ msgstr "Не удалось сохранить информацию аккаун #: ../../include/account.php:314 #, php-format msgid "Registration confirmation for %s" -msgstr "Подтверждение регистрации для %s" +msgstr "Подтверждение регистрации на %s" #: ../../include/account.php:385 #, php-format @@ -4523,7 +4523,7 @@ msgid "" "A verification token was sent to your email address [%s]. Enter that token " "here to complete the account verification step. Please allow a few minutes " "for delivery, and check your spam folder if you do not see the message." -msgstr "Проверочный токен был выслн на ваш адрес электронной почты [%s]. Введите этот токен здесь для завершения этапа проверки учётной записи. Пожалуйста, подождите несколько минут для завершения доставки и проверьте вашу папку \"Спам\" если вы не видите письма." +msgstr "Проверочный токен был отправлен на ваш адрес электронной почты [%s]. Введите этот токен здесь для завершения этапа проверки учётной записи. Пожалуйста, подождите несколько минут для завершения доставки и проверьте вашу папку \"Спам\" если вы не видите письма." #: ../../Zotlabs/Module/Email_validation.php:38 msgid "Resend Email" -- cgit v1.2.3 From c1159337dae9a18f704228ed255428d76f7c498a Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 31 Jan 2019 18:06:19 +0100 Subject: Update hstrings.php --- view/ru/hstrings.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/ru/hstrings.php b/view/ru/hstrings.php index ee4c31619..90bb2b855 100644 --- a/view/ru/hstrings.php +++ b/view/ru/hstrings.php @@ -444,7 +444,7 @@ App::$strings["An invitation is required."] = "Требуется приглаш App::$strings["Invitation could not be verified."] = "Не удалось проверить приглашение."; App::$strings["Please enter the required information."] = "Пожалуйста, введите необходимую информацию."; App::$strings["Failed to store account information."] = "Не удалось сохранить информацию аккаунта."; -App::$strings["Registration confirmation for %s"] = "Подтверждение регистрации для %s"; +App::$strings["Registration confirmation for %s"] = "Подтверждение регистрации на %s"; App::$strings["Registration request at %s"] = "Запрос регистрации на %s"; App::$strings["your registration password"] = "ваш пароль регистрации"; App::$strings["Registration details for %s"] = "Регистрационные данные для %s"; @@ -998,7 +998,7 @@ App::$strings["Privacy group: "] = "Группа безопасности: "; App::$strings["Invalid channel."] = "Недействительный канал."; App::$strings["Token verification failed."] = "Не удалось выполнить проверку токена."; App::$strings["Email Verification Required"] = "Требуется проверка адреса email"; -App::$strings["A verification token was sent to your email address [%s]. Enter that token here to complete the account verification step. Please allow a few minutes for delivery, and check your spam folder if you do not see the message."] = "Проверочный токен был выслн на ваш адрес электронной почты [%s]. Введите этот токен здесь для завершения этапа проверки учётной записи. Пожалуйста, подождите несколько минут для завершения доставки и проверьте вашу папку \"Спам\" если вы не видите письма."; +App::$strings["A verification token was sent to your email address [%s]. Enter that token here to complete the account verification step. Please allow a few minutes for delivery, and check your spam folder if you do not see the message."] = "Проверочный токен был отправлен на ваш адрес электронной почты [%s]. Введите этот токен здесь для завершения этапа проверки учётной записи. Пожалуйста, подождите несколько минут для завершения доставки и проверьте вашу папку \"Спам\" если вы не видите письма."; App::$strings["Resend Email"] = "Выслать повторно"; App::$strings["Validation token"] = "Проверочный токен"; App::$strings["No channel."] = "Канала нет."; -- cgit v1.2.3 From 004246163dd4482ae1d0d442d30256db8ed1535a Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 31 Jan 2019 18:39:07 +0100 Subject: starring and filing is only supported for post item type --- Zotlabs/Lib/ThreadItem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 83d243177..dc84df316 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -411,9 +411,9 @@ class ThreadItem { 'rawmid' => $item['mid'], 'plink' => get_plink($item), 'edpost' => $edpost, // ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''), - 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''), + 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts') && ($item['item_type'] == ITEM_TYPE_POST)) ? $star : ''), 'tagger' => ((feature_enabled($conv->get_profile_owner(),'commtag')) ? $tagger : ''), - 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''), + 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing') && ($item['item_type'] == ITEM_TYPE_POST)) ? $filer : ''), 'bookmark' => (($conv->get_profile_owner() == local_channel() && local_channel() && $has_bookmarks) ? t('Save Bookmarks') : ''), 'addtocal' => (($has_event) ? t('Add to Calendar') : ''), 'drop' => $drop, -- cgit v1.2.3 From ad4dd2def58999c58fc12def0e6b5789597f5581 Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Fri, 1 Feb 2019 09:29:59 +0100 Subject: Set lock red and provide warning if a forum is tagged in the post --- Zotlabs/Lib/ThreadItem.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index dc84df316..7ce0d0f9e 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -101,6 +101,7 @@ class ThreadItem { || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) ? t('Private Message') : false); + $shareable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && ($item['item_private'] != 1)) ? true : false); // allow an exemption for sharing stuff from your private feeds @@ -115,6 +116,16 @@ class ThreadItem { $privacy_warning = true; } + if ($lock) { + if (count(get_terms_oftype($item['term'],TERM_FORUM))) { + $privacy_warning = true; + } + } + + if ($lock && $privacy_warning) { + $lock = t('Privacy conflict. Discretion advised.'); + } + $mode = $conv->get_mode(); switch($item['item_type']) { -- cgit v1.2.3 From 6462c83f69969e1b3a945292a4a9e8df7e730936 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 1 Feb 2019 15:47:51 +0100 Subject: Prevent Hubzilla usage for SEO backlinks --- include/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/text.php b/include/text.php index 7d253e3d7..b6a1004c2 100644 --- a/include/text.php +++ b/include/text.php @@ -1093,7 +1093,7 @@ function searchbox($s,$id='search-box',$url='/search',$save = false) { * @return string */ function linkify($s, $me = false) { - $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\_\@\~\#\'\%\$\!\+\,\@]*)/u", (($me) ? ' $1' : ' $1'), $s); + $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\_\@\~\#\'\%\$\!\+\,\@]*)/u", (($me) ? ' $1' : ' $1'), $s); $s = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$s); return($s); -- cgit v1.2.3 From 708d2881217a3a66d5ff64a33365e0cb96353962 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Fri, 1 Feb 2019 00:12:45 -0500 Subject: Add filter hooks and the ability to add buttons to the default status editor --- doc/hook/jot_header_tpl_filter.bb | 5 +++++ doc/hook/jot_tpl_filter.bb | 5 +++++ doc/hooklist.bb | 6 ++++++ include/conversation.php | 19 ++++++++++++++----- view/tpl/jot.tpl | 12 +++++++++++- 5 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 doc/hook/jot_header_tpl_filter.bb create mode 100644 doc/hook/jot_tpl_filter.bb diff --git a/doc/hook/jot_header_tpl_filter.bb b/doc/hook/jot_header_tpl_filter.bb new file mode 100644 index 000000000..b17d81d03 --- /dev/null +++ b/doc/hook/jot_header_tpl_filter.bb @@ -0,0 +1,5 @@ +[h2]jot_header_tpl_filter[/h2] + +Allows addon developers to modify the values of replacements fed into jot-header.tpl + +cxref: include/conversation.php diff --git a/doc/hook/jot_tpl_filter.bb b/doc/hook/jot_tpl_filter.bb new file mode 100644 index 000000000..426da3c56 --- /dev/null +++ b/doc/hook/jot_tpl_filter.bb @@ -0,0 +1,5 @@ +[h2]jot_tpl_filter[/h2] + +Allows addon developers to alter the macro replacements prior to being fed into jot.tpl + +cxref: include/conversation.php diff --git a/doc/hooklist.bb b/doc/hooklist.bb index 6d56d5e71..5a804c819 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -370,6 +370,12 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/jot_tool]jot_tool[/zrl] Deprecated and possibly obsolete. Allows one to add action buttons to the post editor. +[zrl=[baseurl]/help/hook/jot_tpl_filter]jot_tpl_filter[/zrl] + Called to filter template vars before replacement in jot.tpl. + +[zrl=[baseurl]/help/hook/jot_header_tpl_filter]jot_header_tpl_filter[/zrl] + Called to filter template vars before replacement in jot_header.tpl. + [zrl=[baseurl]/help/hook/legal_webbie]legal_webbie[/zrl] Called to validate a channel address diff --git a/include/conversation.php b/include/conversation.php index 041994b90..e2dd02ffc 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1328,7 +1328,7 @@ function hz_status_editor($a, $x, $popup = false) { $tpl = get_markup_template('jot-header.tpl'); - App::$page['htmlhead'] .= replace_macros($tpl, array( + $tplmacros = [ '$baseurl' => z_root(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$pretext' => ((x($x,'pretext')) ? $x['pretext'] : ''), @@ -1349,7 +1349,10 @@ function hz_status_editor($a, $x, $popup = false) { '$nocomment_disabled' => t('Comments disabled'), '$auto_save_draft' => $feature_auto_save_draft, '$reset' => $reset - )); + ]; + + call_hooks('jot_header_tpl_filter',$tplmacros); + App::$page['htmlhead'] .= replace_macros($tpl, $tplmacros); $tpl = get_markup_template('jot.tpl'); @@ -1389,7 +1392,7 @@ function hz_status_editor($a, $x, $popup = false) { $sharebutton = (x($x,'button') ? $x['button'] : t('Share')); $placeholdtext = (x($x,'content_label') ? $x['content_label'] : $sharebutton); - $o .= replace_macros($tpl, array( + $tplmacros = [ '$return_path' => ((x($x, 'return_path')) ? $x['return_path'] : App::$query_string), '$action' => z_root() . '/item', '$share' => $sharebutton, @@ -1463,9 +1466,15 @@ function hz_status_editor($a, $x, $popup = false) { '$bbcode' => ((x($x, 'bbcode')) ? $x['bbcode'] : false), '$parent' => ((array_key_exists('parent',$x) && $x['parent']) ? $x['parent'] : 0), '$reset' => $reset, - '$is_owner' => ((local_channel() && (local_channel() == $x['profile_uid'])) ? true : false) - )); + '$is_owner' => ((local_channel() && (local_channel() == $x['profile_uid'])) ? true : false), + '$custommoretoolsdropdown' => '', + '$custommoretoolsbuttons' => '', + '$customsubmitright' => [] + ]; + + call_hooks('jot_tpl_filter',$tplmacros); + $o .= replace_macros($tpl, $tplmacros); if ($popup === true) { $o = ''; } diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 4eae33d13..12509fc59 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -137,8 +137,11 @@ {{/if}} + {{if $custommoretoolsbuttons}} + {{$custommoretoolsbuttons}} + {{/if}}
      - {{if $writefiles || $weblink || $setloc || $clearloc || $feature_expire || $feature_encrypt || $feature_voting}} + {{if $writefiles || $weblink || $setloc || $clearloc || $feature_expire || $feature_encrypt || $feature_voting || $custommoretoolsdropdown}}
      {{/if}} @@ -186,6 +191,11 @@
      + {{foreach $customsubmitright as $csr}} + + {{/foreach}} {{if $preview}}