fix: indentation tab -> space
This commit is contained in:
parent
735917119f
commit
ffb4b2c762
20
init.php
20
init.php
@ -13,19 +13,19 @@ class YFrames extends Plugin {
|
||||
$this->host = $host;
|
||||
|
||||
$host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
|
||||
$host->add_hook($host::HOOK_IFRAME_WHITELISTED, $this);
|
||||
}
|
||||
$host->add_hook($host::HOOK_IFRAME_WHITELISTED, $this);
|
||||
}
|
||||
|
||||
function hook_iframe_whitelisted($src) {
|
||||
return in_array($src, ["www.youtube.com", "youtube.com", "youtu.be"]);
|
||||
}
|
||||
function hook_iframe_whitelisted($src) {
|
||||
return in_array($src, ["www.youtube.com", "youtube.com", "youtu.be"]);
|
||||
}
|
||||
|
||||
function hook_article_filter($article) {
|
||||
function hook_article_filter($article) {
|
||||
|
||||
// $debug = json_encode($article);
|
||||
// Match allowed links and extract "video ID"
|
||||
if (preg_match_all("/.*(youtube|youtu)\.(com|be)\/watch\?v=([\w\d_-]+).*/i",
|
||||
$article["link"], $matches, PREG_PATTERN_ORDER)) {
|
||||
// $debug = json_encode($article);
|
||||
// Match allowed links and extract "video ID"
|
||||
if (preg_match_all("/.*(youtube|youtu)\.(com|be)\/watch\?v=([\w\d_-]+).*/i",
|
||||
$article["link"], $matches, PREG_PATTERN_ORDER)) {
|
||||
|
||||
if ($matches[3][0]) {
|
||||
$link = "https://www.youtube.com/embed/" . $matches[3][0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user