{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/1394","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-framework","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/1394/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/1394/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/1394/events","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/1394","id":12770571,"number":1394,"title":"[2011-04-07] $_REQUEST['url'] vs $_GET['url']","user":{"login":"silverstripe-issues","id":4030919,"avatar_url":"https://avatars.githubusercontent.com/u/4030919?v=3","gravatar_id":"","url":"https://api.github.com/users/silverstripe-issues","html_url":"https://github.com/silverstripe-issues","followers_url":"https://api.github.com/users/silverstripe-issues/followers","following_url":"https://api.github.com/users/silverstripe-issues/following{/other_user}","gists_url":"https://api.github.com/users/silverstripe-issues/gists{/gist_id}","starred_url":"https://api.github.com/users/silverstripe-issues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverstripe-issues/subscriptions","organizations_url":"https://api.github.com/users/silverstripe-issues/orgs","repos_url":"https://api.github.com/users/silverstripe-issues/repos","events_url":"https://api.github.com/users/silverstripe-issues/events{/privacy}","received_events_url":"https://api.github.com/users/silverstripe-issues/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/change/major","name":"change/major","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2013-04-03T20:08:20Z","updated_at":"2016-04-29T00:35:14Z","closed_at":"2016-04-21T07:33:32Z","body":"created by: paradigmincarnate\ncreated at: 2011-04-07\noriginal ticket: http://open.silverstripe.org/ticket/6588\n\n---\n\nThe Problem\r\n---\r\nSilverStripe uses webserver rules (e.g. .htaccess, mod_rewrite) to put the path into a query parameter named 'url'.\r\n\r\nIn sapphire/main.php some adjustments are made to this to ensure it's uniform across all web servers.\r\n\r\nThe fixed/normalised value then resides in $_GET['url']\r\n\r\nSilverStripe then goes on to use $_REQUEST['url'] in some places to represent the page url.\r\n\r\nThis is a problem for 2 reasons.\r\n1) $_REQUEST['url'] isn't subject to any fixing.\r\n2) The url shouldn't ever come from somewhere other than $_GET['url'].\r\n\r\n\r\n\r\nThe Fix\r\n---\r\nSurely the easiest way to fix this is to replace all use of $_REQUEST['url'] with $_GET['url'] or SS_HTTPRequest::getUrl()\r\n\r\n\r\n\r\n\r\nSpecial Considerations\r\n---\r\nThe url shouldn't come from a query anyway, but should be grabbed form REQUEST_URI since putting it in the query causes all sorts of encode/decode issues."},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/215601865","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/1394#issuecomment-215601865","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/1394","id":215601865,"user":{"login":"tractorcow","id":936064,"avatar_url":"https://avatars.githubusercontent.com/u/936064?v=3","gravatar_id":"","url":"https://api.github.com/users/tractorcow","html_url":"https://github.com/tractorcow","followers_url":"https://api.github.com/users/tractorcow/followers","following_url":"https://api.github.com/users/tractorcow/following{/other_user}","gists_url":"https://api.github.com/users/tractorcow/gists{/gist_id}","starred_url":"https://api.github.com/users/tractorcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tractorcow/subscriptions","organizations_url":"https://api.github.com/users/tractorcow/orgs","repos_url":"https://api.github.com/users/tractorcow/repos","events_url":"https://api.github.com/users/tractorcow/events{/privacy}","received_events_url":"https://api.github.com/users/tractorcow/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T00:35:14Z","updated_at":"2016-04-29T00:35:14Z","body":"> Surely the easiest way to fix this is to replace all use of $_REQUEST['url'] with $_GET['url'] or SS_HTTPRequest::getUrl()\r\n\r\nI might do this in a separate pull request anyway, along with other direct access to $_SERVER variable."}}