Make parser more tolerant for message structure errors (reported by Manuel Giorgini)

release-0.6
thomascube 17 years ago
parent 532844b677
commit 63749a1a1f

@ -56,8 +56,10 @@ function iml_ParseBSString($str){
for ($i=0; $i<$len; $i++){ for ($i=0; $i<$len; $i++){
if ($str[$i] == "\"") $in_quote = ($in_quote + 1) % 2; if ($str[$i] == "\"") $in_quote = ($in_quote + 1) % 2;
else if (!$in_quote){ else if (!$in_quote){
if ($str[$i] == " ") $id++; //space means new element if ($str[$i] == " "){ //space means new element
else if ($str[$i]=="("){ //new part $id++;
while ($str[$i+1] == " ") $i++; // skip additional spaces
} else if ($str[$i]=="("){ //new part
$i++; $i++;
$endPos = iml_ClosingParenPos($str, $i); $endPos = iml_ClosingParenPos($str, $i);
$partLen = $endPos - $i; $partLen = $endPos - $i;

Loading…
Cancel
Save