Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, October 14, 2026

Diff for phpPlatonLib/HTML_Content/Content.php between version 1.7 and 1.8

version 1.7, 2002/12/02 23:09:49 version 1.8, 2002/12/15 09:05:26
Line 168  class HTML_Content
Line 168  class HTML_Content
                 if (preg_match('|^\s*<!DOCTYPE ([^>]*)>|', $all_data, $matches)) {                  if (preg_match('|^\s*<!DOCTYPE ([^>]*)>|', $all_data, $matches)) {
                         $this->_data['doctype'] = trim($matches[1]);                          $this->_data['doctype'] = trim($matches[1]);
                 }                  }
                 if (preg_match('|<head([^>]*)>(.*)</head>|si', $all_data, $matches)) {                  if (preg_match('|<head([^>]*)>(.*)</head[^>]*>|si', $all_data, $matches)) {
                         $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([^>]*)>(.*)$}si', $all_data, $matches)) {                  if (preg_match('{<body([^>]*)>(.*)$}si', $all_data, $matches)) {
                         /* This will try to find closing BODY or HTML tag and if not found,                          /* 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                             content will remain till end of file although document is not
                            valid without these ending tags */                             valid without these ending tags. */
                         if (($pos = strpos($matches[2], '</body>')) !== false) {                          $matches[2] = preg_replace('|^(.*)</body.*$|si','\\1',$matches[2]);
                                 $matches[2] = substr($matches[2], 0, $pos - 1);                          $matches[2] = preg_replace('|^(.*)</html.*$|si','\\1',$matches[2]);
                         } 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]);                          $this->_data['body_attr'] = trim($matches[1]);
                 }                  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top