Fix #1019 w/o side effects: don't escape QUERY_STRING (not necessary for our purpose)
merge 1c08b2327433a340bb2f9bff9619b840a1ec7f02, refs #1019