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 = '
'. phutil_render_tag( 'iframe', array( 'width' => '650', 'height' => '400', 'style' => 'margin: 1em auto; border: 0px;', 'src' => $youtube_src, 'frameborder' => 0, ), ''). '
'; return $this->getEngine()->storeText($iframe); } else { return $this->uri; } } }