]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Merge remote-tracking branch 'Marsup/firefox-social' into next
[github/shaarli/Shaarli.git] / index.php
index fad0340c21f8d04522a1ce1f242f12c0f0b0e985..80cf8beaebec6a2ca1cd771a4ea9168b376839a5 100644 (file)
--- a/index.php
+++ b/index.php
@@ -555,9 +555,12 @@ function endsWith($haystack,$needle,$case=true)
     PS: I could have used strptime(), but it does not exist on Windows. I'm too kind. */
 function linkdate2timestamp($linkdate)
 {
-    $Y=$M=$D=$h=$m=$s=0;
-    sscanf($linkdate,'%4d%2d%2d_%2d%2d%2d',$Y,$M,$D,$h,$m,$s);
-    return mktime($h,$m,$s,$M,$D,$Y);
+    if(strcmp($linkdate, '_000000') !== 0 || !$linkdate){
+        $Y=$M=$D=$h=$m=$s=0;
+        $r = sscanf($linkdate,'%4d%2d%2d_%2d%2d%2d',$Y,$M,$D,$h,$m,$s);
+        return mktime($h,$m,$s,$M,$D,$Y);
+    }
+    return time();
 }
 
 /*  Converts a linkdate time (YYYYMMDD_HHMMSS) of an article to a RFC822 date.