我构建了一个脚本,它将页面上的所有css组合在一起,以便在我的cms中使用它.它工作了很长时间,现在我得到这个错误:
警告:DOMDocument :: loadHTML()[domdocument.loadhtml]:实体中的标签头无效,第26行的css.php中的第10 行警告:DOMDocument :: loadHTML()[domdocument.loadhtml]:实体中的标签导航无效,第26行的css.php中的第10 行警告:DOMDocument :: loadHTML()[domdocument.loadhtml]:实体中的标记部分无效,第26行的css.php中的第 22行:这是php脚本
这是我的代码:
<?php
header('Content-type: text/css');
include ('../global.php');
if ($usetpl == '1') {
$client = New client();
$tplname = $client->template();
$location = "../templates/$tplname/header.php";
$page = file_get_contents($location);
} else {
$page = file_get_contents('../index.php');
}
class StyleSheets extends DOMDocument implements IteratorAggregate
{
public function __construct ($source)
{
parent::__construct();
$this->loadHTML($source);
}
public function getIterator ()
{
static …
Run Code Online (Sandbox Code Playgroud)