[pLog-svn] r6496 - plog/branches/lifetype-1.2/class/dao

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Fri May 30 08:15:34 EDT 2008


Author: jondaley
Date: 2008-05-30 08:15:34 -0400 (Fri, 30 May 2008)
New Revision: 6496

Modified:
   plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php
Log:
compare only the shorter of the two urls when verifying trackback URLs.  This probably makes us more compatible with other people, and it also fixes http://bugs.lifetype.net/view.php?id=1475

Modified: plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php	2008-05-30 11:54:47 UTC (rev 6495)
+++ plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php	2008-05-30 12:15:34 UTC (rev 6496)
@@ -61,10 +61,27 @@
 	                // if we provided the url of the page, we have a mechanism to make sure
 	                // that we are fetching the right trackback ping
 	                if( $dcIdentifier && $pageUrl ) {
-	                	if( $dcIdentifier == $pageUrl ||
-                            $dcIdentifier == htmlentities($pageUrl) ||
-                            urldecode($dcIdentifier) == $pageUrl )
-                        {
+                        $matched = 0;
+                        
+                        $len1 = strlen($pageUrl);
+                        $len2 = strlen($dcIdentifier);
+                        $length = ($len1 > $len2) ? $len2 : $len1;
+                        if( strncasecmp($dcIdentifier,$pageUrl,$length) == 0)
+                            $matched = 1;
+
+                        $len1 = strlen(htmlentities($pageUrl));
+                        $len2 = strlen($dcIdentifier);
+                        $length = ($len1 > $len2) ? $len2 : $len1;
+	                	if( strncasecmp($dcIdentifier,htmlentities($pageUrl),$length) == 0)
+                            $matched = 1;
+
+                        $len1 = strlen($pageUrl);
+                        $len2 = strlen(urldecode($dcIdentifier));
+                        $length = ($len1 > $len2) ? $len2 : $len1;
+	                	if( strncasecmp(urldecode($dcIdentifier),$pageUrl,$length) == 0)
+                            $matched = 1;
+
+                        if($matched == 1){
 	                		//print("identifer matches page!!");
 	                		array_push( $links, $tbPing );
 	                	}



More information about the pLog-svn mailing list