Skip to content

Commit 2c7a9e9

Browse files
committed
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.
1 parent cdd6161 commit 2c7a9e9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tests/unit/dialog/dialog.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
2020
<script type="text/javascript" src="../../../external/qunit.js"></script>
2121
<script type="text/javascript" src="../../jquery.simulate.js"></script>
22+
<script type="text/javascript" src="../testsuite.js"></script>
2223

2324
<script type="text/javascript" src="dialog_core.js"></script>
2425
<script type="text/javascript" src="dialog_defaults.js"></script>

ui/jquery.ui.dialog.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ $.widget("ui.dialog", {
4949
},
5050
_create: function() {
5151
this.originalTitle = this.element.attr('title');
52+
// #5742 - .attr() might return a DOMElement
53+
if ( typeof this.originalTitle !== "string" ) {
54+
this.originalTitle = "";
55+
}
5256

5357
var self = this,
5458
options = self.options,

0 commit comments

Comments
 (0)