SwiftFileBackend::resolveContainerPath() check the proper length
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 17 Nov 2017 23:27:49 +0000 (15:27 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 17 Nov 2017 23:37:04 +0000 (23:37 +0000)
The length sanity check should use this instead of urlencode()
see it is rawurlencode() that is actually used.

Change-Id: I5632e30c14c8ab27c8324c3e31311ca8bff7c162

includes/libs/filebackend/SwiftFileBackend.php

index f50d26b..373ad93 100644 (file)
@@ -158,7 +158,7 @@ class SwiftFileBackend extends FileBackendStore {
        protected function resolveContainerPath( $container, $relStoragePath ) {
                if ( !mb_check_encoding( $relStoragePath, 'UTF-8' ) ) {
                        return null; // not UTF-8, makes it hard to use CF and the swift HTTP API
-               } elseif ( strlen( urlencode( $relStoragePath ) ) > 1024 ) {
+               } elseif ( strlen( rawurlencode( $relStoragePath ) ) > 1024 ) {
                        return null; // too long for Swift
                }