WordPress.org

Ready to get started?Download WordPress

Forums

My Calendar
Bug in mc_select_category function (2 posts)

  1. akhilstanislavose
    Member
    Posted 2 years ago #

    I was using the upcoming events widget to display events from a single category and and it just did not work. I searched the support forum and nobody have reported any issues regarding category trouble in upcoming widgets. So I did some debugging and found a simple bug in the code.

    my-calendar-limits.php, line 10
    if ( $category == 'all' || strpos( $category, "all" ) !== false ) {

    if the category is 'Football' or 'Baseball' or any other word with 'ball' as a substring, the condition will pass while it should not.

    this is how I fixed it.
    if ( preg_match('/^all$|^all,|,all$|,all,/i', $category) > 0 ) {

    http://wordpress.org/extend/plugins/my-calendar/

  2. Joe Dolson
    Member
    Plugin Author

    Posted 2 years ago #

    Good call. Thanks!

    Best,
    Joe

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic