Make WordPress Core


Ignore:
Timestamp:
08/05/2016 07:27:56 PM (8 years ago)
Author:
ocean90
Message:

Update/Install: Replace "error" and "-1" failure messages with a more meaningful one.

  • "-1" is an invalid nonce error, show 'An error has occurred. Please reload the page and try again.'.
  • "error" means that the connection to the server was lost, show 'Connection lost or the server is busy. Please try again later.'.
  • Escape the message in wp-updates-admin-notice because the response may include HTML.
  • Remove HTML tags in wp.updates.isValidResponse() to make PHP's error messages more readable.

Props azaozz for review.
Fixes #37583.

File:
1 edited

Legend:

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

    r38185 r38205  
    632632    ?>
    633633    <script id="tmpl-wp-updates-admin-notice" type="text/html">
    634         <div <# if ( data.id ) { #>id="{{ data.id }}"<# } #> class="notice {{ data.className }}"><p>{{{ data.message }}}</p></div>
     634        <div <# if ( data.id ) { #>id="{{ data.id }}"<# } #> class="notice {{ data.className }}"><p>{{ data.message }}</p></div>
    635635    </script>
    636636    <script id="tmpl-wp-bulk-updates-admin-notice" type="text/html">
Note: See TracChangeset for help on using the changeset viewer.