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

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Fri May 30 07:36:16 EDT 2008


Author: jondaley
Date: 2008-05-30 07:36:16 -0400 (Fri, 30 May 2008)
New Revision: 6494

Modified:
   plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php
Log:
only one change here, though it looks like a bunch.  If the page has an RDF specifier, and a trackback:ping tag and not a dc:identifier, allow the trackback to happen anyway, even if we specified a URL (which we always do)  This will make us more compatible with some other blogging systems

Modified: plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php	2008-05-30 10:51:53 UTC (rev 6493)
+++ plog/branches/lifetype-1.2/class/dao/trackbackclient.class.php	2008-05-30 11:36:16 UTC (rev 6494)
@@ -43,13 +43,11 @@
          * found in the page, or an empty array if there was none found.
          */
          function getTrackbackLinks( $page, $pageUrl = "" ) {
-         	//$regexp = "/trackback:ping\ *=\ *\"(.+)\"/";
-            $regexp ="/<rdf:RDF.*?<\/rdf:RDF>/s";
-    		$links = preg_match_all( $regexp, $page, $out, PREG_SET_ORDER );
-
+            $regexp ="#<rdf:RDF.*?</rdf:RDF>#s";
+    		preg_match_all( $regexp, $page, $out, PREG_SET_ORDER );
             $links = Array();
             foreach( $out as $result ) {
-            	// we have to get now from within the rdf code the following identifiers:
+                    // we have to get now from within the rdf code the following identifiers:
                 // dc:identifier, trackback:ping and dc:about
 
                 // get the dc identifier
@@ -62,8 +60,11 @@
 
 	                // 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) || urldecode($dcIdentifier) == $pageUrl ) {
+	                if( $dcIdentifier && $pageUrl ) {
+	                	if( $dcIdentifier == $pageUrl ||
+                            $dcIdentifier == htmlentities($pageUrl) ||
+                            urldecode($dcIdentifier) == $pageUrl )
+                        {
 	                		//print("identifer matches page!!");
 	                		array_push( $links, $tbPing );
 	                	}
@@ -191,12 +192,12 @@
                     		if( !$result ) {
                         		// if it didn't work, mark it
                             	array_push( $results, $this->_buildResult( $link, TRACKBACK_FAILED ));
-                                //print("Error: trackback failed<br/>");
+                                    //print("Error: trackback failed<br/>");
                     		}
                         	else {
                         		// it actually worked, so we say so ;)
                         		array_push( $results, $this->_buildResult( $link, TRACKBACK_SUCCESS ));
-                                //print("It worked!<br/>");
+                                    //print("It worked!<br/>");
                         	}
                     	}
                 	}
@@ -204,7 +205,7 @@
             	else {
             		// page could not be fetched, so the trackback was not available
             		array_push( $results, $this->_buildResult( $link, TRACKBACK_UNAVAILABLE ));
-                    //print("Error: page was empty");
+                        //print("Error: page was empty");
             	}
         	}
 



More information about the pLog-svn mailing list