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?
- The topic ‘Breaks when percentage symbol in post content’ is closed to new replies.