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

Diff for phpPlatonLib/HTML_Content/Content.php between version 1.24 and 1.25

version 1.24, 2005/01/31 20:30:29 version 1.25, 2010/07/17 19:33:54
Line 14 
Line 14 
  * @access      public   * @access      public
  */   */
   
 /* $Platon: $ */  /* $Platon: phpPlatonLib/HTML_Content/Content.php,v 1.24 2005/01/31 20:30:29 nepto Exp $ */
   
 /* Notes:  /* Notes:
   
Line 414  class HTML_Content
Line 414  class HTML_Content
                 return $ret;                  return $ret;
         } /* }}} */          } /* }}} */
   
 #  
 #  D E P R E C A T E D  
 #  
   
         function getMeta($attr, $value) /* {{{ */  
         {  
                 $this->_data['meta'] == null && $this->_parseMeta();  
                 $attr = strtolower($attr);  
                 for ($i = 0; $i < count($this->_data['meta']); $i++) {  
                         if (isset($this->_data['meta'][$i][$attr])  
                                         && stristr($this->_data['meta'][$i][$attr], $value)) {  
                                 return $this->_data['meta'][$i];  
                         }  
                 }  
         } /* }}} */  
   
         function _parseTitle() /* {{{ */  
         {  
                 if (preg_match('|<title>(.*)</title>|si', $this->_data['head'], $matches)) {  
                         $this->_data['title'] = trim($matches[1]);  
                         return;  
                 }  
                 $this->_data['title'] = '';  
         } /* }}} */  
   
         function _parseMeta() /* {{{ */  
         {  
                 $this->_data['meta'] = array();  
                 if (preg_match_all('|<meta ([^>]*)>|si', $this->_data['head'], $matches) > 0) {  
                         $meta_idx = 0;  
                         foreach ($matches[1] as $val) {  
                                 $ar = preg_split('{([\w-]+)=(\'[^\']*\'|"[^"]*"|[^ ]*)}si',  
                                                 $val, -1, PREG_SPLIT_DELIM_CAPTURE);  
                                 for ($i = 1; $i < count($ar); $i++) {  
                                         $attr  = $ar[$i++];  
                                         $value = $ar[$i++];  
                                         $l_val = strlen($value);  
                                         if ($l_val > 1 && (($value[0] == "'" && $value[$l_val - 1] == "'")  
                                                                 || ($value[0] == '"' && $value[$l_val - 1] == '"'))) {  
                                                 $value = substr($value, 1, $l_val - 2);  
                                         }  
   
                                         $this->_data['meta'][$meta_idx][strtolower($attr)] = trim($value);  
                                 }  
                                 $meta_idx++;  
                         }  
                 }  
         } /* }}} */  
   
 }  }
   
 /* Modeline for ViM {{{  /* Modeline for ViM {{{

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

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