[GH-ISSUE #121] Date issue when no LASTMODIFIED in HTML import #87

Closed
opened 2026-02-25 23:33:25 +03:00 by kerem · 1 comment
Owner

Originally created by @KillianKemps on GitHub (Jan 20, 2019).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/121

Hello,

I observed a bug which may be distinguished as two different issues. When importing a HTML file which contains no LASTMODIFIED attribute with Shiori, Shiori displays Added 1970-01-01 01:00:00 UTC on the cached page of all the imported items instead of the real date when the bookmark was added in the previous bookmark manager.

The thing is, that this HTML file I imported was in fact exported by Shiori itself before. Items in Shiori HTML exports do not contain LASTMODIFIED attributes.

Imported HTML bookmarks from Firefox and Buku display the correct date and not not have this issue.

An example of a Shiori HTML export which than has false dates after being imported by Shiori:

<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL>
  <p>
  <DT><A HREF="https://github.com/hetznercloud/csi-driver" ADD_DATE="1547914746" TAGS="devops,open source">GitHub - hetznercloud/csi-driver: Kubernetes Container Storage Interface driver for Hetzner Cloud Volumes</A>
  <DD>Kubernetes Container Storage Interface driver for Hetzner Cloud Volumes - hetznercloud/csi-driver
  <DT><A HREF="https://smallstep.com/blog/everything-pki.html" ADD_DATE="1547915726" TAGS="security,sysadmin">Everything you should know about certificates and PKI but are too afraid to ask</A>
  <DD>Certificates and public key infrastructure (PKI) are hard. No shit, right? I know a lot of smart people who&#39;ve avoided this particular rabbit hole. Personally, I avoided it for a long time and felt some shame for not knowing more. The obvious result was a vicious cycle: I was too embarrassed to ask questions so I never learned. Eventually I was forced to learn this stuff because of what it enables: PKI lets you define a system cryptographically. It&#39;s universal and vendor neutral. It works everywhere so bits of your system can run anywhere and communicate securely. It&#39;s conceptually simple and super flexible. It lets you use TLS and ditch VPNs. You can ignore everything about your network and still have strong security characteristics. It&#39;s pretty great.
  <DT><A HREF="https://github.com/emersion/maddy" ADD_DATE="1547915849" TAGS="devops">GitHub - emersion/maddy: Fast, cross</A>
  <DD>Fast, cross-platform mail server. Contribute to emersion/maddy development by creating an account on GitHub.
</DL>
<p>

I think the first issue is that Shiori is not able to read the ADD_DATE attribute alone when importing, and is only reading LASTMODIFED.

The second issue is that Shiori omits the LASTMODIFIED information in the HTML export.

Originally created by @KillianKemps on GitHub (Jan 20, 2019). Original GitHub issue: https://github.com/go-shiori/shiori/issues/121 Hello, I observed a bug which may be distinguished as two different issues. When importing a HTML file which contains no `LASTMODIFIED` attribute with Shiori, Shiori displays `Added 1970-01-01 01:00:00 UTC` on the cached page of all the imported items instead of the real date when the bookmark was added in the previous bookmark manager. The thing is, that this HTML file I imported was in fact exported by Shiori itself before. Items in Shiori HTML exports do not contain `LASTMODIFIED` attributes. Imported HTML bookmarks from Firefox and Buku display the correct date and not not have this issue. An example of a Shiori HTML export which than has false dates after being imported by Shiori: ``` <!DOCTYPE NETSCAPE-Bookmark-file-1> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> <TITLE>Bookmarks</TITLE> <H1>Bookmarks</H1> <DL> <p> <DT><A HREF="https://github.com/hetznercloud/csi-driver" ADD_DATE="1547914746" TAGS="devops,open source">GitHub - hetznercloud/csi-driver: Kubernetes Container Storage Interface driver for Hetzner Cloud Volumes</A> <DD>Kubernetes Container Storage Interface driver for Hetzner Cloud Volumes - hetznercloud/csi-driver <DT><A HREF="https://smallstep.com/blog/everything-pki.html" ADD_DATE="1547915726" TAGS="security,sysadmin">Everything you should know about certificates and PKI but are too afraid to ask</A> <DD>Certificates and public key infrastructure (PKI) are hard. No shit, right? I know a lot of smart people who&#39;ve avoided this particular rabbit hole. Personally, I avoided it for a long time and felt some shame for not knowing more. The obvious result was a vicious cycle: I was too embarrassed to ask questions so I never learned. Eventually I was forced to learn this stuff because of what it enables: PKI lets you define a system cryptographically. It&#39;s universal and vendor neutral. It works everywhere so bits of your system can run anywhere and communicate securely. It&#39;s conceptually simple and super flexible. It lets you use TLS and ditch VPNs. You can ignore everything about your network and still have strong security characteristics. It&#39;s pretty great. <DT><A HREF="https://github.com/emersion/maddy" ADD_DATE="1547915849" TAGS="devops">GitHub - emersion/maddy: Fast, cross</A> <DD>Fast, cross-platform mail server. Contribute to emersion/maddy development by creating an account on GitHub. </DL> <p> ``` I think the first issue is that Shiori is not able to read the `ADD_DATE` attribute alone when importing, and is only reading `LASTMODIFED`. The second issue is that Shiori omits the `LASTMODIFIED` information in the HTML export.
Author
Owner

@fmartingr commented on GitHub (Oct 7, 2022):

Hey @KillianKemps, better late than never! I've taken a look at this, and the export already contains the LAST_MODIFIED but as you said the import wasn't using LAST_MODIFIED nor ADD_DATE. I've tested this and fixed it in #490 along with the issue that made all imported bookmarks use the current date.

<!-- gh-comment-id:1271325707 --> @fmartingr commented on GitHub (Oct 7, 2022): Hey @KillianKemps, better late than never! I've taken a look at this, and the export already contains the `LAST_MODIFIED` but as you said the import wasn't using `LAST_MODIFIED` nor `ADD_DATE`. I've tested this and fixed it in #490 along with the issue that made all imported bookmarks use the current date.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#87
No description provided.