Skip to content

Commit b4ae5ca

Browse files
committed
replace ternary expression by condition
1 parent e543aae commit b4ae5ca

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

class/Files/Classes/ClassFiles.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ private function getFunctionForm($module, $table, $fieldId, $fieldInForm, $field
297297
$xUser = $this->pc->getPhpCodeGlobals('xoopsUser');
298298
$xModule = $this->pc->getPhpCodeGlobals('xoopsModule');
299299
$getForm .= $this->pc->getPhpCodeTernaryOperator('isAdmin', '\is_object(' . $xUser . ')', $xUser . '->isAdmin(' . $xModule . '->mid())', 'false', "\t\t");
300+
$getForm .= $this->xc->getXcEqualsOperator('$isAdmin', "\is_object(\$GLOBALS['xoopsUser']) && \$GLOBALS['xoopsUser']->isAdmin(\$GLOBALS['xoopsModule']->mid())", null, "\t\t");
301+
300302
if ($fieldUpload) {
301303
$permString = 'upload_groups';
302304
$getForm .= $this->pc->getPhpCodeCommentLine('Permissions for', 'uploader', "\t\t");

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- module update to php8 (mamba)
2222
- fix bug in type cast (liomj/goffy)
2323
- removed unnecessary sprintf (goffy)
24+
- replace ternary expression by condition (goffy)
2425

2526
<h5>3.5.1 Beta 1 [NOT RELEASED]</h5> Dev: XOOPS 2.5.11, PHP 7.4.25, PHP 8.0.12, PHP 8.1.0 Beta 4
2627
- semantic versioning (mamba)

0 commit comments

Comments
 (0)