Ticket #15058: 15058.3.diff
File 15058.3.diff, 1.7 KB (added by , 9 years ago) |
---|
-
src/wp-includes/option.php
250 250 function update_option( $option, $value, $autoload = null ) { 251 251 global $wpdb; 252 252 253 $option = trim($option); 254 if ( empty($option) ) 253 $option = trim( $option ); 254 255 if ( empty( $option ) ) { 255 256 return false; 257 } 256 258 259 if ( 191 < strlen( $option ) ) { 260 _doing_it_wrong( __FUNCTION__, __( 'The option name is longer than what can be stored in the options table.' ), '4.5' ); 261 } 262 257 263 wp_protect_special_option( $option ); 258 264 259 265 if ( is_object( $value ) ) … … 395 401 function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) { 396 402 global $wpdb; 397 403 398 if ( !empty( $deprecated ) ) 404 if ( !empty( $deprecated ) ) { 399 405 _deprecated_argument( __FUNCTION__, '2.3' ); 406 } 400 407 401 $option = trim($option); 402 if ( empty($option) ) 408 $option = trim( $option ); 409 410 if ( empty( $option ) ) { 403 411 return false; 412 } 404 413 414 if ( 191 < strlen( $option ) ) { 415 _doing_it_wrong( __FUNCTION__, __( 'The option name is longer than what can be stored in the options table.' ), '4.5' ); 416 } 417 405 418 wp_protect_special_option( $option ); 406 419 407 420 if ( is_object($value) ) … … 713 726 } else { 714 727 $transient_timeout = '_transient_timeout_' . $transient; 715 728 $transient_option = '_transient_' . $transient; 729 730 if ( 191 < strlen( $transient_option ) || 191 < strlen( $transient_timeout ) ) { 731 _doing_it_wrong( __FUNCTION__, __( 'The transient name is longer than what can be stored in the options table.' ), '4.5' ); 732 } 733 716 734 if ( false === get_option( $transient_option ) ) { 717 735 $autoload = 'yes'; 718 736 if ( $expiration ) {