]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Do not try to retrieve thumbnails for internal link
[github/shaarli/Shaarli.git] / index.php
index 633ab89e6386e90eaa02f76d5a1880cb9366dccb..7b54f98f5299bd37a3b780ec429aa1158f1815f8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -362,7 +362,7 @@ function showDailyRSS($conf, $loginManager)
                 $conf->get('redirector.encode_url')
             );
             $link['timestamp'] = $link['created']->getTimestamp();
-            if (startsWith($link['url'], '?')) {
+            if (is_note($link['url'])) {
                 $link['url'] = index_url($_SERVER) . $link['url'];  // make permalink URL absolute
             }
         }
@@ -1176,7 +1176,9 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $link['title'] = $link['url'];
         }
 
-        if ($conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE) {
+        if ($conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE
+            && ! is_note($link['url'])
+        ) {
             $thumbnailer = new Thumbnailer($conf);
             $link['thumbnail'] = $thumbnailer->get($url);
         }
@@ -1558,7 +1560,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         $ids = [];
         foreach ($LINKSDB as $link) {
             // A note or not HTTP(S)
-            if ($link['url'][0] === '?' || ! startsWith(strtolower($link['url']), 'http')) {
+            if (is_note($link['url']) || ! startsWith(strtolower($link['url']), 'http')) {
                 continue;
             }
             $ids[] = $link['id'];