WordPress.org

Make WordPress Core

Ticket #8658: check-post-data-content.diff

File check-post-data-content.diff, 723 bytes (added by projct, 5 years ago)
  • wp-includes/js/autosave.js

    diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js
    index 6fc58e4..aa77463 100644
    a b var autosave = function() { 
    157157                post_data["post_name"] = jQuery('#post_name').val(); 
    158158 
    159159        // Nothing to save or no change. 
    160         if( (post_data["post_title"].length==0 && post_data["content"].length==0) || post_data["post_title"] + post_data["content"] == autosaveLast) { 
     160        if( typeof(post_data["post_title"]) !== "undefined" && typeof(post_data["content"]) !== "undefined" && (post_data["post_title"].length==0 && post_data["content"].length==0) || post_data["post_title"] + post_data["content"] == autosaveLast) { 
    161161                doAutoSave = false 
    162162        } 
    163163