mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Sanitise GridFieldAddNewMultiClassHandler::Link()
This commit is contained in:
parent
08ccb15bdb
commit
57acb83546
@ -265,7 +265,8 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
|
||||
* Sanitise a model class' name for inclusion in a link
|
||||
* @return string
|
||||
*/
|
||||
protected function sanitiseClassName($class) {
|
||||
protected function sanitiseClassName($class)
|
||||
{
|
||||
return str_replace('\\', '-', $class);
|
||||
}
|
||||
|
||||
@ -273,7 +274,8 @@ class GridFieldAddNewMultiClass implements GridField_HTMLProvider, GridField_URL
|
||||
* Unsanitise a model class' name from a URL param
|
||||
* @return string
|
||||
*/
|
||||
protected function unsanitiseClassName($class) {
|
||||
protected function unsanitiseClassName($class)
|
||||
{
|
||||
return str_replace('-', '\\', $class);
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,18 @@ class GridFieldAddNewMultiClassHandler extends GridFieldDetailForm_ItemRequest
|
||||
return Controller::join_links(
|
||||
$this->gridField->Link(),
|
||||
'add-multi-class',
|
||||
get_class($this->record)
|
||||
$this->sanitiseClassName(get_class($this->record))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sanitise a model class' name for inclusion in a link
|
||||
* @return string
|
||||
*/
|
||||
protected function sanitiseClassName($class)
|
||||
{
|
||||
return str_replace('\\', '-', $class);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user