If the string " \' " is inserted in a translatable field. For example the no behaviour text, it will give this error:

Parse error: syntax error, unexpected 't' (T_STRING) in /srv/quadrupal7/sites/all/modules/contrib/features/features.export.inc(629) : eval()'d code on line 110

\' becomes \\' so you're out of the string because the ' isn't ignored with a double backslash.
I'm not a security expert, but escaping from a string might be a security issue?

Faulty code:
$output .= $indent . " t('" . str_replace("'", "\'", $string) . "'),\n";
Shouldn't the str_replace($string) be replaced by a addslashes($string) function?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

StefanPr’s picture

This fixes it.

StefanPr’s picture

Status: Active » Needs review
StefanPr’s picture

Issue summary: View changes

Status: Needs review » Needs work

The last submitted patch, 1: views-backslash_localization_bug-2530164-1.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: views-backslash_localization_bug-2530164-1.patch, failed testing.