Test Failed
Branch trunk (d809b8)
by SuperNova.WS
05:48
created

banned.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * banned.php
5
 *
6
 * List of all issued bans
7
 *
8
 * 2.0 (c) copyright 2010-2011 by Gorlum for http://supernova.ws
9
 *  [!] Full rewrite
10
 *  [~] Complies with PCG1
11
 *  [~] Utilize PTE
12
 * @version 1.0 Created by e-Zobar (XNova Team). All rights reversed (C) 2008
13
 *
14
 */
15
16
$allow_anonymous = true;
17
include('common.' . substr(strrchr(__FILE__, '.'), 1));
18
19
$template = gettemplate('banned_body', true);
0 ignored issues
show
true is of type boolean, but the function expects a object<template>|null.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
20
21
$query = doquery("SELECT * FROM {{banned}} ORDER BY `ban_id` DESC;");
22
$i=0;
23
while($ban_row = db_fetch($query))
24
{
25
  $template->assign_block_vars('banlist', array(
26
    'USER_NAME'   => $ban_row['ban_user_name'],
27
    'REASON'      => $ban_row['ban_reason'],
28
    'FROM'        => $ban_row['ban_time'] ? date(FMT_DATE_TIME, $ban_row['ban_time']) : '--',
29
    'UNTIL'       => date(FMT_DATE_TIME, $ban_row['ban_until']),
30
    'ISSUER_NAME' => $ban_row['ban_issuer_name']
31
  ));
32
  $i++;
33
}
34
35
$template->assign_var('BANNED_COUNT', $i);
36
display($template);
37