Commit: 40bd6ae0626acdb0e40a8b7c8fa2d47ec917c71c Author: Hannes Magnusson <[email protected]> Wed, 22 Jan 2014 21:57:21 -0800 Parents: 6e1cd72453926b6c463343642293e1c2a3e22359 Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=40bd6ae0626acdb0e40a8b7c8fa2d47ec917c71c Log: Fix warning on broken icalendar links Changed paths: M ug.php Diff: diff --git a/ug.php b/ug.php index ce3a965..f055ff0 100644 --- a/ug.php +++ b/ug.php @@ -31,7 +31,12 @@ function ug_get_more_info($group) { file_put_contents("backend/events/" . md5($group["icalendar_url"]), $data); } */ - $data = file("backend/events/" . md5($url), FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); + $filename = "backend/events/" . md5($url); + /* Broken icalendar link */ + if (!file_exists($filename)) { + return ""; + } + $data = file($filename, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); $retval = ug_get_next_even_from_ical_array($data); return $retval; } -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
