Closed (fixed)
Project:
Webform View Reference Component
Version:
6.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 May 2010 at 12:56 UTC
Updated:
20 Jan 2011 at 22:50 UTC
The current implementation runs everything through check_plain(), which converts "&" to "&".
Reusing the model from _webform_filter_values(), an implementation of a $strict argument might be a good idea.
I've quickly hacked it by altering the _webform_viewselect_options() function to the following:
function _webform_viewselect_options($view,$args = '',$strict = TRUE) {
$options = array();
// Prepare field array - Reusing CCK nodreference function _nodereference_potential_references()
$field['advanced_view'] = $view;
$field['advanced_view_args'] = $args;
// Field name used for cid in _nodereference_potential_references
$field['field_name'] = md5($view.$args);
$data = _nodereference_potential_references($field);
foreach($data as $index => $row) {
$options[$index] = ($strict)? check_plain($row['title']) : $row['title'];
}
return $options;
}
And then calling it using a $strict=false arg from _webform_render_viewselect() (line #179) like this:
$options = _webform_viewselect_options($component['extra']['advanced']['advanced_view'],$args, FALSE);
_webform_filter_values() uses filter_xss() instead of check_plan(), but as I'm unsure of the effects, I'll leave it using check_plain for now.
Comments
Comment #1
freakalis commentedThank you for reporting and added solution, this has been fixed in the latest dev.