Changeset 33947
- Timestamp:
- 09/08/2015 04:43:27 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/utils.js
r33840 r33947 162 162 secure = !! userSettings.secure; 163 163 164 name = name.toString().replace( /[^A-Za-z0-9_-]/ , '' );164 name = name.toString().replace( /[^A-Za-z0-9_-]/g, '' ); 165 165 166 166 if ( typeof value === 'number' ) { 167 167 value = parseInt( value, 10 ); 168 168 } else { 169 value = value.toString().replace( /[^A-Za-z0-9_-]/ , '' );169 value = value.toString().replace( /[^A-Za-z0-9_-]/g, '' ); 170 170 } 171 171 -
trunk/tests/phpunit/tests/option/userSettings.php
r33840 r33947 35 35 $this->assertEmpty( $foo ); 36 36 37 $this->set_user_setting( 'foo', 'foo-bar ' );37 $this->set_user_setting( 'foo', 'foo-bar-baz' ); 38 38 39 $this->assertEquals( 'foo-bar', get_user_setting( 'foo' ) ); 39 $this->assertEquals( 'foo-bar-baz', get_user_setting( 'foo' ) ); 40 } 41 42 function test_set_user_setting_strip_asterisks() { 43 $foo = get_user_setting( 'foo' ); 44 45 $this->assertEmpty( $foo ); 46 47 $this->set_user_setting( 'foo', 'foo*bar*baz' ); 48 49 $this->assertEquals( 'foobarbaz', get_user_setting( 'foo' ) ); 40 50 } 41 51
Note: See TracChangeset
for help on using the changeset viewer.