{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/17982","labels_url":"https://api.github.com/repos/owncloud/core/issues/17982/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/17982/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/17982/events","html_url":"https://github.com/owncloud/core/pull/17982","id":98137480,"number":17982,"title":"Sanitize class names before registerService/query","user":{"login":"Xenopathic","id":2016878,"avatar_url":"https://avatars.githubusercontent.com/u/2016878?v=3","gravatar_id":"","url":"https://api.github.com/users/Xenopathic","html_url":"https://github.com/Xenopathic","followers_url":"https://api.github.com/users/Xenopathic/followers","following_url":"https://api.github.com/users/Xenopathic/following{/other_user}","gists_url":"https://api.github.com/users/Xenopathic/gists{/gist_id}","starred_url":"https://api.github.com/users/Xenopathic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xenopathic/subscriptions","organizations_url":"https://api.github.com/users/Xenopathic/orgs","repos_url":"https://api.github.com/users/Xenopathic/repos","events_url":"https://api.github.com/users/Xenopathic/events{/privacy}","received_events_url":"https://api.github.com/users/Xenopathic/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/3%20-%20To%20Review","name":"3 - To Review","color":"ededed"},{"url":"https://api.github.com/repos/owncloud/core/labels/enhancement","name":"enhancement","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/37","html_url":"https://github.com/owncloud/core/milestones/8.2-current","labels_url":"https://api.github.com/repos/owncloud/core/milestones/37/labels","id":993629,"number":37,"title":"8.2-current","description":"","creator":{"login":"craigpg","id":160667,"avatar_url":"https://avatars.githubusercontent.com/u/160667?v=3","gravatar_id":"","url":"https://api.github.com/users/craigpg","html_url":"https://github.com/craigpg","followers_url":"https://api.github.com/users/craigpg/followers","following_url":"https://api.github.com/users/craigpg/following{/other_user}","gists_url":"https://api.github.com/users/craigpg/gists{/gist_id}","starred_url":"https://api.github.com/users/craigpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigpg/subscriptions","organizations_url":"https://api.github.com/users/craigpg/orgs","repos_url":"https://api.github.com/users/craigpg/repos","events_url":"https://api.github.com/users/craigpg/events{/privacy}","received_events_url":"https://api.github.com/users/craigpg/received_events","type":"User","site_admin":false},"open_issues":627,"closed_issues":327,"state":"open","created_at":"2015-02-24T16:19:37Z","updated_at":"2015-08-12T08:59:31Z","due_on":"2015-10-20T04:00:00Z","closed_at":null},"comments":12,"created_at":"2015-07-30T10:37:22Z","updated_at":"2015-08-12T09:13:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/17982","html_url":"https://github.com/owncloud/core/pull/17982","diff_url":"https://github.com/owncloud/core/pull/17982.diff","patch_url":"https://github.com/owncloud/core/pull/17982.patch"},"body":"Leading backslashes are removed, so a `registerService('\\\\OC\\\\Foo')` can still be resolved with `query('OC\\\\Foo')`.\r\n\r\nRationale: sometimes people query services with a leading backslash, while the appframework auto-reflection system queries without the leading backslash (and sometimes, people query like that too). Since both class names are perfectly valid, they should be resolved correctly to the same object. As the appframework has used the form without the backslash all this time, I decided to sanitize all class names to that form.\r\n\r\ncc @rullzer @MorrisJobke @DeepDiver1975 @nickvergessen @LukasReschke "},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/130229210","html_url":"https://github.com/owncloud/core/pull/17982#issuecomment-130229210","issue_url":"https://api.github.com/repos/owncloud/core/issues/17982","id":130229210,"user":{"login":"Xenopathic","id":2016878,"avatar_url":"https://avatars.githubusercontent.com/u/2016878?v=3","gravatar_id":"","url":"https://api.github.com/users/Xenopathic","html_url":"https://github.com/Xenopathic","followers_url":"https://api.github.com/users/Xenopathic/followers","following_url":"https://api.github.com/users/Xenopathic/following{/other_user}","gists_url":"https://api.github.com/users/Xenopathic/gists{/gist_id}","starred_url":"https://api.github.com/users/Xenopathic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xenopathic/subscriptions","organizations_url":"https://api.github.com/users/Xenopathic/orgs","repos_url":"https://api.github.com/users/Xenopathic/repos","events_url":"https://api.github.com/users/Xenopathic/events{/privacy}","received_events_url":"https://api.github.com/users/Xenopathic/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T09:13:14Z","updated_at":"2015-08-12T09:13:14Z","body":"Can we make a final decision on this PR? On the one hand, it would be in ownCloud's API and would remain permanently. On the other hand, it fixes an annoying corner case which even with PHP 5.5's `::class` property we will keep seeing, so perhaps being in the API is a good thing.\r\n\r\nIt all really boils down to this: when using raw PHP, the following two lines are completely identical:\r\n\r\n    $foo = new \\Namespace\\Class();\r\n    $foo = new Namespace\\Class();\r\n\r\nAs such, when using the appframework as an app developer, I *expect* the following to also result in the identical object:\r\n\r\n    $foo = $container->query('\\Namespace\\Class');\r\n    $foo = $container->query('Namespace\\Class');\r\n\r\nThe fact that it returns two separate, independent objects is just weird IMHO"}}