This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
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 | /** |
||
13 | * alumni module |
||
14 | * Edited by John Mordo (jlm69) |
||
15 | * @copyright XOOPS Project https://xoops.org/ |
||
16 | * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
||
17 | * @since 2.6.0 |
||
18 | * @author Mage Grégory (AKA Mage) |
||
19 | * @version $Id: $ |
||
20 | */ |
||
21 | |||
22 | use Xoops\Core\Request; |
||
23 | use Xoops\Module\Plugin\PluginAbstract; |
||
24 | use Xmf\Metagen; |
||
25 | |||
26 | /** |
||
27 | * Class AlumniSearchPlugin |
||
28 | */ |
||
29 | class AlumniSearchPlugin extends PluginAbstract implements SearchPluginInterface |
||
0 ignored issues
–
show
|
|||
30 | { |
||
31 | /** |
||
32 | * @param string[] $queries |
||
33 | * @param string $andor |
||
34 | * @param int $limit |
||
35 | * @param int $start |
||
36 | * @param \type $userid |
||
37 | * @return array |
||
38 | */ |
||
39 | public function search($queries, $andor, $limit, $start, $userid) |
||
40 | { |
||
41 | $xoops = Xoops::getInstance(); |
||
42 | $alumni = Alumni::getInstance(); |
||
0 ignored issues
–
show
$alumni 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 ![]() |
|||
43 | $myts = MyTextSanitizer::getInstance(); |
||
0 ignored issues
–
show
$myts 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 ![]() |
|||
44 | $by_cat = Request::getInt('by_cat', ''); |
||
0 ignored issues
–
show
$by_cat 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. ![]() |
|||
45 | $andor = Request::getWord('andor', 'AND'); |
||
0 ignored issues
–
show
$andor 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 ![]() |
|||
46 | $queries = []; |
||
0 ignored issues
–
show
$queries 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 ![]() |
|||
47 | $query = Request::getString('query', ''); |
||
48 | $start = Request::getInt('start', '0'); |
||
49 | |||
50 | $helper = Xoops::getModuleHelper('alumni'); |
||
51 | $module_id = $helper->getModule()->getVar('mid'); |
||
0 ignored issues
–
show
$module_id 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. ![]() |
|||
52 | $listingHandler = $helper->getHandler('listing'); |
||
53 | $groups = $xoops->getUserGroups(); |
||
54 | $alumni_ids = $xoops->getHandlerGroupperm()->getItemIds('alumni_view', $groups, $module_id); |
||
0 ignored issues
–
show
$alumni_ids 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. ![]() |
|||
55 | $all_ids = implode(', ', $alumni_ids); |
||
0 ignored issues
–
show
$all_ids 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. ![]() |
|||
56 | |||
57 | $criteria = new CriteriaCompo(); |
||
58 | $criteria->add(new Criteria('valid', 1, '=')); |
||
59 | // $criteria->add(new Criteria('date', time(), '<=')); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
67% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||
60 | $criteria->add(new Criteria('cid', '(' . $all_ids . ')', 'IN')); |
||
0 ignored issues
–
show
$all_ids 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. ![]() |
|||
61 | if (0 != $userid) { |
||
62 | $criteria->add(new Criteria('usid', $userid, '=')); |
||
63 | } |
||
64 | if ($by_cat) { |
||
0 ignored issues
–
show
$by_cat 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. ![]() |
|||
65 | $criteria->add(new Criteria('cid', $by_cat, '=')); |
||
0 ignored issues
–
show
$by_cat 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. ![]() |
|||
66 | } |
||
67 | |||
68 | $queries = [$query]; |
||
69 | $queries = implode('+', $queries); |
||
70 | |||
71 | $count = 0; |
||
0 ignored issues
–
show
$count 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 ![]() |
|||
72 | $i = 0; |
||
0 ignored issues
–
show
$i 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 ![]() |
|||
73 | |||
74 | $criteria->add(new Criteria('name', '%' . $queries . '%', 'LIKE'), 'AND'); |
||
75 | $criteria->add(new Criteria('mname', '%' . $queries . '%', 'LIKE'), 'OR'); |
||
76 | $criteria->add(new Criteria('lname', '%' . $queries . '%', 'LIKE'), 'OR'); |
||
77 | $criteria->add(new Criteria('school', '%' . $queries . '%', 'LIKE'), 'OR'); |
||
78 | $criteria->add(new Criteria('year', '%' . $queries . '%', 'LIKE'), 'OR'); |
||
79 | |||
80 | $criteria->setLimit($limit); |
||
81 | $criteria->setSort('date'); |
||
82 | $criteria->setOrder('DESC'); |
||
83 | $criteria->setStart($start); |
||
84 | |||
85 | $numrows = $listingHandler->getCount(); |
||
0 ignored issues
–
show
$numrows 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 ![]() |
|||
86 | $this_search = $listingHandler->getall($criteria); |
||
0 ignored issues
–
show
$this_search 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. ![]() |
|||
87 | |||
88 | $ret = []; |
||
89 | $k = 0; |
||
0 ignored issues
–
show
|
|||
90 | |||
91 | foreach ($this_search as $obj) { |
||
0 ignored issues
–
show
$this_search 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. ![]() |
|||
92 | $ret[$k]['image'] = 'images/cat/default.gif'; |
||
93 | $ret[$k]['link'] = 'listing.php?lid=' . $obj->getVar('lid') . ''; |
||
94 | $ret[$k]['title'] = $obj->getVar('name') . ' ' . $obj->getVar('mname') . ' ' . $obj->getVar('lname') . ' --- ' . $obj->getVar('school') . ' |
||
95 | --- ' . $obj->getVar('year'); |
||
96 | $ret[$k]['time'] = $obj->getVar('date'); |
||
97 | $ret[$k]['uid'] = $obj->getVar('usid'); |
||
98 | $k++; |
||
99 | } |
||
100 | |||
101 | return $ret; |
||
102 | } |
||
103 | } |
||
104 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.