Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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 Nov 1 '10 at 19:05
    
That would depend if you sanitized them before storing them in the database. –  Denis Nov 2 '10 at 10:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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