The problem: operators get converted to their html equivalents, breaking sql

< and > become &lt; and &gt; 

This seems to be true for the built in views operators as well as any that you try to add with other modules. I tried to find the best place to catch this error and convert the entities back before the sql gets run, and this patch is what I came up with. There may be a better place to do it, but this needs to be caught somewhere :-)

CommentFileSizeAuthor
views_query.inc_2.patch653 byteskarens

Comments

yched’s picture

I saw your comment about that in your cck's date field patch.
Strangely enough, I myself have never experienced the issue, and <, >, <= etc... operators have always worked fine for me....

Using LAMP server, PHP 4.4.0, MySQL 4.1.14.

yched’s picture

OK, reposting...

I saw your comment about that in your cck's date field patch.
Strangely enough, I myself have never experienced the issue, and <, >, <= etc... operators have always worked fine for me....

Using LAMP server, PHP 4.4.0, MySQL 4.1.14.

karens’s picture

I've run into this one in several handlers, including some of the views built-in ones. If I turn on the devel module it's easy to see that the sql has things like ' event.event_start > 9999999', and when I check the values the handler is getting I am getting passed the html entity versions. I have no explanation for why it works sometimes and not others. It pretty much never works right for me. This is on Windows XP, both with php4 and php5, mysql4.1.

karens’s picture

Trying again, my sql has things like

event.event_start &gt; 9999999
merlinofchaos’s picture

Ugh. This is because I'm running the operators through %s, which of course is doing that. I never even thought about the > and < issues. I will need to find a better way to ensure the safety of operators that are included that doesn't use check plain.

Briang’s picture

I've been getting this problem to. I posted a message about it on the event_views issue:

http://drupal.org/node/49157

merlinofchaos’s picture

Status: Needs review » Fixed

I put in an generic fix for this. I feel it's kind of hackish, but it'll do.

Anonymous’s picture

Status: Fixed » Closed (fixed)