Jump to content

Apostrophes in value of find() selector fields


creativejay
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...