mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-09 06:50:35 +01:00
Fixes to detect base64 encoded input fields for ldif
This commit is contained in:
parent
0f6b8c94d1
commit
4a1a077a60
@ -95,10 +95,24 @@
|
|||||||
}
|
}
|
||||||
} elseif ($this->type == 'ldif') {
|
} elseif ($this->type == 'ldif') {
|
||||||
while ($data = fgets($fp,8000)) {
|
while ($data = fgets($fp,8000)) {
|
||||||
list($name,$value,$url) = split(':', $data);
|
$url = "";
|
||||||
|
list($name,$value,$extra) = split(':', $data);
|
||||||
if (substr($name,0,2) == 'dn') {
|
if (substr($name,0,2) == 'dn') {
|
||||||
$buffer = $this->import_start_record($buffer);
|
$buffer = $this->import_start_record($buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$test = trim($value);
|
||||||
|
if ($name && !empty($test) && $extra) {
|
||||||
|
// Probable url string
|
||||||
|
$url = $test;
|
||||||
|
$value = $extra;
|
||||||
|
} elseif ($name && empty($test) && $extra) {
|
||||||
|
// Probable multiline encoding
|
||||||
|
$newval = base64_decode(trim($extra));
|
||||||
|
$value = $newval;
|
||||||
|
echo $name.':'.$value;
|
||||||
|
}
|
||||||
|
|
||||||
if ($name && $value) {
|
if ($name && $value) {
|
||||||
$test = split(',mail=',$value);
|
$test = split(',mail=',$value);
|
||||||
if ($test[1]) {
|
if ($test[1]) {
|
||||||
@ -107,7 +121,7 @@
|
|||||||
}
|
}
|
||||||
if ($url) {
|
if ($url) {
|
||||||
$name = "homeurl";
|
$name = "homeurl";
|
||||||
$value = $value . ':' . $url;
|
$value = $url. ':' . $value;
|
||||||
}
|
}
|
||||||
//echo '<br>'.$j.': '.$name.' => '.$value;
|
//echo '<br>'.$j.': '.$name.' => '.$value;
|
||||||
if ($this->import[$name] != "" && $value != "") {
|
if ($this->import[$name] != "" && $value != "") {
|
||||||
|
Loading…
Reference in New Issue
Block a user