{"action":"created","comment":{"url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/comments/27555454","id":27555454,"diff_hunk":"@@ -183,13 +200,28 @@ public function saveMedia(Media $media)\n      */\n     public function getOriginalFile(Media $media)\n     {\n-        $relativePath = sprintf(\n-            '/%s.%s',\n+        return $this->fileSystem->get($this->getFilePath($media), true);\n+    }\n+\n+    /**\n+     *\n+     *\n+     * @param Media $media\n+     * @return string\n+     */\n+    private function getFilePath(Media $media)\n+    {\n+        $filename = $media->getOriginalFilename();\n+\n+        if (!empty($this->blacklistedExtensions)) {\n+            $filename = preg_replace('/\\.('.join('|', $this->blacklistedExtensions).')$/', '.txt', $filename);\n+        }\n+\n+        return sprintf(\n+            '/%s/%s',","path":"src/Kunstmaan/MediaBundle/Helper/File/FileHandler.php","position":89,"original_position":89,"commit_id":"8489e4be07a7d4297e373e105047c9629b8783e5","original_commit_id":"8489e4be07a7d4297e373e105047c9629b8783e5","user":{"login":"wimvds","id":777114,"avatar_url":"https://avatars.githubusercontent.com/u/777114?v=3","gravatar_id":"","url":"https://api.github.com/users/wimvds","html_url":"https://github.com/wimvds","followers_url":"https://api.github.com/users/wimvds/followers","following_url":"https://api.github.com/users/wimvds/following{/other_user}","gists_url":"https://api.github.com/users/wimvds/gists{/gist_id}","starred_url":"https://api.github.com/users/wimvds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wimvds/subscriptions","organizations_url":"https://api.github.com/users/wimvds/orgs","repos_url":"https://api.github.com/users/wimvds/repos","events_url":"https://api.github.com/users/wimvds/events{/privacy}","received_events_url":"https://api.github.com/users/wimvds/received_events","type":"User","site_admin":false},"body":"Please don't create a folder per file, but group them (ie. using a variant of the old OpenMercury naming scheme).\r\n\r\nUUID : 12345678\r\nfile : original_filename.ext\r\n\r\n=> /1/2/3/4/12345678-original_filename.ext (UUID has to be used here to prevent overwriting files)\r\n","created_at":"2015-04-01T09:33:57Z","updated_at":"2015-04-01T09:33:57Z","html_url":"https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/236#discussion_r27555454","pull_request_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/236","_links":{"self":{"href":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/comments/27555454"},"html":{"href":"https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/236#discussion_r27555454"},"pull_request":{"href":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/236"}}},"pull_request":{"url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/236","id":32334291,"html_url":"https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/236","diff_url":"https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/236.diff","patch_url":"https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/236.patch","issue_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/issues/236","number":236,"state":"open","locked":false,"title":"Feature/media files originalname","user":{"login":"Devolicious","id":360302,"avatar_url":"https://avatars.githubusercontent.com/u/360302?v=3","gravatar_id":"","url":"https://api.github.com/users/Devolicious","html_url":"https://github.com/Devolicious","followers_url":"https://api.github.com/users/Devolicious/followers","following_url":"https://api.github.com/users/Devolicious/following{/other_user}","gists_url":"https://api.github.com/users/Devolicious/gists{/gist_id}","starred_url":"https://api.github.com/users/Devolicious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Devolicious/subscriptions","organizations_url":"https://api.github.com/users/Devolicious/orgs","repos_url":"https://api.github.com/users/Devolicious/repos","events_url":"https://api.github.com/users/Devolicious/events{/privacy}","received_events_url":"https://api.github.com/users/Devolicious/received_events","type":"User","site_admin":false},"body":"Keeps the original name on uploaded files and stores it in a uuid directory to prevent duplicate filenames.\r\nAlso allow to configure blacklisted extensions. Defaults are .php and .htaccess","created_at":"2015-03-31T15:32:29Z","updated_at":"2015-04-01T09:33:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be0922c551e98f2f4bc64f9269a19bb69109f2d5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/236/commits","review_comments_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/236/comments","review_comment_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/issues/236/comments","statuses_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/statuses/8489e4be07a7d4297e373e105047c9629b8783e5","head":{"label":"Devolicious:feature/media-files-originalname","ref":"feature/media-files-originalname","sha":"8489e4be07a7d4297e373e105047c9629b8783e5","user":{"login":"Devolicious","id":360302,"avatar_url":"https://avatars.githubusercontent.com/u/360302?v=3","gravatar_id":"","url":"https://api.github.com/users/Devolicious","html_url":"https://github.com/Devolicious","followers_url":"https://api.github.com/users/Devolicious/followers","following_url":"https://api.github.com/users/Devolicious/following{/other_user}","gists_url":"https://api.github.com/users/Devolicious/gists{/gist_id}","starred_url":"https://api.github.com/users/Devolicious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Devolicious/subscriptions","organizations_url":"https://api.github.com/users/Devolicious/orgs","repos_url":"https://api.github.com/users/Devolicious/repos","events_url":"https://api.github.com/users/Devolicious/events{/privacy}","received_events_url":"https://api.github.com/users/Devolicious/received_events","type":"User","site_admin":false},"repo":{"id":26432890,"name":"KunstmaanBundlesCMS","full_name":"Devolicious/KunstmaanBundlesCMS","owner":{"login":"Devolicious","id":360302,"avatar_url":"https://avatars.githubusercontent.com/u/360302?v=3","gravatar_id":"","url":"https://api.github.com/users/Devolicious","html_url":"https://github.com/Devolicious","followers_url":"https://api.github.com/users/Devolicious/followers","following_url":"https://api.github.com/users/Devolicious/following{/other_user}","gists_url":"https://api.github.com/users/Devolicious/gists{/gist_id}","starred_url":"https://api.github.com/users/Devolicious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Devolicious/subscriptions","organizations_url":"https://api.github.com/users/Devolicious/orgs","repos_url":"https://api.github.com/users/Devolicious/repos","events_url":"https://api.github.com/users/Devolicious/events{/privacy}","received_events_url":"https://api.github.com/users/Devolicious/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Devolicious/KunstmaanBundlesCMS","description":"An advanced yet user-friendly content management system, based on the full stack Symfony2 framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.","fork":true,"url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS","forks_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/forks","keys_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/teams","hooks_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/hooks","issue_events_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/issues/events{/number}","events_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/events","assignees_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/assignees{/user}","branches_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/branches{/branch}","tags_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/tags","blobs_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/statuses/{sha}","languages_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/languages","stargazers_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/stargazers","contributors_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/contributors","subscribers_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/subscribers","subscription_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/subscription","commits_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/contents/{+path}","compare_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/merges","archive_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/downloads","issues_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/issues{/number}","pulls_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/pulls{/number}","milestones_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/milestones{/number}","notifications_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/labels{/name}","releases_url":"https://api.github.com/repos/Devolicious/KunstmaanBundlesCMS/releases{/id}","created_at":"2014-11-10T11:03:02Z","updated_at":"2015-03-31T09:40:14Z","pushed_at":"2015-03-31T15:27:44Z","git_url":"git://github.com/Devolicious/KunstmaanBundlesCMS.git","ssh_url":"git@github.com:Devolicious/KunstmaanBundlesCMS.git","clone_url":"https://github.com/Devolicious/KunstmaanBundlesCMS.git","svn_url":"https://github.com/Devolicious/KunstmaanBundlesCMS","homepage":"http://bundles.kunstmaan.be","size":23454,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Kunstmaan:update-frontend-of-admin-and-demosite","ref":"update-frontend-of-admin-and-demosite","sha":"66a1f5d43c976b49223d60d4bdbef1236d186bb0","user":{"login":"Kunstmaan","id":441259,"avatar_url":"https://avatars.githubusercontent.com/u/441259?v=3","gravatar_id":"","url":"https://api.github.com/users/Kunstmaan","html_url":"https://github.com/Kunstmaan","followers_url":"https://api.github.com/users/Kunstmaan/followers","following_url":"https://api.github.com/users/Kunstmaan/following{/other_user}","gists_url":"https://api.github.com/users/Kunstmaan/gists{/gist_id}","starred_url":"https://api.github.com/users/Kunstmaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kunstmaan/subscriptions","organizations_url":"https://api.github.com/users/Kunstmaan/orgs","repos_url":"https://api.github.com/users/Kunstmaan/repos","events_url":"https://api.github.com/users/Kunstmaan/events{/privacy}","received_events_url":"https://api.github.com/users/Kunstmaan/received_events","type":"Organization","site_admin":false},"repo":{"id":22946859,"name":"KunstmaanBundlesCMS","full_name":"Kunstmaan/KunstmaanBundlesCMS","owner":{"login":"Kunstmaan","id":441259,"avatar_url":"https://avatars.githubusercontent.com/u/441259?v=3","gravatar_id":"","url":"https://api.github.com/users/Kunstmaan","html_url":"https://github.com/Kunstmaan","followers_url":"https://api.github.com/users/Kunstmaan/followers","following_url":"https://api.github.com/users/Kunstmaan/following{/other_user}","gists_url":"https://api.github.com/users/Kunstmaan/gists{/gist_id}","starred_url":"https://api.github.com/users/Kunstmaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kunstmaan/subscriptions","organizations_url":"https://api.github.com/users/Kunstmaan/orgs","repos_url":"https://api.github.com/users/Kunstmaan/repos","events_url":"https://api.github.com/users/Kunstmaan/events{/privacy}","received_events_url":"https://api.github.com/users/Kunstmaan/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kunstmaan/KunstmaanBundlesCMS","description":"An advanced yet user-friendly content management system, based on the full stack Symfony2 framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.","fork":false,"url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS","forks_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/forks","keys_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/teams","hooks_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/hooks","issue_events_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/issues/events{/number}","events_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/events","assignees_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/assignees{/user}","branches_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/branches{/branch}","tags_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/tags","blobs_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/statuses/{sha}","languages_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/languages","stargazers_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/stargazers","contributors_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/contributors","subscribers_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/subscribers","subscription_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/subscription","commits_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/contents/{+path}","compare_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/merges","archive_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/downloads","issues_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/issues{/number}","pulls_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls{/number}","milestones_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/milestones{/number}","notifications_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/labels{/name}","releases_url":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/releases{/id}","created_at":"2014-08-14T08:32:55Z","updated_at":"2015-04-01T09:33:01Z","pushed_at":"2015-04-01T09:32:58Z","git_url":"git://github.com/Kunstmaan/KunstmaanBundlesCMS.git","ssh_url":"git@github.com:Kunstmaan/KunstmaanBundlesCMS.git","clone_url":"https://github.com/Kunstmaan/KunstmaanBundlesCMS.git","svn_url":"https://github.com/Kunstmaan/KunstmaanBundlesCMS","homepage":"http://bundles.kunstmaan.be","size":57454,"stargazers_count":27,"watchers_count":27,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":58,"forks":37,"open_issues":58,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/236"},"html":{"href":"https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/236"},"issue":{"href":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/issues/236"},"comments":{"href":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/issues/236/comments"},"review_comments":{"href":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/236/comments"},"review_comment":{"href":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/pulls/236/commits"},"statuses":{"href":"https://api.github.com/repos/Kunstmaan/KunstmaanBundlesCMS/statuses/8489e4be07a7d4297e373e105047c9629b8783e5"}}}}