]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Merge pull request #554 from virtualtam/fix/bookmark-export
[github/shaarli/Shaarli.git] / index.php
index 47bae6e87a943a1b26d5af2d1558053e2909f2fb..408aeae9ca7bcf6cde2b6c8190cabd56bc9fc761 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1590,8 +1590,9 @@ function renderPage()
         exit;
     }
 
-    // -------- Export as Netscape Bookmarks HTML file.
     if ($targetPage == Router::$PAGE_EXPORT) {
+        // Export links as a Netscape Bookmarks file
+
         if (empty($_GET['selection'])) {
             $PAGE->assign('linkcount',count($LINKSDB));
             $PAGE->renderPage('export');
@@ -1600,10 +1601,21 @@ function renderPage()
 
         // export as bookmarks_(all|private|public)_YYYYmmdd_HHMMSS.html
         $selection = $_GET['selection'];
+        if (isset($_GET['prepend_note_url'])) {
+            $prependNoteUrl = $_GET['prepend_note_url'];
+        } else {
+            $prependNoteUrl = false;
+        }
+
         try {
             $PAGE->assign(
                 'links',
-                NetscapeBookmarkUtils::filterAndFormat($LINKSDB, $selection)
+                NetscapeBookmarkUtils::filterAndFormat(
+                    $LINKSDB,
+                    $selection,
+                    $prependNoteUrl,
+                    index_url($_SERVER)
+                )
             );
         } catch (Exception $exc) {
             header('Content-Type: text/plain; charset=utf-8');