mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-20 19:59:54 +09:00
Absorb core functionality of stripEmbedTagForAdmin() into HTMLFilter class
This commit is contained in:
parent
616d894021
commit
ef6f0c839f
2 changed files with 30 additions and 13 deletions
|
|
@ -87,6 +87,21 @@ class HTMLFilter
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove embedded media from HTML content.
|
||||
*
|
||||
* @param string $input
|
||||
* @param string $replacement
|
||||
* @return string
|
||||
*/
|
||||
public static function removeEmbeddedMedia($input, $replacement = '')
|
||||
{
|
||||
$input = preg_replace('!<object[^>]*>(.*?</object>)?!is', $replacement, $input);
|
||||
$input = preg_replace('!<embed[^>]*>(.*?</embed>)?!is', $replacement, $input);
|
||||
$input = preg_replace('!<img[^>]*editor_component="multimedia_link"[^>]*>(.*?</img>)?!is', $replacement, $input);
|
||||
return $input;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an instance of HTMLPurifier.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue