Issues with Invalid Refering URL

  • Marcy

    Marcy - 2012-09-24

    I did a search on here and added the following code to the functions.php but I'm still getting the Invalid Refering URL error on the preferences, system settings and adding events. Can anyone point me in the right direction?

      * Require a valid HTT_REFERER value in the HTTP header.  This will
      * prevent XSRF (cross-site request forgery).
      * For example, suppose a * a "bad guy" sends an email with a link that
      * would delete an event in webcalendar to the admin.  If the admin user
      * clicks on that link we don't want to actually delete the event.
    function require_valide_referring_url ()
      global $SERVER_URL;

      if ( empty( $_SERVER ) ) {
        // Missing the REFERER value
        //die_miserable_death ( translate ( 'Invalid referring URL' ) );
        // Unfortunately, some version of MSIE do not send this info.
        return true;
      if ( ! preg_match ( "@$SERVER_URL@i", $_SERVER ) ) {
        // Gotcha.  URL of referring page is not the same as our server.
        // This can be an instance of XSRF.
        // (This may also happen when more than address is used for your server.
        // However, you're not supposed to do that with this version of
        // WebCalendar anyhow…)
        die_miserable_death ( translate ( 'Invalid referring URL' ) );

  • Marcy

    Marcy - 2012-10-01

    Still looking for help on this.

  • dmonroe

    dmonroe - 2014-02-19

    I'm also getting the Invalid Refering URL error on the preferences, system settings. I have just attempted to upgrade from version 1.2.3 to 1.2.6. Today all of a sudden, the times for all events (in version 1.2.3) were off by 1 hour. That precipitated the upgrade. Anyway, after upgrading, I changed the name of the calendar from WebCalendar-1.2.6 to calendar, which I was using previously. In 1.2.6, the times are now off by 3 hours. When I attempt to change preferences or system settings, I get the "Invalid referring URL" message. Also, I'm not at all sure that the name change from WebCalendar-1.2.6 to calendar was entirely successful. I'd appreciate some help.

  • dmonroe

    dmonroe - 2014-02-20

    I upgraded to version 1.2.7 and no longer get "Invalid referring URL." I must have goofed up when installing 1.2.6, and changing the name from "WebCalendar-1.2.6" to "calendar."


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks