Opened 13 years ago
Closed 12 years ago
#1780 closed defect (fixed)
Problem with line breaks in property fields
Reported by: | janvw | Owned by: | |
---|---|---|---|
Priority: | medium | Milestone: | 2.4 |
Component: | AJAX Viewer | Version: | 2.2.0 |
Severity: | major | Keywords: | |
Cc: | External ID: |
Description
The presence of line breaks in property (string-)fields of SDF features is causing IE7 to show an error message (unterminated string constant), see attached SDF file. This happens when clicking on a feature in the AJAX viewer. The properties of the feature are not being displayed in the properties pane. System: MGOS 2.2 final, PHP installation; IE7; Win XP pro.
Attachments (1)
Change History (8)
by , 13 years ago
Attachment: | Fundstellen_aktuell.sdf added |
---|
comment:1 by , 13 years ago
comment:2 by , 13 years ago
It's the property "Bemerkungen" Sorry, the first version I uploaded didn't contain any line breaks. The actual version does now.
comment:3 by , 13 years ago
I solved the problem by inserting a new line after line 393 in getselectedfeatures.php:
393 $val = JsonEscape($fr->GetString($propName)); String content is arbitrary 394 $val = trim(preg_replace('/\s+/',' ',$val)); new 395 break;
Properties containing line breaks are now correctly displayed in the properties pane.
follow-up: 5 comment:4 by , 13 years ago
Do you have a .net/Java equivalent solution? Basically what is similar to preg_replace in .net/Java
comment:5 by , 13 years ago
Untested possibilities:
.net:
value = JsonEscape(reader.GetString(propName)); String content is arbitrary
Regex rgx = new Regex("
s+");
value = rgx.Replace(value, " ");
value.Trim();
break;
jsp:
value = JsonEscape(reader.GetString(propName)); string content is arbitrary
value.ReplaceAll("
s+", " ");
value.trim();
break;
comment:6 by , 12 years ago
Milestone: | 2.3 → 2.4 |
---|
Can you please indicate which property in particular contains the line breaks?
Thanks