Make WordPress Core

Changeset 48877


Ignore:
Timestamp:
08/27/2020 01:59:29 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Comments: Correct the check for reply element existence in comment-reply.js.

document.getElementById() returns null if no matching element was found, so the previous comparison didn't work as expected.

Follow-up to [47506].

Props mailnew2ster, sarahricker.
Merges [48876] to the 5.5 branch.
Fixes #38009.

Location:
branches/5.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5

  • branches/5.5/src/js/_enqueues/lib/comment-reply.js

    r48650 r48877  
    409409        var temporaryElement = getElementById( temporaryFormId );
    410410        var replyElement = getElementById( config.commentReplyTitleId );
    411         var initialHeadingText = ( 'undefined' !== typeof replyElement ) ? replyElement.firstChild.textContent : '';
     411        var initialHeadingText = replyElement ? replyElement.firstChild.textContent : '';
    412412
    413413        if ( temporaryElement ) {
Note: See TracChangeset for help on using the changeset viewer.