{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/2233","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/2233/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/2233/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/2233/events","html_url":"https://github.com/cakephp/cakephp/issues/2233","id":21792122,"number":2233,"title":"Inconsistent URL encoding in HtmlHelper","user":{"login":"ndm2","id":5031606,"avatar_url":"https://avatars.githubusercontent.com/u/5031606?v=3","gravatar_id":"","url":"https://api.github.com/users/ndm2","html_url":"https://github.com/ndm2","followers_url":"https://api.github.com/users/ndm2/followers","following_url":"https://api.github.com/users/ndm2/following{/other_user}","gists_url":"https://api.github.com/users/ndm2/gists{/gist_id}","starred_url":"https://api.github.com/users/ndm2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndm2/subscriptions","organizations_url":"https://api.github.com/users/ndm2/orgs","repos_url":"https://api.github.com/users/ndm2/repos","events_url":"https://api.github.com/users/ndm2/events{/privacy}","received_events_url":"https://api.github.com/users/ndm2/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/Defect","name":"Defect","color":"f7c6c7"},{"url":"https://api.github.com/repos/cakephp/cakephp/labels/routing","name":"routing","color":"FFFFFF"},{"url":"https://api.github.com/repos/cakephp/cakephp/labels/view","name":"view","color":"ffffff"}],"state":"closed","locked":false,"assignee":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/9","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/9/labels","id":462209,"number":9,"title":"2.4.3","description":"Bugfix release for 2.4.x","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":31,"state":"closed","created_at":"2013-10-23T02:00:06Z","updated_at":"2013-11-25T02:45:51Z","due_on":"2013-11-17T08:00:00Z","closed_at":"2013-11-25T02:45:51Z"},"comments":11,"created_at":"2013-10-29T22:14:19Z","updated_at":"2015-01-30T07:45:51Z","closed_at":"2013-11-16T01:59:02Z","body":"I'm wondering whether this is the intended behavior (I tend to think it's not), the various `HtmlHelper` methods do encode URLs differently.\r\n\r\nHere's what I'm talking about, this:\r\n\r\n```php\r\necho $this->Html->image('http://example.com/foo&bar.baz');\r\necho $this->Html->link('http://example.com/foo&bar.baz');\r\necho $this->Html->css('http://example.com/foo&bar.baz');\r\necho $this->Html->script('http://example.com/foo&bar.baz');\r\necho $this->Html->meta('icon', 'http://example.com/foo&bar.baz');\r\necho $this->Html->media('http://example.com/foo&bar.baz');\r\n\r\necho $this->Html->image('/foo&bar.baz');\r\necho $this->Html->link('/foo&bar.baz');\r\necho $this->Html->css('/foo&bar.baz');\r\necho $this->Html->script('/foo&bar.baz');\r\necho $this->Html->meta('icon', '/foo&bar.baz');\r\necho $this->Html->media('/foo&bar.baz');\r\n```\r\n\r\ngives me the following results:\r\n\r\n```html\r\n<img src=\"http://example.com/foo&bar.baz\" alt=\"\" />\r\n<a href=\"http://example.com/foo&amp;bar.baz\">http://example.com/foo&amp;bar.baz</a>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"http://example.com/foo&bar.baz\" />\r\n<script type=\"text/javascript\" src=\"http://example.com/foo&bar.baz\"></script>\r\n<link href=\"http://example.com/foo&bar.baz\" type=\"image/x-icon\" rel=\"icon\" /><link href=\"http://example.com/foo&bar.baz\" type=\"image/x-icon\" rel=\"shortcut icon\" />\r\n<audio src=\"http://example.com/foo&amp;bar.baz\"></audio>\r\n\r\n<img src=\"/foo%26bar.baz\" alt=\"\" />\r\n<a href=\"/foo&amp;bar.baz\">/foo&amp;bar.baz</a>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/foo%26bar.baz.css\" />\r\n<script type=\"text/javascript\" src=\"/foo%26bar.baz.js\"></script>\r\n<link href=\"/foo&bar.baz\" type=\"image/x-icon\" rel=\"icon\" /><link href=\"/foo&bar.baz\" type=\"image/x-icon\" rel=\"shortcut icon\" />\r\n<audio src=\"/foo%26bar.baz\"></audio>\r\n```\r\n\r\nAs you can see the URLs quite differ, some are entity encoded, some percent encoded, and some are not encoded at all.\r\n\r\nI'm testing this against 2.4.2"},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/72165452","html_url":"https://github.com/cakephp/cakephp/issues/2233#issuecomment-72165452","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/2233","id":72165452,"user":{"login":"oanhnn","id":1757120,"avatar_url":"https://avatars.githubusercontent.com/u/1757120?v=3","gravatar_id":"","url":"https://api.github.com/users/oanhnn","html_url":"https://github.com/oanhnn","followers_url":"https://api.github.com/users/oanhnn/followers","following_url":"https://api.github.com/users/oanhnn/following{/other_user}","gists_url":"https://api.github.com/users/oanhnn/gists{/gist_id}","starred_url":"https://api.github.com/users/oanhnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oanhnn/subscriptions","organizations_url":"https://api.github.com/users/oanhnn/orgs","repos_url":"https://api.github.com/users/oanhnn/repos","events_url":"https://api.github.com/users/oanhnn/events{/privacy}","received_events_url":"https://api.github.com/users/oanhnn/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T07:45:51Z","updated_at":"2015-01-30T07:45:51Z","body":"I has problem with `HtmlHelper::url()` .\r\nI want make URL without escapes query string ‘&’ ( http://example.com?foo=1&bar=2 ), same with `Router::url()` but result always be escaped.\r\nMy code:\r\n\r\n```php\r\n<?php \r\n$url = array(\r\n     'controller' => 'example',\r\n     'action'      => 'index',\r\n     '?'             => array(\r\n           'foo' => 1,\r\n           'bar' => 2,\r\n     ),\r\n);\r\ndebug($this->Html->url($url, array('full' => false, 'escape' => false));\r\ndebug(Router::url($url, array('full' => false, 'escape' => false));\r\n?>\r\n```\r\nMy cakephp version\r\n```json\r\n\"name\": \"cakephp/cakephp\",\r\n\"version\": \"2.5.7\",\r\n\"source\": {\r\n      \"type\": \"git\",\r\n      \"url\": \"https://github.com/cakephp/cakephp.git\",\r\n      \"reference\": \"ef28b42b2b8885a2be216c11adbbf32919e04a5b\"\r\n },\r\n```\r\nI check `Helper::url()` and see:\r\n```php\r\n\r\n/**\r\n * Finds URL for specified action.\r\n *\r\n * Returns a URL pointing at the provided parameters.\r\n *\r\n * @param string|array $url Either a relative string url like `/products/view/23` or\r\n *    an array of URL parameters. Using an array for URLs will allow you to leverage\r\n *    the reverse routing features of CakePHP.\r\n * @param bool $full If true, the full base URL will be prepended to the result\r\n * @return string Full translated URL with base path.\r\n * @link http://book.cakephp.org/2.0/en/views/helpers.html\r\n */\r\n\tpublic function url($url = null, $full = false) {\r\n\t\treturn h(Router::url($url, $full));\r\n\t}\r\n\r\n```\r\nWith this source, result always be escaped, and that is incorrect with document @@"}}