1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
From: William Desportes <williamdes@wdes.fr>
Date: Sun, 19 Mar 2023 00:08:21 +0100
Subject: Fix preg_match(): Passing null to parameter #2 ($subject) of type
string is deprecated
On remove password
Have two password for an user, edit, clear one, save changes
Origin: upstream
Forwarded: no
---
lib/PageRender.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PageRender.php b/lib/PageRender.php
index 789f94a..d404805 100644
--- a/lib/PageRender.php
+++ b/lib/PageRender.php
@@ -917,7 +917,7 @@ class PageRender extends Visitor {
protected function getAutoPostPasswordAttribute($attribute,$i) {
# If the password is already encoded, then we'll return
- if (preg_match('/^\{.+\}.+/',$attribute->getValue($i)))
+ if (preg_match('/^\{.+\}.+/',$attribute->getValue($i) ?? ''))
return;
$attribute->setPostValue(array('function'=>'PasswordEncrypt','args'=>sprintf('%%enc%%;%%%s%%',$attribute->getName())));
|