Formatting: Filter out the bullet character in sanitize_title_with_dashes()
.
Props roytanck, deepaklalwani, veromary. Fixes #49791. git-svn-id: https://develop.svn.wordpress.org/trunk@48593 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1ef40b14cd
commit
f2d98192de
@ -2263,6 +2263,8 @@ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa
|
|||||||
'%e2%80%9b',
|
'%e2%80%9b',
|
||||||
'%e2%80%9e',
|
'%e2%80%9e',
|
||||||
'%e2%80%9f',
|
'%e2%80%9f',
|
||||||
|
// Bullet.
|
||||||
|
'%e2%80%a2',
|
||||||
// ©, ®, °, &hellip, and &trade.
|
// ©, ®, °, &hellip, and &trade.
|
||||||
'%c2%a9',
|
'%c2%a9',
|
||||||
'%c2%ae',
|
'%c2%ae',
|
||||||
|
@ -101,6 +101,13 @@ class Tests_Formatting_SanitizeTitleWithDashes extends WP_UnitTestCase {
|
|||||||
$this->assertEquals( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its „Curly Joe‟', '', 'save' ) );
|
$this->assertEquals( 'hey-its-curly-joe', sanitize_title_with_dashes( 'Hey its „Curly Joe‟', '', 'save' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ticket 49791
|
||||||
|
*/
|
||||||
|
function test_replaces_bullet() {
|
||||||
|
$this->assertEquals( 'fancy-title-amazing', sanitize_title_with_dashes( 'Fancy Title • Amazing', '', 'save' ) );
|
||||||
|
}
|
||||||
|
|
||||||
function test_replaces_copy_reg_deg_trade() {
|
function test_replaces_copy_reg_deg_trade() {
|
||||||
$this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( 'Just © a Slug', '', 'save' ) );
|
$this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( 'Just © a Slug', '', 'save' ) );
|
||||||
$this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( '® Just a Slug', '', 'save' ) );
|
$this->assertEquals( 'just-a-slug', sanitize_title_with_dashes( '® Just a Slug', '', 'save' ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user