das ist n regulärer ausdruck, und der wird n fehler auswerfen, als folgeschaden.
die (deine) Function sieht bei mir so aus:
/**
* Extract the charset value from HTML meta tag.
*
* @param string HTML content
* @return string The charset value if found.
*/
function getHTMLcharset($content) {
if (eregi('<meta[[:space:]]+[^>]*http-equiv[[:space:]]*=[[:space:]]*["\']CONTENT-TYPE["\'][^>]*>',$content,$reg)) {
if (eregi('charset[[:space:]]*=[[:space:]]*([[:alnum:]-]+)',$reg[0],$reg2)) {
return $reg2[1];
}
}
}
ich wollte aber eigentlich diese function haben von dir :
function splitHTMLContent($content) {
...
}
an der hatten wir ja auch (hoffentlich) nur etwas gemacht 🙂
und die sieht bei mir genau so aus:
function splitHTMLContent($content) {
// divide head from body ( u-ouh :) )
$contentArr = $this->defaultContentArray;
$contentArr['body'] = stristr($content,'<body'); headpart="substr($content,0,-strlen($contentArr['body']));" get="" title="" this-="">embracingTags($headPart,'TITLE',$contentArr['title'],$dummy2,$dummy);
$titleParts = explode(':',$contentArr['title'],2);
$contentArr['title'] = trim(isset($titleParts[1]) ? $titleParts[1] : $titleParts[0]);
// get keywords and description metatags
for($i=0;$this->embracingTags($headPart,'meta',$dummy,$headPart,$meta[$i]);$i++) { /*nothing*/ }
for($i=0;isset($meta[$i]);$i++) {
$meta[$i] = t3lib_div::get_tag_attributes($meta[$i]);
//auskommentiert um Metatags nicht mehr zu indizieren
//if(stristr($meta[$i]['name'],'keywords'))$contentArr['keywords'].=','.$meta[$i]['content'];
if(stristr($meta[$i]['name'],'description')) $contentArr['description'].=','.$meta[$i]['content'];
}
// Process <!--TYPO3SEARCH_begin--> or <!--TYPO3SEARCH_end--> tags:
$this->typoSearchTags($contentArr['body']);
// Get rid of unwanted sections (ie. scripting and style stuff) in body
$tagList = explode(',',$this->excludeSections);
foreach($tagList as $tag) {
while($this->embracingTags($contentArr['body'],$tag,$dummy,$contentArr['body'],$dummy2));
}
// remove tags, but first make sure we don't concatenate words by doing it
$contentArr['body'] = str_replace('<',' <',$contentArr['body']);
$contentArr['body'] = trim(strip_tags($contentArr['body']));
$contentArr['keywords'] = trim($contentArr['keywords']);
$contentArr['description'] = trim($contentArr['description']);
// Return array
return $contentArr;
}