Better Related Posts
Breaks when percentage symbol in post content (1 post)

  1. smerriman
    Posted 3 years ago #

    Was experiencing some problems with some posts not showing any related content at all, so I did some digging, and discovered that when using content matching, and there is a percentage in the content, no results are returned at all.

    This is because the % symbol isn't being escaped to %% before being passed to $wpdb->prepare in score_by_content. In fact, since you're not passing any parameters at all, I don't think you need the prepare statement at all - but if you want to keep it, %s should be escaped.

    If this is fixed, I expect there's no way to update problematic posts is there - unless it can somehow be run on posts with % symbols only?


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Better Related Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.