com web/php: Fix warning on broken icalendar links: ug.php
| From: | Hannes Magnusson | Date: | Thu, 23 Jan 2014 05:57:21 +0000 |
| Subject: | com web/php: Fix warning on broken icalendar links: ug.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-18221@lists.php.net to get a copy of this message | ||
Commit: 40bd6ae0626acdb0e40a8b7c8fa2d47ec917c71c
Author: Hannes Magnusson <bjori@mongodb.com> 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;
}