aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/NetscapeBookmarkUtils.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/NetscapeBookmarkUtils.php')
-rw-r--r--application/NetscapeBookmarkUtils.php6
1 files changed, 5 insertions, 1 deletions
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
95 * @param array $files Server $_FILES parameters 95 * @param array $files Server $_FILES parameters
96 * @param LinkDB $linkDb Loaded LinkDB instance 96 * @param LinkDB $linkDb Loaded LinkDB instance
97 * @param ConfigManager $conf instance 97 * @param ConfigManager $conf instance
98 * @param History $history History instance
98 * 99 *
99 * @return string Summary of the bookmark import status 100 * @return string Summary of the bookmark import status
100 */ 101 */
101 public static function import($post, $files, $linkDb, $conf) 102 public static function import($post, $files, $linkDb, $conf, $history)
102 { 103 {
103 $filename = $files['filetoupload']['name']; 104 $filename = $files['filetoupload']['name'];
104 $filesize = $files['filetoupload']['size']; 105 $filesize = $files['filetoupload']['size'];
@@ -179,9 +180,11 @@ class NetscapeBookmarkUtils
179 $newLink['id'] = $existingLink['id']; 180 $newLink['id'] = $existingLink['id'];
180 $newLink['created'] = $existingLink['created']; 181 $newLink['created'] = $existingLink['created'];
181 $newLink['updated'] = new DateTime(); 182 $newLink['updated'] = new DateTime();
183 $newLink['shorturl'] = $existingLink['shorturl'];
182 $linkDb[$existingLink['id']] = $newLink; 184 $linkDb[$existingLink['id']] = $newLink;
183 $importCount++; 185 $importCount++;
184 $overwriteCount++; 186 $overwriteCount++;
187 $history->updateLink($newLink);
185 continue; 188 continue;
186 } 189 }
187 190
@@ -193,6 +196,7 @@ class NetscapeBookmarkUtils
193 $newLink['shorturl'] = link_small_hash($newLink['created'], $newLink['id']); 196 $newLink['shorturl'] = link_small_hash($newLink['created'], $newLink['id']);
194 $linkDb[$newLink['id']] = $newLink; 197 $linkDb[$newLink['id']] = $newLink;
195 $importCount++; 198 $importCount++;
199 $history->addLink($newLink);
196 } 200 }
197 201
198 $linkDb->save($conf->get('resource.page_cache')); 202 $linkDb->save($conf->get('resource.page_cache'));