[-] FO: FIX #PSCFV-5703 quotes in modules translations break javascript execution

This commit is contained in:
Rémi Gaillard
2012-12-07 17:23:06 +01:00
parent 6dd0a04ed0
commit cd7cc208e8
2 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -116,7 +116,7 @@ class TranslateCore
* @param string $source
* @return string
*/
public static function getModuleTranslation($module, $string, $source, $sprintf = null)
public static function getModuleTranslation($module, $string, $source, $sprintf = null, $js = false)
{
global $_MODULES, $_MODULE, $_LANGADM;
@@ -126,7 +126,6 @@ class TranslateCore
static $translations_merged = array();
$name = $module instanceof Module ? $module->name : $module;
if (!isset($translations_merged[$name]))
{
$filesByPriority = array(
@@ -175,6 +174,9 @@ class TranslateCore
if ($sprintf !== null)
$ret = Translate::checkAndReplaceArgs($ret, $sprintf);
if ($js)
$ret = addslashes($ret);
$lang_cache[$cache_key] = str_replace('"', '"', $ret);
}
return $lang_cache[$cache_key];