aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--composer.json2
-rw-r--r--composer.lock19
-rw-r--r--lib/bootstrap.php2
-rw-r--r--lib/models/Course.php30
-rw-r--r--lib/phplib/Seminar_Auth.php2
-rw-r--r--lib/seminar_open.php2
-rw-r--r--phpstan.neon.dist1
-rw-r--r--tests/functional/_bootstrap.php2
-rw-r--r--tests/jsonapi/_bootstrap.php4
9 files changed, 33 insertions, 31 deletions
diff --git a/composer.json b/composer.json
index 32617d6..20e1638 100644
--- a/composer.json
+++ b/composer.json
@@ -71,7 +71,7 @@
"codeception/codeception": "5.1.2",
"codeception/module-asserts": "3.0.0",
"overtrue/phplint": "9.3.0",
- "phpstan/phpstan": "1.11.0",
+ "phpstan/phpstan": "^2.0",
"symfony/var-dumper": "6.4.7",
"maximebf/debugbar": "1.22.3",
"codeception/specify": "^2.0"
diff --git a/composer.lock b/composer.lock
index 7ebf09c..7897e22 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "f64a6bfba9a1758196b21c6394535191",
+ "content-hash": "5bc2e4ef41517f46c14d02cfecdd95d9",
"packages": [
{
"name": "algo26-matthias/idna-convert",
@@ -6516,20 +6516,20 @@
},
{
"name": "phpstan/phpstan",
- "version": "1.11.0",
+ "version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "666cb1703742cea9cc80fee631f0940e1592fa6e"
+ "reference": "6c98c7600fc717b2c78c11ef60040d5b1e359c82"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/666cb1703742cea9cc80fee631f0940e1592fa6e",
- "reference": "666cb1703742cea9cc80fee631f0940e1592fa6e",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6c98c7600fc717b2c78c11ef60040d5b1e359c82",
+ "reference": "6c98c7600fc717b2c78c11ef60040d5b1e359c82",
"shasum": ""
},
"require": {
- "php": "^7.2|^8.0"
+ "php": "^7.4|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
@@ -6570,7 +6570,7 @@
"type": "github"
}
],
- "time": "2024-05-13T06:02:22+00:00"
+ "time": "2024-11-17T14:17:00+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -8742,9 +8742,10 @@
"ext-pcre": "*",
"ext-pdo": "*",
"ext-mbstring": "*",
- "ext-dom": "*"
+ "ext-dom": "*",
+ "ext-iconv": "*"
},
- "platform-dev": [],
+ "platform-dev": {},
"platform-overrides": {
"php": "8.1"
},
diff --git a/lib/bootstrap.php b/lib/bootstrap.php
index 2e762c5..2f8448d 100644
--- a/lib/bootstrap.php
+++ b/lib/bootstrap.php
@@ -112,7 +112,7 @@ if ($GLOBALS['ASSETS_URL'][0] === '/') {
$GLOBALS['ASSETS_URL'] = $GLOBALS['ABSOLUTE_URI_STUDIP'] . $GLOBALS['ASSETS_URL'];
}
-require 'config.inc.php';
+require $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';
require 'lib/helpers.php';
require 'lib/phplib/page_open.php';
diff --git a/lib/models/Course.php b/lib/models/Course.php
index 690fbc2..bf5b738 100644
--- a/lib/models/Course.php
+++ b/lib/models/Course.php
@@ -1781,26 +1781,28 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe
public function getFullName($format = 'default')
{
$template = [
- 'name' => '%1$s',
- 'name-semester' => '%1$s (%4$s)',
- 'number-name' => '%3$s %1$s',
- 'number-name-semester' => '%3$s %1$s (%4$s)',
- 'number-type-name' => '%3$s %2$s: %1$s',
- 'sem-duration-name' => '%4$s',
- 'type' => '%2$s',
- 'type-name' => '%2$s: %1$s',
- 'type-number-name' => '%2$s: %3$s %1$s',
+ 'name' => '%{name}',
+ 'name-semester' => '%{name} (%{semester})',
+ 'number-name' => '%{number} %{name}',
+ 'number-name-semester' => '%{number} %{name} (%{semester})',
+ 'number-type-name' => '%{number} %{type}: %{name}',
+ 'sem-duration-name' => '%{semester}',
+ 'type' => '%{type}',
+ 'type-name' => '%{type}: %{name}',
+ 'type-number-name' => '%{type}: %{number} %{name}',
];
if ($format === 'default' || !isset($template[$format])) {
$format = Config::get()->IMPORTANT_SEMNUMBER ? 'type-number-name' : 'type-name';
}
$sem_type = $this->getSemType();
- $data[0] = $this->name;
- $data[1] = $sem_type['name'];
- $data[2] = $this->veranstaltungsnummer;
- $data[3] = $this->getTextualSemester();
- return trim(vsprintf($template[$format], array_map('trim', $data)));
+ $data = array_map('trim', [
+ 'name' => $this->name,
+ 'type' => $sem_type['name'],
+ 'number' => $this->veranstaltungsnummer,
+ 'semester' => $this->getTextualSemester(),
+ ]);
+ return trim(studip_interpolate($template[$format], $data));
}
/**
diff --git a/lib/phplib/Seminar_Auth.php b/lib/phplib/Seminar_Auth.php
index 17d8b89..4ca21bf 100644
--- a/lib/phplib/Seminar_Auth.php
+++ b/lib/phplib/Seminar_Auth.php
@@ -442,7 +442,7 @@ class Seminar_Auth
// init of output via I18N
$_language_path = init_i18n($_SESSION['_language']);
- include 'config.inc.php';
+ include $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';
if (!empty($_SESSION['contrast'])) {
PageLayout::addStylesheet('accessibility.css');
diff --git a/lib/seminar_open.php b/lib/seminar_open.php
index cfed847..4fb856f 100644
--- a/lib/seminar_open.php
+++ b/lib/seminar_open.php
@@ -125,7 +125,7 @@ if (!empty($_SESSION['contrast']) || UserConfig::get($GLOBALS['user']->id)->USER
// init of output via I18N
$_language_path = init_i18n($_SESSION['_language']);
//force reload of config to get translated data
-include 'config.inc.php';
+include $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';
// Try to select the course or institute given by the parameter 'cid'
// in the current request.
diff --git a/phpstan.neon.dist b/phpstan.neon.dist
index 2d66785..4576401 100644
--- a/phpstan.neon.dist
+++ b/phpstan.neon.dist
@@ -13,7 +13,6 @@ parameters:
- lib
- vendor
excludePaths:
- - lib/classes/ZipArchiveLegacyTrait.php
- lib/ilias_interface/studip_referrer_7x.php
- lib/ilias_interface/studip_referrer_8x.php
tmpDir: .caches
diff --git a/tests/functional/_bootstrap.php b/tests/functional/_bootstrap.php
index cdc9db1..1897878 100644
--- a/tests/functional/_bootstrap.php
+++ b/tests/functional/_bootstrap.php
@@ -37,7 +37,7 @@ StudipFileloader::load(
foreach($added_configs as $key => $value) {
$GLOBALS[$key] = $value;
}
-require 'config/config.inc.php';
+require $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';;
require_once __DIR__ . '/../../lib/bootstrap-autoload.php';
// Do not send mails of any kind during tests
diff --git a/tests/jsonapi/_bootstrap.php b/tests/jsonapi/_bootstrap.php
index 2b30aa9..1fc5ba7 100644
--- a/tests/jsonapi/_bootstrap.php
+++ b/tests/jsonapi/_bootstrap.php
@@ -27,8 +27,8 @@ $CACHING_ENABLE = false;
date_default_timezone_set('Europe/Berlin');
-require 'config.inc.php';
-require 'mvv_config.php';
+require $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';;
+require $GLOBALS['STUDIP_BASE_PATH'] . '/config/mvv_config.php';
require_once __DIR__ . '/../../lib/bootstrap-autoload.php';