diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index 7c9a1d7a1f..c34e0e8b4d 100644
|
a
|
b
|
function sanitize_term_field( $field, $value, $term_id, $taxonomy, $context ) { |
| 1710 | 1710 | |
| 1711 | 1711 | if ( 'slug' === $field ) { |
| 1712 | 1712 | $value = sanitize_title( $value ); |
| | 1713 | |
| | 1714 | /* |
| | 1715 | * Enforce maximum slug length AFTER decoding. |
| | 1716 | * This prevents URL-encoded or multibyte strings |
| | 1717 | * from exceeding the 200 character limit and |
| | 1718 | * breaking admin pagination queries. |
| | 1719 | */ |
| | 1720 | $decoded_slug = rawurldecode( $value ); |
| | 1721 | |
| | 1722 | if ( strlen( $decoded_slug ) > 200 ) { |
| | 1723 | $decoded_slug = substr( $decoded_slug, 0, 200 ); |
| | 1724 | |
| | 1725 | // Re-sanitize after truncation to ensure valid slug. |
| | 1726 | $value = sanitize_title( $decoded_slug ); |
| | 1727 | } |
| 1713 | 1728 | } |
| 1714 | 1729 | |
| 1715 | 1730 | if ( 'db' === $context ) { |