attary may be empty at this point and the sq_fixatts call will generate PHP
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 13 Jul 2011 08:44:04 +0000 (08:44 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 13 Jul 2011 08:44:04 +0000 (08:44 +0000)
Warnings. Wrap it in a conditional just like the other sq_fixatts call.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14134 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php

index 1e8fc880c1b82237c8d316e0851b3e6cca0a489b..a08920ca252b681759f5d6068e8268f653103a55 100644 (file)
@@ -2350,15 +2350,17 @@ function sq_sanitize($body,
             list($free_content, $curpos) =
                 sq_fixstyle($body, $gt+1, $message, $id, $mailbox);
             if ($free_content != FALSE){
-                $attary = sq_fixatts($tagname,
-                                     $attary,
-                                     $rm_attnames,
-                                     $bad_attvals,
-                                     $add_attr_to_tag,
-                                     $message,
-                                     $id,
-                                     $mailbox
-                                     );
+                if ( !empty($attary) ) {
+                    $attary = sq_fixatts($tagname,
+                                         $attary,
+                                         $rm_attnames,
+                                         $bad_attvals,
+                                         $add_attr_to_tag,
+                                         $message,
+                                         $id,
+                                         $mailbox
+                                         );
+                }
                 $trusted .= sq_tagprint($tagname, $attary, $tagtype);
                 $trusted .= $free_content;
                 $trusted .= sq_tagprint($tagname, false, 2);