[Easymod-cvs] easymod/install/em_files/includes/em em_parser_text.php,1.7,1.8
Status: Beta
Brought to you by:
wgeric
From: Eric F. <wg...@us...> - 2006-01-20 22:50:44
|
Update of /cvsroot/easymod/easymod/install/em_files/includes/em In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24178/em_files/includes/em Modified Files: em_parser_text.php Log Message: better handling of history in text parser Index: em_parser_text.php =================================================================== RCS file: /cvsroot/easymod/easymod/install/em_files/includes/em/em_parser_text.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** em_parser_text.php 15 Jan 2006 05:29:59 -0000 1.7 --- em_parser_text.php 20 Jan 2006 22:50:36 -0000 1.8 *************** *** 194,207 **** { $line2 = trim(htmlspecialchars(substr($this->mod_contents[$i], strpos($this->mod_contents[$i], '##')+2))); ! $date = explode('-', $line2); if ( sizeof($date) > 3 ) { $j++; ! $this->header['history'][$j]['date'] = trim($date[0]) . '-' . trim($date[1]) . '-' . trim($date[2]); ! $this->header['history'][$j]['version'] = trim($date[3]); } else if ( !empty($line2) ) { ! $this->header['history'][$j]['change'][] = trim($date[1]); } $i++; --- 194,210 ---- { $line2 = trim(htmlspecialchars(substr($this->mod_contents[$i], strpos($this->mod_contents[$i], '##')+2))); ! preg_match('#([0-9]{4})-([0-9]{2})-([0-9]{2})\s-\s[a-z]*\s([0-9a-z.]*)#i', $line2, $date); if ( sizeof($date) > 3 ) { $j++; ! ! $temp = explode('.', $date[4]); ! $this->header['history'][$j]['date'] = trim($date[1]) . '-' . trim($date[2]) . '-' . trim($date[3]); ! $this->header['history'][$j]['version'] = (int) $temp[0] . '.' . (int) $temp[1] . '.' . $temp[2]; ! unset($temp); } else if ( !empty($line2) ) { ! $this->header['history'][$j]['change'][] = substr(trim($line2), 2); } $i++; |