Skip to content

Commit 754f21a

Browse files
authored
Merge pull request #56 from ggoffy/master
update to php8
2 parents c2808da + d211563 commit 754f21a

150 files changed

Lines changed: 26267 additions & 627 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SECURITY.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# XOOPS Security Policy
2+
3+
XOOPS takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.
4+
This documentation provides guidelines and standard procedures regarding maintaining security with our software.
5+
6+
## Supported Versions
7+
8+
By default, only the latest version built from branch `master` (or `main`) is supported with security updates.
9+
10+
11+
## Reporting a Vulnerability
12+
13+
**Please do not report security vulnerabilities through public GitHub issues.**
14+
15+
Instead, please report (suspected) security vulnerabilities to
16+
**[security@xoops.org](mailto:security@xoops.org)**. You will receive a response from
17+
us within 48 hours. If the issue is confirmed, we will release a patch as soon
18+
as possible depending on complexity, and you'll receive a credit in our changelog.
19+
20+
Please use a descriptive subject line for your report email. After the initial
21+
reply to your report, the security team will endeavor to keep you informed of
22+
the progress being made towards a fix and announcement.
23+
24+
In addition, please include the following information along with your report:
25+
26+
* Your name and affiliation (if any).
27+
* A description of the technical details of the vulnerabilities. It is very
28+
important to let us know how we can reproduce your findings.
29+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
30+
* Full paths of source file(s) related to the manifestation of the issue
31+
* The location of the affected source code (tag/branch/commit or direct URL)
32+
* Any special configuration required to reproduce the issue
33+
* Step-by-step instructions to reproduce the issue
34+
* Proof-of-concept or exploit code (if possible)
35+
* Impact of the issue, including how an attacker might exploit the issue
36+
37+
This information will help us triage your report more quickly.

admin/broken.php

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
* wgGitHub module for xoops
14+
*
15+
* @copyright 2020 XOOPS Project (https://xooops.org)
16+
* @license GPL 2.0 or later
17+
* @package wggithub
18+
* @since 1.0
19+
* @min_xoops 2.5.10
20+
* @author TDM XOOPS - Email:<goffy@wedega.com> - Website:<https://wedega.com>
21+
*/
22+
23+
use Xmf\Request;
24+
use XoopsModules\Wggithub;
25+
use XoopsModules\Wggithub\Constants;
26+
27+
require __DIR__ . '/header.php';
28+
29+
// Define Stylesheet
30+
$GLOBALS['xoTheme']->addStylesheet($style, null);
31+
$templateMain = 'wggithub_admin_broken.tpl';
32+
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('broken.php'));
33+
34+
// Check table repositories
35+
$start = Request::getInt('startRepositories', 0);
36+
$limit = Request::getInt('limitRepositories', $helper->getConfig('adminpager'));
37+
$crRepositories = new \CriteriaCompo();
38+
$crRepositories->add(new \Criteria('repo_status', Constants::STATUS_BROKEN));
39+
$repositoriesCount = $repositoriesHandler->getCount($crRepositories);
40+
$GLOBALS['xoopsTpl']->assign('repositories_count', $repositoriesCount);
41+
$GLOBALS['xoopsTpl']->assign('repositories_result', \sprintf(\_AM_WGGITHUB_BROKEN_RESULT, 'Repositories'));
42+
$crRepositories->setStart($start);
43+
$crRepositories->setLimit($limit);
44+
if ($repositoriesCount > 0) {
45+
$repositoriesAll = $repositoriesHandler->getAll($crRepositories);
46+
foreach (\array_keys($repositoriesAll) as $i) {
47+
$repository['table'] = 'Repositories';
48+
$repository['key'] = 'repo_id';
49+
$repository['keyval'] = $repositoriesAll[$i]->getVar('repo_id');
50+
$repository['main'] = $repositoriesAll[$i]->getVar('repo_name');
51+
$GLOBALS['xoopsTpl']->append('repositories_list', $repository);
52+
}
53+
// Display Navigation
54+
if ($repositoriesCount > $limit) {
55+
include_once \XOOPS_ROOT_PATH . '/class/pagenav.php';
56+
$pagenav = new \XoopsPageNav($repositoriesCount, $limit, $start, 'startRepositories', 'op=list&limitRepositories=' . $limit);
57+
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
58+
}
59+
} else {
60+
$GLOBALS['xoopsTpl']->assign('nodataRepositories', \sprintf(\_AM_WGGITHUB_BROKEN_NODATA, 'Repositories'));
61+
}
62+
unset($crRepositories);
63+
64+
require __DIR__ . '/footer.php';

