mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-03 01:25:21 +02:00
fix(binance): plus some other tweaks (#3753)
This commit is contained in:
parent
fd52b9b9a4
commit
5f37c72be0
9 changed files with 46 additions and 53 deletions
|
@ -260,13 +260,15 @@ class FeedItem
|
|||
return $this->uid;
|
||||
}
|
||||
|
||||
public function setUid($uid)
|
||||
public function setUid($uid): void
|
||||
{
|
||||
$this->uid = null;
|
||||
if (!is_string($uid)) {
|
||||
Debug::log('Unique id must be a string!');
|
||||
} elseif (preg_match('/^[a-f0-9]{40}$/', $uid)) {
|
||||
// keep id if it already is SHA-1 hash
|
||||
Debug::log(sprintf('uid must be string: %s (%s)', (string) $uid, var_export($uid, true)));
|
||||
return;
|
||||
}
|
||||
if (preg_match('/^[a-f0-9]{40}$/', $uid)) {
|
||||
// Preserve sha1 hash
|
||||
$this->uid = $uid;
|
||||
} else {
|
||||
$this->uid = sha1($uid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue