summaryrefslogtreecommitdiffstats
path: root/lib/public/util.php
diff options
context:
space:
mode:
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>2013-07-04 19:21:49 +0300
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>2013-07-09 17:46:11 +0300
commit5a3fce12a4496ec6d2903902e035af017e07f2f8 (patch)
treee8c57c0ae2e5451e1096425fa9036528c7ee3f62 /lib/public/util.php
parentcc0965b9bca53d4c6e31aed76c8eedea1d65a5c1 (diff)
downloadnextcloud-server-5a3fce12a4496ec6d2903902e035af017e07f2f8.tar.gz
nextcloud-server-5a3fce12a4496ec6d2903902e035af017e07f2f8.zip
Implement encodePath
Diffstat (limited to 'lib/public/util.php')
-rw-r--r--lib/public/util.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/public/util.php b/lib/public/util.php
index 6744c2d37bd..d69602f4507 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -355,6 +355,20 @@ class Util {
public static function sanitizeHTML( $value ) {
return(\OC_Util::sanitizeHTML($value));
}
+
+ /**
+ * @brief Public function to encode url parameters
+ *
+ * This function is used to encode path to file before output.
+ * Encoding is done according to RFC 3986 with one exception:
+ * Character '/' is preserved as is.
+ *
+ * @param string $component part of URI to encode
+ * @return string
+ */
+ public static function encodePath($component) {
+ return(\OC_Util::encodePath($component));
+ }
/**
* @brief Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.