Make WordPress Core

Ticket #52440: 52440.diff

File 52440.diff, 663 bytes (added by audrasjb, 4 years ago)

Replace empty default value with undefined to avoid false negative in initialCompareData comparison

  • src/js/_enqueues/wp/autosave.js

    diff --git a/src/js/_enqueues/wp/autosave.js b/src/js/_enqueues/wp/autosave.js
    index a1bd570c68..a44337f572 100644
    a b window.autosave = function() { 
    4747                 */
    4848                function setInitialCompare() {
    4949                        initialCompareData = {
    50                                 post_title: $( '#title' ).val() || '',
    51                                 content: $( '#content' ).val() || '',
    52                                 excerpt: $( '#excerpt' ).val() || ''
     50                                post_title: $( '#title' ).val() || undefined,
     51                                content: $( '#content' ).val() || undefined,
     52                                excerpt: $( '#excerpt' ).val() || undefined
    5353                        };
    5454
    5555                        initialCompareString = getCompareString( initialCompareData );