Don't use addslashes() which could produce unexpected results when magic_quotes_sybase is on
| | |
| | | } |
| | | |
| | | $xml_rep_table['"'] = '"'; |
| | | $js_rep_table['"'] = '\\"'; |
| | | $js_rep_table["'"] = "\\'"; |
| | | } |
| | | |
| | | // encode for XML |
| | |
| | | if ($charset!='UTF-8') |
| | | $str = rcube_charset_convert($str, RCMAIL_CHARSET,$charset); |
| | | |
| | | return preg_replace(array("/\r?\n/", "/\r/", '/<\\//'), array('\n', '\n', '<\\/'), addslashes(strtr($str, $js_rep_table))); |
| | | return preg_replace(array("/\r?\n/", "/\r/", '/<\\//'), array('\n', '\n', '<\\/'), strtr($str, $js_rep_table)); |
| | | } |
| | | |
| | | // no encoding given -> return original string |
| | |
| | | |
| | | $filename = $part->filename ? $part->filename : ($MESSAGE->subject ? $MESSAGE->subject : 'roundcube') . '.'.$ctype_secondary; |
| | | $filename = abbreviate_string($part->filename, 55); |
| | | $filename = $browser->ie ? rawurlencode($filename) : addslashes($filename); |
| | | $filename = $browser->ie ? rawurlencode($filename) : addcslashes($filename, '"'); |
| | | $disposition = !empty($_GET['_download']) ? 'attachment' : 'inline'; |
| | | |
| | | header("Content-Disposition: $disposition; filename=\"$filename\""); |