Problem/Motivation

The ui_limit field can be submitted with different line endings depending on the platform of the client/browser. Display Suite calls explode("\n", ...), which leaves a hanging "\r".

Proposed resolution

Remove all "\r" before storing this field. Simple diff -u patch below:

--- ds/modules/ds_ui/includes/ds.fields.inc        2012-10-25 16:15:01.030283426 -0400
+++ ds/modules/ds_ui/includes/ds.fields.inc     2012-10-25 16:14:45.812437329 -0400
@@ -209,7 +209,7 @@
   $field->properties = array();
   $field->field = $form_state['values']['field'];
   $field->label = $form_state['values']['name'];
-  $field->ui_limit = $form_state['values']['ui_limit'];
+  $field->ui_limit = str_replace("\r", '', $form_state['values']['ui_limit']);
 
   $entities = $form_state['values']['entities'];
   foreach ($entities as $key => $value) {

Comments

swentel’s picture

Status: Needs review » Fixed

Funny one, thanks, committed and pushed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.