Passed
Push — master ( c0a3a7...3b84a4 )
by Jeroen
58:51
created

mod/blog/views/default/resources/blog/view.php (1 issue)

Checks if the types of the passed arguments in a function/method call are compatible.

Bug Minor
1
<?php
2
3
$page_type = elgg_extract('page_type', $vars);
4
$guid = elgg_extract('guid', $vars);
5
6
elgg_entity_gatekeeper($guid, 'object', 'blog');
7
elgg_group_gatekeeper();
8
9
$blog = get_entity($guid);
10
11
elgg_set_page_owner_guid($blog->container_guid);
12
13
// no header or tabs for viewing an individual blog
14
$params = [
15
	'filter' => '',
16
	'title' => $blog->title
17
];
18
19
$container = $blog->getContainerEntity();
20
$crumbs_title = $container->name;
21
22
if ($container instanceof ElggGroup) {
23
	elgg_push_breadcrumb($crumbs_title, elgg_generate_url('collection:object:blog:group', ['group_guid' => $container->guid]));
24
} else {
25
	elgg_push_breadcrumb($crumbs_title, elgg_generate_url('collection:object:blog:owner', ['username' => $container->username]));
26
}
27
28
elgg_push_breadcrumb($blog->title);
29
30
$params['content'] = elgg_view_entity($blog);
31
32
$params['sidebar'] = elgg_view('blog/sidebar', ['page' => $page_type]);
33
34
$body = elgg_view_layout('content', $params);
35
36
echo elgg_view_page($params['title'], $body);
0 ignored issues
show
It seems like $params['title'] can also be of type array; however, parameter $title of elgg_view_page() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

36
echo elgg_view_page(/** @scrutinizer ignore-type */ $params['title'], $body);
Loading history...
37