N°5809 Update apereo/phpcas from 1.6.0 to 1.6.1

This commit is contained in:
Pierre Goiffon
2024-01-25 15:00:09 +01:00
parent 7a5ce8cd6b
commit 71d9710322
25 changed files with 141 additions and 326 deletions

View File

@@ -1,17 +0,0 @@
codecov:
strict_yaml_branch: master
coverage:
round: up
precision: 2
status:
project:
default:
target: "70%"
informational: true
patch: # temporarily disabled
default:
target: "70%"
informational: true
comment: false

View File

@@ -1,7 +0,0 @@
/docs/ export-ignore
/test/ export-ignore
/utils/ export-ignore
/.buildpath export-ignore
/.gitignore export-ignore
/.project export-ignore
/.travis.yml export-ignore

View File

@@ -1,7 +0,0 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

View File

@@ -1,43 +0,0 @@
name: Test
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- php: '7.2'
phpunit: '8'
- php: '7.3'
phpunit: latest
- php: '7.4'
phpunit: latest
- php: '8.0'
phpunit: latest
- php: '8.1'
phpunit: latest
steps:
- uses: actions/checkout@v2
- uses: php-actions/composer@v6
with:
php_version: "${{ matrix.php-version.php }}"
- name: Run PHPUnit
uses: php-actions/phpunit@v3
with:
version: "${{ matrix.php-version.phpunit }}"
php_version: "${{ matrix.php-version.php }}"
php_extensions: xdebug
args: --verbose --coverage-clover=coverage.xml
bootstrap: vendor/autoload.php
env:
XDEBUG_MODE: coverage
- name: Report coverage
uses: codecov/codecov-action@v1
with:
files: coverage.xml

View File

@@ -33,12 +33,12 @@
"phpstan/phpstan" : "^1.5"
},
"autoload" : {
"files": ["source/CAS.php"],
"classmap" : [
"source/"
]
},
"autoload-dev" : {
"files": ["source/CAS.php"],
"psr-4" : {
"PhpCas\\" : "test/CAS/"
}

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="source/CAS.php" convertNoticesToExceptions="false" colors="true" stderr="true" backupGlobals="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="false">
<include>
<directory>source/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="phpCAS Tests">
<directory>test/CAS/Tests/</directory>
</testsuite>
</testsuites>
</phpunit>

View File

@@ -57,7 +57,7 @@ if (!isset($_SERVER['REQUEST_URI']) && isset($_SERVER['SCRIPT_NAME']) && isset($
/**
* phpCAS version. accessible for the user by phpCAS::getVersion().
*/
define('PHPCAS_VERSION', '1.6.0');
define('PHPCAS_VERSION', '1.6.1');
/**
* @addtogroup public

View File

@@ -973,11 +973,6 @@ class CAS_Client
session_start();
phpCAS :: trace("Starting a new session " . session_id());
}
// init phpCAS session array
if (!isset($_SESSION[static::PHPCAS_SESSION_PREFIX])
|| !is_array($_SESSION[static::PHPCAS_SESSION_PREFIX])) {
$_SESSION[static::PHPCAS_SESSION_PREFIX] = array();
}
}
// Only for debug purposes
@@ -1198,9 +1193,21 @@ class CAS_Client
{
$this->validateSession($key);
$this->ensureSessionArray();
$_SESSION[static::PHPCAS_SESSION_PREFIX][$key] = $value;
}
/**
* Ensure that the session array is initialized before writing to it.
*/
protected function ensureSessionArray() {
// init phpCAS session array
if (!isset($_SESSION[static::PHPCAS_SESSION_PREFIX])
|| !is_array($_SESSION[static::PHPCAS_SESSION_PREFIX])) {
$_SESSION[static::PHPCAS_SESSION_PREFIX] = array();
}
}
/**
* Remove a session value with the given key.
*