Explorar o código

Corregido preg_replace()

Daniel Libonati %!s(int64=8) %!d(string=hai) anos
pai
achega
fd57c9cb1b
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      Admin/BaseFieldDescription.php

+ 3 - 1
Admin/BaseFieldDescription.php

@@ -396,7 +396,9 @@ abstract class BaseFieldDescription implements FieldDescriptionInterface
      */
     public static function camelize($property)
     {
-        return preg_replace(array('/(^|_| )+(.)/e', '/\.(.)/e'), array("strtoupper('\\2')", "'_'.strtoupper('\\1')"), $property);
+	return preg_replace_callback('/(^|[_. ])+(.)/', function ($match) {
+		return ('.' === $match[1] ? '_' : '') . strtoupper($match[2]);
+	}, $property);
     }
 
     /**