Commit Graph

308 Commits

Author SHA1 Message Date
Mario Vavti
7fb13f23fe fix docu 2025-02-26 16:37:22 +01:00
Mario Vavti
9eff1a08d4 refactor unparse_url() to allow to return a custom field set only and add tests 2025-02-26 16:26:40 +01:00
Mario Vavti
9e2f3dc05f fix more issues reported by phpstan 2024-11-27 10:25:37 +01:00
Harald Eilertsen
3a2f787f96 Add Zotlabs\Lib\Mailer class to replace z_mail function. 2024-11-22 09:59:14 +00:00
Harald Eilertsen
5b7f8d986c Fix #1879: Emails with + in local part was rejected. 2024-11-16 13:45:36 +01:00
Mario Vavti
45c0091d3d more work on porting containers from streams 2024-10-09 18:17:37 +02:00
Harald Eilertsen
66ea277045 Refactor is_local_url() and add api doc. 2024-06-16 08:56:20 +02:00
Mario
388e7c88df remove superfluous param, fix wrong var and declare types for unparse_url() 2024-06-10 08:22:43 +00:00
Harald Eilertsen
c009c5f43a Fix default timeouts for z_(fetch|post)_url.
When fetching the default timouts from config, the result is converted
to an int via `intval()`, the result of that again is compared strictly
to `false`. Since 0 !== false, the default values will never be used,
and 0 (no timeout) is passed to curl.

This cause requests to hang indefinitely (or until they are killed) when
receiving actions that require a lookup or fetch to another site as part
of the request processing. (E.g webfinger, or fetching objects that we
received an announce action for.) This again cause the request never to
return a useful status to the site sending the action, and could cause
them to think the Hubzilla site is dead.

This patch fixes this by comparing the fetched value from config to 0
instead of false, making the defaults work again if the config is not
set (or set to 0).
2024-05-29 22:50:02 +02:00
Harald Eilertsen
0dc959d9fe Deprecate *_config() functions in core. 2024-03-24 09:58:21 +00:00
Mario
46fa26502b more work on emojis 2024-03-09 20:53:18 +00:00
Harald Eilertsen
80ed2ff89a Add some beginning tests for bbcode, and a bit of refactoring 2024-03-01 16:18:07 +00:00
Harald Eilertsen
403539919a Improve the validate_email function
The validate_email function relied on doing an actual domain lookup (on
supported platforms) to validate the domain of the email address. This
does not work too well in testing environments where we may not want to
spam the DNS system, if it at all is available.

Apart from the the function did very little to actually verify that it
was a valid email address.

This patch tries to change that by usng a somewhat stricted regex based
validation. While this may not be perfect, it should be good enough in
the vast majority of cases. For platforms where no validation was
performed with the old version, it will at least be an improvement.

Also, it allows testing without having an external network connection.

Also clarify the doc comment, that it does not actually try to resolve
the email address, just the domain.
2024-01-15 19:52:31 +01:00
Mario
aac406a245 provide some more jsonld builtins 2024-01-11 16:27:57 +00:00
Mario
58593d7da6 prepare outbound fep-8b32 (object integrity) but do not enable yet since the additional context seems to break ldsig for some reason, introduce Activity::build_packet() and Activity::ap_context() to reduce code duplication, implement fep-2c59 (webfinger) and some cleanup 2024-01-10 13:33:57 +00:00
Mario
150174c3bb jsonld: return object instead of json string 2023-09-21 08:33:17 +00:00
Mario
3708c1ac8c fix regression in jsonld_document_loader() 2023-09-16 10:51:28 +00:00
Mario
931b876b44 fix cached jsonld files fetched via network 2023-07-21 12:07:17 +00:00
DM42.Net Hubzilla Development
ba2d775215 Skip logging when DB functions are not yet loaded (logging requires db lookup). 2023-07-17 20:34:16 -04:00
Mario
0c2cb18578 shuffle queue deliveries for more randomness 2023-06-08 15:33:02 +00:00
Mario Vavti
c9e170dfcc queueworker: introduce new interval config queueworker.queue_interval - defaults to 500000 microseconds. No config UI yet. 2022-12-12 23:26:45 +01:00
Mario
e3a19469eb bring back poll and delivery interval 2022-12-12 09:03:49 +00:00
Mario
2bb58843ab move queueworker to core and bump version 2022-12-02 19:22:19 +00:00
Mario
1d56b9a1bb php8: warning fixes 2022-09-14 12:31:19 +00:00
Harald Eilertsen
b02f6a1dae Add function is_local_url() to check if url is local. 2022-03-20 15:34:24 +01:00
Mario
139ffae367 fix another deprecation warning 2022-02-11 09:51:21 +00:00
Mario
e74359fcfe 3rd arg in str_replace() can not be null 2022-02-11 09:10:19 +00:00
Mario
f06c970628 port z_curl_error() from zap 2022-01-23 20:23:40 +00:00
Mario
532b479f96 provide local copies of the w3.org jsonld documents - addresses issue #1637 2021-10-14 18:15:38 +00:00
Mario
1fa4bc9ac0 remove most legacy zot quirks 2021-05-26 12:18:59 +00:00
Malendur
300679c053 Fix phpDoc 2021-05-20 08:23:45 +00:00
Max Kostikov
11d831e4d7 More PHP 8 fixes 2021-03-10 11:14:02 +00:00
Mario
b242347fa1 onepoll via zot6 to /zotfeed which implements an outbox 2021-01-20 20:17:50 +00:00
Mario
7684861249 do not check against undefined variable 2021-01-02 21:37:06 +00:00
Mario
685c569eaf minor queue adjustments 2020-11-13 13:49:39 +00:00
root
0ad7c8f69e HTML parsing lib change to standard PHP in scrape_feed() and scrape_vcard()
(cherry picked from commit 16d450fc6980bb70f13e574d1b20406dd313110e)
2020-10-31 09:15:37 +01:00
Mario
45a5a04189 do not overwrite $x variable 2020-10-13 09:03:13 +00:00
nobody
e529635952 delete fixes 2020-09-30 17:05:36 -07:00
zotlabs
13ff9a897d foreach warning 2020-07-22 16:20:36 -07:00
Mario
92ee27349c check for zot6 first 2020-06-14 13:35:17 +00:00
Mario
ad040a0b11 set CURLOPT_ENCODING in z_post_url() 2020-05-04 07:44:19 +00:00
Mario
01334d761a set CURLOPT_ENCODING to empty string so that compressed content will be uncompressed 2020-05-01 10:24:00 +00:00
Max Kostikov
b81b18814e Don't validate domain with PTR record; remove uneccessary CNAME check; add IPv6 check 2020-01-19 21:55:15 +01:00
Mario Vavti
090d921006 webfinger: better handling of URLs that contain a @ 2019-07-12 12:43:12 +02:00
Zot
ea9925f489 clone systems apps to the extent possible, auto-configure imagick thumbnail binary during setup if possible 2019-03-18 09:35:53 +01:00
zotlabs
91b03e52f1 email_header_encode() producing lines of illegal length because header field length was not considered in length calculation. 2019-03-14 21:18:17 -07:00
M. Dent
0c05e6593e Add CURLOPT_CONNECTTIMEOUT 2019-03-06 09:52:26 +01:00
Max Kostikov
60f890ce0d Fix for cURL with default HTTP/2 2018-12-20 21:13:05 +01:00
Max Kostikov
e4958d5bb9 Revert "Fix cURL with HTTP/2"
This reverts commit 090fe394e4
2018-12-20 20:58:48 +01:00
Max Kostikov
090fe394e4 Fix cURL with HTTP/2 2018-12-20 20:38:35 +01:00