Commit graph

9422 commits

Author SHA1 Message Date
Roland Häder
8e19998191
Fixes:
- more "bool expected but null returned" errors
2022-06-27 13:49:53 +02:00
Roland Häder
7c049abfda
Fixed:
- Contact/User::isBlocked() needs to return boolean, but sometimes (strangely)
  a NULL can come from database, so let's cast it

This tries to fix:
TypeError: "Return value of Friendica\Model\Contact\User::isBlocked() must be of the type bool, null returned"
2022-06-27 11:39:18 +02:00
Roland Häder
4bdce6948f
Changed:
- $publicContact['about'] can be NULL, causing following error:
--------------------------
Argument 1 passed to Friendica\Content\Text\BBCode::toPlaintext() must be of
the type string, null given, called in /.../src/Object/Api/Twitter/User.php
--------------------------
The "expensive" code there can be avoided being called by an empty string or
NULL to increase performance.
2022-06-26 23:28:48 +02:00
Philipp
e594656a48
Merge pull request #11684 from MrPetovan/bug/11651-ap-fetch-queue
Create ActivityPub\FetchQueue and ActivityPub\FetchQueueItem classes
2022-06-26 13:36:19 +02:00
Hypolite Petovan
91f5a7cc6b Convert potential spaces in Memcache(d) key names
- Address https://github.com/friendica/friendica/issues/11630#issuecomment-1166475036
- Add test for space in cache keys
2022-06-26 07:30:30 -04:00
Philipp
b67e488236
adaptions 2022-06-26 10:13:32 +02:00
Philipp
0223c030a9
Improve 2 factor usage 2022-06-25 23:04:00 +02:00
Philipp
f3de8d7764
improve 2fa token field 2022-06-25 22:48:35 +02:00
Philipp
759d9d9f1a
Add more 2fa properties 2022-06-25 22:48:34 +02:00
Philipp
b86ff1e970
Rename 2FA recovery message 2022-06-25 22:48:34 +02:00
Hypolite Petovan
da32fa8fa6 Create ActivityPub\FetchQueue and ActivityPub\FetchQueueItem classes
- These classes are used to flatten the recursive missing activity fetch that can hit PHP's maximum function nesting limit
- The original caller is responsible for processing the remaining queue once the original activity has been fetched
2022-06-25 12:40:54 -04:00
Hypolite Petovan
3c70d592f6
Merge pull request #11689 from Quix0r/rewrites/double-quotes-single
Changed more double-quotes to single
2022-06-25 12:02:01 -04:00
Roland Häder
e10dd20036
Made @TODO more clear? 2022-06-25 17:58:27 +02:00
Hypolite Petovan
a7d49877a8 Centralize share tag attribute extraction code in Content\Text\BBCode 2022-06-25 11:46:52 -04:00
Roland Häder
4164cdacf5
Changes:
- added type-hints
- added documentation
2022-06-25 16:48:37 +02:00
Roland Häder
804b759df1
Changes:
- let's get rid of that `Database::exists()` is being misused for checking table existence
- reformatted array
2022-06-25 16:48:37 +02:00
Roland Häder
f689faca99
Changed double-quotes to single 2022-06-25 16:48:36 +02:00
Roland Häder
88870d18be
Changes:
- added some type-hints
- added documentation
2022-06-25 16:48:36 +02:00
Roland Häder
39675fe683
Space for the rescue. ;-) 2022-06-25 16:48:35 +02:00
Roland Häder
b0693c1ad7
Reformatted array 2022-06-25 16:48:35 +02:00
Roland Häder
f12cc9648e
Changes:
- added some type-hints
- changed some double-quotes to single
2022-06-25 16:48:35 +02:00
Hypolite Petovan
aa133b5437 Add explicit gserver.site_name string truncate in Model\GServer
- Avoids "Data too long for column 'site_name'" database errors
2022-06-25 06:25:48 -04:00
Hypolite Petovan
a2afb101cd Fix off-by-one error in Message ID header count check in Util\Emailer 2022-06-25 05:35:24 -04:00
Hypolite Petovan
c75dbfd3d7 Update default value for LocalRelationship->priority to avoid null values
- Address https://github.com/friendica/friendica/issues/11630#issuecomment-1166192993
2022-06-25 05:06:22 -04:00
Hypolite Petovan
636b84b41c Update return value type-hint of GServer::getProtocol
- Address https://github.com/friendica/friendica/issues/11630#issuecomment-1164880874
2022-06-25 05:06:22 -04:00
Hypolite Petovan
c5b46fe748
Merge pull request #11681 from Quix0r/fixes/item-guidfromuri-allow-null
Allowing Item::getFromUri()'s 2nd parameter a null value
2022-06-24 10:15:26 -04:00
Roland Häder
82bb36e13d
Changes:
- Made Item::guidFromUri()'s $host parameter optional (allowing null)
- added some type-hints
- added documentation
- this may fix reported issue in #11630
2022-06-24 03:17:57 +02:00
Philipp
2dc38e5632
Move documentation :-) 2022-06-23 23:23:36 +02:00
Philipp
5bf5b5e6c9
adaptions :-) 2022-06-23 23:01:09 +02:00
Philipp
12ba37e8d2
add more doc 2022-06-23 22:46:46 +02:00
Philipp
13783089e7
Add copyright 2022-06-23 22:44:17 +02:00
Philipp
d441b90bda
Respect Forwarded-For headers 2022-06-23 22:42:35 +02:00
Roland Häder
657a8a7cb5
Changes:
- documented null value
- two ' to much!
2022-06-23 17:30:17 +02:00
Roland Häder
202857ba7d
No need to log $tid here 2022-06-23 17:30:17 +02:00
Roland Häder
fd8f4269ff
Reformatted code 2022-06-23 17:30:17 +02:00
Roland Häder
5699b03e8d
Changes:
- added some nodes to OpenSearch descriptor
- still no UTF-8 encoding!
- added some type-hints
2022-06-23 17:30:16 +02:00
Roland Häder
a49fb9cbf9
Changes:
- added some type-hints
- added documentation
2022-06-23 17:30:16 +02:00
Roland Häder
84d3eecc33
Changes:
- added some type-hints
- changed double-quotes to single
2022-06-23 17:30:15 +02:00
Roland Häder
57e741f2cf
More type-hints added 2022-06-23 17:30:15 +02:00
Roland Häder
182c3db9b8
Changes:
- added type-hints
- added missing documentation
2022-06-23 17:30:15 +02:00
Roland Häder
b8353a6eb7
Changes:
- reformatted some array
- added missing documentation
- added type-hints
- changed double-quotes to single
2022-06-23 17:30:14 +02:00
Roland Häder
c6c936a80f
Added more type-hints 2022-06-23 17:30:14 +02:00
Roland Häder
3f74a59f73
Added some type-hints 2022-06-23 17:30:14 +02:00
Roland Häder
69a68be800
Added some missing type-hints 2022-06-23 17:30:13 +02:00
Roland Häder
d8ff966d21
Throw IAE again (should never become visible) 2022-06-23 17:30:13 +02:00
Roland Häder
35c78ce14c
Ops, cannot return Thread? 2022-06-23 17:30:12 +02:00
Roland Häder
c2e26b4f49
Changed:
- Introduced InvalidArgumentException (should never come)
- added type-hints
2022-06-23 17:30:12 +02:00
Roland Häder
2f3705f471
Continued:
- renamed varibales to $camelCase
- added type-hints
- updated documentation
2022-06-23 17:30:11 +02:00
Roland Häder
0ddb315b23
$id in Transmitter::sendContactAccept() is a string, see Introduction class 2022-06-23 16:48:00 +02:00
Hypolite Petovan
bf600905d3
Merge pull request #11676 from Quix0r/fixes/array-element-missing
Maybe this fixes missing array element
2022-06-23 09:06:59 -04:00
Roland Häder
636fef26f1
Maybe this fixes missing array element 2022-06-23 07:40:49 +02:00
Roland Häder
589d0360a4
So simple ... Ops! 2022-06-23 04:58:45 +02:00
Roland Häder
69676c9f7b
Changes:
- enabled sub-directories for compiled/cached files which avoids large+slow
  directory descriptors
