mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Ensure that any white space is stripped in FieldSet::dataFieldByName() and FieldSet::fieldByName()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77650 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c4071d3521
commit
bb5eff8bed
@ -288,7 +288,7 @@ class FieldSet extends DataObjectSet {
|
||||
else $remainder = null;
|
||||
|
||||
foreach($this->items as $child) {
|
||||
if($name == $child->Name() || $name == $child->id) {
|
||||
if(trim($name) == trim($child->Name()) || $name == $child->id) {
|
||||
if($remainder) {
|
||||
if($child->isComposite()) {
|
||||
return $child->fieldByName($remainder);
|
||||
@ -313,7 +313,7 @@ class FieldSet extends DataObjectSet {
|
||||
public function dataFieldByName($name) {
|
||||
if($dataFields = $this->dataFields()) {
|
||||
foreach($dataFields as $child) {
|
||||
if($name == $child->Name() || $name == $child->id) return $child;
|
||||
if(trim($name) == trim($child->Name()) || $name == $child->id) return $child;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user