amr ical events lists
[resolved] [Plugin: AmR iCal Events List] Invalid URL error: Make sure you use PHP 5.2.14 or newer! (2 posts)

  1. ChristianRoth
    Posted 5 years ago #


    I struggled with constant invalid URL errors for a calendar I wanted to use. The file validated, the URL was correct.

    Finally, it turned out that I was running PHP 5.2.13. This version has a bug in filter_var(..., FILTER_VALIDATE_URL) that reported URLs that had a hyphen (-) in the host name as invalid. Sure my URL used the ical-mac.com service, which had a hyphen.

    I'm on shared hosting and cannot update the PHP version easily, so for a interim fix I changed amr-import-ical.php#87 to

    $u = $url;

    Don't know how much of a security risk this is, but now again, the plugin works even on PHP 5.2.13 with webcal-URLs that have a hyphen in their host name.

    HTH for anyone having the same issue,

  2. anmari
    Plugin Author

    Posted 5 years ago #

    Hi Christian,
    Thanks for noting that - not too much of a security risk as it's usually admin putting the url in - was there more for completeness and to avoid silly errors where people think the plugin is not working and it's actually a problem in the url.

    Seems like it was fixed in php's 5.1.14, http://bugs.php.net/bug.php?id=51192

    Next upload of the plugin will include this code

    if (version_compare( PHP_VERSION,'5.2.13', '>')) $u = filter_var ($url, FILTER_VALIDATE_URL);
    else $u = $url;

    so that you'all can stay in the upgrade path.... I hate having to repeat code changes when there is a plugin upgrade.

    It works okay for me, Christian let me know if it works for you and your url.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • amr ical events lists
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic