[dev] git - printing from IMP in Firefox
Rick Romero
rick at havokmon.com
Mon Jan 10 20:44:57 UTC 2011
It seems to work fine in Chrome, but Firefox causes the following error:
Fatal error: Call to a member function getElementsByTagName() on a
non-object in horde/imp/view.php on line 311
This diff seems to fix it, but I'm not sure if that's a proper fix - it's
just too easy :)
--- view.php 2011-01-10 14:40:56.000000000 -0600
+++ view.php.new 2011-01-10 14:40:39.000000000 -0600
@@ -308,10 +308,12 @@
$imp_ui_mbox = new IMP_Ui_Mailbox();
$headelt =
$doc->dom->getElementsByTagName('head')->item(0);
- foreach ($headelt->getElementsByTagName('title') as
$node) {
- $headelt->removeChild($node);
- }
-
$headelt->appendChild($doc->dom->createElement('title',
htmlspecialchars($imp_ui_mbox->getSubject($headers->getValue('subject')))));
+ if ($headelt){
+ foreach ($headelt->getElementsByTagName('title')
as $node) {
+ $headelt->removeChild($node);
+ }
+
$headelt->appendChild($doc->dom->createElement('title',
htmlspecialchars($imp_ui_mbox->getSubject($headers->getValue('subject')))));
+ }
echo $doc->returnHtml();
} else {
More information about the dev
mailing list