Use DeconstructURL rather than rawurldecode since it strips base_name components as well.

This commit is contained in:
Andrew McMillan 2012-07-09 00:53:25 +12:00
parent 07bce5f8bd
commit 4f81556586
3 changed files with 5 additions and 5 deletions

View File

@ -412,7 +412,7 @@ EOSQL;
if ( $this->collection_path == $this->path."/" ) {
$this->path .= '/';
dbg_error_log( "caldav", "Path is actually a collection - sending Content-Location header." );
header( "Content-Loca3tion: ".ConstructURL($this->path) );
header( "Content-Location: ".ConstructURL($this->path) );
}
if ( preg_match( '#^(/principals/[^/]+/[^/]+)/?$#', $this->path, $matches) ) {
// Force a depth of 0 on these, which are at the wrong URL.

View File

@ -1633,13 +1633,13 @@ EOQRY;
$reply->DAVElement( $prop, 'owner', $reply->href( ConstructURL($this->collection->bound_from )) );
}
else {
$reply->DAVElement( $prop, 'owner', $reply->href( ConstructURL(rawurldecode($this->principal_url())) ) );
$reply->DAVElement( $prop, 'owner', $reply->href( ConstructURL(DeconstructURL($this->principal_url())) ) );
}
break;
case 'DAV::add-member':
if ( ! $this->_is_collection ) return false;
$reply->DAVElement( $prop, 'add-member', $reply->href(ConstructURL(rawurldecode($this->url())).'?add-member') );
$reply->DAVElement( $prop, 'add-member', $reply->href(ConstructURL(DeconstructURL($this->url())).'?add-member') );
break;
// Empty tag responses.
@ -1742,7 +1742,7 @@ EOQRY;
break;
case 'DAV::current-user-principal':
$prop->NewElement('current-user-principal', $reply->href( ConstructURL(rawurldecode($request->principal->url())) ) );
$prop->NewElement('current-user-principal', $reply->href( ConstructURL(DeconstructURL($request->principal->url())) ) );
break;
case 'SOME-DENIED-PROPERTY': /** indicating the style for future expansion */

View File

@ -487,7 +487,7 @@ class Principal {
default:
fatal('Unknown internal URL type "'.$type.'"');
}
return ConstructURL(rawurldecode($result));
return ConstructURL(DeconstructURL($result));
}