mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-05 08:07:33 +02:00
fix(html_format): add spacing below date if author is missing (#3425)
* small ui tweak * remove unused <div> * refactor: rename method * refactor: inline const * refactor
This commit is contained in:
@@ -2,18 +2,16 @@
|
||||
|
||||
final class BridgeFactory
|
||||
{
|
||||
private $folder;
|
||||
/** @var array<class-string<BridgeInterface>> */
|
||||
private $bridgeClassNames = [];
|
||||
|
||||
/** @var array<class-string<BridgeInterface>> */
|
||||
private $whitelist = [];
|
||||
|
||||
public function __construct(string $folder = PATH_LIB_BRIDGES)
|
||||
public function __construct()
|
||||
{
|
||||
$this->folder = $folder;
|
||||
|
||||
// create names
|
||||
foreach (scandir($this->folder) as $file) {
|
||||
foreach (scandir(__DIR__ . '/../bridges/') as $file) {
|
||||
if (preg_match('/^([^.]+Bridge)\.php$/U', $file, $m)) {
|
||||
$this->bridgeClassNames[] = $m[1];
|
||||
}
|
||||
@@ -27,6 +25,7 @@ final class BridgeFactory
|
||||
} else {
|
||||
$contents = '';
|
||||
}
|
||||
|
||||
if ($contents === '*') {
|
||||
// Whitelist all bridges
|
||||
$this->whitelist = $this->getBridgeClassNames();
|
||||
|
@@ -16,7 +16,6 @@
|
||||
const PATH_ROOT = __DIR__ . '/../';
|
||||
|
||||
/** Path to the bridges library */
|
||||
const PATH_LIB_BRIDGES = __DIR__ . '/../bridges/';
|
||||
|
||||
/** Path to the formats library */
|
||||
const PATH_LIB_FORMATS = __DIR__ . '/../formats/';
|
||||
|
@@ -124,7 +124,7 @@ function sanitize(
|
||||
return $htmlContent;
|
||||
}
|
||||
|
||||
function sanitize_html(string $html): string
|
||||
function break_annoying_html_tags(string $html): string
|
||||
{
|
||||
$html = str_replace('<script', '<‌script', $html); // Disable scripts, but leave them visible.
|
||||
$html = str_replace('<iframe', '<‌iframe', $html);
|
||||
|
Reference in New Issue
Block a user