1
0
mirror of synced 2024-11-25 14:56:03 +03:00

reset hasGivenName check to more explicit string matching.

This commit is contained in:
Andrew Boyd 2020-05-02 09:34:15 -04:00
parent bdbf2afc8f
commit 45711c581a

View File

@ -164,7 +164,17 @@ function nameOrFallback () {
* determine if an input has a user-defined name * determine if an input has a user-defined name
*/ */
function hasGivenName () { function hasGivenName () {
return typeof this.name !== 'boolean' if (
this.name &&
typeof this.name === 'string' &&
this.name !== `${this.type}_${this.id}` &&
this.name !== `${this.type}_${this.defaultId}` &&
// radio and checkbox options have their value as part of their ID so we need to filter those out too
this.name !== `${this.type}_${(String(this.id).replace('_' + String(this.value), ''))}`
) {
return true
}
return false
} }
/** /**