diff --git wp-includes/option.php wp-includes/option.php
index 1d2c35d..571b055 100644
|
|
function update_option( $option, $value ) { |
271 | 271 | return false; |
272 | 272 | |
273 | 273 | if ( false === $old_value ) |
274 | | return add_option( $option, $value ); |
| 274 | return add_option( $option, $value, '', 'yes', false ); |
275 | 275 | |
276 | 276 | $serialized_value = maybe_serialize( $value ); |
277 | 277 | |
… |
… |
function update_option( $option, $value ) { |
349 | 349 | * @param mixed $value Optional. Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped. |
350 | 350 | * @param mixed $deprecated Optional. Description. Not used anymore. |
351 | 351 | * @param bool $autoload Optional. Default is enabled. Whether to load the option when WordPress starts up. |
| 352 | * @param boolean $sanitize Whether to sanitize the option value. |
352 | 353 | * @return bool False if option was not added and true if option was added. |
353 | 354 | */ |
354 | | function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) { |
| 355 | function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes', $sanitize = true ) { |
355 | 356 | global $wpdb; |
356 | 357 | |
357 | 358 | if ( !empty( $deprecated ) ) |
… |
… |
function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) |
366 | 367 | if ( is_object($value) ) |
367 | 368 | $value = clone $value; |
368 | 369 | |
369 | | $value = sanitize_option( $option, $value ); |
| 370 | if ( $sanitize ) { |
| 371 | $value = sanitize_option( $option, $value ); |
| 372 | } |
370 | 373 | |
371 | 374 | // Make sure the option doesn't already exist. We can check the 'notoptions' cache before we ask for a db query |
372 | 375 | $notoptions = wp_cache_get( 'notoptions', 'options' ); |