diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php
index 47b9cd7..688aac0 100644
a
|
b
|
function wp_initial_constants( ) { |
56 | 56 | if ( !defined('WP_CACHE') ) |
57 | 57 | define('WP_CACHE', false); |
58 | 58 | |
| 59 | if ( !defined('WP_OPTION_LENGTH') ) |
| 60 | define('WP_OPTION_LENGTH', 64); |
| 61 | |
59 | 62 | /** |
60 | 63 | * Private |
61 | 64 | */ |
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 0d458ef..052dab4 100644
a
|
b
|
function wp_load_core_site_options( $site_id = null ) { |
486 | 486 | * @return bool False if value was not updated and true if value was updated. |
487 | 487 | */ |
488 | 488 | function update_option( $option, $newvalue ) { |
| 489 | if ( strlen($option) > WP_OPTION_LENGTH ) { |
| 490 | trigger_error( sprintf( __('update_option: Option name %1$s is longer than the maximum allowed length of %2$s.'), $option, WP_OPTION_LENGTH ), E_USER_WARNING ); |
| 491 | return false; |
| 492 | } |
| 493 | |
489 | 494 | global $wpdb; |
490 | 495 | |
491 | 496 | $option = trim($option); |
… |
… |
function update_option( $option, $newvalue ) { |
566 | 571 | * @return null returns when finished. |
567 | 572 | */ |
568 | 573 | function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) { |
| 574 | if ( strlen($option) > WP_OPTION_LENGTH ) { |
| 575 | trigger_error( sprintf( __('add_option: Option name %1$s is longer than the maximum allowed length of %2$s.'), $option, WP_OPTION_LENGTH ), E_USER_WARNING ); |
| 576 | return false; |
| 577 | } |
| 578 | |
569 | 579 | global $wpdb; |
570 | 580 | |
571 | 581 | if ( !empty( $deprecated ) ) |
… |
… |
function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) |
633 | 643 | * @return bool True, if option is successfully deleted. False on failure. |
634 | 644 | */ |
635 | 645 | function delete_option( $option ) { |
| 646 | if ( strlen($option) > WP_OPTION_LENGTH ) { |
| 647 | trigger_error( sprintf( __('delete_option: Option name %1$s is longer than the maximum allowed length of %2$s.'), $option, WP_OPTION_LENGTH ), E_USER_WARNING ); |
| 648 | return false; |
| 649 | } |
| 650 | |
636 | 651 | global $wpdb; |
637 | 652 | |
638 | 653 | wp_protect_special_option( $option ); |
… |
… |
function delete_option( $option ) { |
676 | 691 | * @return bool true if successful, false otherwise |
677 | 692 | */ |
678 | 693 | function delete_transient( $transient ) { |
| 694 | if ( strlen('_transient_timeout_' . $transient) > WP_OPTION_LENGTH ) { |
| 695 | trigger_error( sprintf( __('delete_transient: Transient name %1$s is longer than the maximum allowed length of %2$s.'), $transient, (WP_OPTION_LENGTH - strlen('_transient_timeout_')) ), E_USER_WARNING ); |
| 696 | return false; |
| 697 | } |
| 698 | |
679 | 699 | global $_wp_using_ext_object_cache; |
680 | 700 | |
681 | 701 | do_action( 'delete_transient_' . $transient, $transient ); |
… |
… |
function delete_transient( $transient ) { |
715 | 735 | * @return mixed Value of transient |
716 | 736 | */ |
717 | 737 | function get_transient( $transient ) { |
| 738 | if ( strlen('_transient_timeout_' . $transient) > WP_OPTION_LENGTH ) { |
| 739 | trigger_error( sprintf( __('get_transient: Transient name %1$s is longer than the maximum allowed length of %2$s.'), $transient, (WP_OPTION_LENGTH - strlen('_transient_timeout_')) ), E_USER_WARNING ); |
| 740 | return false; |
| 741 | } |
| 742 | |
718 | 743 | global $_wp_using_ext_object_cache; |
719 | 744 | |
720 | 745 | $pre = apply_filters( 'pre_transient_' . $transient, false ); |
… |
… |
function get_transient( $transient ) { |
764 | 789 | * @return bool False if value was not set and true if value was set. |
765 | 790 | */ |
766 | 791 | function set_transient( $transient, $value, $expiration = 0 ) { |
| 792 | if ( strlen('_transient_timeout_' . $transient) > WP_OPTION_LENGTH ) { |
| 793 | trigger_error( sprintf( __('set_transient: Transient name %1$s is longer than the maximum allowed length of %2$s.'), $transient, (WP_OPTION_LENGTH - strlen('_transient_timeout_')) ), E_USER_WARNING ); |
| 794 | return false; |
| 795 | } |
| 796 | |
767 | 797 | global $_wp_using_ext_object_cache; |
768 | 798 | |
769 | 799 | $value = apply_filters( 'pre_set_transient_' . $transient, $value ); |