[Comoblog-commit] comoblog index.php,1.4,1.5
Status: Inactive
Brought to you by:
markwallis
|
From: Mark W. \(a. serialmonkey\) <mar...@us...> - 2006-04-19 12:38:49
|
Update of /cvsroot/comoblog/comoblog In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30013 Modified Files: index.php Log Message: Fix for the 1970 calendar problem Index: index.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- index.php 24 Feb 2006 00:01:13 -0000 1.4 +++ index.php 19 Apr 2006 12:38:33 -0000 1.5 @@ -27,12 +27,17 @@ if(isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '/') { $current_date = substr($_SERVER['PATH_INFO'],1,strlen($_SERVER['PATH_INFO'])-1); - $y = substr($current_date,0,4); - $m = substr($current_date,4,2); - $d = substr($current_date,6,2); + if (strlen($current_date) >= 8) + { + $y = substr($current_date,0,4); + $m = substr($current_date,4,2); + $d = substr($current_date,6,2); - $current_timestamp = mktime(0,0,0,$m,$d,$y); - if ($current_timestamp > time() || $current_timestamp <= 0) + $current_timestamp = mktime(0,0,0,$m,$d,$y); + if ($current_timestamp > time() || $current_timestamp <= 0) + $current_timestamp = time(); + } + else $current_timestamp = time(); } else { |