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)

Fundstellen_aktuell.sdf (350.0 KB ) - added by janvw 13 years ago.

Download all attachments as: .zip

Change History (8)

by janvw, 13 years ago

Attachment: Fundstellen_aktuell.sdf added

comment:1 by jng, 13 years ago

Can you please indicate which property in particular contains the line breaks?

Thanks

comment:2 by janvw, 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 janvw, 12 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.

comment:4 by jng, 12 years ago

Do you have a .net/Java equivalent solution? Basically what is similar to preg_replace in .net/Java

in reply to:  4 comment:5 by janvw, 12 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 jng, 12 years ago

Milestone: 2.32.4

comment:7 by jng, 12 years ago

Resolution: fixed
Status: newclosed

Fixed 2.4 branch: r6781, r6782, r6783

Fixed trunk: r6784

Note: See TracTickets for help on using tickets.