WordPress.org

Make WordPress Core

Changeset 29960


Ignore:
Timestamp:
10/18/2014 07:54:40 PM (6 years ago)
Author:
SergeyBiryukov
Message:

In wp.updates.decrementCount(), only display the count if it's a valid non-negative integer.

props jdgrimes.
fixes #29527.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/updates.js

    r28254 r29960  
    1616        count = $elem.text();
    1717        count = parseInt( count, 10 ) - 1;
    18         if ( count < 0 ) {
     18        if ( count < 0 || isNaN( count ) ) {
    1919            return;
    2020        }
     
    3333            pluginCount = $elem.find( '.plugin-count' ).eq(0).text();
    3434            pluginCount = parseInt( pluginCount, 10 ) - 1;
    35             if ( pluginCount < 0 ) {
     35            if ( pluginCount < 0 || isNaN( pluginCount ) ) {
    3636                return;
    3737            }
Note: See TracChangeset for help on using the changeset viewer.