]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/include/rcube_shared.inc
Imported Upstream version 0.7.1
[roundcube.git] / program / include / rcube_shared.inc
index 6e58ad86982c5293ae05d48ac77e1dd351a16403..fcab42950347b047d1c44983d2f4b0dd5b7d8fe3 100644 (file)
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: rcube_shared.inc 5274 2011-09-23 10:11:27Z alec $
+ $Id: rcube_shared.inc 5715 2012-01-05 10:28:24Z alec $
 
 */
 
@@ -163,52 +163,6 @@ function show_bytes($bytes)
   return $str;
 }
 
-/**
- * Convert paths like ../xxx to an absolute path using a base url
- *
- * @param string Relative path
- * @param string Base URL
- * @return string Absolute URL
- */
-function make_absolute_url($path, $base_url)
-{
-  $host_url = $base_url;
-  $abs_path = $path;
-
-  // check if path is an absolute URL
-  if (preg_match('/^[fhtps]+:\/\//', $path))
-    return $path;
-
-  // cut base_url to the last directory
-  if (strrpos($base_url, '/')>7)
-  {
-    $host_url = substr($base_url, 0, strpos($base_url, '/', 7));
-    $base_url = substr($base_url, 0, strrpos($base_url, '/'));
-  }
-
-  // $path is absolute
-  if ($path[0] == '/')
-    $abs_path = $host_url.$path;
-  else
-  {
-    // strip './' because its the same as ''
-    $path = preg_replace('/^\.\//', '', $path);
-
-    if (preg_match_all('/\.\.\//', $path, $matches, PREG_SET_ORDER))
-      foreach ($matches as $a_match)
-      {
-        if (strrpos($base_url, '/'))
-          $base_url = substr($base_url, 0, strrpos($base_url, '/'));
-
-        $path = substr($path, 3);
-      }
-
-    $abs_path = $base_url.'/'.$path;
-  }
-
-  return $abs_path;
-}
-
 /**
  * Wrapper function for wordwrap
  */