com web/php: Fix warning on broken icalendar links: ug.php

From: 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-22196@lists.php.net to get a copy of this message
Commit: 2514f10ac4c5a8f3020f32cbdbb9f79a235bbded Author: Hannes Magnusson <bjori@mongodb.com> Wed, 22 Jan 2014 21:57:21 -0800 Parents: 13e2b3dd041f69cc79adfcd130a98d05fcc9cb18 Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=2514f10ac4c5a8f3020f32cbdbb9f79a235bbded 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; }

« previous php.webmaster (#22196) next »