Commit graph

512 commits

Author SHA1 Message Date
Michael 54d474d0e4 function documentation clarified 2022-01-31 05:47:18 +00:00
Michael 8034a48ffe "inform" functionality moved / unified functionality 2022-01-30 10:56:13 +00:00
Hypolite Petovan aeb112ab5f Fix bidi support in shared posts
- Display was wrong when language direction was different between nickname and content
2022-01-17 07:39:05 -05:00
Michael 95f085b7ac API: The legacy API finally moved 2022-01-15 21:38:19 +00:00
Balázs Úr 733f3de9ed Add missing copyright text 2022-01-02 10:49:50 +01:00
Philipp 322b7c856c
Merge pull request #11129 from urbalazs/copyright-2022
Update copyright
2022-01-02 09:45:35 +01:00
Balázs Úr e56a53647b Update copyright 2022-01-02 08:27:47 +01:00
Michael 33f080d118 Remove obsolete network guessing function 2021-12-07 07:28:55 +00:00
Philipp Holzer 4cc36c9b2c
Fix BBCode::expandTags() & Remove AppMockTrait 2021-11-28 13:07:38 +01:00
Michael eb1b2256a0 Removed and replaced deprecated functionalities 2021-11-07 14:00:47 +00:00
Philipp Holzer 409d909d0f
Restructure HTTPClient for new paradigm 2021-10-28 20:01:03 +02:00
Michael Vogel df99ca8d82
Merge pull request #10888 from MrPetovan/task/10887-bbcode-style-block
Add conditional block output for BBCode tag [style]
2021-10-18 20:19:53 +02:00
Michael Vogel 1dc613a0a1
Merge pull request #10889 from MrPetovan/task/10886-bbcode-remove-class
Deprecate limited-use and potentially confusing [class] BBCode tag
2021-10-18 19:28:07 +02:00
Hypolite Petovan 6f290607de
Merge pull request #10890 from xundeenergie/improve-links
Improve links
2021-10-18 09:08:48 -04:00
Hypolite Petovan 39aff642aa Deprecate limited-use and potentially confusing [class] BBCode tag
- Replace its usage in Mastodon emoji with an internal tag [emoji]
2021-10-18 02:45:42 -04:00
Jakobus Schürz (admin) 4aaa5a6a46 open provider-url in new tab 2021-10-18 08:41:45 +02:00
Jakobus Schürz (admin) c450a7a757 open link from picture in new tab 2021-10-18 08:39:01 +02:00
Hypolite Petovan 4bee4818cf Add conditional block output for BBCode tag [style]
- Move new line conversion to <br> tags
- Update BBCode help page
2021-10-17 21:27:05 -04:00
Hypolite Petovan f9165fbaf0 Decode HTML entities in code blocks in HTML::toBBCode
- Replace PHP_EOL uses with the more common \n
2021-10-15 11:36:40 -04:00
Michael ab17fbf6b2 Unneeded "ProxyUtils" renamed to "Proxy" 2021-10-05 20:18:19 +00:00
Hypolite Petovan 9935e8e711 Remove event.adjust field
- It was confusing and introduced complexity that wasn't worth the unclear gain
2021-10-03 13:42:32 -04:00
Michael 9961943b73 Code Style: Replace "AS" with "as" 2021-10-03 10:34:41 +00:00
Michael 5a7bd4884a Issue 10772: Avoid duplicated links in AP posts 2021-09-27 20:26:08 +00:00
Michael Vogel 5246b9c4b0
Merge pull request #10697 from MrPetovan/bug/10692-api-expand-entities
Prevent expandTags to be performed on existing links in Module\Api\Mastodon\Statuses
2021-09-12 06:47:51 +02:00
Hypolite Petovan 8e99b7f775 Refine BBCode::expandTags regular expression
- Now requires the tag to be preceded by either a non-word character or a start of a line
- Added corresponding tests
2021-09-12 00:06:14 -04:00
Michael 6579a3a106 Use post type "photo" for multiple photos as well 2021-09-12 01:58:29 +00:00
Philipp Holzer 13a91e63aa
Rename DI::httpRequest() into DI::httpClient() 2021-08-25 21:54:54 +02:00
Philipp Holzer 505100bdd7
Rename HTTPRequestOptions to HTTPClientOptions 2021-08-25 21:45:15 +02:00
Philipp Holzer aad7bac686
Use HTTPRequestOptions constants for HTTPClient::post() 2021-08-25 21:31:30 +02:00
Philipp Holzer 65ca164487
A lot of Fixings 2021-08-20 21:35:14 +02:00
Philipp Holzer 06371d29a6
Cleanup 2021-08-20 20:03:42 +02:00
Philipp Holzer 803c1d71de
Fix IHTTPResult::getHeader()
- Now returns a string array, like expected
- Fix usages
- Fix dataset
2021-08-20 19:58:42 +02:00
Michael 6899d3c618 Meaningful notification message 2021-08-19 13:58:55 +00:00
Michael 6f40904ea1 Increased version 2021-07-28 10:18:34 +00:00
Michael d58eaa13d1 Issue 10545: Convert complex zmg BBCode elements 2021-07-27 21:44:02 +00:00
Michael c89533a70b Support for stacked profiler analysis 2021-07-27 04:57:29 +00:00
Michael 1539d76fda Forgotten variable 2021-07-25 20:39:03 +00:00
Michael 5a87ccf026 Getter/Setter for theme info 2021-07-25 19:39:10 +00:00
Michael c52b8595e8 theme infos are now bundled in a single array 2021-07-25 19:07:03 +00:00
Michael 2502a9192d Many more app-variables removed 2021-07-24 10:09:39 +00:00
Michael 71f53c946f New function to replace mentions with nicknames 2021-07-22 09:13:39 +00:00
Michael bb5f738619 Fix for Mastodon falsely adding previews to mentions 2021-07-22 04:50:01 +00:00
Michael 69c6a5f567 Avoid "DB Error" messages 2021-07-21 03:43:30 +00:00
Hypolite Petovan 2b5f1f8bca
Merge pull request #10493 from annando/api
Improve how shared posting look on mobile apps
2021-07-13 22:48:31 -04:00
Michael 5526421607 Issue 10491: Possibility for simple shortening added 2021-07-13 22:37:22 -04:00
Michael ff8f350a42 Change the BBCode version 2021-07-13 20:37:06 +00:00
Michael 875a6b81ef Improve links for API 2021-07-13 14:40:10 +00:00
Michael 267b652857 Improve how shared posting look on mobile apps 2021-07-13 08:30:05 +00:00
Michael 219534e88c Accepting "null" as parameter value 2021-07-11 14:37:17 +00:00
Michael 7390791d21 Avoid problems with "null" values 2021-07-11 11:11:03 +00:00
Michael d8974c9a2a Function renamed to better reflect the functionality 2021-07-09 06:29:24 +00:00
Michael 17ae9b71af Avoid error on empty content 2021-07-09 04:42:01 +00:00
Michael c972cce740 Avoid notice 2021-07-08 16:38:02 +00:00
Michael f29bd23ea8 New function to convert BBCode for a given ID 2021-07-08 13:47:46 +00:00
Michael f3452d86c4 Improved logging, improved link check 2021-07-06 17:40:40 +00:00
Michael d0136222e7 Further simplification 2021-07-06 09:24:25 +00:00
Michael 12173df4d3 Replace proxy function 2021-07-06 09:22:41 +00:00
Michael 8bfa15cf23 Simplify the attachment handling 2021-07-06 08:57:49 +00:00
Michael b7a4ef0ec1 Modfy links for attachments 2021-07-06 08:40:59 +00:00
Michael cdc18387fd Use the uri-id directly in the bbcode converter 2021-07-06 05:25:30 +00:00
Michael db90e3bf25 Remove attachment on plaintext conversion 2021-07-05 20:20:39 +00:00
Michael 90588ddb8e Avoid proxyfying images that are removed or replaced later 2021-07-05 07:00:35 +00:00
Michael e519b782fd Simplified proxy handling 2021-07-04 21:24:49 +00:00
Michael 9cf39dbf00 Quickfix for hashtags in usernames in shared posts 2021-07-02 04:34:49 +00:00
Michael b46b7b08ba Reduce the usage of the "proxifyUrl" function 2021-06-27 11:50:10 +00:00
Hypolite Petovan 303c9d4a54 Check Content\Item::replaceTag return for false return value before using it
- Address https://github.com/friendica/friendica/issues/10169#issuecomment-835547443
- Remove unused code in Content\Item::replaceTag
2021-05-31 08:29:50 -04:00
Michael 6fe916a390 API: improved mail handling 2021-05-22 13:37:04 +00:00
Hypolite Petovan 93f3c511dc Fix wrong display of mentions in RTL context 2021-05-20 08:39:36 -04:00
Michael 1cc341033f API: We now can post statuses via API 2021-05-15 22:40:57 +00:00
Hypolite Petovan cac038639d Capitalize post action translation strings 2021-05-11 16:01:07 -04:00
Michael f683f791ee Avoid duplicated attachments / unwanted attachments 2021-05-05 16:46:55 +00:00
Michael 8f318e492e Don't transmit smiley links to external systems 2021-05-04 21:07:41 +00:00
Michael 4ffb67e73c Another "curl" call is replaced with a standard call 2021-05-04 11:39:56 +00:00
Michael 60bec48f61 Replace "curl" calls with centralized "head" function 2021-05-04 11:35:23 +00:00
Hypolite Petovan 5bca6fe98c Add RTL support for display names in mentions 2021-05-01 15:32:17 -04:00
Michael b88c9f9d67 Handling bottom anchor and top anchor 2021-04-29 19:29:29 +00:00
Michael 8541e248bb Less greedy when replacing attachment elements 2021-04-29 04:14:44 +00:00
Michael 44c801905a Improve page load performance with attached links 2021-04-27 12:29:54 +00:00
Michael 8685e5ca32 Reworked media handling 2021-04-26 06:50:12 +00:00
Michael f21d04e01e Simplified code 2021-04-19 04:18:43 +00:00
Michael 02700194c1 Fix photo post detection / url check in publisher url 2021-04-18 14:38:12 +00:00
Michael 5a00902e11 Avoid HTML parsing of an empty body 2021-04-10 05:46:19 +00:00
Michael 99e93d2ba8 Remove empty lines arounf the horizontal ruler, no maximum height 2021-04-07 12:17:35 +00:00
Hypolite Petovan 1849bf0a12
Merge pull request #10124 from annando/media-attachments
Attached audio is now displayed with the audio element
2021-04-05 13:26:09 -04:00
Michael 770b9359a4 Harmonize the video display 2021-04-05 11:45:03 +00:00
Hypolite Petovan 3027b7d3aa Prevent HTMLPurify from removing ForkAwesome icon tags 2021-04-04 20:21:31 -04:00
Hypolite Petovan 62e7d0f40a Update HTML::purify debug comment formatting 2021-04-04 20:21:10 -04:00
Balázs Úr 054c301ef0 Update copyright 2021-03-29 08:40:20 +02:00
Michael 13ed585156 Display rhe provider and author of a shared post 2021-03-21 23:32:49 +00:00
Michael 08771d96c2 Remove unused parameter 2021-03-16 07:15:20 +00:00
Hypolite Petovan 393de1a283 Use system.allowed_oembed config to allow iframe source 2021-03-14 14:19:35 -04:00
Hypolite Petovan 93823ecef5 Move HTML purification to own method in Content\Text\HTML 2021-03-14 14:19:33 -04:00
Hypolite Petovan e1f8e10fe7 Increase video tag regular expression specificity to decrease backtrack in BBCode::convert 2021-03-13 09:06:52 -05:00
Hypolite Petovan a6423031eb
Merge pull request #9963 from mexon/mat/support-cid-scheme
Support cid URLs as used in mailstream plugin
2021-02-27 12:11:15 -05:00
Matthew Exon 4a16d8e06f Support cid URLs as used in mailstream plugin 2021-02-27 16:54:52 +00:00
Adam Clark 995d53ebfc Missed this file when adding. 2021-02-23 10:18:56 -08:00
Hypolite Petovan dc8ecbeb24 Add new Content\Text\BBCode::embedURL method 2021-02-18 09:06:13 -05:00
Michael 312c01a517 Several speed improvements (magiclink, caching, indexes) 2021-02-17 18:59:19 +00:00
Hypolite Petovan 7653bc00df Try OEmbed first for [audio] and [video] tags 2021-02-09 23:20:28 -05:00
Michael c3398511b4 New table "post-content" 2021-01-30 22:03:53 +00:00
Hypolite Petovan e2c38f1347 Prevent hashtag parsing and replacement in image alternative text 2021-01-22 17:45:28 -05:00
Hypolite Petovan 35213630e8 Remove strictly numeric tags exception
- It prevented to use year number hashtags for no clear benefit
2021-01-20 08:10:20 -05:00
Hypolite Petovan fff565a80b Prevent alt text of emoji image tags to be converted to smilies in BBCode::convert 2020-12-30 22:23:58 -05:00
Hypolite Petovan 4b1180ec8b Restore autolink in share block content in BBCode::convertShare 2020-12-21 22:46:29 -05:00
Michael 3ec1270fde Quit when message is empty 2020-12-19 18:17:32 +00:00
Hypolite Petovan bcd61c8372
Merge branch '2020.12-rc' into bug/9656-purify-video-embed 2020-12-18 14:47:24 -05:00
Hypolite Petovan 95f099d26c Restore Mastodon emoji span classes
- Fix typo in replacement of [class] tag
2020-12-18 11:08:03 -05:00
Hypolite Petovan 20d9dcf7ac Bump BBCode version to 2020-12-18 2020-12-18 10:32:36 -05:00
Hypolite Petovan 0781f28ca6 Allow support for allowlisted iframe sources in Content\text\BBCode::convert
- Support Youtube, Vimeo and unused local embeds
2020-12-18 10:32:36 -05:00
Hypolite Petovan ec0c9dcdb1 Remove support for [iframe] BBCode
- It was a huge gaping security hole, and now HTML Purify will remove the src attribute of all non-allowed sources anyway.
2020-12-18 10:32:36 -05:00
Hypolite Petovan e6270bc46d Enable back references in reg exp in BBCode::convert
- Bump BBCode version
2020-12-06 08:57:06 -05:00
Hypolite Petovan f141f5acf4 Prevents share block new lines from being converted to HTML <br> tags
- Address https://github.com/friendica/friendica/pull/9621#issuecomment-739333767
2020-12-05 19:55:16 -05:00
Hypolite Petovan e712706302 Add BBCode versioning
- This will trigger the re-conversion of displayed items on version update
2020-12-04 07:29:49 -05:00
Hypolite Petovan a0f6d678c4 Add HTML Purify to BBCode::convert
- Replace previous HTML cleanup using DOMDocument
- Remove obsolete HTML::sanitizeCSS method
- Use Strings::autoLinkRegEx for PageInfo::getRelevantUrlFromBody
- Update previous tests expectations
- Add new specific XSS tests
2020-12-04 07:29:48 -05:00
Hypolite Petovan dbb33399bc Prevent image descriptions from being replaced by local smilies
- AP-received emojis have their code in the image description
2020-11-15 00:12:26 -05:00
Hypolite Petovan edd439cfab Simplify code in Content\Text\BBCode::convert
- Use performWithEscapedTags instead of custom solution
2020-11-08 23:25:46 -05:00
Michael 498dda7999 Fix parser issues when a video is linked without a matching extension 2020-11-08 09:24:01 +00:00
Michael a012234d82 Publish the provider fields in the API 2020-10-26 19:40:09 +00:00
Philipp Holzer a6fc9cd32e
Remove $binary flag for HTTPRequest::get(), HTTPRequest::fetch(), HTTPRequest::fetchAll() (deprecated since PHP 5.1.3) 2020-10-18 20:56:31 +02:00
Philipp Holzer 0449077126
Revert "Fix IHTTPResult::getHeader() - Now returns a string array, like expected - Fix usages - Fix dataset"
This reverts commit 80bd0a4d
2020-10-11 23:25:40 +02:00
Philipp Holzer 80bd0a4d5a
Fix IHTTPResult::getHeader()
- Now returns a string array, like expected
- Fix usages
- Fix dataset
2020-10-10 23:11:30 +02:00
Michael Vogel 20652870b6
Update src/Content/Text/BBCode.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2020-10-06 04:55:28 +02:00
Michael Vogel 397f239abb
Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2020-10-05 17:40:06 +02:00
Michael 16224a7001 Improve plaintext generation for language detection 2020-10-05 12:50:18 +00:00
Michael 38ed5c943d Avoid probing non existing profiles 2020-08-19 05:24:53 +00:00
Michael 71b6226909 Some more avatar function replacements 2020-07-28 19:30:55 +00:00
Hypolite Petovan afb882048e Generate callstack value from inside Profiler::saveTimestamp
- Save a massive amount of time computing callstacks when profiling is disabled
2020-07-27 02:33:05 -04:00
nupplaPhil 657d08f09f Rename "fetchUrl" and "fetchUrlFull" to "fetch" and "fetchFull" 2020-07-21 03:15:53 -04:00
nupplaPhil 7029012f27 Rename "HTTPRequest::curl()" to HTTPRequest::get() 2020-07-21 03:14:01 -04:00
nupplaPhil 57587efe58 Move "getUserAgent()" to "HTTPRequest" class 2020-07-21 03:04:58 -04:00
nupplaPhil 1aa07f87a4 Make "HTTPRequest::fetchUrl" dynamic 2020-07-21 03:04:58 -04:00
nupplaPhil 5344efef71 Move post/curl/fetchUrl/fetchUrlFull to own class "Network\HTTPRequest" 2020-07-21 02:56:10 -04:00
Michael fc0312451d Changed parameter order for getByURL 2020-07-15 17:06:48 +00:00
Michael d9c6a46ffe Replaced "getDetailsByURL" with "getByURL/getByURLForUser" 2020-07-15 04:42:04 +00:00
Michael 52bb1ff0f1 Some more replaced logger 2020-06-28 17:35:56 +00:00
Michael Vogel f611c99ad7 Improve render speed by not probing for unknown contacts 2020-06-28 15:57:33 +02:00
Michael Vogel 7fd2c00171
Merge pull request #8792 from MrPetovan/task/share-block-guid
[frio] Add local post link to share block when guid attribute is present
2020-06-23 21:26:07 +02:00
Hypolite Petovan faeffff8a3 [pre] blocks now preserve spaces
- Added test case
- Added English documentation
2020-06-23 07:53:18 -04:00
Hypolite Petovan 251a3791dd Keep spaces after non-tags in Content\BBCode::convert
- Added test case
2020-06-23 07:52:38 -04:00
Hypolite Petovan d2aa68106b Make guid attribute available to convertShare callback 2020-06-21 09:45:00 -04:00
Hypolite Petovan 912ff069c0 Update getShareOpeningTag::getShareOpeningTag method signature
- Optional parameter $guid is now at the end
- Always provided parameter $posted is now mandatory
2020-06-21 09:42:37 -04:00
Hypolite Petovan cd74fb8609 Add new Content\BBCode::getShareOpeningTag 2020-06-18 08:53:30 -04:00
Hypolite Petovan f9ecbbd743 Exclude [img] tags from tag replacement
- It broke image captions by inserting an HTML link inside an HTML attribute
2020-06-16 16:34:16 -04:00
Michael Vogel 9b85d0b16e
Merge pull request #8740 from MrPetovan/task/frio-improve-share-display
[frio] Improve share blocks display
2020-06-11 07:32:29 +02:00
Hypolite Petovan db3f90ec01 Replace mention to $_SERVER with parameter in Content\Markdown::convert
- $_SERVER key isn't always available, no idea what it was used for exactly
2020-06-10 11:40:18 -04:00
Hypolite Petovan 9b2d758c1a Add no-parsing block escaping in BBCode::setMentions 2020-06-10 10:16:07 -04:00
Hypolite Petovan eaa7740da6 Remove superfluous code
- Remove explicit default parameter value in BBCode::convertShareCallback
- Remove Probe::$baseurl reset since the twitter probe sets the `baseurl` property
- Remove baseurl guessing in Probe::detect
2020-06-10 10:15:54 -04:00
Hypolite Petovan a5f0225d60 Add mention support to shared content 2020-06-10 10:15:54 -04:00
Hypolite Petovan 89b3ae2657 Add null/empty string parameter value case in BBCode::convert
- Remove obsolete coalesce operator uses
2020-06-08 19:15:08 -04:00
Hypolite Petovan 472018191b Add tag escaping to BBCode::setTags 2020-06-08 18:40:20 -04:00