1
0
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:
Dag
2023-10-13 20:48:08 +02:00
committed by GitHub
parent fd52b9b9a4
commit 5f37c72be0
9 changed files with 46 additions and 53 deletions

View File

@@ -24,6 +24,7 @@ abstract class FeedExpander extends BridgeAbstract
}
// prepare/massage the xml to make it more acceptable
$badStrings = [
' ',
'»',
];
$xmlString = str_replace($badStrings, '', $xmlString);

View File

@@ -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);

View File

@@ -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);