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.

This commit is contained in:
Scott González 2010-07-14 15:28:01 -04:00
parent cdd6161419
commit 2c7a9e9ff3
2 changed files with 5 additions and 0 deletions

View File

@ -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>

View File

@ -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,