aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-07-03 00:43:02 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-07-03 00:43:02 +0200
commit32750182382ab0f49ef6fb9aa0ebc1f3d69493ae (patch)
treebadf35aea9da3d2eba518873852b46e67b7997a4
parent5b06f6cd944ec56c8cc58b019f07ea65d415224f (diff)
Cleaning some hash functions
-rw-r--r--app/Models/Feed.php4
-rw-r--r--lib/lib_rss.php6
2 files changed, 2 insertions, 8 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 14b52b143..ba142c8c8 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -105,7 +105,7 @@ class FreshRSS_Feed extends Minz_Model {
$file = DATA_PATH . '/favicons/' . $this->hash() . '.txt';
if (!file_exists ($file)) {
$t = $this->website;
- if (empty($t)) {
+ if ($t == '') {
$t = $this->url;
}
file_put_contents($file, $t);
@@ -296,7 +296,7 @@ class FreshRSS_Feed extends Minz_Model {
}
function lock() {
- $this->lockPath = TMP_PATH . '/' . md5(Minz_Configuration::salt() . $this->url) . '.freshrss.lock';
+ $this->lockPath = TMP_PATH . '/' . $this->hash() . '.freshrss.lock';
if (file_exists($this->lockPath) && ((time() - @filemtime($this->lockPath)) > 3600)) {
@unlink($this->lockPath);
}
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 0f8161129..1b1e4b021 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -56,12 +56,6 @@ function checkUrl($url) {
}
}
-// tiré de Shaarli de Seb Sauvage //Format RFC 4648 base64url
-function small_hash ($txt) {
- $t = rtrim (base64_encode (hash ('crc32', $txt, true)), '=');
- return strtr ($t, '+/', '-_');
-}
-
function formatNumber($n, $precision = 0) {
return str_replace(' ', ' ', //Espace insécable //TODO: remplacer par une espace _fine_ insécable
number_format($n, $precision, '.', ' ')); //number_format does not seem to be Unicode-compatible