1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-18 05:09:05 +01:00

12399 Commits

Author SHA1 Message Date
Nick Liu
4321c1b944
Null coalescing for $_SERVER keys in session_handler.php
Resolves CLI-invoked E_NOTICE in:
* e_session::getValidateData()
* e_core_session::challenge()
2020-01-17 15:54:12 +01:00
Nick Liu
6fe4bf16be
Null coalescing for $_SERVER keys in online_class.php
Resolves CLI-invoked E_NOTICE in:
* e_online::goOnline()
2020-01-17 15:46:15 +01:00
Nick Liu
a49b532519
Stop stepping on E107_DBG_* constants in tests
\Helper\Unit::_beforeSuite() now sets E107_DEBUG_LEVEL so that
debug_handler.php sets the debug mode.

Also fixed E_NOTICE if E107_DEBUG_LEVEL is set beforehand
2020-01-17 15:42:57 +01:00
Nick Liu
bcba1e065f
Null coalescing for $_SERVER keys in iphandler_class.php
Resolves CLI-invoked E_NOTICE in:
* eIPHandler::__construct()
* eIPHandler::getCurrentIP()

Also resolves possible blank eIPHandler::$serverIP
2020-01-17 15:11:45 +01:00
Nick Liu
c232613e44
Fix mkdir() failure in e107::_init() if parent not exists 2020-01-17 15:10:18 +01:00
Nick Liu
be36462fe6
Null coalescing for $_SERVER keys in e107_class.php
Removes CLI-invoked E_NOTICE in:
* e107::prepare_request()
* e107::set_constants()
* e107::set_urls()
2020-01-17 15:04:29 +01:00
Nick Liu
b9d4961571
Turn off web error handler for CLI (breaks a lot of stuff!)
error_handler now only runs set_error_handler in web mode.

E_ALL notices, warnings, and errors are now reported, which causes
the test harness to fail.
2020-01-17 14:48:55 +01:00
Nick Liu
34047a2db3
Prevent HTML code injection in e107::url()
Fixes: #4054

This is a better fix for #4054. HTML code injection can no longer occur in URLs generated by
e107::url() thanks to htmlspecialchars(). The previous implementation only addressed:

    & => &

Now, quotation marks and alligator brackets are also escaped, so:

    <a href=""></html>"></a>

is now rendered as:

    <a href="&quot;&gt;&lt;/html&gt;"></a>
2020-01-14 23:56:19 +01:00
Nick Liu
82b2da4c36
Better documentation for e107::url()
Clarifies that the output format of e107::url() is like htmlspecialchars()
2020-01-14 23:56:19 +01:00
Cameron
ac47858941 PHP Notice Fix. 2020-01-14 14:44:29 -08:00
Cameron
15e76c84d1 Revert last test as e107::redirect() will correct any entity detected. 2020-01-14 13:57:33 -08:00
Cameron
4aa5ac8622 Issue 4054 Added test for e107::url() with 'mode' => 'full' as often utilized by e107::redirect() 2020-01-14 13:45:35 -08:00
Nick L
9488fdcdc3
Merge pull request #4067 from Deltik/fix-4054
Compliant query string ampersands in e_url
2020-01-14 10:17:02 +01:00
Nick Liu
4893ea7c67
Fix bad reformatting of e107::url() 2020-01-13 01:14:22 +01:00
Nick Liu
e62422d63a
Old HTML ampersand strict compatibility
- FIX: e107::url() now puts "&amp;" in the query string instead of "&" for compliance with the older,
       looser definition of ambiguous ampersands in the HTML specification.
       Fixes: #4054
- FIX: Typo in comment
- FIX: Clear the core/e107/addons/e_url registry (cache) because if a plugin is installed after that
       cache is initialized, the cache is not updated anymore. The plugin's e_url is therefore not
       loaded, so SEF URLs won't be generated for that plugin until the cache is regenerated.
- NEW: Test for #4054
- FIX: e_pluginTest::testGetFields() expects the initial condition of the "forum" plugin to be
       uninstalled.
2020-01-13 00:54:50 +01:00
Nick Liu
d13fcd44c7
De-indented e107::url() with guard clause
Less cognitive complexity now that the e_url.php check is a guard clause
2020-01-13 00:54:49 +01:00
Nick Liu
75d1ae2649
Hard-coded Code Climate test reporter ID
Apparently, there's no easy way to submit coverage reports from GitHub pull request builds
without exposing this reporter ID. Coverage diff reports should now come in from pull
request builds after this commit. The expectation is that Code Climate will comment on the
pull requests and mark the build as failed or succeeded based on the coverage diff.