- changed some double-quotes to single
2022-06-23 04:24:55 +02:00
Roland Häder
7eefb9aed8
Changed:
- empty() is maybe superflous here, still I would prefer a code style that is
  written explicitly and not rely on "magic casting"
2022-06-22 18:57:01 +02:00
Roland Häder
15d8341d9a
Converted multiple single-comment (//) to multi-line comment block (/* */) 2022-06-22 18:06:35 +02:00
Roland Häder
b996712ef7
Images::getInfoFromURL[Cached]() will both return empty arrays on error and
that needs to be reflected here, too.
2022-06-22 17:20:59 +02:00
Roland Häder
eb231bc548
Fixed: ?? didn't work here as bool won't be seen as null 2022-06-22 17:09:53 +02:00
Philipp
78bf7f187c
Merge pull request #11669 from MrPetovan/bug/11666-email-subject-double-encode 2022-06-22 16:51:23 +02:00
Roland Häder
d5441da49a
Fixed:
- TypeError: "Argument 1 passed to Friendica\Util\XML::escape() must be of the
  type string, null given, called in src/Util/XML.php line 171
2022-06-22 16:20:26 +02:00
Roland Häder
101cd2dd10
Changes:
- added some documentation
- fixed some documentation
- changed more double-quotes to singl
2022-06-22 16:14:14 +02:00
Roland Häder
ba45e59313
Changes:
- added more type-hints
- added missing documentation
- Email::send() now returns what mail() returns (bool)
2022-06-22 14:36:48 +02:00
Roland Häder
ee8d0ad619
Changes:
- added more type-hints
- added some documentation
2022-06-22 14:36:47 +02:00
Roland Häder
feec96cbc4
Return empty array on error (I hope it works this way). 2022-06-22 14:36:47 +02:00
Roland Häder
2dd7d465e8
Changes:
- added more type-hints
- updated documentation
- changed double-quotes to single
2022-06-22 14:36:47 +02:00
Roland Häder
74ab7648c6
Changes:
- addHubLink()'s 2nd parameter is DOMElement
- added more type-hints
- converted double-quotes to single
2022-06-22 14:36:46 +02:00
Roland Häder
12add2fb64
$data can turn into bool here 2022-06-22 14:36:46 +02:00
Roland Häder
08f55f0358
Ops, forgot to rename these, too. 2022-06-22 14:36:46 +02:00
Roland Häder
abd0d9f3fd
Changes
- added type-hints
- added some documentation
- added default: block for unknown 'rel' value
- changed return type void to empty array
2022-06-22 14:36:45 +02:00
Roland Häder
dfa95ea58d
Changes:
- added type-hints
- added documentation
2022-06-22 14:36:45 +02:00
Roland Häder
84bfc37bf1
Changes:
- added more type-hints
- added missing documentation
2022-06-22 14:36:45 +02:00
Hypolite Petovan
e9f7bb477d Add expected type-hint to BoundariesPager::renderFull
- Address https://github.com/friendica/friendica/issues/11630#issuecomment-1162634199
2022-06-22 07:49:45 -04:00
Hypolite Petovan
7295138f8d Remove type-hint inconsistent with expected return value in Database->getVariable 2022-06-22 07:47:15 -04:00
Hypolite Petovan
d68f307337 Remove email subject encoding from ItemCCEmail constructor
- It was wrongly re-encoded in Emailer::send
2022-06-21 21:12:09 -04:00
Roland Häder
2f358607c7
Changes:
- renamed Logger::getLogger() to getInstance() (@MrPetovan)
2022-06-22 01:50:10 +02:00
Roland Häder
cdcfb4064b
Changes:
- added type-hints
- added missing documentation
- renamed Logger::getWorker() to Logger::getLogger() as there is no worker class
  returned but the actual (inner) logger
2022-06-21 21:22:16 +02:00
Roland Häder
80c8ec17c2
Fixed documentation 2022-06-21 18:43:25 +02:00
Roland Häder
0332a57bfd
Rewrote to suggestions from @MrPetovan (I tried to maintain the old way of
['scheme' => 'table'] with my version).
2022-06-21 18:13:01 +02:00
Roland Häder
5fe428d3e4
Fixed:
- PHPUnit\Framework\Error\Notice:  Undefined index: language in /.../src/Util/EMailer/MailBuilder.php on line 122
2022-06-21 13:47:40 +02:00
Roland Häder
1080a840f5
Changes:
- Database->$driver can no longer be NULL, an empty string is fine anyway
2022-06-21 13:47:39 +02:00
Roland Häder
945cd1a2c2
Fixed:
- since $table can be now schema.table, this needs being taken care off
- maybe this foreach(explode()) is a bit an overkill as only 1 or 2 entries
  can be found in it
2022-06-21 13:47:39 +02:00
Roland Häder
0d81a08e3c
WIP: Properly some fixes? Also why is DROP VIEW IF EXISTS is being killed? 2022-06-21 13:47:39 +02:00
Roland Häder
44a9ec9b17
Rewrite:
- avoid having array|string for $table to have a "string" type-hint for $table
- you now have to do it for yourself by giving 'schema.table' as parameter
2022-06-21 13:47:38 +02:00
Roland Häder
f62c28008a
Removed comment 2022-06-21 13:47:38 +02:00
Roland Häder
cefffde691
Changes:
- added type-hints
- added some missing documentation
2022-06-21 13:47:37 +02:00
Roland Häder
f1867463a0
Changes:
- added more type-hints
2022-06-21 13:47:37 +02:00
Roland Häder
77c37ff2db
Fixed:
- Uncaught Exception TypeError: "Argument 3 passed to
  Friendica\Protocol\DFRN::createActivity() must be of the type string, null
  given, called ..."
2022-06-21 13:47:37 +02:00
Tobias Diekershoff
4650ff53d9
Merge pull request #11662 from MrPetovan/bug/11661-splitattachment-null
Ensure parameter 4 of Post\Media::splitAttachment is a boolean value
2022-06-21 06:48:52 +02:00
Hypolite Petovan
d2ca812647
Merge pull request #11660 from Quix0r/fixes/more-type-hints-003
More type-hints - Batch 003
2022-06-20 21:53:17 -04:00
Roland Häder
3e522ed512
Fixed:
- prevent NULL from being handled over to XML::escape()
- still I wonder that an object can be? It is a string-only accepting method
2022-06-21 01:42:37 +02:00
Roland Häder
95f9eb34ac
Fixed indenting 2022-06-21 01:29:33 +02:00
Roland Häder
b6fa022a73
Changes:
- added type-hints
- added some documentation
- marked some generic methods to be moved to Util\Strings class instead
2022-06-20 23:50:24 +02:00
Roland Häder
fbae0b8bcf
Changes:
- renamed ItemArrayFromMail() to getItemArrayFromMail() to follow naming-convetion
- added missing type-hints
- added missing documentation
2022-06-20 21:22:46 +02:00
Roland Häder
ea22e88896
Added documentation 2022-06-20 21:02:34 +02:00
Roland Häder
752953e472
Changes:
- as @MrPetovan pointed out, $actor can be NULL earlier and used later as NULL
- added some missing type-hints
- added missing documentation
- the added @TODO points out to avoid true|false|null for a boolean
2022-06-20 21:00:19 +02:00
Hypolite Petovan
88eacbf66e Ensure parameter 4 of Post\Media::splitAttachment is a boolean value 2022-06-20 14:34:02 -04:00
Roland Häder
0c12e947dd
Changes:
- null was 2nd argument's value before, an empty string is basically the same here
2022-06-20 20:01:59 +02:00
Roland Häder
feb87e8dc3
Changes:
- let's start throwing exceptions on e.g. invalid arguments instead of returning
  FALSE
2022-06-20 19:09:08 +02:00
Roland Häder
4fb03cf163
Changes:
- fixed a null value handled over to Friendica\Model\APContact::getByURL()
- added missing type-hints
2022-06-20 19:05:02 +02:00
Roland Häder
e96a548286
Changes:
- dumped default value for $input
- added unknown 'platform' which prevents an "Undefined index: platform in
  /var/www/.../src/Model/GServer.php on line 940" error
2022-06-20 18:56:22 +02:00
Roland Häder
6743de63f5
Changed:
- DBA::exists() should only be used for checking if records exists.
- if you want to check if a table exists, please ALWAYS use
  DBStructure::existsTable() instead
2022-06-20 08:20:07 +02:00