From: Scott González Date: Wed, 14 Jul 2010 19:28:01 +0000 (-0400) Subject: Dialog: Verify that we get a string back from .attr( "title" ) before using the retur... X-Git-Tag: 1.8.3~47 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2c7a9e9ff3540365254ee1b9b3113e6c2ad9f5f3;p=jquery-ui.git Dialog: Verify that we get a string back from .attr( "title" ) before using the return value. Fixes #5742 - Form field with `name="title"` moved to title area. --- diff --git a/tests/unit/dialog/dialog.html b/tests/unit/dialog/dialog.html index 97a5d44cd..d8260cc9f 100644 --- a/tests/unit/dialog/dialog.html +++ b/tests/unit/dialog/dialog.html @@ -19,6 +19,7 @@ + diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 5fb5f1007..46f931669 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -49,6 +49,10 @@ $.widget("ui.dialog", { }, _create: function() { this.originalTitle = this.element.attr('title'); + // #5742 - .attr() might return a DOMElement + if ( typeof this.originalTitle !== "string" ) { + this.originalTitle = ""; + } var self = this, options = self.options,