Selaa lähdekoodia

Changed the way we handle entities in message/rfc822 types. $msg->entity_id++
would increment by 0.1 in php 4.0.4 but would increment by 1.0 in php 4.0.6.
This meant that a message/rfc822 type with only a text/plain part would label
the text/plain part entity 3.0 instead of 2.1. This should fix that problem.

indiri69 23 vuotta sitten
vanhempi
commit
ab5e17e9a9
1 muutettua tiedostoa jossa 3 lisäystä ja 5 poistoa
  1. 3 5
      class/mime.class.php

+ 3 - 5
class/mime.class.php

@@ -854,10 +854,8 @@ class message {
                         $hdr->disposition = (isset($arg_a[8+$s]) ? $arg_a[8+$s] : $hdr->disposition);
                         $hdr->language = (isset($arg_a[9+$s]) ? $arg_a[9+$s] : $hdr->language);
                         $msg->header = $hdr;
-//                        $arg_no = 0;
-                        ++$i;
-                        if ((substr($msg->entity_id, -2) == '.0') && ($msg->type0 !='multipart')) {
-                           $msg->entity_id++;
+                        if ((strrchr($msg->entity_id, '.') == '.0') && ($msg->type0 !='multipart')) {
+                           $msg->entity_id = $this->entity_id . '.1';
                         }
                     } else {
                         $hdr->type0 = 'multipart';
@@ -868,8 +866,8 @@ class message {
                         $hdr->disposition = (isset($arg_a[2]) ? $arg_a[2] : $hdr->disposition);
                         $hdr->language = (isset($arg_a[3]) ? $arg_a[3] : $hdr->language);
                         $msg->header = $hdr;
-			++$i;
                     }
+                    ++$i;
                     return (array($msg, $i));
                 default: break;
             } /* switch */