Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hubzilla
core
Commits
b0b9b9f2
Commit
b0b9b9f2
authored
Dec 11, 2020
by
Mario
Browse files
fix hubloc issue in mod getfile
parent
e7e08616
Pipeline
#371358
passed with stage
in 1 minute and 58 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Zotlabs/Module/Getfile.php
View file @
b0b9b9f2
...
...
@@ -2,6 +2,7 @@
namespace
Zotlabs\Module
;
use
Zotlabs\Web\HTTPSig
;
use
Zotlabs\Lib\Libzot
;
/**
* module: getfile
...
...
@@ -54,11 +55,11 @@ class Getfile extends \Zotlabs\Web\Controller {
if
(
$keyId
)
{
$r
=
q
(
"select * from hubloc left join xchan on hubloc_hash = xchan_hash
where hubloc_addr = '%s'
limit 1
"
,
where hubloc_addr = '%s'"
,
dbesc
(
str_replace
(
'acct:'
,
''
,
$keyId
))
);
if
(
$r
)
{
$hubloc
=
$r
[
0
]
;
$hubloc
=
Libzot
::
zot_record_preferred
(
$r
)
;
$verified
=
HTTPSig
::
verify
(
''
,
$hubloc
[
'xchan_pubkey'
]);
if
(
$verified
&&
$verified
[
'header_signed'
]
&&
$verified
[
'header_valid'
]
&&
$hash
==
$hubloc
[
'hubloc_hash'
])
{
$header_verified
=
true
;
...
...
include/import.php
View file @
b0b9b9f2
...
...
@@ -527,12 +527,12 @@ function sync_apps($channel, $apps) {
/**
* @brief Import system apps.
* System apps from the original server may not exist on this system
* System apps from the original server may not exist on this system
* (e.g. apps associated with addons that are not installed here).
* Check the system apps that were provided in the import file to see if they
* exist here and if so, install them locally. Preserve categories that
* might have been added by this channel on the other server.
* Do not use any paths from the original as they will point to a different server.
* Do not use any paths from the original as they will point to a different server.
* @param array $channel
* @param array $apps
*/
...
...
@@ -1373,7 +1373,7 @@ function sync_files($channel, $files) {
logger
(
'attachment store failed'
,
LOGGER_NORMAL
,
LOG_ERR
);
}
if
(
$f
[
'photo'
])
{
foreach
(
$f
[
'photo'
]
as
$p
)
{
unset
(
$p
[
'id'
]);
$p
[
'aid'
]
=
$channel
[
'channel_account_id'
];
...
...
@@ -1446,7 +1446,7 @@ function sync_files($channel, $files) {
$x
=
z_post_url
(
$fetch_url
,
$parr
,
$redirects
,[
'filep'
=>
$fp
,
'headers'
=>
$headers
]);
fclose
(
$fp
);
// Override remote hub thumbnails storage settings
if
(
!
boolval
(
get_config
(
'system'
,
'filesystem_storage_thumbnails'
,
0
)))
{
$p
[
'os_storage'
]
=
0
;
...
...
@@ -1488,12 +1488,12 @@ function sync_files($channel, $files) {
create_table_from_array
(
'photo'
,
$p
,
[
'content'
]
);
}
}
}
// Set xchan photo date to prevent thumbnails fetch for clones on profile update packet recieve
if
(
isset
(
$update_xchan
))
{
$x
=
q
(
"UPDATE xchan SET xchan_photo_date = '%s' WHERE xchan_hash = '%s'"
,
dbescdate
(
$update_xchan
),
dbesc
(
$channel
[
'channel_hash'
])
...
...
@@ -1522,13 +1522,13 @@ function sync_addressbook($channel, $data) {
if
(
!
\
Zotlabs\Lib\Apps
::
system_app_installed
(
$channel
[
'channel_id'
],
'CardDAV'
))
return
;
logger
(
"debug: "
.
print_r
(
$data
,
true
),
LOGGER_DEBUG
);
require_once
(
'include/cdav.php'
);
$principalUri
=
'principals/'
.
$channel
[
'channel_address'
];
if
(
$data
[
'action'
]
!==
'create'
)
{
$id
=
get_cdav_id
(
$principalUri
,
$data
[
'uri'
],
'addressbooks'
);
if
(
!
$id
)
...
...
@@ -1630,7 +1630,7 @@ function sync_calendar($channel, $data) {
break
;
case
'update_card'
:
$caldavBackend
->
updateCalendarObject
(
$id
,
$data
[
'carduri'
],
$data
[
'card'
]);
$caldavBackend
->
updateCalendarObject
(
$id
,
$data
[
'carduri'
],
$data
[
'card'
]);
break
;
case
'switch'
:
...
...
Mario
@mario
mentioned in commit
8c1c49a4
·
Dec 11, 2020
mentioned in commit
8c1c49a4
mentioned in commit 8c1c49a45ed28f5235d6a5f7668d2c31158fbea3
Toggle commit list
Mario
@mario
mentioned in commit
8720931a
·
Dec 12, 2020
mentioned in commit
8720931a
mentioned in commit 8720931a537028db3b35f2c6afe8f3653408d8f9
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment