Skip to content

Commit 4af9716

Browse files
Merge branch 'ILIAS-eLearning:release_10' into release_10
2 parents 7723ffe + 555420b commit 4af9716

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

components/ILIAS/Authentication/classes/class.ilSessionReminder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function getMaxPossibleLeadTime(): int
109109
{
110110
$expires = ilSession::getSessionExpireValue();
111111

112-
return max(self::MIN_LEAD_TIME, ($expires / 60) - 1);
112+
return max(self::MIN_LEAD_TIME, (int) (floor($expires / 60) - 1));
113113
}
114114

115115
private function init(): void

components/ILIAS/Forum/classes/Purifier/class.ilHtmlForumPostPurifier.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function getPurifierConfigInstance(): HTMLPurifier_Config
2828
{
2929
$config = HTMLPurifier_Config::createDefault();
3030
$config->set('HTML.DefinitionID', 'ilias forum post');
31-
$config->set('HTML.DefinitionRev', 2);
31+
$config->set('HTML.DefinitionRev', 3);
3232
$config->set('Cache.SerializerPath', ilHtmlPurifierAbstractLibWrapper::_getCacheDirectory());
3333
$config->set('HTML.Doctype', 'XHTML 1.0 Strict');
3434

@@ -37,6 +37,16 @@ protected function getPurifierConfigInstance(): HTMLPurifier_Config
3737
$config->set('HTML.AllowedElements', $this->removeUnsupportedElements($tags));
3838
$config->set('HTML.ForbiddenAttributes', 'div@style');
3939

40+
$config->autoFinalize = false;
41+
$config->set(
42+
'URI.AllowedSchemes',
43+
array_merge(
44+
$config->get('URI.AllowedSchemes'),
45+
['data' => true]
46+
)
47+
);
48+
$config->autoFinalize = true;
49+
4050
if (($def = $config->maybeGetRawHTMLDefinition()) !== null) {
4151
$def->addAttribute('img', 'data-id', 'Number');
4252
$def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');

components/ILIAS/Logging/classes/public/class.ilLoggerFactory.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* This file is part of ILIAS, a powerful learning management system
75
* published by ILIAS open source e-Learning e.V.
@@ -18,6 +16,7 @@
1816
*
1917
*********************************************************************/
2018

19+
declare(strict_types=1);
2120

2221
use Monolog\Logger;
2322
use Monolog\Handler\StreamHandler;
@@ -127,31 +126,31 @@ public function initUser(string $a_login): void
127126
*/
128127
protected function isConsoleAvailable(): bool
129128
{
130-
if (ilContext::getType() != ilContext::CONTEXT_WEB) {
129+
if (ilContext::getType() !== ilContext::CONTEXT_WEB) {
131130
return false;
132131
}
133-
if (
134-
$this->dic->isDependencyAvailable('ctrl') && $this->dic->ctrl()->isAsynch() ||
132+
133+
if (($this->dic->isDependencyAvailable('ctrl') && $this->dic->ctrl()->isAsynch()) ||
135134
(
136135
$this->dic->isDependencyAvailable('http') &&
137-
strtolower($this->dic->http()->request()->getServerParams()['HTTP_X_REQUESTED_WITH'] ?? '') === 'xmlhttprequest'
136+
strtolower(
137+
$this->dic->http()->request()->getServerParams()['HTTP_X_REQUESTED_WITH'] ?? ''
138+
) === 'xmlhttprequest'
138139
)
139140
) {
140141
return false;
141142
}
142143

143-
if (
144-
$this->dic->isDependencyAvailable('http') &&
145-
strpos($this->dic->http()->request()->getServerParams()['HTTP_ACCEPT'], 'text/html') !== false
146-
) {
144+
if ($this->dic->isDependencyAvailable('http') &&
145+
str_contains($this->dic->http()->request()->getServerParams()['HTTP_ACCEPT'] ?? '', 'text/html')) {
147146
return true;
148147
}
149-
if (
150-
$this->dic->isDependencyAvailable('http') &&
151-
strpos($this->dic->http()->request()->getServerParams()['HTTP_ACCEPT'], 'application/json') !== false
152-
) {
148+
149+
if ($this->dic->isDependencyAvailable('http') &&
150+
str_contains($this->dic->http()->request()->getServerParams()['HTTP_ACCEPT'] ?? '', 'application/json')) {
153151
return false;
154152
}
153+
155154
return true;
156155
}
157156

0 commit comments

Comments
 (0)