Skip to content
Snippets Groups Projects
Commit 4bc0f88d authored by Claudiu Cristea's avatar Claudiu Cristea
Browse files

ISAICP-7278: Don't check for file, it may be a page.

parent c5b05784
No related branches found
No related tags found
1 merge request!52ISAICP-7278: Additional checks on internal path videos
...@@ -22,14 +22,14 @@ class InternalPath extends ProviderPluginBase { ...@@ -22,14 +22,14 @@ class InternalPath extends ProviderPluginBase {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function renderEmbedCode($width, $height, $autoplay) { public function renderEmbedCode($width, $height, $autoplay) {
$video_path = $this->getVideoId(); $path = $this->getVideoId();
if (UrlHelper::isExternal($video_path) || !file_exists($video_path)) { if (UrlHelper::isExternal($path)) {
return []; return [];
} }
return [ return [
'#type' => 'video_embed_iframe', '#type' => 'video_embed_iframe',
'#provider' => 'internal_path', '#provider' => 'internal_path',
'#url' => Url::fromUri("internal:/$video_path") '#url' => Url::fromUri("internal:/$path")
->setOption('base_url', $GLOBALS['base_url']) ->setOption('base_url', $GLOBALS['base_url'])
->setAbsolute() ->setAbsolute()
->toString(), ->toString(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment