This is valid in all versions of Views (6.x-2.x, 6.x-3.x, 7.x-3.x): views_var_export() doesn't properly encode array keys:

$output .= "  '$key' => " . views_var_export($value, '  ', FALSE) . ",\n";

Should be:

$output .= "  " . views_var_export($key, '  ', FALSE) . " => " . views_var_export($value, '  ', FALSE) . ",\n";

Critical because it means that Views exports are broken as soon as an array key contains a single quote.

CommentFileSizeAuthor
#3 views_var_export.patch688 bytesiamjon
#2 views_var_export.patch689 bytesiamjon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iamjon’s picture

Assigned: Unassigned » iamjon
iamjon’s picture

Status: Active » Needs review
FileSize
689 bytes

hopefully my patching ability has improved

iamjon’s picture

FileSize
688 bytes

removed extra space from prefix

merlinofchaos’s picture

Status: Needs review » Fixed

Committed to all branches.

Status: Fixed » Closed (fixed)

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