-
-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with URLs that contain an @ symbol #314
Comments
Not personally, no. Could you provide an (anonymised) example of a URL that doesn't work, and some description of the parsing failure, please. Along with the details requested by the Issue Template. |
Yeah, so I'm working on a custom plugin for my wordpress site. I essentially have a file upload and a URL text field so that I can either upload an ICS or enter in a URL.. This is the URL causing issues These two URLS work https://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics I can download the ICS from the URL that doesn't work and upload it and it works fine. The warnings/fatal errors I'm getting are: ( ! ) Fatal error: Uncaught Exception: The file path or URL 'https://outlook.office365.com/owa/calendar/ceb1ae3ad22a4c66bf2b7293ebc21cfb@county-lambton.on.ca/127c4cd019924e1ba54861f278c0b83518115264385855080647/calendar.ics' does not exist. in C:\wamp64\www\Plugin Development\wp-content\plugins\icsImporter\ICal.php on line 2640 PHP Version: 7.4.26 |
I'm initiating it like this $ical = new ICal($file); // $file is the URL/File Location given in the form But have also tried this $ical = new ICal();
if (substr($file, -4) === '.ics') {
$ical->initString($file);
} else if (substr($file, -4) === '.tmp') {
$ical->initFile($file);
} else {
$ical->initUrl($file);
} I'm 80% positive I had it working by using initString, but I'm doubting myself because I can't replicate the success. |
Looking into it this appears to be a quirk of Outlook, where it requires the User Agent string to be set in the request headers. Try using the "httpUserAgent" argument when creating the $ical = new ICal($url, array("httpUserAgent" => "A User Agent")); |
(Note added to README: 10f0df5) |
Closing as I believe the question has been answered |
Trying to figure out an issue, and I believe that it may be the @ symbol in a url causing the issue.
I have tried many different URLs and they all parse correctly except for the one that Outlook provides me when publishing a calendar; it contains an @ symbol. Wondering if you have come across this issue.
The text was updated successfully, but these errors were encountered: