From 9803fd6b2eaa852005e07d4c56de1fc27deec973 Mon Sep 17 00:00:00 2001 From: Aaron Date: Fri, 10 Aug 2012 14:25:59 -0700 Subject: [PATCH] [FileBackend] Added UTF-8 restriction to file names to avoid CF breakage. Change-Id: Id0f246c80f2595fba96e99b3bbe778e89dbc6e84 --- includes/filebackend/SwiftFileBackend.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 5be86e6807..5fe568a2c9 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -116,7 +116,9 @@ class SwiftFileBackend extends FileBackendStore { * @return null */ protected function resolveContainerPath( $container, $relStoragePath ) { - if ( strlen( urlencode( $relStoragePath ) ) > 1024 ) { + if ( !mb_check_encoding( $relStoragePath, 'UTF-8' ) ) { // mb_string required by CF + return null; // not UTF-8, makes it hard to use CF and the swift HTTP API + } elseif ( strlen( urlencode( $relStoragePath ) ) > 1024 ) { return null; // too long for Swift } return $relStoragePath; -- 2.20.1