{"action":"created","comment":{"url":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/comments/242951433","pull_request_review_id":186590889,"id":242951433,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0Mjk1MTQzMw==","diff_hunk":"@@ -181,6 +181,10 @@ private String getFileName(Attr source) throws MimeTypeException\n             try {\n                 // We have to decode the image file name in case it contains URL special characters.\n                 fileName = URLDecoder.decode(fileName, UTF_8);\n+\n+                // we also need to replace the \"&amp;\" by \"&\" since the fileName of the image could contain \"&\".\n+                // note that if the image name contains \"&amp;\" the produced html would contain \"&amp;amp;\"\n+                fileName = fileName.replaceAll(\"&amp;\", \"&\");","path":"xwiki-platform-core/xwiki-platform-office/xwiki-platform-office-importer/src/main/java/org/xwiki/officeimporter/internal/filter/ImageFilter.java","position":7,"original_position":7,"commit_id":"b795bda225dabeb03bd182ff9337d1c40ca65160","original_commit_id":"b795bda225dabeb03bd182ff9337d1c40ca65160","user":{"login":"surli","id":1478232,"node_id":"MDQ6VXNlcjE0NzgyMzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1478232?v=4","gravatar_id":"","url":"https://api.github.com/users/surli","html_url":"https://github.com/surli","followers_url":"https://api.github.com/users/surli/followers","following_url":"https://api.github.com/users/surli/following{/other_user}","gists_url":"https://api.github.com/users/surli/gists{/gist_id}","starred_url":"https://api.github.com/users/surli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surli/subscriptions","organizations_url":"https://api.github.com/users/surli/orgs","repos_url":"https://api.github.com/users/surli/repos","events_url":"https://api.github.com/users/surli/events{/privacy}","received_events_url":"https://api.github.com/users/surli/received_events","type":"User","site_admin":false},"body":"> But it does not make any sense to have & in the DOM\r\n\r\nI'm not sure what you mean: `&` is actually the value of the original document, so we decode it, as we decode the rest of the imageName in the line after. So it totally makes sense to have it in the DOM.\r\n\r\nNow if you meant `&amp;` in the DOM, I don't really see what you suggest?","created_at":"2018-12-19T15:10:53Z","updated_at":"2018-12-19T15:10:53Z","html_url":"https://github.com/xwiki/xwiki-platform/pull/1002#discussion_r242951433","pull_request_url":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/1002","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/comments/242951433"},"html":{"href":"https://github.com/xwiki/xwiki-platform/pull/1002#discussion_r242951433"},"pull_request":{"href":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/1002"}},"in_reply_to_id":242882563},"pull_request":{"url":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/1002","id":239522719,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5NTIyNzE5","html_url":"https://github.com/xwiki/xwiki-platform/pull/1002","diff_url":"https://github.com/xwiki/xwiki-platform/pull/1002.diff","patch_url":"https://github.com/xwiki/xwiki-platform/pull/1002.patch","issue_url":"https://api.github.com/repos/xwiki/xwiki-platform/issues/1002","number":1002,"state":"open","locked":false,"title":"XWIKI-15930: Importing office documents with special chars in file name breaks embedded images","user":{"login":"surli","id":1478232,"node_id":"MDQ6VXNlcjE0NzgyMzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1478232?v=4","gravatar_id":"","url":"https://api.github.com/users/surli","html_url":"https://github.com/surli","followers_url":"https://api.github.com/users/surli/followers","following_url":"https://api.github.com/users/surli/following{/other_user}","gists_url":"https://api.github.com/users/surli/gists{/gist_id}","starred_url":"https://api.github.com/users/surli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surli/subscriptions","organizations_url":"https://api.github.com/users/surli/orgs","repos_url":"https://api.github.com/users/surli/repos","events_url":"https://api.github.com/users/surli/events{/privacy}","received_events_url":"https://api.github.com/users/surli/received_events","type":"User","site_admin":false},"body":"## Issue\r\n\r\nhttps://jira.xwiki.org/browse/XWIKI-15930\r\n\r\n## Solution\r\n  * Also replace &amp; from image source in ImageFilter\r\n\r\n## Tests\r\n\r\nChecks added in existing tests for image presence in both non-accentuated and accentuated files. Failing on master, passing with the changes made in ImageFilter.","created_at":"2018-12-18T15:08:31Z","updated_at":"2018-12-19T15:10:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5299af91997c35023726da9228aae3256039b0c0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/1002/commits","review_comments_url":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/1002/comments","review_comment_url":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xwiki/xwiki-platform/issues/1002/comments","statuses_url":"https://api.github.com/repos/xwiki/xwiki-platform/statuses/b795bda225dabeb03bd182ff9337d1c40ca65160","head":{"label":"surli:XWIKI-15930-office-document-ecom","ref":"XWIKI-15930-office-document-ecom","sha":"b795bda225dabeb03bd182ff9337d1c40ca65160","user":{"login":"surli","id":1478232,"node_id":"MDQ6VXNlcjE0NzgyMzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1478232?v=4","gravatar_id":"","url":"https://api.github.com/users/surli","html_url":"https://github.com/surli","followers_url":"https://api.github.com/users/surli/followers","following_url":"https://api.github.com/users/surli/following{/other_user}","gists_url":"https://api.github.com/users/surli/gists{/gist_id}","starred_url":"https://api.github.com/users/surli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surli/subscriptions","organizations_url":"https://api.github.com/users/surli/orgs","repos_url":"https://api.github.com/users/surli/repos","events_url":"https://api.github.com/users/surli/events{/privacy}","received_events_url":"https://api.github.com/users/surli/received_events","type":"User","site_admin":false},"repo":{"id":142174930,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIxNzQ5MzA=","name":"xwiki-platform","full_name":"surli/xwiki-platform","private":false,"owner":{"login":"surli","id":1478232,"node_id":"MDQ6VXNlcjE0NzgyMzI=","avatar_url":"https://avatars2.githubusercontent.com/u/1478232?v=4","gravatar_id":"","url":"https://api.github.com/users/surli","html_url":"https://github.com/surli","followers_url":"https://api.github.com/users/surli/followers","following_url":"https://api.github.com/users/surli/following{/other_user}","gists_url":"https://api.github.com/users/surli/gists{/gist_id}","starred_url":"https://api.github.com/users/surli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surli/subscriptions","organizations_url":"https://api.github.com/users/surli/orgs","repos_url":"https://api.github.com/users/surli/repos","events_url":"https://api.github.com/users/surli/events{/privacy}","received_events_url":"https://api.github.com/users/surli/received_events","type":"User","site_admin":false},"html_url":"https://github.com/surli/xwiki-platform","description":"The XWiki platform","fork":true,"url":"https://api.github.com/repos/surli/xwiki-platform","forks_url":"https://api.github.com/repos/surli/xwiki-platform/forks","keys_url":"https://api.github.com/repos/surli/xwiki-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/surli/xwiki-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/surli/xwiki-platform/teams","hooks_url":"https://api.github.com/repos/surli/xwiki-platform/hooks","issue_events_url":"https://api.github.com/repos/surli/xwiki-platform/issues/events{/number}","events_url":"https://api.github.com/repos/surli/xwiki-platform/events","assignees_url":"https://api.github.com/repos/surli/xwiki-platform/assignees{/user}","branches_url":"https://api.github.com/repos/surli/xwiki-platform/branches{/branch}","tags_url":"https://api.github.com/repos/surli/xwiki-platform/tags","blobs_url":"https://api.github.com/repos/surli/xwiki-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/surli/xwiki-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/surli/xwiki-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/surli/xwiki-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/surli/xwiki-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/surli/xwiki-platform/languages","stargazers_url":"https://api.github.com/repos/surli/xwiki-platform/stargazers","contributors_url":"https://api.github.com/repos/surli/xwiki-platform/contributors","subscribers_url":"https://api.github.com/repos/surli/xwiki-platform/subscribers","subscription_url":"https://api.github.com/repos/surli/xwiki-platform/subscription","commits_url":"https://api.github.com/repos/surli/xwiki-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/surli/xwiki-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/surli/xwiki-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/surli/xwiki-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/surli/xwiki-platform/contents/{+path}","compare_url":"https://api.github.com/repos/surli/xwiki-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/surli/xwiki-platform/merges","archive_url":"https://api.github.com/repos/surli/xwiki-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/surli/xwiki-platform/downloads","issues_url":"https://api.github.com/repos/surli/xwiki-platform/issues{/number}","pulls_url":"https://api.github.com/repos/surli/xwiki-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/surli/xwiki-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/surli/xwiki-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/surli/xwiki-platform/labels{/name}","releases_url":"https://api.github.com/repos/surli/xwiki-platform/releases{/id}","deployments_url":"https://api.github.com/repos/surli/xwiki-platform/deployments","created_at":"2018-07-24T15:03:25Z","updated_at":"2018-07-24T15:03:55Z","pushed_at":"2018-12-19T10:10:18Z","git_url":"git://github.com/surli/xwiki-platform.git","ssh_url":"git@github.com:surli/xwiki-platform.git","clone_url":"https://github.com/surli/xwiki-platform.git","svn_url":"https://github.com/surli/xwiki-platform","homepage":"http://platform.xwiki.org/","size":336544,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xwiki:master","ref":"master","sha":"1de58d9be119090d6d86023f293e643c8134bf53","user":{"login":"xwiki","id":488445,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ4ODQ0NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/488445?v=4","gravatar_id":"","url":"https://api.github.com/users/xwiki","html_url":"https://github.com/xwiki","followers_url":"https://api.github.com/users/xwiki/followers","following_url":"https://api.github.com/users/xwiki/following{/other_user}","gists_url":"https://api.github.com/users/xwiki/gists{/gist_id}","starred_url":"https://api.github.com/users/xwiki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xwiki/subscriptions","organizations_url":"https://api.github.com/users/xwiki/orgs","repos_url":"https://api.github.com/users/xwiki/repos","events_url":"https://api.github.com/users/xwiki/events{/privacy}","received_events_url":"https://api.github.com/users/xwiki/received_events","type":"Organization","site_admin":false},"repo":{"id":1463490,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYzNDkw","name":"xwiki-platform","full_name":"xwiki/xwiki-platform","private":false,"owner":{"login":"xwiki","id":488445,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ4ODQ0NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/488445?v=4","gravatar_id":"","url":"https://api.github.com/users/xwiki","html_url":"https://github.com/xwiki","followers_url":"https://api.github.com/users/xwiki/followers","following_url":"https://api.github.com/users/xwiki/following{/other_user}","gists_url":"https://api.github.com/users/xwiki/gists{/gist_id}","starred_url":"https://api.github.com/users/xwiki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xwiki/subscriptions","organizations_url":"https://api.github.com/users/xwiki/orgs","repos_url":"https://api.github.com/users/xwiki/repos","events_url":"https://api.github.com/users/xwiki/events{/privacy}","received_events_url":"https://api.github.com/users/xwiki/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/xwiki/xwiki-platform","description":"The XWiki platform","fork":false,"url":"https://api.github.com/repos/xwiki/xwiki-platform","forks_url":"https://api.github.com/repos/xwiki/xwiki-platform/forks","keys_url":"https://api.github.com/repos/xwiki/xwiki-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xwiki/xwiki-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xwiki/xwiki-platform/teams","hooks_url":"https://api.github.com/repos/xwiki/xwiki-platform/hooks","issue_events_url":"https://api.github.com/repos/xwiki/xwiki-platform/issues/events{/number}","events_url":"https://api.github.com/repos/xwiki/xwiki-platform/events","assignees_url":"https://api.github.com/repos/xwiki/xwiki-platform/assignees{/user}","branches_url":"https://api.github.com/repos/xwiki/xwiki-platform/branches{/branch}","tags_url":"https://api.github.com/repos/xwiki/xwiki-platform/tags","blobs_url":"https://api.github.com/repos/xwiki/xwiki-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xwiki/xwiki-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xwiki/xwiki-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/xwiki/xwiki-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xwiki/xwiki-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/xwiki/xwiki-platform/languages","stargazers_url":"https://api.github.com/repos/xwiki/xwiki-platform/stargazers","contributors_url":"https://api.github.com/repos/xwiki/xwiki-platform/contributors","subscribers_url":"https://api.github.com/repos/xwiki/xwiki-platform/subscribers","subscription_url":"https://api.github.com/repos/xwiki/xwiki-platform/subscription","commits_url":"https://api.github.com/repos/xwiki/xwiki-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/xwiki/xwiki-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/xwiki/xwiki-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/xwiki/xwiki-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/xwiki/xwiki-platform/contents/{+path}","compare_url":"https://api.github.com/repos/xwiki/xwiki-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xwiki/xwiki-platform/merges","archive_url":"https://api.github.com/repos/xwiki/xwiki-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xwiki/xwiki-platform/downloads","issues_url":"https://api.github.com/repos/xwiki/xwiki-platform/issues{/number}","pulls_url":"https://api.github.com/repos/xwiki/xwiki-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/xwiki/xwiki-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/xwiki/xwiki-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xwiki/xwiki-platform/labels{/name}","releases_url":"https://api.github.com/repos/xwiki/xwiki-platform/releases{/id}","deployments_url":"https://api.github.com/repos/xwiki/xwiki-platform/deployments","created_at":"2011-03-10T13:26:41Z","updated_at":"2018-12-19T13:02:02Z","pushed_at":"2018-12-19T13:25:41Z","git_url":"git://github.com/xwiki/xwiki-platform.git","ssh_url":"git@github.com:xwiki/xwiki-platform.git","clone_url":"https://github.com/xwiki/xwiki-platform.git","svn_url":"https://github.com/xwiki/xwiki-platform","homepage":"http://platform.xwiki.org/","size":340015,"stargazers_count":387,"watchers_count":387,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":291,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":291,"open_issues":35,"watchers":387,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/1002"},"html":{"href":"https://github.com/xwiki/xwiki-platform/pull/1002"},"issue":{"href":"https://api.github.com/repos/xwiki/xwiki-platform/issues/1002"},"comments":{"href":"https://api.github.com/repos/xwiki/xwiki-platform/issues/1002/comments"},"review_comments":{"href":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/1002/comments"},"review_comment":{"href":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xwiki/xwiki-platform/pulls/1002/commits"},"statuses":{"href":"https://api.github.com/repos/xwiki/xwiki-platform/statuses/b795bda225dabeb03bd182ff9337d1c40ca65160"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"surli"}}