Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
60748033
Commit
60748033
authored
Mar 17, 2016
by
Côme Chilliet
Browse files
Fixes
#4610
Fixed postalAddress special handling
parent
bc129629
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/personal/generic/class_user.inc
View file @
60748033
...
...
@@ -237,35 +237,24 @@ class PostalAddressAttribute extends TextAreaAttribute
{
function
inputValue
(
$ldapValue
)
{
$string
=
$ldapValue
;
$offset
=
0
;
$lastslash
=
NULL
;
while
(
preg_match
(
'/[\\\$]/'
,
$string
,
$m
,
PREG_OFFSET_CAPTURE
,
$offset
))
{
$offset
=
$m
[
0
][
1
]
+
1
;
if
(
$m
[
0
][
0
]
==
'\\'
)
{
if
(
$lastslash
==
$m
[
0
][
1
]
-
1
)
{
$string
=
substr_replace
(
$string
,
'\\'
,
$m
[
0
][
1
]
-
1
,
2
);
$offset
=
$m
[
0
][
1
];
$lastslash
=
NULL
;
}
else
{
$lastslash
=
$m
[
0
][
1
];
}
}
elseif
(
$m
[
0
][
0
]
==
'$'
)
{
if
(
$lastslash
==
$m
[
0
][
1
]
-
1
)
{
$string
=
substr_replace
(
$string
,
'$'
,
$m
[
0
][
1
]
-
1
,
2
);
$offset
=
$m
[
0
][
1
];
}
else
{
$string
=
substr_replace
(
$string
,
"
\n
"
,
$m
[
0
][
1
],
1
);
$offset
=
$m
[
0
][
1
];
}
}
}
return
$string
;
return
str_replace
(
array
(
'$'
,
'\24'
,
'\5C'
),
array
(
"
\n
"
,
'$'
,
'\\'
),
$ldapValue
);
}
function
computeLdapValue
()
{
return
str_replace
(
array
(
"
\r\n
"
,
"
\n
"
,
"
\r
"
),
'$'
,
addcslashes
(
$this
->
getValue
(),
'$\\'
));
return
str_replace
(
array
(
"
\r\n
"
,
"
\n
"
,
"
\r
"
),
'$'
,
str_replace
(
array
(
'\\'
,
'$'
),
array
(
'\5C'
,
'\24'
),
$this
->
getValue
()
)
);
}
}
...
...
mhamant
@mhamant
mentioned in issue
#1470 (closed)
·
Sep 02, 2017
mentioned in issue
#1470 (closed)
mentioned in issue #1470
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment