Skip to content

Commit

Permalink
Dialog: Verify that we get a string back from .attr( "title" ) before…
Browse files Browse the repository at this point in the history
… using the return value. Fixes #5742 - Form field with `name="title"` moved to title area.
  • Loading branch information
scottgonzalez committed Jul 14, 2010
1 parent cdd6161 commit 2c7a9e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/unit/dialog/dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
<script type="text/javascript" src="../../../external/qunit.js"></script>
<script type="text/javascript" src="../../jquery.simulate.js"></script>
<script type="text/javascript" src="../testsuite.js"></script>

<script type="text/javascript" src="dialog_core.js"></script>
<script type="text/javascript" src="dialog_defaults.js"></script>
Expand Down
4 changes: 4 additions & 0 deletions ui/jquery.ui.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2c7a9e9

Please sign in to comment.