[pLog-svn] r2877 - plugins/branches/lifetype-1.0/moblog/class/moblog

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Tue Jan 31 22:21:03 GMT 2006


Author: jondaley
Date: 2006-01-31 22:21:02 +0000 (Tue, 31 Jan 2006)
New Revision: 2877

Modified:
   plugins/branches/lifetype-1.0/moblog/class/moblog/moblogrequest.class.php
Log:
fixes http://forums.lifetype.net/viewtopic.php?t=4041 where his phone outputs ^M instead of true new lines after the password, etc. fields.  I believe this doesn't break anything for other people, unless people wanted to have ^M's in their post topics or something

Modified: plugins/branches/lifetype-1.0/moblog/class/moblog/moblogrequest.class.php
===================================================================
--- plugins/branches/lifetype-1.0/moblog/class/moblog/moblogrequest.class.php	2006-01-31 16:15:01 UTC (rev 2876)
+++ plugins/branches/lifetype-1.0/moblog/class/moblog/moblogrequest.class.php	2006-01-31 22:21:02 UTC (rev 2877)
@@ -91,31 +91,31 @@
             $body = str_replace("\xE2\x80\xA9","\n",$body);
             
             //We try to find out where the line containing the title is at...
-            if (preg_match("/^topic:(.*)/mi", $body, $title)) {
+            if (preg_match("/^topic:\W*(\w+)/mi", $body, $title)) {
                 //And put the title var in the proper place
                 $this->_topic = trim($title[1]);
             }
             
             //We repeat the same trick as above... for all vars wanted
-            if (preg_match("/^user:(.*)/mi", $body, $user)) {
+            if (preg_match("/^user:\W*(\w+)/mi", $body, $user)) {
                 $this->_user = trim($user[1]); 
             }       
             
             // in case ppl are lazy and use pass instead of password
-            if (preg_match("/^pass:(.*)/mi", $body, $pass)) {
+            if (preg_match("/^pass:\W*(\w+)/mi", $body, $pass)) {
                 $this->_pass = trim($pass[1]);
             } 
-            else if (preg_match("/^password:(.*)/mi", $body, $password)) {
+            else if (preg_match("/^password:\W*(\w+)/mi", $body, $password)) {
                 $this->_pass = trim($password[1]);
             }
 
             // we can either specify a blog id...
-            if (preg_match("/^blogid:(.*)/mi", $body, $blog)) {
+            if (preg_match("/^blogid:\W*(\w+)/mi", $body, $blog)) {
                 $this->_blogId = trim($blog[1]); 
             }
             
             // ...or a blog name
-            if (preg_match("/^blog:(.*)/mi", $body, $blogname)) {
+            if (preg_match("/^blog:\W*(\w+)/mi", $body, $blogname)) {
                 $this->_blogName = trim($blogname[1]); 
             }
             



More information about the pLog-svn mailing list