Little fix for new string quoting

release-0.6
thomascube 18 years ago
parent b66d40776c
commit f91a499046

@ -1020,7 +1020,7 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
// if the replace tables for XML and JS are not yet defined // if the replace tables for XML and JS are not yet defined
if (!$js_rep_table) if (!$js_rep_table)
{ {
$js_rep_tabl = $xml_rep_table = array(); $js_rep_table = $xml_rep_table = array();
$xml_rep_table['&'] = '&'; $xml_rep_table['&'] = '&';
for ($c=160; $c<256; $c++) // can be increased to support more charsets for ($c=160; $c<256; $c++) // can be increased to support more charsets
@ -1032,7 +1032,6 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
$js_rep_table[Chr($c)] = sprintf("\u%s%s", str_repeat('0', 4-strlen($hex)), $hex); $js_rep_table[Chr($c)] = sprintf("\u%s%s", str_repeat('0', 4-strlen($hex)), $hex);
} }
$js_rep_table['"'] = sprintf("\u%s%s", str_repeat('0', 4-strlen(dechex(34))), dechex(34));
$xml_rep_table['"'] = '&quot;'; $xml_rep_table['"'] = '&quot;';
} }

@ -56,9 +56,9 @@ foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath)
$content = sprintf('<a href="#delete" onclick="return %s.command(\\\'remove-attachment\\\', \\\'rcmfile%d\\\', this)" title="%s">%s</a>%s', $content = sprintf('<a href="#delete" onclick="return %s.command(\\\'remove-attachment\\\', \\\'rcmfile%d\\\', this)" title="%s">%s</a>%s',
$JS_OBJECT_NAME, $JS_OBJECT_NAME,
$id, $id,
JQ(Q(rcube_label('delete'))), Q(rcube_label('delete')),
JQ($button), $button,
JQ(Q($_FILES['_attachments']['name'][$i]))); Q($_FILES['_attachments']['name'][$i]));
$response .= sprintf('parent.%s.add2attachment_list(\'rcmfile%d\',\'%s\');', $response .= sprintf('parent.%s.add2attachment_list(\'rcmfile%d\',\'%s\');',
$JS_OBJECT_NAME, $JS_OBJECT_NAME,

Loading…
Cancel
Save