creativejay Posted April 4, 2015 Share Posted April 4, 2015 I'm using find in a sidebar to retrieve other pages in my site that share the same subject matter, as set in a text field. The trouble I'm running into is that, when that field's user entry contains apostrophes, find() does not return any results. if(!$polish) { $polish = wire('page');} $polish_year = $polish->blog_year; $polish_brand = $polish->blog_brand; $polish_collection = $polish->blog_polish_collection; $polish_name = $polish->blog_name; $postID = $polish->id; $samePolishPosts = wire('pages')->find("template=blog-post, blog_polish_collection=$polish_collection, blog_brand=$polish_brand, blog_year=$polish_year, blog_name=$polish_name, blog_categories=1040, id!=$postID"); Any tips? Link to comment Share on other sites More sharing options...
Macrura Posted April 4, 2015 Share Posted April 4, 2015 depending on which field is is you could use htmlentities($str, ENT_QUOTES); can you provide more info on the fields you are trying to match? Link to comment Share on other sites More sharing options...
creativejay Posted April 4, 2015 Author Share Posted April 4, 2015 On each page there is a Text field called "blog_name" which is currently using HTML Entity Encoder (htmlspecialchars) and Strip Markup Tags for formatting, and Strip Tags is checked on the Input tab. In the specific case that revealed the problem with apostrophes, the value of the field is set to "There's Snow One Like You" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now