Mailer.php
authorAlan Knowles <alan@roojs.com>
Wed, 15 Aug 2018 02:26:31 +0000 (10:26 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 15 Aug 2018 02:26:31 +0000 (10:26 +0800)
Mailer.php

index 497d321..ff0ace8 100644 (file)
@@ -503,8 +503,9 @@ class Pman_Core_Mailer {
         @$dom->loadHTML('<?xml encoding="UTF-8">' .$html);
         
         $body = $dom->getElementsByTagName('body');
-        
-         $body->setAttribute('class', $cls);
+        if ($body->count()) {
+            $body->item(0)->setAttribute('class', $cls);
+        }
         
         
         return $dom->saveHTML();