]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - plugins/qrcode/qrcode.php
URL encode links when a redirector is set.
[github/shaarli/Shaarli.git] / plugins / qrcode / qrcode.php
index 5db409291c772e3ad811ed26eb9c199163e14b76..5f6e76a2f8c42d035f0c7026158b463935d953b0 100644 (file)
@@ -1,11 +1,15 @@
 <?php
-
-// TODO: Can't be tested in localhost
+/**
+ * Plugin qrcode
+ * Add QRCode containing URL for each links.
+ * Display a QRCode icon in link list.
+ */
 
 /**
  * Add qrcode icon to link_plugin when rendering linklist.
  *
- * @param $data - linklist data.
+ * @param array $data - linklist data.
+ *
  * @return mixed - linklist data with qrcode plugin.
  */
 function hook_qrcode_render_linklist($data)
@@ -13,7 +17,7 @@ function hook_qrcode_render_linklist($data)
     $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html');
 
     foreach ($data['links'] as &$value) {
-        $qrcode = sprintf($qrcode_html, $value['url'], $value['url'], PluginManager::$PLUGINS_PATH);
+        $qrcode = sprintf($qrcode_html, $value['real_url'], $value['real_url'], PluginManager::$PLUGINS_PATH);
         $value['link_plugin'][] = $qrcode;
     }
 
@@ -24,6 +28,7 @@ function hook_qrcode_render_linklist($data)
  * When linklist is displayed, include qrcode JS files.
  *
  * @param array $data - footer data.
+ *
  * @return mixed - footer data with qrcode JS files added.
  */
 function hook_qrcode_render_footer($data)
@@ -33,4 +38,4 @@ function hook_qrcode_render_footer($data)
     }
 
     return $data;
-}
\ No newline at end of file
+}