Jump to content

$sanitizer->selectorValue($value) in 3.0.8


Recommended Posts

Posted

I'm sure I've used $sanitizer->selectorValue($value) many times before. However in this case it's getting rid of the | bar and replacing it with a space.

Here is my code:

$selection = implode($input->get->filter, "|");
$input->whitelist('filter', $selection);
if($selection) { $selection = ", category.name=" . $sanitizer->selectorValue($selection); }
$activities = $pages->find("template=activity|event, limit=1, sort=title{$selection}");

Filter is a checkbox.

Posted

Uhm. Shouldn't it be

$selection = implode("|", $input->get->filter);

?

Oops, yes it should, however the previous format did work. It shouldn't have. It echoed out fine. Even with swap around it's still being replaced with spaces. 

Posted

At least in 2.7.0 it already removed pipe characters (this is from Sanitizer::selectorValue):

$value = str_replace(array('*', '~', '`', '$', '^', '|', '<', '>', '=', '[', ']', '{', '}'), ' ', $value);
  • Like 1

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
  • Recently Browsing   0 members

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