<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -21,8 +21,8 @@ require_once('configuration.php');
 // Check for URL or a referrer
 $uri='';
 if (isset($_GET['referer'])) {
-  if (getenv(&quot;HTTP_REFERER&quot;) != '') { 
-      $uri = getenv(&quot;HTTP_REFERER&quot;); 
+  if (getenv(&quot;HTTP_REFERER&quot;) != '') {
+      $uri = getenv(&quot;HTTP_REFERER&quot;);
   }
 }
 
@@ -34,73 +34,73 @@ if (isset($_GET['uri'])){
 }
 
 if ((substr($uri, 0,7) == &quot;http://&quot;) || (substr($uri, 0,8) == &quot;https://&quot;)) {
-    
+
     set_time_limit(90);
 
-	// explode on the '#' to separate the anchor link from the page
-	$temp = explode(&quot;#&quot;,$uri);
-    if(isSet($temp[1])){ 
+  // explode on the '#' to separate the anchor link from the page
+  $temp = explode(&quot;#&quot;,$uri);
+    if(isSet($temp[1])){
         $anchor = $temp[1];
     } else {
         $anchor = '';
     }
     $temp = $temp[0];
-    
-	$c = curl_init();
-	curl_setopt($c, CURLOPT_RETURNTRANSFER,1);
-	curl_setopt($c, CURLOPT_URL, str_replace('&amp;amp;','&amp;',$uri));
-	curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 2);
-	curl_setopt($c, CURLOPT_TIMEOUT, 4);
-	curl_setopt($c, CURLOPT_USERAGENT, X2V_USER_AGENT);
-	curl_setopt($c, CURLOPT_FOLLOWLOCATION,1);
-	$xml_string = curl_exec($c);
-	$info = curl_getinfo($c);
+
+  $c = curl_init();
+  curl_setopt($c, CURLOPT_RETURNTRANSFER,1);
+  curl_setopt($c, CURLOPT_URL, str_replace('&amp;amp;','&amp;',$uri));
+  curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 2);
+  curl_setopt($c, CURLOPT_TIMEOUT, 4);
+  curl_setopt($c, CURLOPT_USERAGENT, X2V_USER_AGENT);
+  curl_setopt($c, CURLOPT_FOLLOWLOCATION,1);
+  $xml_string = curl_exec($c);
+  $info = curl_getinfo($c);
 
 
     // $config = array('indent' =&gt; TRUE,
     //                'output-xhtml' =&gt; TRUE,
     //                'wrap' =&gt; 200);
     // $tidy = tidy_parse_string($xml_string, $config, 'UTF8');
-    // 
+    //
     // $tidy-&gt;cleanRepair();
     // $xml_string = $tidy;
 
-	$doc = new DOMDocument();
-	$xsl = new XSLTProcessor();
-	
-	if (isset($_GET['type'])){
-		switch(strtolower($_GET['type'])){
-		    case &quot;rdf&quot;:     
-		        $extension .= &quot;rdf&quot;;
-		        $contentType = 'application/xml+rdf';
-		        $filename = X2V_ROOT_PATH . '/hcard/xhtml2vcardrdf.xsl';
-		        break;
-		    default:
-		        $filename = X2V_ROOT_PATH . '/hcard/xhtml2vcard.xsl';
-		        $contentType = &quot;text/x-vcard&quot;;
-		        $extension = 'vcf';
-		        break;
-		}
-	} else { 
-	    $filename = X2V_ROOT_PATH . '/hcard/xhtml2vcard.xsl';
-	    $contentType = &quot;text/x-vcard&quot;; $extension = 'vcf';
-	}
-	
-	$doc-&gt;load($filename);
-	$xsl-&gt;importStyleSheet($doc);
-	$xsl-&gt;setParameter('', 'Source', $uri);
-	$xsl-&gt;setParameter('', 'Anchor', $anchor);
-	$xsl-&gt;setParameter('', 'Encoding', X2V_CHARSET);
-
-	$doc-&gt;loadHTML($xml_string);
-	$doc-&gt;formatOutput = true;
-	$Str = $xsl-&gt;transformToXML($doc);
-	
-	
-	// check to see if a filename is specified
-	if (isset($_GET['filename'])){
-	  if ($_GET['filename'] != ''){ $logfile = $_GET['filename']; }
-	} else { 
+  $doc = new DOMDocument();
+  $xsl = new XSLTProcessor();
+
+  if (isset($_GET['type'])){
+    switch(strtolower($_GET['type'])){
+        case &quot;rdf&quot;:
+            $extension .= &quot;rdf&quot;;
+            $contentType = 'application/xml+rdf';
+            $filename = X2V_ROOT_PATH . '/hcard/xhtml2vcardrdf.xsl';
+            break;
+        default:
+            $filename = X2V_ROOT_PATH . '/hcard/xhtml2vcard.xsl';
+            $contentType = &quot;text/x-vcard&quot;;
+            $extension = 'vcf';
+            break;
+    }
+  } else {
+      $filename = X2V_ROOT_PATH . '/hcard/xhtml2vcard.xsl';
+      $contentType = &quot;text/x-vcard&quot;; $extension = 'vcf';
+  }
+
+  $doc-&gt;load($filename);
+  $xsl-&gt;importStyleSheet($doc);
+  $xsl-&gt;setParameter('', 'Source', $uri);
+  $xsl-&gt;setParameter('', 'Anchor', $anchor);
+  $xsl-&gt;setParameter('', 'Encoding', X2V_CHARSET);
+
+  $doc-&gt;loadHTML($xml_string);
+  $doc-&gt;formatOutput = true;
+  $Str = $xsl-&gt;transformToXML($doc);
+
+
+  // check to see if a filename is specified
+  if (isset($_GET['filename'])){
+    if ($_GET['filename'] != ''){ $logfile = $_GET['filename']; }
+  } else {
     # look for the fullname so we can name the vcard
     preg_match_all( '/FN.*?:(.*)/i', $Str, &amp;$matches);
     # we will get the matched line and all matches for our requested parameter
@@ -118,19 +118,19 @@ if ((substr($uri, 0,7) == &quot;http://&quot;) || (substr($uri, 0,8) == &quot;https://&quot;)) {
 
   # get the filename encoding correct
   $logfile = utf8_decode( $logfile );
-  
-	if (FALSE == $Str){
-		print 'No vCards found';
-		//print '&lt;!-- '.htmlentities($xml_string).' --&gt;';
-	} else {
-		header(&quot;Content-Disposition: attachment; filename=\&quot;$logfile.$extension\&quot;&quot;);
-	//	header(&quot;Content-Length: &quot;.mb_strlen($Str)+1);
-		header(&quot;Connection: close&quot;);
-		header(&quot;Content-Type: $contentType; charset=&quot;.X2V_CHARSET.&quot;; name=$logfile.$extension&quot;);
-		echo $Str;
-		exit();
-	}
+
+  if (FALSE == $Str){
+    print 'No vCards found';
+    //print '&lt;!-- '.htmlentities($xml_string).' --&gt;';
+  } else {
+    header(&quot;Content-Disposition: attachment; filename=\&quot;$logfile.$extension\&quot;&quot;);
+  //  header(&quot;Content-Length: &quot;.mb_strlen($Str)+1);
+    header(&quot;Connection: close&quot;);
+    header(&quot;Content-Type: $contentType; charset=&quot;.X2V_CHARSET.&quot;; name=$logfile.$extension&quot;);
+    echo $Str;
+    exit();
+  }
 } else {
-	print 'invalid URI!';
+  print 'invalid URI!';
 }
 ?&gt;
\ No newline at end of file</diff>
      <filename>get-contact-named-vcf.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c4efec817be9aa175564bf6f0961c188f746e0f9</id>
    </parent>
  </parents>
  <author>
    <name>Matt</name>
    <email>matt@themattharris.com</email>
  </author>
  <url>http://github.com/themattharris/x2v/commit/a94b8a8cbe01516fb417979dc92df4fd9fb55278</url>
  <id>a94b8a8cbe01516fb417979dc92df4fd9fb55278</id>
  <committed-date>2009-10-29T17:13:49-07:00</committed-date>
  <authored-date>2009-10-29T17:13:49-07:00</authored-date>
  <message>Formatting fixes</message>
  <tree>cb3165671da0e96ee9290a0b2830ed903298b614</tree>
  <committer>
    <name>Matt</name>
    <email>matt@themattharris.com</email>
  </committer>
</commit>
