summaryrefslogtreecommitdiffstats
path: root/3rdparty/Sabre/DAV/URLUtil.php
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-07-20 15:23:56 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-07-20 15:23:56 +0200
commite4154e68324fd9af4c7ba0b9abba3e50d5b5c56e (patch)
tree74371bd2efed92a05b2e0c0a00fb031baa58cace /3rdparty/Sabre/DAV/URLUtil.php
parentb3d7043f9cd4d252050570a4ae85f78f1ad662c2 (diff)
downloadnextcloud-server-e4154e68324fd9af4c7ba0b9abba3e50d5b5c56e.tar.gz
nextcloud-server-e4154e68324fd9af4c7ba0b9abba3e50d5b5c56e.zip
remove old files
Diffstat (limited to '3rdparty/Sabre/DAV/URLUtil.php')
-rw-r--r--3rdparty/Sabre/DAV/URLUtil.php121
1 files changed, 0 insertions, 121 deletions
diff --git a/3rdparty/Sabre/DAV/URLUtil.php b/3rdparty/Sabre/DAV/URLUtil.php
deleted file mode 100644
index 794665a44f6..00000000000
--- a/3rdparty/Sabre/DAV/URLUtil.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-
-/**
- * URL utility class
- *
- * This class provides methods to deal with encoding and decoding url (percent encoded) strings.
- *
- * It was not possible to use PHP's built-in methods for this, because some clients don't like
- * encoding of certain characters.
- *
- * Specifically, it was found that GVFS (gnome's webdav client) does not like encoding of ( and
- * ). Since these are reserved, but don't have a reserved meaning in url, these characters are
- * kept as-is.
- *
- * @package Sabre
- * @subpackage DAV
- * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
- * @author Evert Pot (http://www.rooftopsolutions.nl/)
- * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
- */
-class Sabre_DAV_URLUtil {
-
- /**
- * Encodes the path of a url.
- *
- * slashes (/) are treated as path-separators.
- *
- * @param string $path
- * @return string
- */
- static function encodePath($path) {
-
- return preg_replace_callback('/([^A-Za-z0-9_\-\.~\(\)\/])/',function($match) {
-
- return '%'.sprintf('%02x',ord($match[0]));
-
- }, $path);
-
- }
-
- /**
- * Encodes a 1 segment of a path
- *
- * Slashes are considered part of the name, and are encoded as %2f
- *
- * @param string $pathSegment
- * @return string
- */
- static function encodePathSegment($pathSegment) {
-
- return preg_replace_callback('/([^A-Za-z0-9_\-\.~\(\)])/',function($match) {
-
- return '%'.sprintf('%02x',ord($match[0]));
-
- }, $pathSegment);
- }
-
- /**
- * Decodes a url-encoded path
- *
- * @param string $path
- * @return string
- */
- static function decodePath($path) {
-
- return self::decodePathSegment($path);
-
- }
-
- /**
- * Decodes a url-encoded path segment
- *
- * @param string $path
- * @return string
- */
- static function decodePathSegment($path) {
-
- $path = rawurldecode($path);
- $encoding = mb_detect_encoding($path, array('UTF-8','ISO-8859-1'));
-
- switch($encoding) {
-
- case 'ISO-8859-1' :
- $path = utf8_encode($path);
-
- }
-
- return $path;
-
- }
-
- /**
- * Returns the 'dirname' and 'basename' for a path.
- *
- * The reason there is a custom function for this purpose, is because
- * basename() is locale aware (behaviour changes if C locale or a UTF-8 locale is used)
- * and we need a method that just operates on UTF-8 characters.
- *
- * In addition basename and dirname are platform aware, and will treat backslash (\) as a
- * directory separator on windows.
- *
- * This method returns the 2 components as an array.
- *
- * If there is no dirname, it will return an empty string. Any / appearing at the end of the
- * string is stripped off.
- *
- * @param string $path
- * @return array
- */
- static function splitPath($path) {
-
- $matches = array();
- if(preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u',$path,$matches)) {
- return array($matches[1],$matches[2]);
- } else {
- return array(null,null);
- }
-
- }
-
-}