Bug 818014: strip null bytes in document titles when setting the chrome window's title, since some platform nsWindow::SetTitle implementations don't handle them correctly, r=dolske

--HG--
extra : rebase_source : 1e161ed51b2cd1c8125982341878f454d8cd2339
This commit is contained in:
Gavin Sharp 2013-03-05 22:59:30 -08:00
parent e7f05c167d
commit da50c79701

View File

@ -783,7 +783,10 @@
var docElement = this.ownerDocument.documentElement;
var sep = docElement.getAttribute("titlemenuseparator");
var docTitle = aBrowser.contentTitle;
// Strip out any null bytes in the content title, since the
// underlying widget implementations of nsWindow::SetTitle pass
// null-terminated strings to system APIs.
var docTitle = aBrowser.contentTitle.replace("\0", "");
if (!docTitle)
docTitle = docElement.getAttribute("titledefault");