aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/views/default/object/file/embed.php
blob: b93c46e5e44a98071f5f5f80632dc10689a6a6d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
	$mime = $vars['entity']->mimetype;
	
	if (elgg_view_exists('file/specialcontent/' . $mime)) {
		$content = elgg_view('file/specialcontent/' . $mime, $vars);
	} else if (elgg_view_exists("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default")) {
		$content = elgg_view("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default", $vars);
	}
	
	if (empty($content) || substr_count(strtolower($content),'<embed') || substr_count(strtolower($content),'<object') || substr_count(strtolower($content),'<script')) {
		echo elgg_view('object/default/embed',$vars);
	} else {
		echo $content;
	}
	
?>