mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-09 10:06:33 +02:00
fix(binance): plus some other tweaks (#3753)
This commit is contained in:
@@ -24,6 +24,7 @@ abstract class FeedExpander extends BridgeAbstract
|
||||
}
|
||||
// prepare/massage the xml to make it more acceptable
|
||||
$badStrings = [
|
||||
' ',
|
||||
'»',
|
||||
];
|
||||
$xmlString = str_replace($badStrings, '', $xmlString);
|
||||
|
@@ -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);
|
||||
|
@@ -149,6 +149,7 @@ final class StreamHandler
|
||||
);
|
||||
error_log($text);
|
||||
if ($record['level'] < Logger::ERROR && Debug::isEnabled()) {
|
||||
// Not a good idea to print here because http headers might not have been sent
|
||||
print sprintf("<pre>%s</pre>\n", e($text));
|
||||
}
|
||||
//$bytes = file_put_contents('/tmp/rss-bridge.log', $text, FILE_APPEND | LOCK_EX);
|
||||
|
Reference in New Issue
Block a user