Issues (884)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

blocks/alumni.php (10 issues)

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
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 30 and the first side effect is on line 21.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
/**
12
 * Alumni module for Xoops
13
 *
14
 * @copyright       XOOPS Project https://xoops.org/
15
 * @license         GPL 2.0 or later
16
 * @package         alumni
17
 * @since           2.6.x
18
 * @author          John Mordo (jlm69)
19
 */
20
21
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
22
23
include_once dirname(__DIR__) . '/include/common.php';
24
25
/**
26
 * @param $options
27
 * @return array
28
 */
29
30
function alumni_show($options)
31
{
32
    $block        = [];
33
    $myts         = MyTextSanitizer::getInstance();
34
    $blockDirName = basename(dirname(__DIR__));
35
36
    $xoops          = Xoops::getInstance();
37
    $helper         = Xoops::getModuleHelper('alumni');
38
    $module_id      = $helper->getModule()->getVar('mid');
39
    $listingHandler = $helper->getHandler('listing');
40
    $groups         = $xoops->getUserGroups();
41
    $alumni_ids     = $xoops->getHandlerGroupPermission()->getItemIds('alumni_view', $groups, $module_id);
42
    $all_ids        = implode(', ', $alumni_ids);
43
44
    $criteria = new CriteriaCompo();
45
    $criteria->add(new Criteria('valid', 1, '='));
46
    $criteria->add(new Criteria('cid', '(' . $all_ids . ')', 'IN'));
47
    $criteria->setLimit($options[1]);
48
    $criteria->setSort('date');
49
    $criteria->setOrder('DESC');
50
    $block_listings = $listingHandler->getall($criteria);
51
52
    foreach (array_keys($block_listings) as $i) {
0 ignored issues
show
$block_listings does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
53
        $name   = $block_listings[$i]->getVar('name');
0 ignored issues
show
$block_listings does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
54
        $mname  = $block_listings[$i]->getVar('mname');
0 ignored issues
show
$block_listings does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
55
        $lname  = $block_listings[$i]->getVar('lname');
0 ignored issues
show
$block_listings does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
56
        $school = $block_listings[$i]->getVar('school');
0 ignored issues
show
$block_listings does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
57
        $year   = $block_listings[$i]->getVar('year');
0 ignored issues
show
$block_listings does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
58
        $view   = $block_listings[$i]->getVar('view');
0 ignored issues
show
$block_listings does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
$view is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
59
60
        $a_item           = [];
61
        $a_item['school'] = $school;
0 ignored issues
show
$a_item does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
62
        $a_item['link']   = '<a href="' . XOOPS_URL . "/modules/{$blockDirName}/listing.php?lid=" . addslashes($block_listings[$i]->getVar('lid')) . "\"><b>$year&nbsp;-&nbsp;$name $mname $lname</b><br></a>";
63
64
        $block['items'][] = $a_item;
65
    }
66
    $block['lang_title'] = AlumniLocale::BLOCKS_ITEM;
67
    $block['lang_date']  = AlumniLocale::BLOCKS_DATE;
68
    $block['link']       = '<a href="' . XOOPS_URL . "/modules/{$blockDirName}/index.php\"><b>" . AlumniLocale::BLOCKS_ALL_LISTINGS . '</b></a></div>';
69
70
    return $block;
71
}
72
73
/**
74
 * @param $options
75
 * @return string
76
 */
77
78
function alumni_edit($options)
79
{
80
    $form = AlumniLocale::BLOCKS_ORDER . "&nbsp;<select name='options[]'>";
81
    $form .= "<option value='date'";
82
    if ('date' === $options[0]) {
83
        $form .= " selected='selected'";
84
    }
85
    $form .= '>' . AlumniLocale::BLOCKS_DATE . "</option>\n";
86
    $form .= "<option value='view'";
87
    if ('view' === $options[0]) {
88
        $form .= " selected='selected'";
89
    }
90
    $form .= '>' . AlumniLocale::BLOCKS_HITS . '</option>';
91
    $form .= "</select>\n";
92
    $form .= '&nbsp;' . AlumniLocale::BLOCKS_DISPLAY . "&nbsp;<input type='text' name='options[]' value='" . $options[1] . "'/>&nbsp;" . AlumniLocale::BLOCKS_LISTINGS;
93
    $form .= '&nbsp;<br><br>' . AlumniLocale::BLOCKS_LENGTH . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'/>&nbsp;" . AlumniLocale::BLOCKS_CHARS . '<br><br>';
94
95
    return $form;
96
}
97