]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/PtitUrl/PtitUrlPlugin.php
Merge branch 'master' of git@gitorious.org:statusnet/mainline
[quix0rs-gnu-social.git] / plugins / PtitUrl / PtitUrlPlugin.php
index ef453e96d84e388903efa480b7eb923e030777f3..76a438dd5e9ec9f41e98e1ba32ad9e49e6a298bd 100644 (file)
@@ -47,11 +47,14 @@ class PtitUrlPlugin extends UrlShortenerPlugin
     {
         $response = $this->http_get(sprintf($this->serviceUrl,urlencode($url)));
         if (!$response) return;
-        $response = $this->tidy($response);
-        $y = @simplexml_load_string($response);
+        $dom = new DOMDocument();
+        @$dom->loadHTML($response);
+        $y = @simplexml_import_dom($dom);
         if (!isset($y->body)) return;
         $xml = $y->body->center->table->tr->td->pre->a->attributes();
-        if (isset($xml['href'])) return $xml['href'];
+        if (isset($xml['href'])) {
+            return strval($xml['href']);
+        }
     }
 }