Placeholder arguments are processed in _views_replace_args() and double %% symbols (which represent literal % symbols) are replaced with a single % symbol. Later on these single % symbols may be reinterpreted as argument placeholders and removed. To solve this, _views_replace_args() needs to replace any single % symbols with double %% symbols.

To reproduce this problem, create a view that uses a "contains" operator and use a value that begins with "s", "d", "f", or "b". After _views_replace_args() the query looks right (e.g. "... title LIKE '%something%' ...") but then this query is reprocessed by the regular database functions and the '%s' part might be replaced with whatever the first query argument was.

CommentFileSizeAuthor
views_replace_arguments_fix.patch1.07 KBbenshell

Comments

merlinofchaos’s picture

Status: Needs review » Fixed

This is already fixed in -dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.