[wp-hackers] Nasty get_option()/get_settings() bug

Robert Deaton false.hopes at gmail.com
Wed Jan 11 23:37:19 GMT 2006


On 1/11/06, Mark Jaquith <mark.wordpress at txfx.net> wrote:
> Yeah, that could work.  Return "%WP_OPTION_DOES_NOT_EXIST%" or some
> such if the option does not exist in the option cache.  Then, instead
> of checking for $value === false, check for $value === "%
> WP_OPTION_DOES_NOT_EXIST%" and only do the query in that circumstance.

define('WP_FALSE',
'%WP_OPTION_DOES_NOT_EXIST_23I47239856Y34YHJCXHFLKDSHLTASHD%');

return WP_FALSE...

if($value == WP_FALSE)...

or, we could do s/false/null if anyone preferred that.

>
> It's hacky, but it's relatively uncomplicated.  As long as our
> "magic" string is obscure enough that it will never be legitimately
> used, it should work fine.
>
> --
> Mark Jaquith
> http://txfx.net/
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


--
--Robert Deaton
http://somethingunpredictable.com


More information about the wp-hackers mailing list