X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FNetscapeBookmarkUtils.php;h=2a10ff22149f8c89f30458d9e5c907e19847438a;hb=dc37a482edd7d164de4a0f5458de4c7f65ebc763;hp=ab346f81c2ada769d204ea79d8f5ed21efb90213;hpb=196808e14f4df44faea4d010c062c09f36095d9b;p=github%2Fshaarli%2FShaarli.git diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php index ab346f81..2a10ff22 100644 --- a/application/NetscapeBookmarkUtils.php +++ b/application/NetscapeBookmarkUtils.php @@ -95,10 +95,11 @@ class NetscapeBookmarkUtils * @param array $files Server $_FILES parameters * @param LinkDB $linkDb Loaded LinkDB instance * @param ConfigManager $conf instance + * @param History $history History instance * * @return string Summary of the bookmark import status */ - public static function import($post, $files, $linkDb, $conf) + public static function import($post, $files, $linkDb, $conf, $history) { $filename = $files['filetoupload']['name']; $filesize = $files['filetoupload']['size']; @@ -179,9 +180,11 @@ class NetscapeBookmarkUtils $newLink['id'] = $existingLink['id']; $newLink['created'] = $existingLink['created']; $newLink['updated'] = new DateTime(); + $newLink['shorturl'] = $existingLink['shorturl']; $linkDb[$existingLink['id']] = $newLink; $importCount++; $overwriteCount++; + $history->updateLink($newLink); continue; } @@ -193,6 +196,7 @@ class NetscapeBookmarkUtils $newLink['shorturl'] = link_small_hash($newLink['created'], $newLink['id']); $linkDb[$newLink['id']] = $newLink; $importCount++; + $history->addLink($newLink); } $linkDb->save($conf->get('resource.page_cache'));