]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/LilUrl/LilUrlPlugin.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / plugins / LilUrl / LilUrlPlugin.php
index e906751e8424410b15fbbb3061e0d0897cee9fcc..c3e37c0c0f358a76bde8bf9633992f947fe7c034 100644 (file)
@@ -46,16 +46,29 @@ class LilUrlPlugin extends UrlShortenerPlugin
 
     protected function shorten($url) {
         $data = array('longurl' => $url);
-        
+
         $responseBody = $this->http_post($this->serviceUrl,$data);
-        
+
         if (!$responseBody) return;
         $y = @simplexml_load_string($responseBody);
         if (!isset($y->body)) return;
         $x = $y->body->p[0]->a->attributes();
         if (isset($x['href'])) {
-            return $x['href'];
+            return strval($x['href']);
         }
     }
+
+    function onPluginVersion(&$versions)
+    {
+        $versions[] = array('name' => sprintf('LilUrl (%s)', $this->shortenerName),
+                            'version' => STATUSNET_VERSION,
+                            'author' => 'Craig Andrews',
+                            'homepage' => 'http://status.net/wiki/Plugin:LilUrl',
+                            'rawdescription' =>
+                            sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'),
+                                    $this->shortenerName));
+
+        return true;
+    }
 }