1

I was wondering if you really need to escape user submitted data (widget option fields) within the widget() and form() functions (from the widget class) ?

I don't see a reason to do this, if the data is already escaped in the update() function. Or am I missing something?

1 Answer 1

1

Mm, they're not slashed, if that's what your meaning.

However, they're definitely not xss-sanitized. Use kses before saving, or esc_attr() on display, if you're dealing with untrusted data.

2
  • yes, but I wanted to know if you are required to sanitize them even when you're retrieving these options from the database. It just doesn't seem necessary to do that...
    – Alex
    Commented Nov 1, 2010 at 19:05
  • That would depend if you sanitized them before storing them in the database. Commented Nov 2, 2010 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.