mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 11:15:34 +00:00
Adding check to make sure file is a calendar file.
This commit is contained in:
parent
a7464b1854
commit
d3c667375d
@ -501,6 +501,16 @@ calendarManager.prototype.checkCalendarURL = function calMan_checkCalendarURL( C
|
||||
|
||||
function onResponseAndRefresh( )
|
||||
{
|
||||
//check to make sure this is a real calendar file first.
|
||||
//if its not, it causes Mozilla to crash.
|
||||
if( request.responseText.indexOf( "BEGIN:VCALENDAR" ) == -1 )
|
||||
{
|
||||
alert( "The calendar "+calendarToGet.name+" is not a valid iCalendar file." );
|
||||
gCalendarWindow.calendarManager.deleteCalendar( calendarToGet );
|
||||
saveDataToFile( calendarToGet.path, "", "UTF-8" );
|
||||
return;
|
||||
}
|
||||
|
||||
//save the stream to a file.
|
||||
saveDataToFile( calendarToGet.path, request.responseText, "UTF-8" );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user