1
0

umlaut conversion

This commit is contained in:
Ian
2015-10-05 19:20:47 +02:00
parent 2b610dc791
commit fdc7c089c2

View File

@ -1943,7 +1943,7 @@ function serendipity_deletePath($dir) {
/** /**
* Transform a filename into a valid upload path * Transform a filename into a valid upload path
* ToDO: Rewrite to use converted Umlauts, eg -> ae! * ToDO: Rewrite to use converted Umlauts, eg -> ae! (use serendipity_makeFilename()?)
* *
* @access public * @access public
* @param string The input filename * @param string The input filename
@ -1954,6 +1954,8 @@ function serendipity_deletePath($dir) {
function serendipity_uploadSecure($var, $strip_paths = true, $append_slash = false) { function serendipity_uploadSecure($var, $strip_paths = true, $append_slash = false) {
$var = str_replace(' ', '_', $var); $var = str_replace(' ', '_', $var);
#$var = serendipity_makeFilename($var); // shouldn't this do? We will need to include functions_permalinks.inc.php for this!
if (function_exists('iconv') && strtolower(LANG_CHARSET) == 'utf-8') $var = iconv("utf-8", "ascii//TRANSLIT", $var);
$var = preg_replace('@[^0-9a-z\._/-]@i', '', $var); $var = preg_replace('@[^0-9a-z\._/-]@i', '', $var);
if ($strip_paths) { if ($strip_paths) {
$var = preg_replace('@(\.+[/\\\\]+)@', '/', $var); $var = preg_replace('@(\.+[/\\\\]+)@', '/', $var);