Changeset 61585
- Timestamp:
- 02/03/2026 08:07:57 PM (8 weeks ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/js/_enqueues/wp/sanitize.js (modified) (1 diff)
-
tests/qunit/wp-includes/js/wp-sanitize.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/wp/sanitize.js
r61578 r61585 24 24 */ 25 25 stripTags: function( text ) { 26 if ( null === text || 'undefined' === typeoftext ) {26 if ( ! text ) { 27 27 return ''; 28 28 } -
trunk/tests/qunit/wp-includes/js/wp-sanitize.js
r61578 r61585 23 23 } ); 24 24 25 QUnit.test( 'stripTags should return empty string for input 0', function( assert ) { 26 const result = wp.sanitize.stripTags( 0 ); 27 assert.strictEqual( result, '', 'stripTags( 0 ) should return ""' ); 28 } ); 29 30 QUnit.test( 'stripTags should return "0" for input "0"', function( assert ) { 31 const result = wp.sanitize.stripTags( '0' ); 32 assert.strictEqual( result, '0', 'stripTags( "0" ) should return "0"' ); 33 } ); 34 35 QUnit.test( 'stripTags should return empty string for input false', function( assert ) { 36 const result = wp.sanitize.stripTags( false ); 37 assert.strictEqual( result, '', 'stripTags( false ) should return ""' ); 38 } ); 39 40 QUnit.test( 'stripTags should return empty string for input NaN', function( assert ) { 41 const result = wp.sanitize.stripTags( NaN ); 42 assert.strictEqual( result, '', 'stripTags( NaN ) should return ""' ); 43 } ); 44 45 QUnit.test( 'stripTags should return empty string for empty string input', function( assert ) { 46 const result = wp.sanitize.stripTags( '' ); 47 assert.strictEqual( result, '', 'stripTags( "" ) should return ""' ); 48 } ); 49 25 50 QUnit.module( 'wp.sanitize.stripTagsAndEncodeText' ); 26 51
Note: See TracChangeset
for help on using the changeset viewer.