Opened 9 years ago
Last modified 5 years ago
#32729 new defect (bug)
WP sanitize + (plus) and other mathematic symbols as nothing instead of dash separator
Reported by: | thomask | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.3 |
Component: | Formatting | Keywords: | |
Focuses: | Cc: |
Description
If title contains e.g. plus symbol (e.g. title is "1+1=2", it creates slug 112, instead of 1-1-2. (and than it brings the other bug reported by me 8 years ago, that is just being to repair - #5305)
IMO such mathematical symbols should be considered as word separator (btw "apple+bannana" is converted to "applebannana"), so replaced by dash by default
Attachments (2)
Change History (8)
This ticket was mentioned in Slack in #core by swissspidy. View the logs.
9 years ago
#5
@
9 years ago
Here's a quick patch for removing + and = from post slugs instead of replacing it with -. % is already removed. There's a line in there specifically replacing times with an x (included below). Might want to change that too?
// Convert times to x
$title = str_replace( '%c3%97', 'x', $title );
(WCUS)
Note: See
TracTickets for help on using
tickets.
Related: #10792