Commit Graph

78 Commits

Author SHA1 Message Date
Hypolite Petovan 1874a32728 Happy New Year 2023! 2023-01-01 09:36:24 -05:00
Hypolite Petovan 91c4ab2359 Add new xpathQuote and checkRelMeLink methods to Content\Text\HTML class
- Add tests for both methods
2022-12-23 02:41:22 -05:00
Hypolite Petovan 39607b20e2 Convert custom profile field URL values to rel="me" links 2022-12-18 23:24:59 -05:00
Hypolite Petovan 4a626ef101 Create new Contact\Redir module class
- Move /redir route to /contact/redir
2022-11-08 20:12:23 -05:00
Hypolite Petovan 3e1b6890b7 Fix removing falsy text nodes in HTML::tagToBBCodeSub
- This wrongly removed text nodes containing just '0'
2022-09-24 22:03:49 -04:00
Roland Häder 962b06bf41
Added check as suggested by @MrPetovan for empty $message. 2022-06-16 16:54:51 +02:00
Roland Häder 143e4c4a18
Added more known type-hints
Signed-off-by: Roland Häder <roland@mxchange.org>
2022-06-15 21:52:50 +02:00
Hypolite Petovan 237492979c Add rel="tag" to the HTML Purifier allow list in BBCode::convert
- This enables Mastodon to recognize hashtag links and prevent unwarranted link previews
2022-02-01 08:20:45 -05:00
Balázs Úr e56a53647b Update copyright 2022-01-02 08:27:47 +01:00
Michael eb1b2256a0 Removed and replaced deprecated functionalities 2021-11-07 14:00:47 +00: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 c89533a70b Support for stacked profiler analysis 2021-07-27 04:57:29 +00:00
Michael 2502a9192d Many more app-variables removed 2021-07-24 10:09:39 +00:00
Michael 5a00902e11 Avoid HTML parsing of an empty body 2021-04-10 05:46:19 +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
Hypolite Petovan 93823ecef5 Move HTML purification to own method in Content\Text\HTML 2021-03-14 14:19:33 -04:00
Adam Clark 995d53ebfc Missed this file when adding. 2021-02-23 10:18:56 -08:00
Michael 312c01a517 Several speed improvements (magiclink, caching, indexes) 2021-02-17 18:59:19 +00:00
Michael 3ec1270fde Quit when message is empty 2020-12-19 18:17:32 +00: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 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
Michael 71b6226909 Some more avatar function replacements 2020-07-28 19:30:55 +00:00
Hypolite Petovan 0bc7b89530 Replace existing block escaping by performWitEscaped* calls 2020-06-08 18:40:20 -04:00
Michael a3c4021f12 Issue 8514: Make paging for searcg items work again
Fixes #8514
2020-05-17 13:51:56 +00:00
Hypolite Petovan b100b9600e Add rel="noopener noreferrer" to all target="_blank" links
See https://mathiasbynens.github.io/rel-noopener/
2020-02-24 20:07:34 -05:00
nupplaPhil 23c64b9a11
Add license info at Friendica classes 2020-02-09 15:45:36 +01:00
Philipp Holzer ed9392469e
Remove unneeded Config namespace usages 2020-01-19 22:50:44 +01:00
Philipp Holzer 6c36fd9e01
Move Config::get() to DI::config()->get() 2020-01-19 21:21:13 +01:00
Hypolite Petovan 1bc4b2e078
Merge pull request #8134 from nupplaphil/task/di_l10n
Cleanup L10n namespace
2020-01-19 11:30:19 -05:00
Philipp Holzer d6efc90194
cleanup namespace usages for L10n 2020-01-19 16:31:33 +01:00
Philipp Holzer 5dfee31108
Move L10n::t() calls to DI::l10n()->t() calls 2020-01-19 16:31:16 +01:00
Hypolite Petovan c632d4e7a2 Update deprecated passing glue string after array in implode in Content\Text\HTML 2020-01-19 10:25:18 -05:00
Michael 0a4119adaf @brief is removed completely 2020-01-19 06:05:23 +00:00
Michael 8e87c5f05f Fix: removed unneeded HTML escaping 2020-01-07 22:00:39 +00:00
Philipp Holzer f0eea6f875
Remove get_app() in favor of DI::app() 2020-01-04 23:42:01 +01:00
Michael 9b750345c7 Arrays 2019-12-27 01:15:54 +00:00
Michael b1b3744759 Support for tables in HTML2BBCode parser 2019-12-27 01:07:19 +00:00
Hypolite Petovan 146646c4d4 Replace deprecated calls to defaults() by ?? and ?: in src/ 2019-10-16 08:38:52 -04:00
Hypolite Petovan 230a97ccdd Correctly URL encode return URLS for saved search 2019-10-13 08:39:55 -04:00
Hypolite Petovan 22598fc7e8 Improve search box
- Use new saved search module
- Use dynamic search option loop
- Use "q" instead of "search" for search query string parameter
2019-10-07 14:27:46 -04:00
Hypolite Petovan 1f20a9330c Add new ignoreChildren behavior to HTML::tagToBBCode
- Allow discarding HTML tag children for single-value BBCode
- Add test for it
2019-09-25 20:44:09 -04:00
Michael Vogel 74d93269da Prevent a fatal error for an empty parameter in "unparseURL" 2019-08-23 07:19:08 +02:00
Hypolite Petovan 246894f233 Ensure trimmed HTML nodes are text nodes in HTML::toBBCode 2019-08-06 21:22:19 -04:00
Hypolite Petovan 79374dbf7a Fix DOMNodeList length compatibility with PHP <7.2 in Content\Text\HTML 2019-08-06 09:00:32 -04:00
Hypolite Petovan 5dbf319e06 Fix bug removing spaces between hashtag links in HTML::toPlaintext 2019-08-06 08:20:48 -04:00
Hypolite Petovan 2ab43f94d8 Revert using LIBXML_NOBLANKS
- This removed all self-closing tags (img, br, etc...) from HTML sources
2019-08-05 20:57:03 -04:00
Michael Vogel a507963c7f
Merge pull request #7474 from MrPetovan/bug/7457-html-bbcode-plaintext
Fix HTML/BBCode::toPlaintext
2019-08-04 22:08:53 +02:00
Hypolite Petovan a0f77e1800 Improve HTML::toPlaintext
- Ignore empty trimmed text nodes
- Ignore anchor links
- Ignore blank tags and avoids adding a doctype to transitional DOM objects
2019-08-04 10:11:59 -04:00