WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
plugin requires php 5.2 not 5.1 (1 post)

  1. danstowell
    Member
    Posted 3 years ago #

    Hi - the installation guide says PHP 5.1 is needed, which is what we've got. However on editing an entry you get an error:

    Fatal error: Call to undefined function filter_var() in ....../wp-content/plugins/the-events-calendar/the-events-calendar.class.php on line 883

    This is because filter_var() was added in PHP 5.2. Grateful if you could update the instructions!

    Alternatively, you can use strip_tags() rather than filter_var(), which seems to make it work again:


    --- the-events-calendar.class.php.orig 2011-06-11 12:22:08.000000000 +0100
    +++ the-events-calendar.class.php 2011-06-11 12:25:59.000000000 +0100
    @@ -880,7 +880,7 @@
    $htmlElement = ltrim( $tag, '_' );
    if ( $tag != self::EVENTSERROROPT ) {
    if ( isset( $_POST[$htmlElement] ) ) {
    - if( is_string($_POST[$htmlElement]) ) $_POST[$htmlElement] = filter_var($_POST[$htmlElement], FILTER_SANITIZE_STRING);
    + if( is_string($_POST[$htmlElement]) ) $_POST[$htmlElement] = strip_tags($_POST[$htmlElement]);
    update_post_meta( $postId, $tag, $_POST[$htmlElement] );
    }
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic