Skip to content

Commit a33726f

Browse files
authored
Fix(Core): prevent fatal error with Safe\ini_set() (#568)
1 parent 1995852 commit a33726f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2323
- Fix user fields nullability to prevent SQL errors during injection
2424
- Remove groups as import link field
2525
- Fix `clean` function
26+
- Prevent fatal error with `Safe\ini_set()`
2627

2728
## [2.14.4] - 2025-11-25
2829

inc/clientinjection.class.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
*/
3030
use Glpi\Application\View\TemplateRenderer;
3131
use Glpi\Debug\Profile;
32+
use Glpi\Error\ErrorHandler;
33+
use Safe\Exceptions\InfoException;
3234

3335
use function Safe\fclose;
3436
use function Safe\filesize;
@@ -179,8 +181,12 @@ public static function processInjection(PluginDatainjectionModel $model, $entiti
179181
/** @var array $CFG_GLPI */
180182
global $CFG_GLPI;
181183

182-
// To prevent problem of execution time during injection
183-
ini_set("max_execution_time", "0");
184+
try {
185+
ini_set("max_execution_time", "0");
186+
} catch (InfoException $e) {
187+
//empty catch -- but keep trace of issue
188+
ErrorHandler::logCaughtException($e);
189+
}
184190

185191
// Disable recording each SQL request in $_SESSION
186192
Profile::getCurrent()->disable();

0 commit comments

Comments
 (0)