Jump to content

Selector weirdness when searched value has zeroes and dots


MSP01
 Share

Recommended Posts

So I'm trying two different selector values, both values exist on page titles that are being searched.

CASE 1
title*=test_7.50

CASE 2
title*=test_7.00

CASE 1 will return all pages with test_7.50 in the title.

However

CASE 2 will return zero pages, even though there are plenty with that exact value in the title. Aside from 5 being replaced by 0, the titles and the search phrases are identical.

If I change the dot to comma, both values return pages. I was wrong on this, comma doesn't actually work any better.

Why does CASE 2 not work? I tried to do some googling, but found nothing on this. I'm assuming the search being a "phrase" and not a "word" search is part of the issue.

Link to comment
Share on other sites

Yeah, the selector value is sanitized.

I actually made a small mistake in my first post. The actual problem is the trailing zero.

These don't work

CASE 1
title*=test_7.50

CASE 2
title*=test_7.00

This works

CASE 3
title*=test_7.5

So basically if you search with *= and the value ends with zero, you run into problems. Using ~= works fine, but this example is simplified and I'm actually searching for a phrase.

Link to comment
Share on other sites

It looks like the numeric chars aren't seen as text but as number and gets cleaned up like trailing zeros in decimal sector have no meaning. So I bet if you have something like 7.50000 it comes out as 7.5 but 7.50001 will come out as 7.50001. 
I'm not sure if this sort of clean up (sanitizing) is done by PW or by MySQL. ??

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...