From 344763ad4e90e41c8a94b0a69a527ff2d6319ab5 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sat, 2 Apr 2011 03:32:13 +0100 Subject: FS#2122 alter SafeFN safe and post indicator characters. Note, any filenames encoded with the previous SafeFN scheme will need to be converted to the new scheme. Users of the old SafeFN scheme should not use this new scheme until after converting their filenames. --- inc/SafeFN.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/SafeFN.class.php') diff --git a/inc/SafeFN.class.php b/inc/SafeFN.class.php index ac6698a63..43b19e9ab 100644 --- a/inc/SafeFN.class.php +++ b/inc/SafeFN.class.php @@ -16,9 +16,9 @@ class SafeFN { // 'safe' characters are a superset of $plain, $pre_indicator and $post_indicator - private static $plain = '-/_0123456789abcdefghijklmnopqrstuvwxyz'; // these characters aren't converted + private static $plain = '-./[_0123456789abcdefghijklmnopqrstuvwxyz'; // these characters aren't converted private static $pre_indicator = '%'; - private static $post_indicator = '.'; + private static $post_indicator = ']'; /** * Convert an UTF-8 string to a safe ASCII String @@ -37,7 +37,7 @@ class SafeFN { * - reduce codepoint value for non-printable ASCII characters (0x00 - 0x1f). Space becomes our zero. * - convert reduced value to base36 (0-9a-z) * - append $pre_indicator characater followed by base36 string to output, set converted flag - * continue to next character) + * (continue to next character) * * @param string $filename a utf8 string, should only include printable characters - not 0x00-0x1f * @return string an encoded representation of $filename using only 'safe' ASCII characters -- cgit v1.2.3