mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31: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
|
|
@ -14,6 +14,7 @@ use Rhymix\Framework\Storage;
|
|||
use Rhymix\Framework\URL;
|
||||
use Rhymix\Modules\Admin\Controllers\Base;
|
||||
use Rhymix\Modules\Admin\Models\Icon as IconModel;
|
||||
use Rhymix\Modules\Admin\Models\Utility as UtilityModel;
|
||||
|
||||
class Domains extends Base
|
||||
{
|
||||
|
|
@ -340,8 +341,8 @@ class Domains extends Base
|
|||
$vars->meta_description = utf8_trim($vars->meta_description);
|
||||
|
||||
// Clean up the header and footer scripts.
|
||||
$vars->html_header = utf8_trim($vars->html_header);
|
||||
$vars->html_footer = utf8_trim($vars->html_footer);
|
||||
$vars->html_header = UtilityModel::cleanHeaderAndFooterScripts($vars->html_header ?? '');
|
||||
$vars->html_footer = UtilityModel::cleanHeaderAndFooterScripts($vars->html_footer ?? '');
|
||||
|
||||
// Validate the color scheme setting.
|
||||
$valid_color_scheme_options = array('auto', 'light', 'dark');
|
||||
|
|
|
|||
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