[wp-trac] [WordPress Trac] #31790: sanitize_title_with_dashes() has issues with non breaking space ( and   )
WordPress Trac
noreply at wordpress.org
Thu Jan 14 15:49:15 UTC 2016
#31790: sanitize_title_with_dashes() has issues with non breaking space ( and
)
-------------------------------------------------+-------------------------
Reporter: michelski | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.5
Component: Formatting | Version: 4.1.1
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests needs- | Focuses:
refresh needs-testing |
-------------------------------------------------+-------------------------
Changes (by swissspidy):
* keywords: has-patch needs-testing has-unit-tests => has-patch has-unit-
tests needs-refresh needs-testing
* milestone: Future Release => 4.5
Comment:
Replying to [comment:3 polevaultweb]:
> @swissspidy would you mind having a look at the patch when you get a
second? Cheers :)
The replacement should probably only be done if `'save' === $context`,
just like further down the function. That's what you're testing, after
all. With your current patch you're doing it on `display` as well.
Regarding the test, I'd personally stick to the "1 assertion per test"
rule used in most of the other functions — and use non-German strings for
testing :). Example (taken from another test):
{{{#!php
<?php
function test_replaces_ndash_entities() {
$this->assertEquals("do-the-dash",
sanitize_title_with_dashes("Do–the Dash", '', 'save'));
$this->assertEquals("do-the-dash", sanitize_title_with_dashes("Do
the–Dash", '', 'save'));
}
}}}
Oh, and you should add the `@ticket 31790` annotation for every new test
method you introduce, not only the first one.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31790#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list