summaryrefslogtreecommitdiff
path: root/inc/SafeFN.class.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2011-04-02 03:32:13 +0100
committerChristopher Smith <chris@jalakai.co.uk>2011-04-02 03:32:13 +0100
commit344763ad4e90e41c8a94b0a69a527ff2d6319ab5 (patch)
treede34196c9cc3de0bee4a4074eed37139f12c3feb /inc/SafeFN.class.php
parentd0b3f06b8b1835b2c332d9b5ac06fe68d890bf5e (diff)
downloadrpg-344763ad4e90e41c8a94b0a69a527ff2d6319ab5.tar.gz
rpg-344763ad4e90e41c8a94b0a69a527ff2d6319ab5.tar.bz2
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.
Diffstat (limited to 'inc/SafeFN.class.php')
-rw-r--r--inc/SafeFN.class.php6
1 files changed, 3 insertions, 3 deletions
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