txmodxoops /
tdmcreate
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 | namespace XoopsModules\Tdmcreate\Files\User; |
||
| 4 | |||
| 5 | use XoopsModules\Tdmcreate; |
||
| 6 | use XoopsModules\Tdmcreate\Files; |
||
| 7 | |||
| 8 | /* |
||
| 9 | You may not change or alter any portion of this comment or credits |
||
| 10 | of supporting developers from this source code or any supporting source code |
||
| 11 | which is considered copyrighted (c) material of the original comment or credit authors. |
||
| 12 | |||
| 13 | This program is distributed in the hope that it will be useful, |
||
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
| 16 | */ |
||
| 17 | /** |
||
| 18 | * tdmcreate module. |
||
| 19 | * |
||
| 20 | * @copyright XOOPS Project (https://xoops.org) |
||
| 21 | * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
||
| 22 | * |
||
| 23 | * @since 2.5.0 |
||
| 24 | * |
||
| 25 | * @author Txmod Xoops http://www.txmodxoops.org |
||
| 26 | * |
||
| 27 | */ |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Class UserVisit. |
||
| 31 | */ |
||
| 32 | class UserVisit extends Files\CreateFile |
||
| 33 | { |
||
| 34 | /** |
||
| 35 | * @var mixed |
||
| 36 | */ |
||
| 37 | private $uxc = null; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @var string |
||
| 41 | */ |
||
| 42 | private $xc = null; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @var string |
||
| 46 | */ |
||
| 47 | private $pc = null; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @public function constructor |
||
| 51 | * @param null |
||
| 52 | */ |
||
| 53 | public function __construct() |
||
| 54 | { |
||
| 55 | parent::__construct(); |
||
| 56 | $this->xc = Tdmcreate\Files\CreateXoopsCode::getInstance(); |
||
|
0 ignored issues
–
show
|
|||
| 57 | $this->pc = Tdmcreate\Files\CreatePhpCode::getInstance(); |
||
|
0 ignored issues
–
show
It seems like
XoopsModules\Tdmcreate\F...ePhpCode::getInstance() of type XoopsModules\Tdmcreate\Files\CreatePhpCode is incompatible with the declared type string of property $pc.
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property. Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.. Loading history...
|
|||
| 58 | $this->uxc = UserXoopsCode::getInstance(); |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @static function getInstance |
||
| 63 | * @param null |
||
| 64 | * @return UserVisit |
||
| 65 | */ |
||
| 66 | public static function getInstance() |
||
| 67 | { |
||
| 68 | static $instance = false; |
||
| 69 | if (!$instance) { |
||
| 70 | $instance = new self(); |
||
| 71 | } |
||
| 72 | |||
| 73 | return $instance; |
||
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @public function write |
||
| 78 | * @param string $module |
||
| 79 | * @param mixed $table |
||
| 80 | * @param string $filename |
||
| 81 | */ |
||
| 82 | public function write($module, $table, $filename) |
||
| 83 | { |
||
| 84 | $this->setModule($module); |
||
| 85 | $this->setTable($table); |
||
| 86 | $this->setFileName($filename); |
||
| 87 | } |
||
| 88 | |||
| 89 | /** |
||
| 90 | * @private function getUserVisitHeader |
||
| 91 | * |
||
| 92 | * @param $table |
||
| 93 | * |
||
| 94 | * @param $fields |
||
| 95 | * @return string |
||
| 96 | */ |
||
| 97 | private function getUserVisitHeader($table, $fields) |
||
| 98 | { |
||
| 99 | $pc = Tdmcreate\Files\CreatePhpCode::getInstance(); |
||
| 100 | $module = $this->getModule(); |
||
| 101 | $moduleDirname = $module->getVar('mod_dirname'); |
||
| 102 | $ret = $pc->getPhpCodeUseNamespace(['Xmf', 'Request'], '', ''); |
||
| 103 | $ret .= $pc->getPhpCodeUseNamespace(['XoopsModules', $moduleDirname], '', ''); |
||
| 104 | $ret .= $pc->getPhpCodeUseNamespace(['XoopsModules', $moduleDirname, 'Constants']); |
||
| 105 | $ret .= $this->getInclude(); |
||
| 106 | foreach (array_keys($fields) as $f) { |
||
| 107 | $fieldName = $fields[$f]->getVar('field_name'); |
||
| 108 | if (0 == $f) { |
||
| 109 | $fieldId = $fieldName; |
||
| 110 | } |
||
| 111 | if (1 == $fields[$f]->getVar('field_parent')) { |
||
| 112 | $fieldPid = $fieldName; |
||
| 113 | } |
||
| 114 | } |
||
| 115 | if (1 == $table->getVar('table_category')) { |
||
| 116 | $ccFieldPid = $this->getCamelCase($fieldPid, false, true); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
| 117 | $ret .= $this->xc->getXcXoopsRequest($ccFieldPid, (string)$fieldPid, '0', 'Int'); |
||
| 118 | } |
||
| 119 | $ccFieldId = $this->getCamelCase($fieldId, false, true); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
| 120 | $ret .= $this->xc->getXcXoopsRequest($ccFieldId, (string)$fieldId, '0', 'Int'); |
||
| 121 | |||
| 122 | return $ret; |
||
| 123 | } |
||
| 124 | |||
| 125 | /** |
||
| 126 | * @private function getUserVisitCheckPermissions |
||
| 127 | * |
||
| 128 | * @param null |
||
| 129 | * |
||
| 130 | * @return string |
||
| 131 | */ |
||
| 132 | private function getUserVisitCheckPermissions() |
||
| 133 | { |
||
| 134 | $ret = ''; |
||
| 135 | |||
| 136 | return $ret; |
||
| 137 | } |
||
| 138 | |||
| 139 | /** |
||
| 140 | * @private function getUserVisitCheckLimit |
||
| 141 | * |
||
| 142 | * @param null |
||
| 143 | * |
||
| 144 | * @return string |
||
| 145 | */ |
||
| 146 | private function getUserVisitCheckLimit() |
||
| 147 | { |
||
| 148 | $ret = ''; |
||
| 149 | |||
| 150 | return $ret; |
||
| 151 | } |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @private function getUserVisitCheckHost |
||
| 155 | * |
||
| 156 | * @param null |
||
| 157 | * |
||
| 158 | * @return string |
||
| 159 | */ |
||
| 160 | private function getUserVisitCheckHost() |
||
| 161 | { |
||
| 162 | $ret = ''; |
||
| 163 | |||
| 164 | return $ret; |
||
| 165 | } |
||
| 166 | |||
| 167 | /** |
||
| 168 | * @public function render |
||
| 169 | * @param null |
||
| 170 | * @return bool|string |
||
| 171 | */ |
||
| 172 | public function render() |
||
| 173 | { |
||
| 174 | $module = $this->getModule(); |
||
| 175 | $table = $this->getTable(); |
||
| 176 | $filename = $this->getFileName(); |
||
| 177 | $moduleDirname = $module->getVar('mod_dirname'); |
||
| 178 | $tableId = $table->getVar('table_id'); |
||
| 179 | $tableMid = $table->getVar('table_mid'); |
||
| 180 | $fields = $this->getTableFields($tableMid, $tableId); |
||
| 181 | $content = $this->getHeaderFilesComments($module); |
||
| 182 | $content .= $this->getUserVisitHeader($table, $fields); |
||
| 183 | $content .= $this->getUserVisitCheckPermissions(); |
||
| 184 | $content .= $this->getUserVisitCheckLimit(); |
||
| 185 | $content .= $this->getUserVisitCheckHost(); |
||
| 186 | |||
| 187 | $this->create($moduleDirname, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); |
||
| 188 | |||
| 189 | return $this->renderFile(); |
||
| 190 | } |
||
| 191 | } |
||
| 192 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..