[wp-hackers] single quote in plugin options

Matt Freedman speedboxer at gmail.com
Wed Jul 15 08:26:45 UTC 2009


Use stripslashes() before displaying the option.


On Wed, Jul 15, 2009 at 1:09 AM, Daiv Mowbray<daiv at daivmowbray.com> wrote:
>
> Hello List.
>
> I am trying to find a solution.
> My problem is: an option in one of my plugins includes single quotes.
> for example, text field contains: 'href', 'rel', 'rev', 'title'
> however, when saving the options,
> the field now contains: \'href\', \'rel\', \'rev\', \'title\'
> when I save the options a second time,
> the field now contains: \\\'href\\\', \\\'rel\\\', \\\'rev\\\',
> \\\'title\\\'
>
> In my options form, I have tried to use :
> echo attribute_escape($Options['myfield']);
>
> I don't want to escape the single quotes, I want them to stay as
> entered: 'href', 'rel', 'rev', 'title'
>
> Any pointers greatly appreciated.
>
> ----------
> Daiv Mowbray
> daiv at daivmowbray.com
> ----------
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Matt Freedman
http://mattfreedman.ca/


More information about the wp-hackers mailing list