From 2c7a9e9ff3540365254ee1b9b3113e6c2ad9f5f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 14 Jul 2010 15:28:01 -0400 Subject: [PATCH] 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. --- tests/unit/dialog/dialog.html | 1 + ui/jquery.ui.dialog.js | 4 ++++ 2 files changed, 5 insertions(+) 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, -- 2.39.5