diff --git a/lib/Simples/Document.php b/lib/Simples/Document.php index 345447d..5c08829 100755 --- a/lib/Simples/Document.php +++ b/lib/Simples/Document.php @@ -144,7 +144,8 @@ protected function _export(array $data, array $options) { */ protected function _options($key, array & $options) { foreach($options['cast'] as $path => $_value) { - $_path = preg_replace('/^' . $key . '\./', '', $path) ; + $pattern = '/^' . preg_quote($key) . '\./'; + $_path = preg_replace($pattern, '', $path) ; if ($_path !== $path) { $options['cast'][$_path] = $_value ; unset($options['cast'][$path]) ;