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.
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 | * Module: Pedigree |
||||||
14 | * |
||||||
15 | * @package Xoopsmodules\Pedigree |
||||||
16 | * @copyright 2011-2018 XOOPS Project (https://xoops.org) |
||||||
17 | * @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
||||||
18 | * @author XOOPS Module Dev Team (https://xoops.org) |
||||||
19 | */ |
||||||
20 | |||||||
21 | use Xmf\Request; |
||||||
0 ignored issues
–
show
|
|||||||
22 | use Xmf\Module\Admin; |
||||||
23 | use XoopsModules\Pedigree\{ |
||||||
24 | Helper |
||||||
25 | }; |
||||||
26 | /** @var \XoopsThemeForm $form */ |
||||||
27 | /** @var \Xmf\Module\Admin $adminObject */ |
||||||
28 | |||||||
29 | require_once __DIR__ . '/admin_header.php'; |
||||||
30 | |||||||
31 | xoops_cp_header(); |
||||||
32 | |||||||
33 | $trashHandler = Helper::getInstance()->getHandler('Trash'); |
||||||
34 | |||||||
35 | $op = Request::getCmd('op', 'list'); |
||||||
36 | switch ($op) { |
||||||
37 | case 'list': |
||||||
38 | default: |
||||||
39 | $adminObject->displayNavigation(basename(__FILE__)); |
||||||
40 | $adminObject->addItemButton(_AM_PEDIGREE_NEWPEDIGREE_TRASH, 'pedigree_trash.php?op=new_pedigree_trash', 'add'); |
||||||
41 | //$adminObject->displayButton('left'); |
||||||
42 | $criteria = new \CriteriaCompo(); |
||||||
43 | $criteria->setSort('id'); |
||||||
44 | $criteria->setOrder('ASC'); |
||||||
45 | $numRows = $trashHandler->getCount(); |
||||||
46 | $pedigreeTrashArr = $trashHandler->getAll($criteria); |
||||||
0 ignored issues
–
show
The method
getAll() does not exist on XoopsModules\Pedigree\TrashHandler .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
47 | |||||||
48 | //Table view |
||||||
49 | if ($numRows > 0) { |
||||||
50 | echo "<table cellspacing='1' class='outer width100'> |
||||||
51 | <thead> |
||||||
52 | <tr> |
||||||
53 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_PNAME . "</th> |
||||||
54 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_ID_OWNER . "</th> |
||||||
55 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_ID_BREEDER . "</th> |
||||||
56 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_USER . "</th> |
||||||
57 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_ROFT . "</th> |
||||||
58 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_MOTHER . "</th> |
||||||
59 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_FATHER . "</th> |
||||||
60 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_FOTO . "</th> |
||||||
61 | <th class='txtcenter'>" . _AM_PEDIGREE_PEDIGREE_TRASH_COI . "</th> |
||||||
62 | <th class='txtcenter' width='10%'>" . _AM_PEDIGREE_FORMACTION . '</th> |
||||||
63 | </tr> |
||||||
64 | </thead> |
||||||
65 | <tbody>'; |
||||||
66 | |||||||
67 | $class = 'odd'; |
||||||
68 | |||||||
69 | foreach ($pedigreeTrashArr as $tId => $trashObj) { |
||||||
70 | if (0 == $trashObj->getVar('pedigree_trash_pid')) { |
||||||
71 | echo "<tr class='{$class}'>"; |
||||||
72 | $class = ('even' === $class) ? 'odd' : 'even'; |
||||||
73 | echo "<td class='txtcenter'>" . $trashObj->getVar('pname') . '</td>'; |
||||||
74 | echo "<td class='txtcenter'>" . $trashObj->getVar('id_owner') . '</td>'; |
||||||
75 | echo "<td class='txtcenter'>" . $trashObj->getVar('id_breeder') . '</td>'; |
||||||
76 | echo "<td class='txtcenter'>" . $trashObj->getVar('user') . '</td>'; |
||||||
77 | echo "<td class='txtcenter'>" . $trashObj->getVar('roft') . '</td>'; |
||||||
78 | echo "<td class='txtcenter'>" . $trashObj->getVar('mother') . '</td>'; |
||||||
79 | echo "<td class='txtcenter'>" . $trashObj->getVar('father') . '</td>'; |
||||||
80 | echo "<td class='txtcenter'>" . $trashObj->getVar('foto') . '</td>'; |
||||||
81 | echo "<td class='txtcenter'>" . $trashObj->getVar('coi') . '</td>'; |
||||||
82 | echo "<td class'txtcenter width10'> |
||||||
83 | <a href='pedigree_trash.php?op=edit_pedigree_trash&id=" . $tId . "'><img src='{$pathIcon16}/edit.png' alt='" . _EDIT . "' title='" . _EDIT . "'></a> |
||||||
84 | <a href='pedigree_trash.php?op=delete_pedigree_trash&id=" . $tId . "'><img src='{$pathIcon16}/delete.png' alt='" . _DELETE . "' title='" . _DELETE . "'></a> |
||||||
85 | </td>"; |
||||||
86 | echo '</tr>'; |
||||||
87 | } |
||||||
88 | } |
||||||
89 | echo '</tbody> |
||||||
90 | </table> |
||||||
91 | <br><br>'; |
||||||
92 | } |
||||||
93 | |||||||
94 | break; |
||||||
95 | |||||||
96 | case 'new_pedigree_trash': |
||||||
97 | $adminObject->displayNavigation(basename(__FILE__)); |
||||||
98 | $adminObject->addItemButton(_AM_PEDIGREE_PEDIGREE_TRASHLIST, 'pedigree_trash.php?op=list', 'list'); |
||||||
99 | $adminObject->displayButton('left'); |
||||||
100 | |||||||
101 | /** @var Pedigree\Trash $trashObj */ |
||||||
102 | $trashObj = $trashHandler->create(); |
||||||
103 | /** @var \XoopsThemeForm $form */ |
||||||
104 | $form = $trashObj->getForm(); |
||||||
105 | $form->display(); |
||||||
106 | break; |
||||||
107 | |||||||
108 | case 'save_pedigree_trash': |
||||||
109 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||||||
110 | $helper->redirect('admin/pedigree_trash.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
||||||
111 | } |
||||||
112 | $tId = Request::getInt('id', null, 'POST'); |
||||||
113 | $trashObj = $trashHandler->get($tId); // gets object or creates one if tId is empty |
||||||
114 | /* |
||||||
115 | if (isset($_REQUEST['id'])) { |
||||||
116 | $obj = $trashHandler->get($_REQUEST['id']); |
||||||
117 | } else { |
||||||
118 | $obj = $trashHandler->create(); |
||||||
119 | } |
||||||
120 | */ |
||||||
121 | |||||||
122 | $trashObj->setVar('pname', Request::getString('pname', '', 'POST')); //Form pname |
||||||
123 | $trashObj->setVar('id_owner', Request::getInt('id_owner', 0, 'POST')); //Form id_owner |
||||||
124 | $trashObj->setVar('id_breeder', Request::getInt('id_breeder', 0, 'POST')); //Form id_breeder |
||||||
125 | $trashObj->setVar('user', Request::getString('user', '', 'POST')); //Form user |
||||||
126 | $trashObj->setVar('roft', Request::getString('roft', '', 'POST')); //Form roft |
||||||
127 | $trashObj->setVar('mother', Request::getInt('mother', 0, 'POST')); //Form mother |
||||||
128 | $trashObj->setVar('father', Request::getInt('father', 0, 'POST')); //Form father |
||||||
129 | $trashObj->setVar('foto', Request::getString('foto', '', 'POST')); //Form foto |
||||||
130 | $trashObj->setVar('coi', Request::getString('coi', '', 'POST')); //Form coi |
||||||
131 | |||||||
132 | if ($trashHandler->insert($trashObj)) { |
||||||
0 ignored issues
–
show
It seems like
$trashObj can also be of type null ; however, parameter $object of XoopsPersistableObjectHandler::insert() does only seem to accept XoopsObject , 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
![]() |
|||||||
133 | $helper->redirect('admin/pedigree_trash.php?op=list', 2, _AM_PEDIGREE_FORMOK); |
||||||
134 | } |
||||||
135 | |||||||
136 | echo $trashObj->getHtmlErrors(); |
||||||
0 ignored issues
–
show
The method
getHtmlErrors() does not exist on XoopsObject .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
137 | $form = $trashObj->getForm(); |
||||||
0 ignored issues
–
show
The method
getForm() does not exist on XoopsObject . It seems like you code against a sub-type of XoopsObject such as XoopsModules\Pedigree\Temp or SystemSmilies or XoopsModules\Pedigree\Owner or SystemBanner or SystemBannerclient or XoopsModules\Pedigree\Registry or XoopsModules\Pedigree\Tree or XoopsModules\Pedigree\Trash or XoopsModules\Pedigree\Fields or ProfileCategory or SystemUserrank or SystemGroup or SystemBlock or SystemAvatar or SystemUsers .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
138 | $form->display(); |
||||||
139 | break; |
||||||
140 | |||||||
141 | case 'edit_pedigree_trash': |
||||||
142 | $adminObject->displayNavigation(basename(__FILE__)); |
||||||
143 | $adminObject->addItemButton(_AM_PEDIGREE_NEWPEDIGREE_TRASH, 'pedigree_trash.php?op=new_pedigree_trash', 'add'); |
||||||
144 | $adminObject->addItemButton(_AM_PEDIGREE_PEDIGREE_TRASHLIST, 'pedigree_trash.php?op=list', 'list'); |
||||||
145 | $adminObject->displayButton('left'); |
||||||
146 | $obj = $trashHandler->get($_REQUEST['id']); |
||||||
147 | $form = $obj->getForm(); |
||||||
148 | $form->display(); |
||||||
149 | break; |
||||||
150 | |||||||
151 | case 'delete_pedigree_trash': |
||||||
152 | $tId = Request::getInt('id', 0); |
||||||
153 | if (!$tId) { |
||||||
154 | $helper->redirect('admin/pedigree_trash.php', 3, _AM_PEDIGREE_ERR_INVALID); |
||||||
155 | } |
||||||
156 | $trashObj = $trashHandler->get($tId); |
||||||
157 | if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
||||||
158 | if (!$GLOBALS['xoopsSecurity']->check()) { |
||||||
159 | $helper->redirect('admin/pedigree_trash.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
||||||
160 | } |
||||||
161 | if ($trashHandler->delete($obj)) { |
||||||
0 ignored issues
–
show
The method
delete() does not exist on XoopsModules\Pedigree\TrashHandler .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
162 | $helper->redirect('admin/pedigree_trash.php', 3, _AM_PEDIGREE_FORMDELOK); |
||||||
163 | } else { |
||||||
164 | echo $obj->getHtmlErrors(); |
||||||
165 | } |
||||||
166 | } else { |
||||||
167 | xoops_confirm(['ok' => 1, 'id' => $tId, 'op' => 'delete_pedigree_trash'], $_SERVER['REQUEST_URI'], sprintf(_AM_PEDIGREE_FORMSUREDEL, $obj->getVar('pedigree_trash'))); |
||||||
168 | } |
||||||
169 | break; |
||||||
170 | } |
||||||
171 | require_once __DIR__ . '/admin_footer.php'; |
||||||
172 |
Let?s assume that you have a directory layout like this:
and let?s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: