Merge branch 'master' of git://github.com/sebsauvage/Shaarli
This commit is contained in:
commit
a9821c6fcd
2 changed files with 8 additions and 11 deletions
|
@ -239,7 +239,7 @@ cursor:pointer;
|
||||||
.linkdescription { color:#000; margin-top:0; margin-bottom:12px; font-weight:normal; max-height:400px; overflow:auto; }
|
.linkdescription { color:#000; margin-top:0; margin-bottom:12px; font-weight:normal; max-height:400px; overflow:auto; }
|
||||||
.linkdescription a { text-decoration: none; color:#3465A4; }
|
.linkdescription a { text-decoration: none; color:#3465A4; }
|
||||||
.linkdescription a:hover { color:#F57900; }
|
.linkdescription a:hover { color:#F57900; }
|
||||||
.linktaglist { padding-top:10px;}
|
.linktaglist { padding-top:10px; line-height:200%;}
|
||||||
.linktag {
|
.linktag {
|
||||||
|
|
||||||
font-size:9pt;
|
font-size:9pt;
|
||||||
|
|
17
index.php
17
index.php
|
@ -221,7 +221,7 @@ function nl2br_escaped($html)
|
||||||
return str_replace('>','>',str_replace('<','<',nl2br($html)));
|
return str_replace('>','>',str_replace('<','<',nl2br($html)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the small hash of a string
|
/* Returns the small hash of a string, using RFC 4648 base64url format
|
||||||
eg. smallHash('20111006_131924') --> yZH23w
|
eg. smallHash('20111006_131924') --> yZH23w
|
||||||
Small hashes:
|
Small hashes:
|
||||||
- are unique (well, as unique as crc32, at last)
|
- are unique (well, as unique as crc32, at last)
|
||||||
|
@ -233,10 +233,7 @@ function nl2br_escaped($html)
|
||||||
function smallHash($text)
|
function smallHash($text)
|
||||||
{
|
{
|
||||||
$t = rtrim(base64_encode(hash('crc32',$text,true)),'=');
|
$t = rtrim(base64_encode(hash('crc32',$text,true)),'=');
|
||||||
$t = str_replace('+','-',$t); // Get rid of characters which need encoding in URLs.
|
return strtr($t, '+/', '-_');
|
||||||
$t = str_replace('/','_',$t);
|
|
||||||
$t = str_replace('=','@',$t);
|
|
||||||
return $t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// In a string, converts urls to clickable links.
|
// In a string, converts urls to clickable links.
|
||||||
|
@ -942,7 +939,7 @@ function showRSS()
|
||||||
echo '<description><![CDATA['.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))).$descriptionlink.']]></description>'."\n</item>\n";
|
echo '<description><![CDATA['.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))).$descriptionlink.']]></description>'."\n</item>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
echo '</channel></rss><!-- Cached version of '.pageUrl().' -->';
|
echo '</channel></rss><!-- Cached version of '.htmlspecialchars(pageUrl()).' -->';
|
||||||
|
|
||||||
$cache->cache(ob_get_contents());
|
$cache->cache(ob_get_contents());
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
|
@ -1027,7 +1024,7 @@ function showATOM()
|
||||||
$feed.='<author><name>'.htmlspecialchars($pageaddr).'</name><uri>'.htmlspecialchars($pageaddr).'</uri></author>';
|
$feed.='<author><name>'.htmlspecialchars($pageaddr).'</name><uri>'.htmlspecialchars($pageaddr).'</uri></author>';
|
||||||
$feed.='<id>'.htmlspecialchars($pageaddr).'</id>'."\n\n"; // Yes, I know I should use a real IRI (RFC3987), but the site URL will do.
|
$feed.='<id>'.htmlspecialchars($pageaddr).'</id>'."\n\n"; // Yes, I know I should use a real IRI (RFC3987), but the site URL will do.
|
||||||
$feed.=$entries;
|
$feed.=$entries;
|
||||||
$feed.='</feed><!-- Cached version of '.pageUrl().' -->';
|
$feed.='</feed><!-- Cached version of '.htmlspecialchars(pageUrl()).' -->';
|
||||||
echo $feed;
|
echo $feed;
|
||||||
|
|
||||||
$cache->cache(ob_get_contents());
|
$cache->cache(ob_get_contents());
|
||||||
|
@ -1104,7 +1101,7 @@ function showDailyRSS()
|
||||||
echo '<description><![CDATA['.$html.']]></description>'."\n</item>\n\n";
|
echo '<description><![CDATA['.$html.']]></description>'."\n</item>\n\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
echo '</channel></rss><!-- Cached version of '.pageUrl().' -->';
|
echo '</channel></rss><!-- Cached version of '.htmlspecialchars(pageUrl()).' -->';
|
||||||
|
|
||||||
$cache->cache(ob_get_contents());
|
$cache->cache(ob_get_contents());
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
|
@ -1747,11 +1744,11 @@ function importFile()
|
||||||
}
|
}
|
||||||
$LINKSDB->savedb();
|
$LINKSDB->savedb();
|
||||||
|
|
||||||
echo '<script language="JavaScript">alert("File '.$filename.' ('.$filesize.' bytes) was successfully processed: '.$import_count.' links imported.");document.location=\'?\';</script>';
|
echo '<script language="JavaScript">alert("File '.json_encode($filename).' ('.$filesize.' bytes) was successfully processed: '.$import_count.' links imported.");document.location=\'?\';</script>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo '<script language="JavaScript">alert("File '.$filename.' ('.$filesize.' bytes) has an unknown file format. Nothing was imported.");document.location=\'?\';</script>';
|
echo '<script language="JavaScript">alert("File '.json_encode($filename).' ('.$filesize.' bytes) has an unknown file format. Nothing was imported.");document.location=\'?\';</script>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue