Use variable name string instead of query

You introduced a new variable $query which doesn't exist. Changed it to $string as in the rest of the code.
Here it happened: https://github.com/dmj/vf2/commit/d3e4c2e0fcb31cf1aae3ff75616d7898a47ea5d6