Index: trunk/phase3/includes/filerepo/backend/FSFileBackend.php |
— | — | @@ -39,18 +39,18 @@ |
40 | 40 | */ |
41 | 41 | public function __construct( array $config ) { |
42 | 42 | parent::__construct( $config ); |
| 43 | + |
| 44 | + // Remove any possible trailing slash from directories |
| 45 | + |
43 | 46 | if ( isset( $config['basePath'] ) ) { |
44 | | - if ( substr( $this->basePath, -1 ) === '/' ) { |
45 | | - $this->basePath = substr( $this->basePath, 0, -1 ); // remove trailing slash |
46 | | - } |
| 47 | + rtrim( $this->basePath, '/' ); // remove trailing slash |
47 | 48 | } else { |
48 | 49 | $this->basePath = null; // none; containers must have explicit paths |
49 | 50 | } |
| 51 | + |
50 | 52 | $this->containerPaths = (array)$config['containerPaths']; |
51 | 53 | foreach ( $this->containerPaths as &$path ) { |
52 | | - if ( substr( $path, -1 ) === '/' ) { |
53 | | - $path = substr( $path, 0, -1 ); // remove trailing slash |
54 | | - } |
| 54 | + rtrim( $path, '/' ); // remove trailing slash |
55 | 55 | } |
56 | 56 | $this->fileMode = isset( $config['fileMode'] ) |
57 | 57 | ? $config['fileMode'] |