aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorAlexandre Alapetite <alexandre@alapetite.fr>2013-09-21 18:15:41 +0200
committerAlexandre Alapetite <alexandre@alapetite.fr>2013-09-21 18:15:41 +0200
commitfc93ae1d1a661ff33d1f1ed1100ae09277a77456 (patch)
treed72a4c1057023075c689023ac58093b9afd169cb /index.php
parent002ef0e5c8ed2bab38e205a5d54617780f25c3a9 (diff)
downloadShaarli-fc93ae1d1a661ff33d1f1ed1100ae09277a77456.tar.gz
Shaarli-fc93ae1d1a661ff33d1f1ed1100ae09277a77456.tar.zst
Shaarli-fc93ae1d1a661ff33d1f1ed1100ae09277a77456.zip
Import NETSCAPE-Bookmark compatible milliseconds
NETSCAPE-Bookmark sometimes contains dates as milliseconds instead of seconds. For instance, this is the case of the files gererated for Google +1s by Google Takeout. This patch make these files compatible.
Diffstat (limited to 'index.php')
-rw-r--r--index.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/index.php b/index.php
index d88f471c..b65bfb7c 100644
--- a/index.php
+++ b/index.php
@@ -1695,7 +1695,11 @@ function importFile()
1695 { 1695 {
1696 $attr=$m[1]; $value=$m[2]; 1696 $attr=$m[1]; $value=$m[2];
1697 if ($attr=='HREF') $link['url']=html_entity_decode($value,ENT_QUOTES,'UTF-8'); 1697 if ($attr=='HREF') $link['url']=html_entity_decode($value,ENT_QUOTES,'UTF-8');
1698 elseif ($attr=='ADD_DATE') $raw_add_date=intval($value); 1698 elseif ($attr=='ADD_DATE')
1699 {
1700 $raw_add_date=intval($value);
1701 if ($raw_add_date>30000000000) $raw_add_date/=1000; //If larger than year 2920, then was likely stored in milliseconds instead of seconds
1702 }
1699 elseif ($attr=='PRIVATE') $link['private']=($value=='0'?0:1); 1703 elseif ($attr=='PRIVATE') $link['private']=($value=='0'?0:1);
1700 elseif ($attr=='TAGS') $link['tags']=html_entity_decode(str_replace(',',' ',$value),ENT_QUOTES,'UTF-8'); 1704 elseif ($attr=='TAGS') $link['tags']=html_entity_decode(str_replace(',',' ',$value),ENT_QUOTES,'UTF-8');
1701 } 1705 }