diff options
author | hubzilla <git@macgirvin.com> | 2016-06-30 09:34:22 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-30 09:34:22 +1000 |
commit | 05aba0b4dd9ce5798e2c8bb57900b03ae96a233e (patch) | |
tree | 0910b2128981452a1c61ba6b6b4683dc51568027 /vendor/sabre/dav/lib/DAV/Xml/Property/LocalHref.php | |
parent | f098600c41553bc47267a61fb47a4957046e696e (diff) | |
parent | 3102440d407fe195878b9535aae4fd0da750f437 (diff) | |
download | volse-hubzilla-05aba0b4dd9ce5798e2c8bb57900b03ae96a233e.tar.gz volse-hubzilla-05aba0b4dd9ce5798e2c8bb57900b03ae96a233e.tar.bz2 volse-hubzilla-05aba0b4dd9ce5798e2c8bb57900b03ae96a233e.zip |
Merge pull request #444 from git-marijus/dev
Merge branch sabre32 into dev
Diffstat (limited to 'vendor/sabre/dav/lib/DAV/Xml/Property/LocalHref.php')
-rw-r--r-- | vendor/sabre/dav/lib/DAV/Xml/Property/LocalHref.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/vendor/sabre/dav/lib/DAV/Xml/Property/LocalHref.php b/vendor/sabre/dav/lib/DAV/Xml/Property/LocalHref.php new file mode 100644 index 000000000..76a27b95d --- /dev/null +++ b/vendor/sabre/dav/lib/DAV/Xml/Property/LocalHref.php @@ -0,0 +1,48 @@ +<?php + +namespace Sabre\DAV\Xml\Property; + +use Sabre\HTTP; + +/** + * LocalHref property + * + * Like the Href property, this element represents {DAV:}href. The difference + * is that this is used stricly for paths on the server. The LocalHref property + * will prepare the path so it's a valid URI. + * + * These two objects behave identically: + * new LocalHref($path) + * new Href(\Sabre\HTTP\encodePath($path)) + * + * LocalPath basically ensures that your spaces are %20, and everything that + * needs to be is uri encoded. + * + * @copyright Copyright (C) fruux GmbH (https://fruux.com/) + * @author Evert Pot (http://www.rooftopsolutions.nl/) + * @license http://sabre.io/license/ Modified BSD License + */ +class LocalHref extends Href { + + /** + * Constructor + * + * You must either pass a string for a single href, or an array of hrefs. + * + * If auto-prefix is set to false, the hrefs will be treated as absolute + * and not relative to the servers base uri. + * + * @param string|string[] $href + */ + function __construct($hrefs) { + + parent::__construct(array_map( + function($href) { + return \Sabre\HTTP\encodePath($href); + }, + (array)$hrefs + )); + + } + +} |