Opened 6 years ago

Closed 5 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 6 years ago.

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by janvw

Attachment: Fundstellen_aktuell.sdf added

comment:1 Changed 6 years ago by jng

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

Thanks

comment:2 Changed 6 years ago by janvw

It's the property "Bemerkungen" Sorry, the first version I uploaded didn't contain any line breaks. The actual version does now.

comment:3 Changed 6 years ago by janvw

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 Changed 6 years ago by jng

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

comment:5 in reply to:  4 Changed 6 years ago by janvw

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 Changed 6 years ago by jng

Milestone: 2.32.4

comment:7 Changed 5 years ago by jng

Resolution: fixed
Status: newclosed

Fixed 2.4 branch: r6781, r6782, r6783

Fixed trunk: r6784

Note: See TracTickets for help on using tickets.