diff --git a/src/infrastructure/markup/remarkup/markuprule/PhabricatorRemarkupRuleYoutube.php b/src/infrastructure/markup/remarkup/markuprule/PhabricatorRemarkupRuleYoutube.php index 4351b95d34..b23f049580 100644 --- a/src/infrastructure/markup/remarkup/markuprule/PhabricatorRemarkupRuleYoutube.php +++ b/src/infrastructure/markup/remarkup/markuprule/PhabricatorRemarkupRuleYoutube.php @@ -1,59 +1,59 @@ uri = new PhutilURI($text); if ($this->uri->getDomain() && - preg_match('/youtube\.com$/', $this->uri->getDomain())) { + preg_match('/(^|\.)youtube\.com$/', $this->uri->getDomain())) { return $this->markupYoutubeLink(); } return $text; } public function markupYoutubeLink() { $v = idx($this->uri->getQueryParams(), 'v'); if ($v) { $youtube_src = 'https://www.youtube.com/embed/'.$v; $iframe = '
'; return $this->getEngine()->storeText($iframe); } else { return $this->uri; } } }