Use already existing addTrailingSlash function
authorMichael McAndrew <michaelmcandrew@thirdsectordesign.org>
Tue, 27 Sep 2016 20:34:18 +0000 (21:34 +0100)
committerGitHub <noreply@github.com>
Tue, 27 Sep 2016 20:34:18 +0000 (21:34 +0100)
CRM/Utils/File.php

index 268373bad18dbbc16ed874f9c851ad1868cd3352..284b71a5ea31d9b53598fb3d3779830e26779141 100644 (file)
@@ -605,8 +605,7 @@ HTACCESS;
     $basePath = ($basePath === NULL) ? self::baseFilePath() : $basePath;
 
     // ensure that $basePath has a trailing slash
-    $basePath = (substr($basePath, -strlen(DIRECTORY_SEPARATOR)) != DIRECTORY_SEPARATOR) ? $basePath . DIRECTORY_SEPARATOR : $basePath;
-
+    $basePath = self::addTrailingSlash($basePath);
     return $basePath . $directory;
   }