Skip to content

Commit

Permalink
Merge branch 'e107inc:master' into rica-carv-news_user-update
Browse files Browse the repository at this point in the history
  • Loading branch information
rica-carv authored Jan 11, 2025
2 parents d3366fd + 73c5760 commit bce9e82
Show file tree
Hide file tree
Showing 81 changed files with 7,534 additions and 6,541 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/test-acceptance.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Acceptance Tests

on:
push:
pull_request:

jobs:
test-acceptance:
strategy:
Expand All @@ -11,30 +13,27 @@ jobs:
- image: docker.io/jrei/systemd-ubuntu:20.04
- image: docker.io/jrei/systemd-ubuntu:22.04
runs-on: ubuntu-latest

steps:
- name: Replace Docker with Podman Rootless
run: |
sudo apt-get -o Dpkg::Options::="--force-overwrite" install -y podman
echo -e "export XDG_RUNTIME_DIR=/tmp/${RUNNER_TEMP}" >> $GITHUB_ENV
echo -e "export XDG_DATA_HOME=/tmp/${RUNNER_TEMP}" >> $GITHUB_ENV
echo -e "export CONTAINERS_STORAGE_CONF=/tmp/${RUNNER_TEMP}/storage.conf" >> $GITHUB_ENV
- name: Replace Docker with Podman
run: sudo apt-get -o Dpkg::Options::="--force-overwrite" install -y podman-docker

- uses: actions/setup-go@v3
with:
go-version: "^1.19"

- uses: actions/checkout@v3

- name: Compile SaltStack bootstrap wrapper
run: CGO_ENABLED=0 go build -ldflags "-s -w" -o ./salt-bootstrap salt-bootstrap.go
working-directory: ./e107_tests/lib/ci/salt/

- name: Launch test container
run: |
docker run -d --rm --name target -v .:/app/ ${{ matrix.operating_system.image }} tail -f /dev/null
sleep 5
if ! docker ps | grep -q target; then
docker logs target
exit 1
fi
run: docker run -d -it --rm --name target -v .:/app/ ${{ matrix.operating_system.image }}

- name: Install SaltStack
run: docker exec target /app/e107_tests/lib/ci/salt/salt-bootstrap onedir

- name: Apply Salt state
run: |
ln -v -s master minion
Expand All @@ -48,14 +47,18 @@ jobs:
salt-call -c ./ --id=e107-dev --local state.apply e107-dev
"
working-directory: ./e107_tests/lib/ci/salt/

- name: Install test dependencies
run: |
docker exec -w /app/e107_tests/ -e COMPOSER_ALLOW_SUPERUSER=1 target \
composer update --prefer-dist --no-progress
- name: Download Git submodule dependencies
run: git submodule update --init --recursive --remote

- name: Install the CI test configuration file
run: |
ln -v -s -f ./lib/ci/config.acceptance.ci.yml ./e107_tests/config.yml
- name: Run acceptance tests
run: docker exec -w /app/e107_tests/ target php ./vendor/bin/codecept run acceptance --steps
13 changes: 11 additions & 2 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,17 @@ jobs:
--input ./e107_tests/tests/_output/coverage/codeclimate.json
continue-on-error: true

- name: Set artifact name
id: set_artifact_name
run: |
TIMESTAMP=$(date +%Y%m%d%H%M%S)
INTERPRETER_IMAGE=$(echo "${{ matrix.interpreter.image }}" | sed 's/[:/]/_/g')
DB_IMAGE=$(echo "${{ matrix.db.image }}" | sed 's/[:/]/_/g')
ARTIFACT_NAME="tests_output_${{ github.run_id }}_${INTERPRETER_IMAGE}_${DB_IMAGE}_${TIMESTAMP}"
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
- name: Upload test output
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: tests_output
name: ${{ env.ARTIFACT_NAME }}
path: ./e107_tests/tests/_output/
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![e107 Content Management System](https://e107.org/e107_images/logoHD.png)](https://e107.org)
=================
[![Supported PHP Versions](https://img.shields.io/badge/PHP-7.4,%208.0,%208.1,%208.2-blue)](https://github.com/e107inc/e107/)
[![Supported PHP Versions](https://img.shields.io/badge/PHP-7.4,%208.0,%208.1,%208.2,%208.3-blue)](https://github.com/e107inc/e107/)
[![GitHub release](https://img.shields.io/github/v/release/e107inc/e107?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAA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zrH9iwZviTPMZscQsShmLIoLq+kBznqIox3cwj7127b2CZtckTZFwqIYWMRe52RKc5Wr7B8S9Iyw3+QEe3L9dNym+n6IrSzwiapUbTHNe7kRtCn4Kk7Sa80oLaLk5waaWc+NuchjuRFsZRAYIhj/FoArJgWB0R/CAA1UcgtoYVmuIlXTxWvs08agfeGUUG91NEd5hW/Sdk4akhVE3cOcAPXa01nWSL6LMk4b8+cPPuAdwsazc/Y4z4eiSJu0XsscaXlRzE1aH/jFMv/lS3F23tnbQj07NU6UKBEiTDDOU6ZaWCSFWwT+PzoQf8Ad7jHA4Ez0dEHhU2vm9dhBGmgc+4y3sj/1HPOcQpNXqqPqAAAAAElFTkSuQmCC)](https://github.com/e107inc/e107/releases)
[![GitHub Workflow "Unit Tests" Status](https://img.shields.io/github/actions/workflow/status/e107inc/e107/test-unit.yml?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAOCAQAAABnEe8CAAAAAnNCSVQICFXsRgQAAAAJcEhZcwAAA3cAAAN3Aa+SYCgAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAABG0lEQVQoFW3By0pUARgA4H8O05AQZWjkImjprr0LL7guJ3VcidAmkFZBi0AHDyNCtu4FeoF6hbQLw5CiKIX2BLWa0+jshj6P13Tq++KUfjWbDrTtWnUvrnAzjpmU2Vc14aGXdhwaizP6VNyKCFM6qirWNR2qe2ROT+Qk5qWKEeGO36peaxiWKBnx3u3IGVL3NE5Ztqei4breuOCut34ajnO2LfpoJMIDqWKEoucy2+7HX1rKMknkvPHZjF28cyMu01KWSSKn1y/8UVOIq2ypWjcaJzzRNhP/UrNn2lc9kVMwqKQU3fTLLHnlu3GJgiGfPFOIbh7rSE1b09T0xawXPrgW3ZQ1/ZAqm7Dgm5bZ+B99UhtaDmxZMRBdjgBnPOGTaoNcdgAAAABJRU5ErkJggg==)](https://github.com/e107inc/e107/actions)
[![Code coverage](https://img.shields.io/codeclimate/coverage/e107inc/e107?logo=code-climate)](https://codeclimate.com/github/e107inc/e107/test_coverage)
Expand Down Expand Up @@ -122,7 +122,6 @@ Having trouble getting e107 up and running? Something not working the way you th

## License

e107 is released under the terms and conditions of the GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
This changed.
e107 is released under the terms and conditions of the GNU [General Public License](http://www.gnu.org/licenses/gpl.txt)

[1]: https://e107.org
48 changes: 9 additions & 39 deletions class2.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,54 +470,24 @@
}
elseif(deftrue('e_DOMAIN'))
{
// Find domain and port from user and from pref
list($urlbase,$urlport) = explode(':',$_SERVER['HTTP_HOST'].':');
if(!$urlport)
{
$urlport = (int) $_SERVER['SERVER_PORT'];
}
if(!$urlport)
{
$urlport = 80;
}
$aPrefURL = explode('/',$pref['siteurl'],4);
if (count($aPrefURL) > 2) // we can do this -- there's at least http[s]://dom.ain/whatever
{
$PrefRoot = $aPrefURL[2];
list($PrefSiteBase,$PrefSitePort) = explode(':',$PrefRoot.':');
if (!$PrefSitePort)
{
$PrefSitePort = ( $aPrefURL[0] === 'https:' ) ? 443 : 80; // no port so set port based on 'scheme'
}
$location = e107::getRedirect()->host($_SERVER, $pref['siteurl'], ADMINDIR);

// Redirect only if
// -- ports do not match (http <==> https)
// -- base domain does not match (case-insensitive)
// -- NOT admin area
if (($urlport !== $PrefSitePort || stripos($PrefSiteBase, $urlbase) === false) && strpos(e_REQUEST_SELF, ADMINDIR) === false)
{
$aeSELF = explode('/', e_REQUEST_SELF, 4);
$aeSELF[0] = $aPrefURL[0]; // Swap in correct type of query (http, https)
$aeSELF[1] = ''; // Defensive code: ensure http:// not http:/<garbage>/
$aeSELF[2] = $aPrefURL[2]; // Swap in correct domain and possibly port
$location = implode('/',$aeSELF).($_SERVER['QUERY_STRING'] ? '?'.$_SERVER['QUERY_STRING'] : '');
$location = filter_var($location, FILTER_SANITIZE_URL);
//
// header("Location: {$location}", true, 301); // send 301 header, not 302
if($location)
{
if(defined('e_DEBUG') && e_DEBUG === true)
{
echo "DEBUG INFO: site-redirect preference enabled.<br />Redirecting to: <a hre='".$location."'>".$location. '</a>';
echo '<br />e_DOMAIN: ' .e_DOMAIN;
echo '<br />e_SUBDOMAIN: ' .e_SUBDOMAIN;
echo "DEBUG INFO: site-redirect preference enabled.<br />Redirecting to: <a href='" . $location . "'>" . $location . "</a>";
echo '<br />e_DOMAIN: ' . e_DOMAIN;
echo '<br />e_SUBDOMAIN: ' . e_SUBDOMAIN;
}
else
{
e107::getRedirect()->go($location,true,301);
e107::getRedirect()->go($location, true, 301); // Issue 301 redirect
}

exit();
}
exit();
}

}
}

Expand Down
38 changes: 19 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bce9e82

Please sign in to comment.