-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REF] dev/core#3676 Add in html2text/html2text to replace usage of roundcube's version we have in packages #23971
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
tools/scripts/composer/html2text_html2_text_php81_deprecation.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From c4d3df97f95c74cea45b452fa8bc8e153658f3f8 Mon Sep 17 00:00:00 2001 | ||
From: Ade Attwood <ade@practically.io> | ||
Date: Fri, 14 Jan 2022 10:31:09 +0000 | ||
Subject: [PATCH] Fix `html_entity_decode` deprecation warning in PHP 8.1 | ||
|
||
Passing null as the second parameter is deprecated in PHP 8.1. When using the | ||
`legacyConstruct` function the `htmlFuncFlags` are never set and passing null | ||
into `html_entity_decode`. | ||
|
||
This move setting `htmlFuncFlags` above the legacy check to ensure they are | ||
always set to prevent passing null into `html_entity_decode`. | ||
--- | ||
src/Html2Text.php | 7 ++++--- | ||
1 file changed, 4 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/src/Html2Text.php b/src/Html2Text.php | ||
index 16a6572..c3e0109 100644 | ||
--- a/src/Html2Text.php | ||
+++ b/src/Html2Text.php | ||
@@ -236,6 +236,10 @@ private function legacyConstruct($html = '', $fromFile = false, array $options = | ||
*/ | ||
public function __construct($html = '', $options = array()) | ||
{ | ||
+ $this->htmlFuncFlags = (PHP_VERSION_ID < 50400) | ||
+ ? ENT_QUOTES | ||
+ : ENT_QUOTES | ENT_HTML5; | ||
+ | ||
// for backwards compatibility | ||
if (!is_array($options)) { | ||
return call_user_func_array(array($this, 'legacyConstruct'), func_get_args()); | ||
@@ -247,9 +247,6 @@ public function __construct($html = '', $options = array()) | ||
|
||
$this->html = $html; | ||
$this->options = array_merge($this->options, $options); | ||
- $this->htmlFuncFlags = (PHP_VERSION_ID < 50400) | ||
- ? ENT_COMPAT | ||
- : ENT_COMPAT | ENT_HTML5; | ||
} | ||
|
||
/** |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is just correcting the order of the function parameters the expected output should be first then the actual recorded output