diff options
author | Sébastien SAUVAGE <sebsauvage@sebsauvage.net> | 2013-09-24 02:02:33 -0700 |
---|---|---|
committer | Sébastien SAUVAGE <sebsauvage@sebsauvage.net> | 2013-09-24 02:02:33 -0700 |
commit | fdc3c114d1617578e388147af138e8470d7b20b3 (patch) | |
tree | 15c1ee4122b1fea014227a0b999acaae7dd87575 | |
parent | 5d48d5d06e5d38933c3415890d692d4b23febe06 (diff) | |
parent | fc93ae1d1a661ff33d1f1ed1100ae09277a77456 (diff) | |
download | Shaarli-fdc3c114d1617578e388147af138e8470d7b20b3.tar.gz Shaarli-fdc3c114d1617578e388147af138e8470d7b20b3.tar.zst Shaarli-fdc3c114d1617578e388147af138e8470d7b20b3.zip |
Merge pull request #126 from Alkarex/Milliseconds
Import: add compatibility for milliseconds in NETSCAPE-Bookmark
-rw-r--r-- | index.php | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 | } |