top | item 8428244

(no title)

jsstylos | 11 years ago

For the jobid example, the stringify is necessary because the jobid returned by the server includes a # symbol. Try the code you suggested and you get the result: "Error: ContextExpansion Error: jobid is in incorrect format."

discuss

order

colanderman|11 years ago

This is a perfect example of why I don't like to take silly shortcuts based on tenuous assumptions like the GP suggests.

Assumptions, more often than not, (1) change, (2) are understood differently by others, and/or (3) (as in this case) are flat-out wrong. Code that takes "advantage" of such silly assumptions usually (1) are poor examples to coders new to the project, (2) complicate reviewing the code for correctness, and (3) waste brain-time figuring out when they can (and can't) be applied.

Just escape everything that should be, whether you think you know what it is/where it came from or not.