hi,
well, i look to the code, and i see, that the bug with "hex 0A" in the filed happens on:
addressbook/inc/class.sifaddressbook.inc.php
~line 130
function characterData($_parser, $_data) {
$this->sifData .= $_data;
error_log(sprintf(“THIS->sifData=>%s<”,$this->sifData));
}
and i see, that there the string comes back as: (in php.log)
THIS->sifData=>“
NAME”<
so there is also the \n (hex 0a) also in the front of the field
but this should be
THIS->sifData=>“NAME”< !
and the function above is vcalled from: line ~146
xml_set_character_data_handler($this->xml_parser, “characterData”);
it looks like, that the xml_parser doesn’t do that correct …h mm serious.
normally \n shouldn’t be inside - it should be “” (empty) on a line with:
and if the line is: 1234@123.co then it give back:
“
1234@123.co”
well - can somebody look if he ahad the same issue ?
maybe it could be, that the version number of XML expat code have an bug…
or we can include the “substr” to the “function characterData” , that the values comes clean back.
cu camel
[/quote]
well some news…
ex: (parts of full xml data) the xml data =
<?xml version="1.0" encoding="UTF-8"?>
DEFAULT_FOLDER_Test
1234@123.co
SMTP
0987654321
0987654321
well now the xmlparser function is:
xml_set_element_handler($this->xml_parser, “startElement”, “endElement”);
startElement and Endelement is the function from the $sifMapping
well it looks ok.
but then:
xml_set_character_data_handler($this->xml_parser, “characterData”);
line ~ 100
function characterData take the values between this xml structure.
function characterData($_parser, $_data) {
$this->sifData .= $_data;
error_log(sprintf("characterData -> THIS->sifData=>%s<",$this->sifData));
}
and here is the bug !!!
so it’s automatic take the carrige return to the value.
because startElement and endelement (alos from other group) found the carrige retunr and so place it to the characterData.
i can’t belive that nobody haven’t found this bug before or doesn’t get this bug.
cu camel
i hope this help to think about.
(PLS: in the bug tracker ai can’t only write the bug, but i can’t make another writings to the bug, so there is not so easy to handle this -> it’s not usable for me