Make WordPress Core

Ticket #30300: 22781-1.patch

File 22781-1.patch, 647 bytes (added by TV productions, 10 years ago)

Replace regex with the g modifier

  • src/wp-includes/js/utils.js

     
    161161                path = userSettings.url,
    162162                secure = !! userSettings.secure;
    163163
    164         name = name.toString().replace( /[^A-Za-z0-9_]/, '' );
     164        name = name.toString().replace( /[^A-Za-z0-9_]/g, '' );
    165165
    166166        if ( typeof value === 'number' ) {
    167167                value = parseInt( value, 10 );
    168168        } else {
    169                 value = value.toString().replace( /[^A-Za-z0-9_]/, '' );
     169                value = value.toString().replace( /[^A-Za-z0-9_]/g, '' );
    170170        }
    171171
    172172        settings = settings || {};