This commit also disables sending code coverage reports to Codecov, which has been broken
for a while now: https://github.com/codecov/codecov-action/issues/43
2020-01-13 00:54:30 +01:00
LaocheXe
e01f1a4345 Delete Account Option
Delete Account Option added in admin  area. Also updated the default_install.xml to add missing core options.
2020-01-10 08:28:17 -06:00
Nick L
08b9041039 Categorized issue types under "types:"
Based on feedback from https://github.com/e107inc/e107/issues/4054#issuecomment-571527342
2020-01-07 21:15:38 +01:00
Tijn Kuyper
530914f631
Added Jetbrains reference link to Sponsor button
b812fd1bdc (commitcomment-36595755)
2020-01-02 10:44:53 +01:00
Cameron
a7c177c9f0
Merge pull request #4047 from Serios/patch-14
Fixing an issue that with contact form sending unnecessary additional…
2019-12-31 11:38:11 -08:00
Cameron
2a6e3a182d Issue #4020 - Removed Admin Nav button labels for all device and provided solution for plugins to add them back via css if required. Example added to admin_style.css 2019-12-31 11:24:14 -08:00
Nick Liu
0b269013c1
Added an issue template for questions 2019-12-30 15:07:58 +01:00
Nick Liu
d31f4cd45e
E107Preparer: Clean up hidden files as well
Fixes test run cleanup errors that look like:

    In ErrorHandler.php line 83:

      rmdir(W:\www\e107v2/e107_system/000000test/): Directory not empty

Or:

    In E107Preparer.php line 27:

      E107Preparer couldn't delete W:\www\e107v2/e107_system/000000test
2019-12-30 11:15:43 +01:00
Cameron
8270c5cf42 Remove tests folder when doing a core github pull, unless developer mode is active. 2019-12-29 12:45:35 -08:00
Cameron
b26c0abfbb
Merge pull request #4053 from e107inc/fix-4052
Fixes #4052 Use canonical file system paths in e_fileTest::testUnzipGithubArchive()
2019-12-29 12:18:40 -08:00
Nick Liu
80b49a5d14
Fix outdated Git on Debian stretch
by enabling Debian backports
2019-12-29 13:47:03 +01:00
Nick Liu
d7e083b59a
Fix Code Climate test coverage reports on wrong branch
GitHub Actions actions/checkout@v1 checked out code as a detached HEAD,
which caused Code Climate test coverage reports to appear as on the HEAD branch.

Coverage reports should now appear on an upstream branch.

From the actions/checkout@v2 release notes: https://github.com/actions/checkout/blob/v2/README.md

> - Creates a local branch
>   - No longer detached HEAD when checking out a branch
>   - A local branch is created with the corresponding upstream branch set
2019-12-29 13:20:35 +01:00
Nick Liu
029f4883e6
Use canonical file system paths in e_fileTest::testUnzipGithubArchive()
Should fix the tests on Windows

Fixes: #4052
2019-12-29 12:29:27 +01:00
Nick L
0f749d7822 More descriptive issue templates
Hopefully improves the reproducibility of bug reports and quality of feature requests
2019-12-29 12:08:56 +01:00
Cameron
d7451bdd3c
Merge pull request #3994 from Jimmi08/patch-4
Fixes #3993 outdated db methods
2019-12-28 12:03:38 -08:00
Cameron
ec2061e880
Merge pull request #3995 from Jimmi08/patch-5
Fixes #3983 blank page because missing method name
2019-12-28 12:03:09 -08:00
Cameron
b5f2cf2f9e
Merge pull request #3991 from Jimmi08/patch-2
Fixes #3984 Missing scenario with secondary source
2019-12-28 12:02:33 -08:00
Cameron
7e5b104f7e
Merge pull request #3990 from Jimmi08/patch-1
Fixes #3981 fatal error because non supported mysql function
2019-12-28 12:01:47 -08:00
Cameron
bcab5172e6
Merge pull request #3992 from Jimmi08/patch-3
#3982 fix for wrong user data while creating user
2019-12-28 11:59:21 -08:00
Cameron
363eb6751a
Merge pull request #3989 from sudakk/sudakk-patch-2
Update cpage.php to prevent empty records.
2019-12-28 11:55:46 -08:00
Cameron
598522e603
Merge pull request #4038 from e107inc/test-harness
Automated Testing for e107
2019-12-28 10:45:11 -08:00
Nick Liu
8d5d184ab2
Redesigned README.md above-the-fold content
- NEW: Logo at the top
- MOD: Moved Gitter badge to the end
- MOD: Added e107 logo to GitHub release badge
- MOD: Replaced GitHub Workflow badge with Shields.io equivalent for consistency
- MOD: Replaced Codecov code coverage badge with Code Climate equivalent
- MOD: Added Gitter logo and styling to Gitter badge
2019-12-28 18:23:13 +01:00
Nick Liu
939d01271c
GitHub Actions: Upload code coverage report to Code Climate as well 2019-12-28 16:57:30 +01:00
Nick Liu
4ca73daad5
Salt state e107-dev now installs LAMP for acceptance tests 2019-12-28 15:39:21 +01:00
Nick Liu
20ed1ecb00
Enable xdebug in PHP 5.6 builds 2019-12-28 10:58:07 +01:00
Nick Liu
60aa3f34d4
Refactored e_db_pdo::copyRow() for Codeception
Fixes: "The method copyRow() has an NPath complexity of 252. The configured NPath complexity threshold is 200."
2019-12-28 10:57:51 +01:00
Nick Liu
c31b645013
Made acceptance tests work again
Broken due to Codeception moving modules out of codeception/codeception
2019-12-28 10:35:36 +01:00
Nick Liu
e797efce74
Fixed some formatting oddities 2019-12-27 22:18:27 +01:00
Nick Liu
fabb0c2757
e_db_pdo::copyRow() - Greatly decrease collision chance
Increased possible random strings for unique fields in e_db_pdo::copyRow() from 1000 to 59^11 (UserHandler::generateRandomString() "alphanumeric" should have 59 characters to choose from)

