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

views/default/discussion/listing/all.php (1 issue)

1
<?php
2
/**
3
 * Renders a list of discussions, optionally filtered by container type
4
 *
5
 * @uses $vars['container_type'] Container type filter to apply
6
 */
7
8
$options = [
9
	'type' => 'object',
10
	'subtype' => 'discussion',
11
	'order_by' => 'e.last_action desc',
12
	'limit' => max(20, elgg_get_config('default_limit')),
13
	'full_view' => false,
14
	'no_results' => elgg_echo('discussion:none'),
15
	'preload_owners' => true,
16
	'preload_containers' => true,
17
];
18
19
$container_type = elgg_extract('container_type', $vars);
20
if ($container_type) {
21
	$dbprefix = elgg_get_config('dbprefix');
22
	$container_type = sanitize_string($container_type);
0 ignored issues
show
Deprecated Code introduced by Ismayil Khayredinov
The function sanitize_string() has been deprecated: Use query parameters where possible ( Ignorable by Annotation )

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

22
	$container_type = /** @scrutinizer ignore-deprecated */ sanitize_string($container_type);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
23
	$options['joins'][] = "JOIN {$dbprefix}entities ce ON ce.guid = e.container_guid";
24
	$options['wheres'][] = "ce.type = '$container_type'";
25
}
26
27
echo elgg_list_entities($options);
28