Avoid hexadecimal directory names where possible
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 24 Oct 2005 00:43:49 +0000 (00:43 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 24 Oct 2005 00:43:49 +0000 (00:43 +0000)
maintenance/dumpHTML.inc
skins/htmldump/lookup.js

index ec9f710..250f8d5 100644 (file)
@@ -616,7 +616,7 @@ ENDTEXT;
                                $dir .= '_';
                        } else {
                                $c = $chars[$i];
-                               if ( ord( $c ) >= 128 || ctype_alnum( $c ) ) {
+                               if ( ord( $c ) >= 128 || preg_match( '/[a-zA-Z0-9!#$%&()+,[\]^_`{}-]/', $c ) ) {
                                        if ( function_exists( 'mb_strtolower' ) ) {
                                                $dir .= mb_strtolower( $c );
                                        } else {
index 92c06ce..469ee9a 100644 (file)
@@ -56,10 +56,10 @@ function getHashedDirectory(pdbk, depth) {
                        c = dbk.charAt(i);
                        cc = dbk.charCodeAt(i);
                        
-                       if (cc >= 128 || /[a-zA-Z0-9]/.exec(c)) {
+                       if (cc >= 128 || /[a-zA-Z0-9!#$%&()+,[\]^_`{}-]/.exec(c)) {
                                dir += c.toLowerCase();
                        } else {
-                               dir += binl2hex([cc]);
+                               dir += binl2hex([cc]).substr(0,2).toUpperCase();
                        }
                }
        }