{"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/core/pulls/comments/30620529","id":30620529,"diff_hunk":"@@ -0,0 +1,107 @@\n+/**\n+* ownCloud\n+*\n+* @author Vincent Petry\n+* @copyright 2015 Vincent Petry <pvince81@owncloud.com>\n+*\n+* This library is free software; you can redistribute it and/or\n+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE\n+* License as published by the Free Software Foundation; either\n+* version 3 of the License, or any later version.\n+*\n+* This library is distributed in the hope that it will be useful,\n+* but WITHOUT ANY WARRANTY; without even the implied warranty of\n+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.\n+*\n+* You should have received a copy of the GNU Affero General Public\n+* License along with this library.  If not, see <http://www.gnu.org/licenses/>.\n+*\n+*/\n+\n+describe('OCA.Sharing.PublicApp tests', function() {\n+\tvar App = OCA.Sharing.PublicApp;\n+\tvar $preview;\n+\tvar fileListIn;\n+\tvar fileListOut;\n+\n+\tbeforeEach(function() {\n+\t\t$preview = $('<div id=\"preview\"></div>');\n+\t\t$('#testArea').append($preview);\n+\t\t$preview.append(\n+\t\t\t'<div id=\"mimetype\"></div>' +\n+\t\t\t'<div id=\"mimetypeIcon\"></div>' +\n+\t\t\t'<input type=\"hidden\" id=\"sharingToken\" value=\"sh4tok\"></input>'\n+\t\t);\n+\t});\n+\n+\tdescribe('File list', function() {\n+\t\t// TODO: this should be moved to a separate file once the PublicFileList is extracted from public.js\n+\t\tbeforeEach(function() {\n+\t\t\t$preview.append(\n+\t\t\t\t'<div id=\"app-content-files\">' +\n+\t\t\t\t// init horrible parameters\n+\t\t\t\t'<input type=\"hidden\" id=\"dir\" value=\"/subdir\"/>' +\n+\t\t\t\t'<input type=\"hidden\" id=\"permissions\" value=\"31\"/>' +\n+\t\t\t\t// dummy controls\n+\t\t\t\t'<div id=\"controls\">' +\n+\t\t\t\t'   <div class=\"actions creatable\"></div>' +\n+\t\t\t\t'   <div class=\"notCreatable\"></div>' +\n+\t\t\t\t'</div>' +\n+\t\t\t\t// uploader\n+\t\t\t\t'<input type=\"file\" id=\"file_upload_start\" name=\"files[]\" multiple=\"multiple\">' +\n+\t\t\t\t// dummy table\n+\t\t\t\t// TODO: at some point this will be rendered by the fileList class itself!\n+\t\t\t\t'<table id=\"filestable\">' +\n+\t\t\t\t'<thead><tr>' +\n+\t\t\t\t'<th id=\"headerName\" class=\"hidden column-name\">' +\n+\t\t\t\t'<input type=\"checkbox\" id=\"select_all_files\" class=\"select-all\">' +\n+\t\t\t\t'<a class=\"name columntitle\" data-sort=\"name\"><span>Name</span><span class=\"sort-indicator\"></span></a>' +\n+\t\t\t\t'<span class=\"selectedActions hidden\">' +\n+\t\t\t\t'<a href class=\"download\">Download</a>' +\n+\t\t\t\t'</th>' +\n+\t\t\t\t'<th class=\"hidden column-size\"><a class=\"columntitle\" data-sort=\"size\"><span class=\"sort-indicator\"></span></a></th>' +\n+\t\t\t\t'<th class=\"hidden column-mtime\"><a class=\"columntitle\" data-sort=\"mtime\"><span class=\"sort-indicator\"></span></a></th>' +\n+\t\t\t\t'</tr></thead>' +\n+\t\t\t\t'<tbody id=\"fileList\"></tbody>' +\n+\t\t\t\t'<tfoot></tfoot>' +\n+\t\t\t\t'</table>' +\n+\t\t\t\t// TODO: move to handlebars template\n+\t\t\t\t'<div id=\"emptycontent\"><h2>Empty content message</h2><p class=\"uploadmessage\">Upload message</p></div>' +\n+\t\t\t\t'<div class=\"nofilterresults hidden\"></div>' +\n+\t\t\t\t'</div>'\n+\t\t\t);\n+\n+\t\t\tApp.initialize($('#preview'));\n+\t\t});\n+\t\tafterEach(function() {\n+\t\t\tApp._initialized = false;\n+\t\t});\n+\n+\t\tdescribe('Download Url', function() {\n+\t\t\tvar fileList;\n+\n+\t\t\tbeforeEach(function() {\n+\t\t\t\tfileList = App.fileList;\n+\t\t\t});\n+\n+\t\t\tit('returns correct download URL for single files', function() {\n+\t\t\t\texpect(fileList.getDownloadUrl('some file.txt'))\n+\t\t\t\t\t.toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=some%20file.txt');\n+\t\t\t\texpect(fileList.getDownloadUrl('some file.txt', '/anotherpath/abc'))\n+\t\t\t\t\t.toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fanotherpath%2Fabc&files=some%20file.txt');\n+\t\t\t\tfileList.changeDirectory('/');\n+\t\t\t\texpect(fileList.getDownloadUrl('some file.txt'))\n+\t\t\t\t\t.toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2F&files=some%20file.txt');\n+\t\t\t});\n+\t\t\tit('returns correct download URL for multiple files', function() {\n+\t\t\t\texpect(fileList.getDownloadUrl(['a b c.txt', 'd e f.txt']))\n+\t\t\t\t\t.toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D');\n+\t\t\t});\n+\t\t\tit('returns the correct ajax URL', function() {\n+\t\t\t\texpect(fileList.getAjaxUrl('test', {a:1, b:'x y'}))\n+\t\t\t\t\t.toEqual(OC.webroot + '/index.php/apps/files_sharing/ajax/test.php?a=1&b=x%20y&t=sh4tok');\n+\t\t\t});\n+\t\t});\n+\t});\n+});","path":"apps/files_sharing/tests/js/publicAppSpec.js","position":107,"original_position":107,"commit_id":"f7a2b5e7a948f9bd8e5fcf5b642afad3fa84ae5d","original_commit_id":"f7a2b5e7a948f9bd8e5fcf5b642afad3fa84ae5d","user":{"login":"LukasReschke","id":878997,"avatar_url":"https://avatars.githubusercontent.com/u/878997?v=3","gravatar_id":"","url":"https://api.github.com/users/LukasReschke","html_url":"https://github.com/LukasReschke","followers_url":"https://api.github.com/users/LukasReschke/followers","following_url":"https://api.github.com/users/LukasReschke/following{/other_user}","gists_url":"https://api.github.com/users/LukasReschke/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasReschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasReschke/subscriptions","organizations_url":"https://api.github.com/users/LukasReschke/orgs","repos_url":"https://api.github.com/users/LukasReschke/repos","events_url":"https://api.github.com/users/LukasReschke/events{/privacy}","received_events_url":"https://api.github.com/users/LukasReschke/received_events","type":"User","site_admin":false},"body":"Awesome @PVince81!!!!!","created_at":"2015-05-19T16:53:28Z","updated_at":"2015-05-19T16:53:28Z","html_url":"https://github.com/owncloud/core/pull/16446#discussion_r30620529","pull_request_url":"https://api.github.com/repos/owncloud/core/pulls/16446","_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments/30620529"},"html":{"href":"https://github.com/owncloud/core/pull/16446#discussion_r30620529"},"pull_request":{"href":"https://api.github.com/repos/owncloud/core/pulls/16446"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/16446","id":35728517,"html_url":"https://github.com/owncloud/core/pull/16446","diff_url":"https://github.com/owncloud/core/pull/16446.diff","patch_url":"https://github.com/owncloud/core/pull/16446.patch","issue_url":"https://api.github.com/repos/owncloud/core/issues/16446","number":16446,"state":"open","locked":false,"title":"Fix URL generation","user":{"login":"LukasReschke","id":878997,"avatar_url":"https://avatars.githubusercontent.com/u/878997?v=3","gravatar_id":"","url":"https://api.github.com/users/LukasReschke","html_url":"https://github.com/LukasReschke","followers_url":"https://api.github.com/users/LukasReschke/followers","following_url":"https://api.github.com/users/LukasReschke/following{/other_user}","gists_url":"https://api.github.com/users/LukasReschke/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasReschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasReschke/subscriptions","organizations_url":"https://api.github.com/users/LukasReschke/orgs","repos_url":"https://api.github.com/users/LukasReschke/repos","events_url":"https://api.github.com/users/LukasReschke/events{/privacy}","received_events_url":"https://api.github.com/users/LukasReschke/received_events","type":"User","site_admin":false},"body":"`params` in the `OC.generateUrl` function call only replaces all specified occurences of a key just like the l10n PHP functionality does.\r\n\r\nThis means that to build a query string we have to use `OC.buildQueryString` instead of the params parameters.\r\n\r\nFixes https://github.com/owncloud/core/issues/16336 which is a regression introduced with https://github.com/owncloud/core/commit/58a87d0babcb91aab75b45e630d2fc2fee15691e of https://github.com/owncloud/core/pull/15652.\r\n\r\nWithout this fix downloading single files from a public shared folder is not possible.\r\n\r\n<hr/>\r\n# Testplan\r\n\r\n1. Share a folder on master publicly\r\n2. Access the public link and downloading single files does download the whole folder as a ZIP\r\n3. Apply the patch, clear your cache, downloading single files and all works again","created_at":"2015-05-19T13:15:10Z","updated_at":"2015-05-19T16:53:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a46d487281352ce0afee7f49999778c41ede3c4e","assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/31","html_url":"https://github.com/owncloud/core/milestones/8.1-current","labels_url":"https://api.github.com/repos/owncloud/core/milestones/31/labels","id":912160,"number":31,"title":"8.1-current","description":"","creator":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"open_issues":119,"closed_issues":1182,"state":"open","created_at":"2014-12-22T12:04:01Z","updated_at":"2015-05-19T16:37:28Z","due_on":"2015-04-02T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/owncloud/core/pulls/16446/commits","review_comments_url":"https://api.github.com/repos/owncloud/core/pulls/16446/comments","review_comment_url":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owncloud/core/issues/16446/comments","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/f7a2b5e7a948f9bd8e5fcf5b642afad3fa84ae5d","head":{"label":"owncloud:fix-url-generation","ref":"fix-url-generation","sha":"f7a2b5e7a948f9bd8e5fcf5b642afad3fa84ae5d","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-05-19T10:20:03Z","pushed_at":"2015-05-19T16:37:11Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":"https://owncloud.org/","size":1044964,"stargazers_count":3320,"watchers_count":3320,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1062,"mirror_url":null,"open_issues_count":1824,"forks":1062,"open_issues":1824,"watchers":3320,"default_branch":"master"}},"base":{"label":"owncloud:master","ref":"master","sha":"10d1fd1306400f61ad219c976557df6e8a431f0e","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2015-05-19T10:20:03Z","pushed_at":"2015-05-19T16:37:11Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":"https://owncloud.org/","size":1044964,"stargazers_count":3320,"watchers_count":3320,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1062,"mirror_url":null,"open_issues_count":1824,"forks":1062,"open_issues":1824,"watchers":3320,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/16446"},"html":{"href":"https://github.com/owncloud/core/pull/16446"},"issue":{"href":"https://api.github.com/repos/owncloud/core/issues/16446"},"comments":{"href":"https://api.github.com/repos/owncloud/core/issues/16446/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/core/pulls/16446/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owncloud/core/pulls/16446/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/core/statuses/f7a2b5e7a948f9bd8e5fcf5b642afad3fa84ae5d"}}}}