[pLog-svn] r4812 - in plog/branches/lifetype-1.2/class: dao test/tests/dao

oscar at devel.lifetype.net oscar at devel.lifetype.net
Wed Feb 21 18:12:54 EST 2007


Author: oscar
Date: 2007-02-21 18:12:54 -0500 (Wed, 21 Feb 2007)
New Revision: 4812

Modified:
   plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php
   plog/branches/lifetype-1.2/class/test/tests/dao/trackbackclient_test.class.php
Log:
Another fix related to trackback auto-discovery. Since URLs in the dc:identifier attribute could be url-escaped, we need to urldecode them and compare if it's the same to the one we're looking for.


Modified: plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php	2007-02-21 23:04:38 UTC (rev 4811)
+++ plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php	2007-02-21 23:12:54 UTC (rev 4812)
@@ -63,7 +63,7 @@
 	                // if we provided the url of the page, we have a mechanism to make sure
 	                // that we are fetching the right trackback ping
 	                if( $pageUrl != "" ) {
-	                	if( $dcIdentifier == $pageUrl || $dcIdentifier == htmlentities($pageUrl)) {
+	                	if( $dcIdentifier == $pageUrl || $dcIdentifier == htmlentities($pageUrl) || urldecode($dcIdentifier) == $pageUrl ) {
 	                		//print("identifer matches page!!");
 	                		array_push( $links, $tbPing );
 	                	}

Modified: plog/branches/lifetype-1.2/class/test/tests/dao/trackbackclient_test.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/test/tests/dao/trackbackclient_test.class.php	2007-02-21 23:04:38 UTC (rev 4811)
+++ plog/branches/lifetype-1.2/class/test/tests/dao/trackbackclient_test.class.php	2007-02-21 23:12:54 UTC (rev 4812)
@@ -124,5 +124,17 @@
 			// there should only be one link
 			$this->assertEquals( 0, count( $links ), "There shouldn't be any trackback links detected in this page!" );			
 		}
+		
+		function testTrackbackLinksWithDashes()
+		{
+			// get the trackback links from the given page
+			$links = TrackbackClient::getTrackbackLinks( $this->page, "http://www.lifetype.net/blog/lifetype-development-journal/2007/02/14/critical-security-issue-lifetype-1.1.6-and-lifetype-1.2-beta2-released" );
+			
+			// there should only be one link
+			$this->assertEquals( 1, count( $links ), "There was more than one trackback link detected in the test page!" );
+			
+			// and that it is equal to the value that we're expecting
+			$this->assertEquals( "http://www.lifetype.net/trackback.php?id=193", $links[0], "The returned trackback link was not the expected one!" );			
+		}
 	}
 ?>
\ No newline at end of file



More information about the pLog-svn mailing list