WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/29/2019 07:52:43 AM (7 months ago)
Author:
mikeschroder
Message:

Administration: Output valid HTML when wp_die() is called.

To better support HTML and string calls to wp_die() without
outputting invalid HTML, wraps error messages in <div> rather than <p>.

Adds .wp-die-message CSS class for styling.

Props dinhtungdu, jeremyfelt, audrasjb, SergeyBiryukov, afercia, audrasjb, noisysocks.
Fixes #47580.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r45908 r45909  
    31923192            );
    31933193            $message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $message ) . "</li>\n\t</ul>";
    3194         } else {
    3195             $message = "<p>$message</p>";
    3196         }
     3194        }
     3195
     3196        $message = sprintf(
     3197            '<div class="wp-die-message">%s</div>',
     3198            $message
     3199        );
    31973200    }
    31983201
     
    32643267            margin-top: 50px;
    32653268        }
    3266         #error-page p {
     3269        #error-page p,
     3270        #error-page .wp-die-message {
    32673271            font-size: 14px;
    32683272            line-height: 1.5;
Note: See TracChangeset for help on using the changeset viewer.