diff --git a/core/js/js.js b/core/js/js.js
index 7a53bb75ef5ec871d3c22b72814a4fc838aeca0a..d6483b2c22561617343b40ff5e1a7eaa1b8462db 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -67,6 +67,8 @@ OC={
 			if(type){
 				link+= '/'+type+'/';
 			}
+			if(link.substring(link.length-1) != '/')
+				link+='/';
 			link+=file;
 		}else{
 			link+='/';