Fixes #1061 SQL error when searching for "posts with this ip"

Fixes #1061