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:
Sam Minnee 2009-07-07 01:28:47 +00:00
parent cf302011b8
commit 2000087dd6

View File

@ -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);
}
}