Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Button: added replace on radio name to escape quotes. Fixed #7505 - Butt... #754

Closed
wants to merge 1 commit into from

5 participants

@DaleKocian

...on: Buttonset not applied to radio group with quotation/apostrophe in name

@DaleKocian DaleKocian Button: added replace on radio name to escape quotes. Fixed #7505 - B…
…utton: Buttonset not applied to radio group with quotation/apostrophe in name
cbe7fc3
@jzaefferer
Owner

We need a more general escaping that isn't specific to single characters. Probably overlaps with what tabs is already doing: https://github.com/jquery/jquery-ui/blob/94221c4e5b11496ef927889e1541d84b5746fb31/ui/jquery.ui.tabs.js#L296

@jzaefferer
Owner

Duplicate of #401 :sadpanda:

@jzaefferer jzaefferer closed this
@jzaefferer
Owner

Kind of. Leaving this open for now.

@jzaefferer jzaefferer reopened this
@gnarf
Owner

I like this better than #401 since it only escapes the ' - Gonna close that old one

@mikesherov
Collaborator

@gnarf37, @jzaefferer what's the status of this pull request? And it also needs tests if it's going to land, right?

@jzaefferer
Owner

@DaleKocian could you add a unit test for this? Also, the replace call should happen inside the if ( name ) so that it doesn't throw up when there is no name property.

@mikesherov
Collaborator

@jzaefferer, besides a unit test, we'd also want to generalize the solution using https://github.com/jquery/jquery-ui/blob/94221c4e5b11496ef927889e1541d84b5746fb31/ui/jquery.ui.tabs.js#L296, right?

@scottgonzalez

I'm fine moving that method to core if it makes sense.

@jzaefferer
Owner

No we don't, according to @gnarf37 commenting here: #401 (comment)

@mikesherov
Collaborator

Ok, thanks @jzaefferer

@mikesherov
Collaborator

Landed something similar in cc7df71

@mikesherov mikesherov closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 15, 2012
  1. @DaleKocian

    Button: added replace on radio name to escape quotes. Fixed #7505 - B…

    DaleKocian authored
    …utton: Buttonset not applied to radio group with quotation/apostrophe in name
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  ui/jquery.ui.button.js
View
2  ui/jquery.ui.button.js
@@ -25,7 +25,7 @@ var lastActive, startXPos, startYPos, clickDragged,
}, 1 );
},
radioGroup = function( radio ) {
- var name = radio.name,
+ var name = radio.name.replace( /'/g, "\\'" ),
form = radio.form,
radios = $( [] );
if ( name ) {
Something went wrong with that request. Please try again.