Skip to content
Snippets Groups Projects
Verified Commit d9d2af63 authored by William Desportes's avatar William Desportes :sailboat:
Browse files

Add a patch for Serialization of SensitiveParameterValue

parent 97b687c5
No related branches found
No related tags found
No related merge requests found
From: William Desportes <williamdes@wdes.fr>
Date: Tue, 31 Dec 2024 18:21:27 +0100
Subject: Fix deprecation for the Serialization of SensitiveParameterValue
Uncaught Exception: Serialization of 'SensitiveParameterValue' is not allowed in /usr/share/phpldapadmin/lib/functions.php:645
Origin: vendor
Forwarded: no
---
lib/functions.php | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/lib/functions.php b/lib/functions.php
index 293df6b..1fdda23 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -642,8 +642,17 @@ function error($msg,$type='note',$redirect=null,$fatal=false,$backtrace=false) {
_('Function'),$line['function']);
if (isset($line['args'])) {
- $display = strlen(serialize($line['args'])) < 50 ? htmlspecialchars(serialize($line['args'])) : htmlspecialchars(substr(serialize($line['args']),0,50)).'...<TRUNCATED>';
- $_SESSION['backtrace'][$error]['args'] = $line['args'];
+ $args = $line['args'];
+ // Filter out SensitiveParameterValue objects
+ $args = array_map(function ($arg) {
+ if ($arg instanceof \SensitiveParameterValue) {
+ return '**SENSITIVE**';
+ }
+ return $arg;
+ }, $args);
+
+ $display = strlen(serialize($args)) < 50 ? htmlspecialchars(serialize($args)) : htmlspecialchars(substr(serialize($args),0,50)).'...<TRUNCATED>';
+ $_SESSION['backtrace'][$error]['args'] = $args;
if (file_exists(LIBDIR.'../tools/unserialize.php'))
$body .= sprintf('&nbsp;(<a href="%s?index=%s" onclick="target=\'backtrace\';">%s</a>)',
'../tools/unserialize.php',$error,$display);
......@@ -3,3 +3,4 @@ Update-documentation-for-Debian.patch
Update-the-VERSION-file.patch
0004-Replace-E_STRICT-by-E_DEPRECATED.patch
0005-Stop-using-xml_set_object-for-PHP-8.4.patch
0006-Fix-deprecation-for-the-Serialization-of-SensitivePa.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment