| version 1.4, 2002/10/14 22:38:27 |
version 1.5, 2002/10/25 00:50:52 |
| Line 166 class HTML_Content |
|
| Line 166 class HTML_Content |
|
| $this->_data['head_attr'] = trim($matches[1]); |
$this->_data['head_attr'] = trim($matches[1]); |
| $this->_data['head'] = trim($matches[2]); |
$this->_data['head'] = trim($matches[2]); |
| } |
} |
| if (preg_match('{<body([^>]*)>(.*)(</body>|</html>|$)}si', $all_data, $matches)) { |
if (preg_match('{<body([^>]*)>(.*)$}si', $all_data, $matches)) { |
| $this->_data['body_attr'] = trim($matches[1]); |
/* This will try to find closing BODY or HTML tag and if not found, |
| |
content will remain till end of file although document is not |
| |
valid without these ending tags */ |
| |
if (($pos = strpos($matches[2], '</body>')) !== false) { |
| |
$matches[2] = substr($matches[2], 0, $pos - 1); |
| |
} elseif (($pos = strpos($matches[2], '</html>')) !== false) { |
| |
$matches[2] = substr($matches[2], 0, $pos - 1); |
| |
} |
| $this->_data['body'] = trim($matches[2]); |
$this->_data['body'] = trim($matches[2]); |
| |
$this->_data['body_attr'] = trim($matches[1]); |
| } |
} |
| if ($this->_data['head'] == '' && $this->_data['body'] == '') { |
if ($this->_data['head'] == '' && $this->_data['body'] == '') { |
| $this->_data['body'] = $all_data; |
$this->_data['body'] = $all_data; |