If a collision still happens, e_db_pdo::copyRow() retries up to 3 times for a successful copy.

Fixes: #3678
2019-12-27 21:54:11 +01:00
Nick Liu
5e9b3bee14
Resolve Code Climate error about file not existing
Error message from Code Climate:

> Exception: The given file "/code/e107_tests/lib/ci/salt/pillars/config-local.sls" does not exist. in /usr/src/app/vendor/pdepend/pdepend/src/main/php/PDepend/Engine.php
> #0 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/ParserFactory.php(129): PDepend\Engine->addFile('/code/e107_test...')
> #1 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/ParserFactory.php(109): PHPMD\ParserFactory->initInput(Object(PDepend\Engine), Object(PHPMD\PHPMD))
> #2 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/ParserFactory.php(76): PHPMD\ParserFactory->init(Object(PDepend\Engine), Object(PHPMD\PHPMD))
> #3 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/PHPMD.php(215): PHPMD\ParserFactory->create(Object(PHPMD\PHPMD))
> #4 /usr/src/app/Runner.php(116): PHPMD\PHPMD->processFiles('/code/e107_test...', 'cleancode,unuse...', Array, Object(PHPMD\RuleSetFactory))
> #5 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1852): CodeClimate\PHPMD\Runner->run(Array)
> #6 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1772): fork_daemon->invoke_callback(Array, Array, false)
> #7 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1673): fork_daemon->fork_work_unit(Array, '', -1)
> #8 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1445): fork_daemon->process_work_unit(-1)
> #9 /usr/src/app/Runner.php(31): fork_daemon->process_work(false)
> #10 /usr/src/app/engine.php(35): CodeClimate\PHPMD\Runner->queueDirectory('/code')
> #11 {main}
2019-12-27 19:35:19 +01:00
Nick Liu
3b4240bbae
Quality control for e_file::unzipGithubArchive()
- MOD: PHPDoc for e_file::unzipGithubArchive()
- NEW: e_file::unzipGithubArchive(): Added exclusions for files that don't exist in production
- NEW: e_file::unzipGithubArchive(): Accept a destination path argument for a custom extraction location
- NEW: Restored unimplemented skipped list in e_file::unzipGithubArchive()
- FIX: e_file::unzipGithubArchive(): Extraction fails if parent directory of file doesn't exist
- MOD: Type hint for Base::$deployer
- NEW: Basic test for e_file::unzipGithubArchive()
2019-12-27 11:33:21 -06:00
Nick Liu
3fca73064a
Improvements to CONTRIBUTING.md 2019-12-26 11:05:17 -08:00
Nick Liu
38c8c71a09
Improvements to README.md
- MOD: Removed hard-coded version number
- NEW: Added badge for latest version number
- NEW: Added badge for build results
- NEW: Added badge for code coverage
- NEW: Added table of contents
- FIX: Clarification of system requirements
- MOD: Combined installation insructions into "Installation" secion
- MOD: Standard installation instructions now explain how to download e107
- FIX: Clarification of Git installation instructions
- FIX: Grammar in "Reporting Bugs" section
- MOD: Renamed "Pull-Requests" section to "Contributing to Development"
- FIX: Readability of the "Contributing to Development" section
- FIX: Grammar in "Donations" section
- MOD: Replaced all HTTP links with HTTPS
2019-12-26 11:05:11 -08:00
Nick Liu
16ca1494e3
GitHub Actions workflow renamed "Test e107" => "Unit Tests" 2019-12-26 10:18:26 -08:00