{"action":"closed","number":11353,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/11353","id":79375984,"html_url":"https://github.com/joomla/joomla-cms/pull/11353","diff_url":"https://github.com/joomla/joomla-cms/pull/11353.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/11353.patch","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11353","number":11353,"state":"closed","locked":false,"title":"Email Cloaking plugin corrupts HTML","user":{"login":"demis-palma","id":1609992,"avatar_url":"https://avatars.githubusercontent.com/u/1609992?v=3","gravatar_id":"","url":"https://api.github.com/users/demis-palma","html_url":"https://github.com/demis-palma","followers_url":"https://api.github.com/users/demis-palma/followers","following_url":"https://api.github.com/users/demis-palma/following{/other_user}","gists_url":"https://api.github.com/users/demis-palma/gists{/gist_id}","starred_url":"https://api.github.com/users/demis-palma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demis-palma/subscriptions","organizations_url":"https://api.github.com/users/demis-palma/orgs","repos_url":"https://api.github.com/users/demis-palma/repos","events_url":"https://api.github.com/users/demis-palma/events{/privacy}","received_events_url":"https://api.github.com/users/demis-palma/received_events","type":"User","site_admin":false},"body":"The plugin “Content - Email Cloaking”, under some circumstances, corrupts the HTML of the processed content.\r\n\r\nThe use of email addresses within attributes of HTML tags is legitimate in the HTML code of a Joomla article.\r\nChances are high this actually happens when users include any kind of modules within articles, using the “Content - Load Modules” plugin (now used more than ever, due to the new editor button “Module”).\r\n\r\nAn article containing this HTML code\r\n`<img src=\"/envelope.png\" title=\"email@address.com\">`\r\n\r\nShould appear like that:\r\n\r\n![img-expected](https://cloud.githubusercontent.com/assets/1609992/17252677/83036c52-55a5-11e6-8a91-eb5330dd620d.png)\r\n\r\nBut the cloak plugin corrupts the output\r\n\r\n`<img src=\"/envelope.png\" title=\"<span id=\"cloak84493\">This email address is being protected ...</span><script type='text/javascript'>...</script>`\r\n\r\nWhich produce that result:\r\n\r\n![img-got](https://cloud.githubusercontent.com/assets/1609992/17252766/c8a99aec-55a5-11e6-8279-e32ee4c6299a.png)\r\n\r\n\r\nThe same goes for an input element\r\n\r\n`<input type=\"text\" value=\"\" placeholder=\"email@address.com\">`\r\n\r\nWhich should appear like that:\r\n\r\n![input-expected](https://cloud.githubusercontent.com/assets/1609992/17252797/e56829f0-55a5-11e6-8b10-6ebf18f4424c.png)\r\n\r\nbut it becomes like that instead:\r\n\r\n`<input type=\"text\" value=\"\" placeholder=\"<span id=\"cloak77416\">This email address is being protected ...</span><script type='text/javascript'>...</script>`\r\n\r\n![input-got](https://cloud.githubusercontent.com/assets/1609992/17252815/f8436cec-55a5-11e6-8ff5-132af825e509.png)\r\n\r\n## The cause\r\nHTML attributes (like title=”...”) don't allow any further nested HTML tags, nor JavaScripts inside them.\r\n\r\n## Summary of Changes\r\n\r\n1. The negative lookahead '(?![^<]*>)' added to the regular expression is used to exclude occurrences within HTML tags.\r\n2. Added exhaustive comments to explain the reason behind the lookahead.\r\n\r\n## Testing Instructions\r\n[I have tested](https://regex101.com/r/rP2hR5/3) the new regular expression with a lot of sample text, and it behaves good to me, but everyone interested is encouraged to test further (we know how tricky regular expressions can be).\r\n\r\n","created_at":"2016-07-29T15:15:11Z","updated_at":"2016-08-04T21:23:36Z","closed_at":"2016-08-04T21:23:36Z","merged_at":"2016-08-04T21:23:36Z","merge_commit_sha":"98b7c98b52bbdffc4601c0900dd72efbee4d7324","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/joomla/joomla-cms/milestones/16","html_url":"https://github.com/joomla/joomla-cms/milestones/Joomla%203.6.3","labels_url":"https://api.github.com/repos/joomla/joomla-cms/milestones/16/labels","id":1901872,"number":16,"title":"Joomla 3.6.3","description":"","creator":{"login":"wilsonge","id":1986000,"avatar_url":"https://avatars.githubusercontent.com/u/1986000?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonge","html_url":"https://github.com/wilsonge","followers_url":"https://api.github.com/users/wilsonge/followers","following_url":"https://api.github.com/users/wilsonge/following{/other_user}","gists_url":"https://api.github.com/users/wilsonge/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonge/subscriptions","organizations_url":"https://api.github.com/users/wilsonge/orgs","repos_url":"https://api.github.com/users/wilsonge/repos","events_url":"https://api.github.com/users/wilsonge/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonge/received_events","type":"User","site_admin":false},"open_issues":47,"closed_issues":1,"state":"open","created_at":"2016-07-25T09:08:01Z","updated_at":"2016-08-04T21:23:36Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/11353/commits","review_comments_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/11353/comments","review_comment_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11353/comments","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/8feba8d02a793dc665c26ada408c8ec41d117cb9","head":{"label":"demis-palma:email-cloak","ref":"email-cloak","sha":"8feba8d02a793dc665c26ada408c8ec41d117cb9","user":{"login":"demis-palma","id":1609992,"avatar_url":"https://avatars.githubusercontent.com/u/1609992?v=3","gravatar_id":"","url":"https://api.github.com/users/demis-palma","html_url":"https://github.com/demis-palma","followers_url":"https://api.github.com/users/demis-palma/followers","following_url":"https://api.github.com/users/demis-palma/following{/other_user}","gists_url":"https://api.github.com/users/demis-palma/gists{/gist_id}","starred_url":"https://api.github.com/users/demis-palma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demis-palma/subscriptions","organizations_url":"https://api.github.com/users/demis-palma/orgs","repos_url":"https://api.github.com/users/demis-palma/repos","events_url":"https://api.github.com/users/demis-palma/events{/privacy}","received_events_url":"https://api.github.com/users/demis-palma/received_events","type":"User","site_admin":false},"repo":{"id":32748278,"name":"joomla-cms","full_name":"demis-palma/joomla-cms","owner":{"login":"demis-palma","id":1609992,"avatar_url":"https://avatars.githubusercontent.com/u/1609992?v=3","gravatar_id":"","url":"https://api.github.com/users/demis-palma","html_url":"https://github.com/demis-palma","followers_url":"https://api.github.com/users/demis-palma/followers","following_url":"https://api.github.com/users/demis-palma/following{/other_user}","gists_url":"https://api.github.com/users/demis-palma/gists{/gist_id}","starred_url":"https://api.github.com/users/demis-palma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demis-palma/subscriptions","organizations_url":"https://api.github.com/users/demis-palma/orgs","repos_url":"https://api.github.com/users/demis-palma/repos","events_url":"https://api.github.com/users/demis-palma/events{/privacy}","received_events_url":"https://api.github.com/users/demis-palma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/demis-palma/joomla-cms","description":"Home of the Joomla! Content Management System","fork":true,"url":"https://api.github.com/repos/demis-palma/joomla-cms","forks_url":"https://api.github.com/repos/demis-palma/joomla-cms/forks","keys_url":"https://api.github.com/repos/demis-palma/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demis-palma/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demis-palma/joomla-cms/teams","hooks_url":"https://api.github.com/repos/demis-palma/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/demis-palma/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/demis-palma/joomla-cms/events","assignees_url":"https://api.github.com/repos/demis-palma/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/demis-palma/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/demis-palma/joomla-cms/tags","blobs_url":"https://api.github.com/repos/demis-palma/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demis-palma/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demis-palma/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/demis-palma/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demis-palma/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/demis-palma/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/demis-palma/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/demis-palma/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/demis-palma/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/demis-palma/joomla-cms/subscription","commits_url":"https://api.github.com/repos/demis-palma/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/demis-palma/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/demis-palma/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/demis-palma/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/demis-palma/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/demis-palma/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demis-palma/joomla-cms/merges","archive_url":"https://api.github.com/repos/demis-palma/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demis-palma/joomla-cms/downloads","issues_url":"https://api.github.com/repos/demis-palma/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/demis-palma/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/demis-palma/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/demis-palma/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demis-palma/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/demis-palma/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/demis-palma/joomla-cms/deployments","created_at":"2015-03-23T17:38:35Z","updated_at":"2016-02-28T12:12:54Z","pushed_at":"2016-07-29T23:42:02Z","git_url":"git://github.com/demis-palma/joomla-cms.git","ssh_url":"git@github.com:demis-palma/joomla-cms.git","clone_url":"https://github.com/demis-palma/joomla-cms.git","svn_url":"https://github.com/demis-palma/joomla-cms","homepage":"http://joomla.org","size":150391,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"staging"}},"base":{"label":"joomla:staging","ref":"staging","sha":"9d7f941463b6e04a43a8aae4864449c7fdd70f1d","user":{"login":"joomla","id":751633,"avatar_url":"https://avatars.githubusercontent.com/u/751633?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"repo":{"id":2464908,"name":"joomla-cms","full_name":"joomla/joomla-cms","owner":{"login":"joomla","id":751633,"avatar_url":"https://avatars.githubusercontent.com/u/751633?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joomla/joomla-cms","description":"Home of the Joomla! Content Management System","fork":false,"url":"https://api.github.com/repos/joomla/joomla-cms","forks_url":"https://api.github.com/repos/joomla/joomla-cms/forks","keys_url":"https://api.github.com/repos/joomla/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joomla/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joomla/joomla-cms/teams","hooks_url":"https://api.github.com/repos/joomla/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/joomla/joomla-cms/events","assignees_url":"https://api.github.com/repos/joomla/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/joomla/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/joomla/joomla-cms/tags","blobs_url":"https://api.github.com/repos/joomla/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joomla/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joomla/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/joomla/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/joomla/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/joomla/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/joomla/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/joomla/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/joomla/joomla-cms/subscription","commits_url":"https://api.github.com/repos/joomla/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/joomla/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/joomla/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/joomla/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joomla/joomla-cms/merges","archive_url":"https://api.github.com/repos/joomla/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joomla/joomla-cms/downloads","issues_url":"https://api.github.com/repos/joomla/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/joomla/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/joomla/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/joomla/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joomla/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/joomla/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/joomla/joomla-cms/deployments","created_at":"2011-09-27T02:07:38Z","updated_at":"2016-08-04T13:54:15Z","pushed_at":"2016-08-04T21:23:37Z","git_url":"git://github.com/joomla/joomla-cms.git","ssh_url":"git@github.com:joomla/joomla-cms.git","clone_url":"https://github.com/joomla/joomla-cms.git","svn_url":"https://github.com/joomla/joomla-cms","homepage":"https://www.joomla.org","size":286151,"stargazers_count":2101,"watchers_count":2101,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2242,"mirror_url":null,"open_issues_count":502,"forks":2242,"open_issues":502,"watchers":2101,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/11353"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/11353"},"issue":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/11353"},"comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/11353/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/11353/comments"},"review_comment":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/11353/commits"},"statuses":{"href":"https://api.github.com/repos/joomla/joomla-cms/statuses/8feba8d02a793dc665c26ada408c8ec41d117cb9"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"wilsonge","id":1986000,"avatar_url":"https://avatars.githubusercontent.com/u/1986000?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonge","html_url":"https://github.com/wilsonge","followers_url":"https://api.github.com/users/wilsonge/followers","following_url":"https://api.github.com/users/wilsonge/following{/other_user}","gists_url":"https://api.github.com/users/wilsonge/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonge/subscriptions","organizations_url":"https://api.github.com/users/wilsonge/orgs","repos_url":"https://api.github.com/users/wilsonge/repos","events_url":"https://api.github.com/users/wilsonge/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonge/received_events","type":"User","site_admin":false},"comments":28,"review_comments":0,"commits":4,"additions":6,"deletions":2,"changed_files":1}}
{"actor":{"display_login":"wilsonge"}}