← Back to team overview

registry team mailing list archive

[Branch ~pressflow/pressflow/6] Rev 99: Prevent doubled slashes in absolute paths.

 

------------------------------------------------------------
revno: 99
committer: David Strauss <david@xxxxxxxxxxxxxxxx>
branch nick: 6
timestamp: Mon 2011-04-11 11:32:39 -0700
message:
  Prevent doubled slashes in absolute paths.
modified:
  includes/file.inc


--
lp:pressflow
https://code.launchpad.net/~pressflow/pressflow/6

Your team Registry Administrators is subscribed to branch lp:pressflow.
To unsubscribe from this branch go to https://code.launchpad.net/~pressflow/pressflow/6/+edit-subscription
=== modified file 'includes/file.inc'
--- includes/file.inc	2011-02-23 04:31:05 +0000
+++ includes/file.inc	2011-04-11 18:32:39 +0000
@@ -77,7 +77,7 @@
   else {
     switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {
       case FILE_DOWNLOADS_PUBLIC:
-        return base_path() . $path;
+        return rtrim(base_path(), '/') . '/' . ltrim($path, '/');
       case FILE_DOWNLOADS_PRIVATE:
         // Strip file_directory_path from $path. Private downloads' URLs are
         // rewritten to be served relatively to system/files (which is a menu