diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 35637de050d81a5bfaff56ea54f159d78ca3a9bf..2e62b5cf1357ec2244bbb3be7d4eeef7f355518b 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -1477,7 +1477,7 @@ OC.Contacts={
 			}
 			var contact = params.data
 					? $('<li data-id="'+params.data.id+'" data-bookid="'+params.data.addressbookid
-						+ '" role="button"><a href="'+OC.linkTo('contacts', 'index.php')+'&id='
+						+ '" role="button"><a href="'+OC.linkTo('contacts', 'index.php')+'?id='
 						+ params.data.id+'"  style="background: url('+OC.filePath('contacts', '', 'thumbnail.php')
 						+ '?id='+params.data.id+') no-repeat scroll 0% 0% transparent;">'
 						+ params.data.displayname+'</a></li>')
diff --git a/apps/contacts/lib/search.php b/apps/contacts/lib/search.php
index 53aa2b48496a13609d6fcced0ac0125024a78fce..c86bc12c5b6ca352c65b8cae528aa1447be57b33 100644
--- a/apps/contacts/lib/search.php
+++ b/apps/contacts/lib/search.php
@@ -11,7 +11,7 @@ class OC_Search_Provider_Contacts extends OC_Search_Provider{
 			$vcards = OC_Contacts_VCard::all($addressbook['id']);
 			foreach($vcards as $vcard){
 				if(substr_count(strtolower($vcard['fullname']), strtolower($query)) > 0) {
-					$link = OCP\Util::linkTo('contacts', 'index.php').'&id='.urlencode($vcard['id']);
+					$link = OCP\Util::linkTo('contacts', 'index.php').'?id='.urlencode($vcard['id']);
 					$results[]=new OC_Search_Result($vcard['fullname'], '', $link, (string)$l->t('Contact'));//$name,$text,$link,$type
 				}
 			}
diff --git a/apps/files/index.php b/apps/files/index.php
index 79bed8e357ed8d711a89bd7a4041e9e7906cff47..ffe9493272b01407b080dc16d97a85bd38ec47bf 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -75,11 +75,11 @@ foreach( explode( '/', $dir ) as $i ){
 // make breadcrumb und filelist markup
 $list = new OCP\Template( 'files', 'part.list', '' );
 $list->assign( 'files', $files, false );
-$list->assign( 'baseURL', OCP\Util::linkTo('files', 'index.php').'&dir=', false);
+$list->assign( 'baseURL', OCP\Util::linkTo('files', 'index.php').'?dir=', false);
 $list->assign( 'downloadURL', OCP\Util::linkTo('files', 'download.php').'?file=', false);
 $breadcrumbNav = new OCP\Template( 'files', 'part.breadcrumb', '' );
 $breadcrumbNav->assign( 'breadcrumb', $breadcrumb, false );
-$breadcrumbNav->assign( 'baseURL', OCP\Util::linkTo('files', 'index.php').'&dir=', false);
+$breadcrumbNav->assign( 'baseURL', OCP\Util::linkTo('files', 'index.php').'?dir=', false);
 
 $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
 $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index b6f4d0b08967423032e19a55e3dd164d2f63dd63..cecfddbf1cff83fdfeb9255cc36a1d44d25661bc 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -168,7 +168,7 @@ FileActions.register('all','Rename',function(){return OC.imagePath('core','actio
 });
 
 FileActions.register('dir','Open','',function(filename){
-	window.location=OC.linkTo('files', 'index.php') + '&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+	window.location=OC.linkTo('files', 'index.php') + '?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
 });
 
 FileActions.setDefault('dir','Open');
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index a414c5f8303630e933e4bb7481556adb0f0ce44c..0bfc810baf2edf51ccfba849fd1e89293f430ea0 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -41,7 +41,7 @@ FileList={
 		html = $('<tr></tr>').attr({ "data-type": "dir", "data-size": size, "data-file": name});
 		td = $('<td></td>').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' });
 		td.append('<input type="checkbox" />');
-		var link_elem = $('<a></a>').attr({ "class": "name", "href": OC.linkTo('files', 'index.php')+"&dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') });
+		var link_elem = $('<a></a>').attr({ "class": "name", "href": OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') });
 		link_elem.append($('<span></span>').addClass('nametext').text(name));
 		link_elem.append($('<span></span>').attr({'class': 'uploadtext', 'currentUploads': 0}));
 		td.append(link_elem);
diff --git a/apps/files_archive/js/archive.js b/apps/files_archive/js/archive.js
index 9fb9853e299e3fde320a51cb9ca167bdbbbfacb1..48ec031be62cb7484934b7616ea6577cbe7cb437 100644
--- a/apps/files_archive/js/archive.js
+++ b/apps/files_archive/js/archive.js
@@ -8,11 +8,11 @@
 $(document).ready(function() {
 	if(typeof FileActions!=='undefined'){
 		FileActions.register('application/zip','Open','',function(filename){
-			window.location=OC.linkTo('files', 'index.php')+'&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+			window.location=OC.linkTo('files', 'index.php')+'?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
 		});
 		FileActions.setDefault('application/zip','Open');
 		FileActions.register('application/x-gzip','Open','',function(filename){
-			window.location=OC.linkTo('files', 'index.php')+'&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+			window.location=OC.linkTo('files', 'index.php')+'?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
 		});
 		FileActions.setDefault('application/x-gzip','Open');
 	}
diff --git a/apps/gallery/lib/tiles.php b/apps/gallery/lib/tiles.php
index e36d26d31913adb9bb4fae8a2a125f42265479dc..3903d2dde73e500d4ec3e0f13bb85c573bba49e5 100644
--- a/apps/gallery/lib/tiles.php
+++ b/apps/gallery/lib/tiles.php
@@ -95,11 +95,11 @@ class TileSingle extends TileBase {
 	public function get($extra = '') {
 		//	!HACK! file path needs to be encoded twice because files app decode twice url, so any special chars like + or & in filename
 		//	!HACK! will result in failing of opening them 
-		return '<a rel="images" title="'.htmlentities(basename($this->getPath())).'" href="'.\OCP\Util::linkTo('gallery','ajax/viewImage.php').'?img='.urlencode(urlencode($this->getPath())).'"><img rel="images" src="'.\OCP\Util::linkTo('gallery', 'ajax/thumbnail.php').'&filepath='.urlencode($this->getPath()).'" '.$extra.'></a>';
+		return '<a rel="images" title="'.htmlentities(basename($this->getPath())).'" href="'.\OCP\Util::linkTo('gallery','ajax/viewImage.php').'?img='.urlencode(urlencode($this->getPath())).'"><img rel="images" src="'.\OCP\Util::linkTo('gallery', 'ajax/thumbnail.php').'?filepath='.urlencode($this->getPath()).'" '.$extra.'></a>';
 	}
 	
 	public function getMiniatureSrc() {
-		return \OCP\Util::linkTo('gallery', 'ajax/thumbnail.php').'&filepath='.urlencode($this->getPath());
+		return \OCP\Util::linkTo('gallery', 'ajax/thumbnail.php').'?filepath='.urlencode($this->getPath());
 	}
 
 	public function getPath() {
diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php
index b2efd5342ffa6ec0454828e3c7294f235dd23df3..b0f220360323e0e13cd4b2475f573cd2988318ed 100644
--- a/apps/gallery/templates/index.php
+++ b/apps/gallery/templates/index.php
@@ -18,7 +18,7 @@ $(document).ready(function() {
 		for ($i = 0; $i < count($paths); $i++) {
 			$path .= urlencode($paths[$i]).'/';
 			$classess = 'crumb'.($i == count($paths)-1?' last':'');
-			echo '<div class="'.$classess.'" style="background-image:url(\''.\OCP\image_path('core','breadcrumb.png').'\')"><a href="'.\OCP\Util::linkTo('gallery', 'index.php').'&root='.$path.'">'.OCP\Util::sanitizeHTML($paths[$i]).'</a></div>';
+			echo '<div class="'.$classess.'" style="background-image:url(\''.\OCP\image_path('core','breadcrumb.png').'\')"><a href="'.\OCP\Util::linkTo('gallery', 'index.php').'?root='.$path.'">'.OCP\Util::sanitizeHTML($paths[$i]).'</a></div>';
 		}
 	}