Changeset 55245 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 02/07/2023 03:32:43 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/formatting.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r55209 r55245 5396 5396 */ 5397 5397 function wp_strip_all_tags( $text, $remove_breaks = false ) { 5398 if ( is_null( $text ) ) { 5399 return ''; 5400 } 5401 5402 if ( ! is_scalar( $text ) ) { 5403 /* 5404 * To maintain consistency with pre-PHP 8 error levels, 5405 * trigger_error() is used to trigger an E_USER_WARNING, 5406 * rather than _doing_it_wrong(), which triggers an E_USER_NOTICE. 5407 */ 5408 trigger_error( 5409 sprintf( 5410 /* translators: 1: The function name, 2: The argument number, 3: The argument name, 4: The expected type, 5: The provided type. */ 5411 __( 'Warning: %1$s expects parameter %2$s (%3$s) to be a %4$s, %5$s given.' ), 5412 __FUNCTION__, 5413 '#1', 5414 '$text', 5415 'string', 5416 gettype( $text ) 5417 ), 5418 E_USER_WARNING 5419 ); 5420 5421 return ''; 5422 } 5423 5398 5424 $text = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $text ); 5399 5425 $text = strip_tags( $text );
Note: See TracChangeset
for help on using the changeset viewer.