mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Fixed application of parameterised extensions with Object::add_extension()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81173 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
cf302011b8
commit
2000087dd6
@ -368,7 +368,7 @@ abstract class Object {
|
||||
* as a string, e.g. "Versioned" or "Translatable('Param')"
|
||||
*/
|
||||
public static function add_extension($class, $extension) {
|
||||
if(!preg_match('/([^(]*)/', $extension, $matches)) {
|
||||
if(!preg_match('/^([^(]*)/', $extension, $matches)) {
|
||||
return false;
|
||||
}
|
||||
$extensionClass = $matches[1];
|
||||
@ -393,7 +393,7 @@ abstract class Object {
|
||||
|
||||
// load statics now for DataObject classes
|
||||
if(is_subclass_of($class, 'DataObject')) {
|
||||
DataObjectDecorator::load_extra_statics($class, $extension);
|
||||
DataObjectDecorator::load_extra_statics($class, $extensionClass);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user