X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=babce3dca8f6aa5b380b1c11775cec37883af557;hb=9aadcdaefaceec86c0610499e48bc41273f5d26f;hp=520d7d30af41cfc17f721334279d7a15fabb3c7d;hpb=ef4275c50edad6de268d53214db37f071e227b34;p=github%2Fshaarli%2FShaarli.git
diff --git a/index.php b/index.php
index 520d7d30..babce3dc 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,5 @@
getLinkFromUrl($url); // Check if URL is not already in database (in this case, we will edit the existing link)
@@ -853,7 +858,8 @@ Import Netscape html bookmarks (as exported from Firefox/Chrome/Opera/delicious/
- Import all links as private
+ Import all links as private
+ Overwrite existing links
HTML;
@@ -884,6 +890,8 @@ function importFile()
$filesize=$_FILES['filetoupload']['size'];
$data=file_get_contents($_FILES['filetoupload']['tmp_name']);
$private = (empty($_POST['private']) ? 0 : 1); // Should the links be imported as private ?
+ $overwrite = !empty($_POST['overwrite']) ; // Should the imported links overwrite existing ones ?
+ $import_count=0;
// Sniff file type:
$type='unknown';
@@ -895,35 +903,35 @@ function importFile()
// This is a standard Netscape-style bookmark file.
// This format is supported by all browsers (except IE, of course), also delicious, diigo and others.
// I didn't want to use DOM... anyway, this is FAST (less than 1 second to import 7200 links (2.1 Mb html file)).
- $before=count($LINKSDB);
foreach(explode('