/** * Decodes the URLs in href attributes of PROPFIND responses. * * Konqueror does not use the <displayname> property (which is also URL * encoded), but the <href> tag of the response to determine the displayed * resource names. It expects the content to be un-encoded. * * This method calls the parent method and replaces the content of all * <href> elements in the DOM tree. * * @param ezcWebdavPropFindResponse $response * @return ezcWebdavXmlDisplayInformation */ protected function processPropFindResponse(ezcWebdavPropFindResponse $response) { $xmlDisplayInfo = parent::processPropFindResponse($response); $hrefElements = $xmlDisplayInfo->body->getElementsByTagName('href'); foreach ($hrefElements as $href) { $href->nodeValue = urldecode($href->nodeValue); } return $xmlDisplayInfo; }
/** * Post-processes <href/> XML elements to contain relative URIs. * * This is needed by Nautilus when auth is enabled. * * @param ezcWebdavPropFindResponse $response * @return ezcWebdavXmlDisplayInformation */ protected function processPropFindResponse(ezcWebdavPropFindResponse $response) { $xmlDispInfo = parent::processPropFindResponse($response); $subResponses = $xmlDispInfo->body->getElementsByTagNameNS(ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'response'); foreach ($subResponses as $subResponse) { $hrefs = $subResponse->getElementsByTagNameNS(ezcWebdavXmlTool::XML_DEFAULT_NAMESPACE, 'href'); foreach ($hrefs as $href) { $href->nodeValue = parse_url($href->nodeValue, PHP_URL_PATH); } } return $xmlDispInfo; }