Your code edit didn't work, however I made a further code edit which fixed the problem. I changed:
Code:
Content visible to verified customers only.
to
Code:
Content visible to verified customers only.
which did the trick
I also made a mistake in my original post as I hadn't tested the error properly. When typing an apostrophe into the search box everything works fine. The problem comes when a user clicks on a keyword link that contains an apostrophe like http://XXXXXXXX.com/gallery/search.php?keywords=Don't
This returns the error:
Code:
Content visible to verified customers only.
Login details sent by pm
(NOTE: url has been removed from this post as site contains adult content and may offend some)