[pLog-svn] r6631 - plog/branches/lifetype-1.2/class/action/admin

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Sat Jun 21 15:38:20 EDT 2008


Author: jondaley
Date: 2008-06-21 15:38:20 -0400 (Sat, 21 Jun 2008)
New Revision: 6631

Modified:
   plog/branches/lifetype-1.2/class/action/admin/adminaddpostaction.class.php
Log:
filter the trackback url before posting - might help a little with slightly invalid trackback urls, ie. missing http:// or whatever

Modified: plog/branches/lifetype-1.2/class/action/admin/adminaddpostaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminaddpostaction.class.php	2008-06-21 18:55:36 UTC (rev 6630)
+++ plog/branches/lifetype-1.2/class/action/admin/adminaddpostaction.class.php	2008-06-21 19:38:20 UTC (rev 6631)
@@ -42,7 +42,7 @@
 			$validateOk = parent::validate();
 			if( !$validateOk )
 				$this->clearAutoSaveCookie();
-				
+            
 			return $validateOk;
 		}
 
@@ -163,6 +163,8 @@
                     // and now check what to do with the trackbacks
                     if( $this->_sendTrackbacks ) {
                         lt_include( PLOG_CLASS_PATH."class/data/stringutils.class.php" );
+                        lt_include( PLOG_CLASS_PATH."class/data/filter/urlconverter.class.php" );
+                        $f = new UrlConverter();
 
                     	// get the links from the text of the post
         				$postLinks = StringUtils::getLinks( $article->getText());
@@ -171,8 +173,10 @@
 		                $trackbackLinks = Array();
 		                foreach(explode( "\r\n", $this->_trackbackUrls ) as $host ) {
 		                	trim($host);
-		                	if( $host != "" && $host != "\r\n" && $host != "\r" && $host != "\n" )
+		                	if( $host != "" && $host != "\r\n" && $host != "\r" && $host != "\n" ){
+                                $host = $f->filter($host);
 		                    	array_push( $trackbackLinks, $host );
+                            }
 		                }
 
         				// if no links, there is nothing to do



More information about the pLog-svn mailing list