cvs: phpweb / cal.php

From: Date: Fri, 22 Nov 2002 18:19:13 +0000
Subject: cvs: phpweb / cal.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-13786@lists.php.net to get a copy of this message
rasmus Fri Nov 22 13:19:13 2002 EDT Modified files: /phpweb cal.php Log: Make cal.php E_NOTICE clean Index: phpweb/cal.php diff -u phpweb/cal.php:1.34 phpweb/cal.php:1.35 --- phpweb/cal.php:1.34 Tue Jun 18 20:46:07 2002 +++ phpweb/cal.php Fri Nov 22 13:19:13 2002 @@ -9,10 +9,10 @@ # month (or the month of the requested day) $begun = 0; -$id = (int)$id; -$cy = (int)$cy; -$cm = (int)$cm; -$cd = (int)$cd; +$id = isset($id) ? (int)$id : 0; +$cy = isset($cy) ? (int)$cy : 0; +$cm = isset($cm) ? (int)$cm : 0; +$cd = isset($cd) ? (int)$cd : 0; if ($id) { if ($event = load_event($id)) { @@ -70,7 +70,7 @@ $events = load_events($date,1); -if ($errors) { +if (isset($errors) && $errors) { display_errors($errors); commonFooter(); exit(0); @@ -187,7 +187,8 @@ while (!feof($fp)) { $event = read_event($fp); - if ($seen[$event['id']]++) continue; # only want each event once! + if(!isset($seen[$event['id']])) $seen[$event['id']] = 1; + else continue; switch ($event['type']) { case 3: /* recurring event */ @@ -214,9 +215,8 @@ /* read an event from the event listing */ function read_event($fp) { - list(,,,,$sdesc,$id,$ldesc,$url,$recur,$tipo,$sdato,$edato) - = fgetcsv($fp,8192); - list($recur,$recur_day) = explode(":",$recur,2); + list(,,,,$sdesc,$id,$ldesc,$url,$recur,$tipo,$sdato,$edato) = fgetcsv($fp,8192); + @list($recur,$recur_day) = explode(":",$recur,2); return array( 'id' => $id, 'type' => $tipo,

« previous php.mirrors (#13786) next »