mirror of
https://github.com/silverstripe/silverstripe-restfulserver
synced 2024-10-22 14:05:58 +02:00
FIX Apply the same fix to other usage of absoluteURL()
This commit is contained in:
parent
4acfe9d1d8
commit
83cbb59c72
@ -160,11 +160,11 @@ class XMLDataFormatter extends DataFormatter
|
||||
|
||||
$fieldName = $relName . 'ID';
|
||||
if ($obj->$fieldName) {
|
||||
$href = Director::absoluteURL($this->config()->api_base . "$relClass/" . $obj->$fieldName);
|
||||
$href = Director::absoluteURL($this->config()->api_base . "$relClass/" . $obj->$fieldName . ".xml");
|
||||
} else {
|
||||
$href = Director::absoluteURL($this->config()->api_base . "$className/$id/$relName");
|
||||
$href = Director::absoluteURL($this->config()->api_base . "$className/$id/$relName" . ".xml");
|
||||
}
|
||||
$xml .= "<$relName linktype=\"has_one\" href=\"$href.xml\" id=\"" . $obj->$fieldName
|
||||
$xml .= "<$relName linktype=\"has_one\" href=\"$href\" id=\"" . $obj->$fieldName
|
||||
. "\"></$relName>\n";
|
||||
}
|
||||
|
||||
@ -190,8 +190,8 @@ class XMLDataFormatter extends DataFormatter
|
||||
$items = $obj->$relName();
|
||||
if ($items) {
|
||||
foreach ($items as $item) {
|
||||
$href = Director::absoluteURL($this->config()->api_base . "$relClass/$item->ID");
|
||||
$xml .= "<$relClass href=\"$href.xml\" id=\"{$item->ID}\"></$relClass>\n";
|
||||
$href = Director::absoluteURL($this->config()->api_base . "$relClass/$item->ID" . ".xml");
|
||||
$xml .= "<$relClass href=\"$href\" id=\"{$item->ID}\"></$relClass>\n";
|
||||
}
|
||||
}
|
||||
$xml .= "</$relName>\n";
|
||||
@ -221,8 +221,8 @@ class XMLDataFormatter extends DataFormatter
|
||||
$items = $obj->$relName();
|
||||
if ($items) {
|
||||
foreach ($items as $item) {
|
||||
$href = Director::absoluteURL($this->config()->api_base . "$relClass/$item->ID");
|
||||
$xml .= "<$relClass href=\"$href.xml\" id=\"{$item->ID}\"></$relClass>\n";
|
||||
$href = Director::absoluteURL($this->config()->api_base . "$relClass/$item->ID" . ".xml");
|
||||
$xml .= "<$relClass href=\"$href\" id=\"{$item->ID}\"></$relClass>\n";
|
||||
}
|
||||
}
|
||||
$xml .= "</$relName>\n";
|
||||
|
Loading…
Reference in New Issue
Block a user