mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Remove <html>, <head>, <body> tags from header and footer scripts
This commit is contained in:
parent
0de42bebaf
commit
be6cc58311
2 changed files with 22 additions and 2 deletions
19
modules/admin/models/Utility.php
Normal file
19
modules/admin/models/Utility.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Rhymix\Modules\Admin\Models;
|
||||
|
||||
class Utility
|
||||
{
|
||||
/**
|
||||
* Clean up header and footer scripts.
|
||||
*
|
||||
* @param string $content
|
||||
* @return string
|
||||
*/
|
||||
public static function cleanHeaderAndFooterScripts(string $content)
|
||||
{
|
||||
$content = utf8_clean($content);
|
||||
$content = preg_replace('!</?(html|head|body)[^>]*>!', '', $content);
|
||||
return utf8_trim($content);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue