-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RaceDepartmentBridge] added a bridge for racedepartment.com #1681
Conversation
bridges/RaceDepartmentBridge.php
Outdated
$pattern = '/src="(.+?)"/i'; | ||
if(preg_match($pattern, $found->outertext, $match)) { | ||
$iframeUrl = $match[1]; | ||
$found->outertext = '<a href="' . $iframeUrl . '">' . $iframeUrl . '</a>'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use regex to get src value
$iframeUrl = $found->getAttribute("src");
if ($iframeUrl) {
$found->outertext = '<a href="' . $iframeUrl . '">' . $iframeUrl . '</a>';
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
@em92 Question: should I need to do this iframe replacement at all? (line 21 to 29) p.s. I have been using this bridge since opening this PR and it's worked fine. |
Yes. This is one of sanitizers. rss-bridge/lib/FormatAbstract.php Line 179 in 47dc26c
Unfortunately no. Your solution is good enough. |
gj @t0stiman ! |
No description provided.