From 180bd69dbb21dc6e53533a7d93972445b2ff922e Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Mon, 30 Jul 2012 20:52:47 +0200
Subject: [PATCH] Fix OC_API::register

---
 lib/api.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/api.php b/lib/api.php
index 00a3dc108e..fd2c621f38 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -40,8 +40,10 @@ class OC_API {
 	*/
 	public static function register($method, $url, $action, $app){
 		$name = strtolower($method).$url;
+		$name = str_replace(array('/', '{', '}'), '_', $name);
 		if(!isset(self::$actions[$name])){
-			OC_Router::create($name, $url.'.{format}')
+			OC::$router->create($name, $url.'.{_format}')
+				->defaults(array('_format'=>'xml'))
 				->action('OC_API', 'call');
 			self::$actions[$name] = array();
 		}
-- 
GitLab