admin/directories.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@
4141
default:
4242
// Define Stylesheet
4343
$GLOBALS['xoTheme']->addStylesheet($style, null);
44-
$GLOBALS['xoTheme']->addScript(WGGITHUB_URL . '/assets/js/jquery-ui.js');
45-
$GLOBALS['xoTheme']->addScript(WGGITHUB_URL . '/assets/js/sortable.js');
44+
$GLOBALS['xoTheme']->addScript(\WGGITHUB_URL . '/assets/js/jquery-ui.js');
45+
$GLOBALS['xoTheme']->addScript(\WGGITHUB_URL . '/assets/js/sortable.js');
4646
$templateMain = 'wggithub_admin_directories.tpl';
4747
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php'));
4848
$adminObject->addItemButton(\_AM_WGGITHUB_ADD_DIRECTORY, 'directories.php?op=new', 'add');
4949
$GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
5050
$directoriesCount = $directoriesHandler->getCountDirectories();
5151
$directoriesAll = $directoriesHandler->getAllDirectories($start, $limit);
5252
$GLOBALS['xoopsTpl']->assign('directories_count', $directoriesCount);
53-
$GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL);
54-
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
55-
$GLOBALS['xoopsTpl']->assign('wggithub_icons_url_16', WGGITHUB_ICONS_URL . '/16');
53+
$GLOBALS['xoopsTpl']->assign('wggithub_url', \WGGITHUB_URL);
54+
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', \WGGITHUB_UPLOAD_URL);
55+
$GLOBALS['xoopsTpl']->assign('wggithub_icons_url_16', \WGGITHUB_ICONS_URL . '/16');
5656
// Table view directories
5757
if ($directoriesCount > 0) {
5858
foreach (\array_keys($directoriesAll) as $i) {
@@ -133,7 +133,7 @@
133133
$errors = [];
134134
//delete all related data
135135
$crRepositories = new \CriteriaCompo();
136-
$crRepositories->add(new Criteria('repo_user', $dirName));
136+
$crRepositories->add(new \Criteria('repo_user', $dirName));
137137
$repositoriesAll = $repositoriesHandler->getAll($crRepositories);
138138
foreach (\array_keys($repositoriesAll) as $i) {
139139
$repoId = $repositoriesAll[$i]->getVar('repo_id');

admin/header.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
$sysPathIcon16 = '../' . $GLOBALS['xoopsModule']->getInfo('sysicons16');
2727
$sysPathIcon32 = '../' . $GLOBALS['xoopsModule']->getInfo('sysicons32');
2828
$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
29-
$modPathIcon16 = WGGITHUB_URL . '/' . $GLOBALS['xoopsModule']->getInfo('modicons16') . '/';
30-
$modPathIcon32 = WGGITHUB_URL . '/' . $GLOBALS['xoopsModule']->getInfo('modicons32') . '/';
29+
$modPathIcon16 = \WGGITHUB_URL . '/' . $GLOBALS['xoopsModule']->getInfo('modicons16') . '/';
30+
$modPathIcon32 = \WGGITHUB_URL . '/' . $GLOBALS['xoopsModule']->getInfo('modicons32') . '/';
3131

3232
// Get instance of module
3333
$helper = \XoopsModules\Wggithub\Helper::getInstance();
@@ -64,4 +64,4 @@
6464
$GLOBALS['xoopsTpl']->assign('modPathIcon32', $modPathIcon32);
6565

6666
$adminObject = \Xmf\Module\Admin::getInstance();
67-
$style = WGGITHUB_URL . '/assets/css/admin/style.css';
67+
$style = \WGGITHUB_URL . '/assets/css/admin/style.css';

admin/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
// Uploads Folders Created
6363
foreach (\array_keys($folder) as $i) {
6464
$adminObject->addConfigBoxLine($folder[$i], 'folder');
65-
$adminObject->addConfigBoxLine(array($folder[$i], '777'), 'chmod');
65+
$adminObject->addConfigBoxLine([$folder[$i], '777'], 'chmod');
6666
}
6767

6868
// Render Index

admin/logs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
$logsCount = $logsHandler->getCountLogs();
4747
$logsAll = $logsHandler->getAllLogs($start, $limit);
4848
$GLOBALS['xoopsTpl']->assign('logs_count', $logsCount);
49-
$GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL);
50-
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
49+
$GLOBALS['xoopsTpl']->assign('wggithub_url', \WGGITHUB_URL);
50+
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', \WGGITHUB_UPLOAD_URL);
5151
// Table view logs
5252
if ($logsCount > 0) {
5353
foreach (\array_keys($logsAll) as $i) {

admin/menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
$dirname = \basename(\dirname(__DIR__));
2424
$moduleHandler = \xoops_getHandler('module');
25-
$xoopsModule = XoopsModule::getByDirname($dirname);
25+
$xoopsModule = \XoopsModule::getByDirname($dirname);
2626
$moduleInfo = $moduleHandler->get($xoopsModule->getVar('mid'));
2727
$sysPathIcon32 = $moduleInfo->getInfo('sysicons32');
2828

admin/readmes.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
$filterField = Request::getString('filter_field', '');
5151
$filterValue = Request::getString('filter_value', 'none');
5252
if (Constants::FILTER_OPERAND_EQUAL == $operand) {
53-
$crRepositories->add(new Criteria($filterField, $filterValue));
53+
$crRepositories->add(new \Criteria($filterField, $filterValue));
5454
} elseif (Constants::FILTER_OPERAND_LIKE == $operand) {
55-
$crRepositories->add(new Criteria($filterField, "%$filterValue%", 'LIKE'));
55+
$crRepositories->add(new \Criteria($filterField, "%$filterValue%", 'LIKE'));
5656
}
5757
$repositoriesCount = $repositoriesHandler->getCount($crRepositories);
5858
$in = [];
@@ -63,15 +63,15 @@
6363
$in[] = $i;
6464
}
6565
}
66-
$crReadmes->add(new Criteria('rm_repoid', '(' . \implode(',', $in) . ')', 'IN'));
66+
$crReadmes->add(new \Criteria('rm_repoid', '(' . \implode(',', $in) . ')', 'IN'));
6767
}
6868
$crReadmes->setStart($start);
6969
$crReadmes->setLimit($limit);
7070
$readmesCount = $readmesHandler->getCount($crReadmes);
7171
$readmesAll = $readmesHandler->getAll($crReadmes);
7272
$GLOBALS['xoopsTpl']->assign('readmes_count', $readmesCount);
73-
$GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL);
74-
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
73+
$GLOBALS['xoopsTpl']->assign('wggithub_url', \WGGITHUB_URL);
74+
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', \WGGITHUB_UPLOAD_URL);
7575
// Table view readmes
7676
if ($readmesCount > 0) {
7777
foreach (\array_keys($readmesAll) as $i) {

admin/releases.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@
4949
$filterField = Request::getString('filter_field', '');
5050
$filterValue = Request::getString('filter_value', 'none');
5151
if (Constants::FILTER_OPERAND_EQUAL == $operand) {
52-
$crReleases->add(new Criteria($filterField, $filterValue));
52+
$crReleases->add(new \Criteria($filterField, $filterValue));
5353
} elseif (Constants::FILTER_OPERAND_LIKE == $operand) {
54-
$crReleases->add(new Criteria($filterField, "%$filterValue%", 'LIKE'));
54+
$crReleases->add(new \Criteria($filterField, "%$filterValue%", 'LIKE'));
5555
}
5656
}
5757
$crReleases->setStart($start);
5858
$crReleases->setLimit($limit);
5959
$releasesCount = $releasesHandler->getCount($crReleases);
6060
$releasesAll = $releasesHandler->getAll($crReleases);
6161
$GLOBALS['xoopsTpl']->assign('releases_count', $releasesCount);
62-
$GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL);
63-
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
62+
$GLOBALS['xoopsTpl']->assign('wggithub_url', \WGGITHUB_URL);
63+
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', \WGGITHUB_UPLOAD_URL);
6464
// Table view releases
6565
if ($releasesCount > 0) {
6666
foreach (\array_keys($releasesAll) as $i) {

admin/repositories.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
$autoApproved = (int)$helper->getConfig('autoapproved');
4747
$GLOBALS['xoopsTpl']->assign('autoApproved', !$autoApproved);
48-
$GLOBALS['xoopsTpl']->assign('wggithub_icons_url_16', WGGITHUB_ICONS_URL . '/16');
48+
$GLOBALS['xoopsTpl']->assign('wggithub_icons_url_16', \WGGITHUB_ICONS_URL . '/16');
4949

5050
$filterValue = '';
5151
$filterStatus = 0;
@@ -56,23 +56,23 @@
5656
$filterValue = Request::getString('filter_value', '');
5757
if ('' !== $filterValue) {
5858
if (Constants::FILTER_OPERAND_EQUAL == $operand) {
59-
$crRepositories->add(new Criteria($filterField, $filterValue));
59+
$crRepositories->add(new \Criteria($filterField, $filterValue));
6060
} elseif (Constants::FILTER_OPERAND_LIKE == $operand) {
61-
$crRepositories->add(new Criteria($filterField, "%$filterValue%", 'LIKE'));
61+
$crRepositories->add(new \Criteria($filterField, "%$filterValue%", 'LIKE'));
6262
}
6363
}
6464
$filterStatus = Request::getInt('filter_status');
6565
if ($filterStatus > 0) {
66-
$crRepositories->add(new Criteria('repo_status', $filterStatus));
66+
$crRepositories->add(new \Criteria('repo_status', $filterStatus));
6767
}
6868
}
6969
$crRepositories->setStart($start);
7070
$crRepositories->setLimit($limit);
7171
$repositoriesCount = $repositoriesHandler->getCount($crRepositories);
7272
$repositoriesAll = $repositoriesHandler->getAll($crRepositories);
7373
$GLOBALS['xoopsTpl']->assign('repositories_count', $repositoriesCount);
74-
$GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL);
75-
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
74+
$GLOBALS['xoopsTpl']->assign('wggithub_url', \WGGITHUB_URL);
75+
$GLOBALS['xoopsTpl']->assign('wggithub_upload_url', \WGGITHUB_UPLOAD_URL);
7676
// Table view repositories
7777
if ($repositoriesCount > 0) {
7878
foreach (\array_keys($repositoriesAll) as $i) {

0 commit comments

Comments
 (0)