[pLog-svn] r1996 - plugins/trunk/moblog/class/moblog

oscar at devel.plogworld.net oscar at devel.plogworld.net
Wed May 11 23:01:51 GMT 2005


Author: oscar
Date: 2005-05-11 23:01:51 +0000 (Wed, 11 May 2005)
New Revision: 1996

Modified:
   plugins/trunk/moblog/class/moblog/moblogrequest.class.php
Log:
the subject wasn't still properly detected in those situations where there was no subject at all (it should be the first 50 characters of the body)

Modified: plugins/trunk/moblog/class/moblog/moblogrequest.class.php
===================================================================
--- plugins/trunk/moblog/class/moblog/moblogrequest.class.php	2005-05-11 22:56:45 UTC (rev 1995)
+++ plugins/trunk/moblog/class/moblog/moblogrequest.class.php	2005-05-11 23:01:51 UTC (rev 1996)
@@ -49,22 +49,21 @@
             }
             
             // parse the body
-            $this->parseBody( $structure->body );
+            $this->parseBody( $structure->body );                                 
             
+            MoblogLogger::log( "There are ".count($structure->parts)." MIME parts available to parse" );      
+            $this->parseMimeParts( $structure->parts );                        
+            
             // if there was no subject specified, then let's see if there was something in the
             // 'subject' line...
-            if( !$this->_topic ) {
+            if( $this->_topic == "" ) {
                 $this->_topic = $structure->headers['subject'];
-                if( !$this->_topic ) {
+                if( $this->_topic == "" ) {
                     // if there is still no subject, get the first 50 characters of the body
-                    $this->_topic = substr($this->_body, 0, 50 );
+                    $this->_topic = substr(strip_tags($this->_body), 0, 50 );
                 }
-            }
-                
-            MoblogLogger::Log("subject is = ".$this->_topic );                                    
-            
-            MoblogLogger::log( "There are ".count($structure->parts)." MIME parts available to parse" );      
-            $this->parseMimeParts( $structure->parts );                        
+            }                
+            MoblogLogger::Log("subject is = ".$this->_topic );            
         }
         
         /**
@@ -128,7 +127,7 @@
             list($body, $sig) = explode("\n-- ", $body);
             
             MoblogLogger::log( "parseBody ---> body = $body" );
-            $body = Textfilter::autoP($body);         
+            $body = Textfilter::autoP(trim($body));         
             
             $this->_body .= $body;
         }




More information about the pLog-svn mailing list