Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

[BUGFIX] Deprecation Notice HtmlUtility.php #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Classes/Utility/HtmlUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class HtmlUtility
* @param string $content: the input content
* @return string the input content with HTML comment removed
*/
public function removeHTMLComments($content)
public static function removeHTMLComments($content)
{
$result = preg_replace('/<!(?:--[\s\S]*?--\s*)?>[\t\v\n\r\f]*/', '', $content);
return $result;
Expand All @@ -46,7 +46,7 @@ public function removeHTMLComments($content)
* @param string $content: the input content
* @return string the input content with HTML br tags replaced
*/
public function replaceHTMLBr($content)
public static function replaceHTMLBr($content)
{
$result = preg_replace('/<br\s?\/?>/', LF, $content);
return $result;
Expand All @@ -58,7 +58,7 @@ public function replaceHTMLBr($content)
* @param string $content: the input content
* @return string the input content with HTML tags removed
*/
public function removeHtmlTags($content)
public static function removeHtmlTags($content)
{
// Preserve <http://...> constructs
$result = str_replace('<http', '###http', $content);
Expand All @@ -73,10 +73,10 @@ public function removeHtmlTags($content)
* @param string $content: the input content
* @return string the input content with superfluous fine feeds removed
*/
public function removeSuperfluousLineFeeds($content)
public static function removeSuperfluousLineFeeds($content)
{
$result = preg_replace('/[' . preg_quote(LF . CR) . ']{2,}/', LF, $content);
$result = preg_replace('/[' . preg_quote(LF) . ']{3,}/', LF, $result);
return $result;
}
}
}