Private GIT

Skip to content
Snippets Groups Projects
Commit b9c99447 authored by Gary Allan's avatar Gary Allan
Browse files

Bugfix: Changed values in address notification emails are truncated after a...

Bugfix: Changed values in address notification emails are truncated after a colon. Fixes #2203 #2554
parent 74108af0
No related branches found
No related tags found
No related merge requests found
......@@ -739,24 +739,25 @@ class Common_functions {
*/
public function array_to_log ($logs, $changelog = false) {
$result = "";
# reformat
if(is_array($logs)) {
// changelog
if ($changelog===true) {
foreach($logs as $key=>$req) {
# ignore __ and PHPSESSID
if( (substr($key,0,2) == '__') || (substr($key,0,9) == 'PHPSESSID') || (substr($key,0,4) == 'pass') || $key=='plainpass' ) {}
else { $result .= "[$key]: $req<br>"; }
}
}
else {
if(!is_array($logs))
return $result;
foreach($logs as $key=>$req) {
# ignore __ and PHPSESSID
if( (substr($key,0,2) == '__') || (substr($key,0,9) == 'PHPSESSID') || (substr($key,0,4) == 'pass') || $key=='plainpass' ) {}
else { $result .= " ". $key . ": " . $req . "<br>"; }
}
}
if( substr($key,0,2)=='__' || substr($key,0,9)=='PHPSESSID' || substr($key,0,4)=='pass' || $key=='plainpass' )
continue;
// NOTE The colon character ":" is reserved as it used in array_to_log for implode/explode.
// Replace colon (U+003A) with alternative characters.
// Using JSON encode/decode would be more appropiate but we need to maintain backwards compatibility with historical changelog/logs data in the database.
if ($req == "mac")
$req = strtr($req, ':', '-'); # Mac-addresses, replace Colon U+003A with hyphen U+002D
if (strpos($req, ':')!==false)
$req = strtr($req, ':', '.'); # Default, replace Colon U+003A with Full Stop U+002E.
$result .= ($changelog===true) ? "[$key]: $req<br>" : " ". $key . ": " . $req . "<br>";
}
return $result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment