[wp-trac] [WordPress Trac] #35792: tags cannot be added to post when using armenian language interface

WordPress Trac noreply at wordpress.org
Wed Feb 10 15:45:39 UTC 2016


#35792: tags cannot be added to post when using armenian language interface
----------------------------+------------------------------
 Reporter:  noch            |       Owner:  azaozz
     Type:  defect (bug)    |      Status:  assigned
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  3.4
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |     Focuses:  ui, javascript
----------------------------+------------------------------
Changes (by afercia):

 * status:  new => assigned
 * focuses:   => ui, javascript
 * component:  Editor => Administration
 * owner:   => azaozz
 * version:  trunk => 3.4
 * keywords:   => needs-patch


Comment:

 Hello @noch and welcome to Trac. That's interesting. The Armenian
 translation translates the tag delimiter with a dot `'.'` so the following
 in `tagBox.clean()`
 {{{
 tags = tags.replace(new RegExp(comma, 'g'), ',');
 }}}
 becomes:
 {{{
 tags = tags.replace(new RegExp( '.', 'g'), ',');
 }}}
 which means "replace any character, globally (i.e. all matches) with a
 comma" and the final result is an empty string because all commas get
 removed in following replacements. So, `comma` passed to the regex should
 probably be escaped when it's a special character. To be honest, I don't
 understand the second check for `if ( ',' !== comma )` which re-adds back
 the original delimiter, so I'd appreciate someone with more historical
 knowledge than me to have a look at this :) See [19853]. cc @azaozz

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35792#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list