{"action":"created","issue":{"url":"https://api.github.com/repos/download-monitor/download-monitor/issues/238","labels_url":"https://api.github.com/repos/download-monitor/download-monitor/issues/238/labels{/name}","comments_url":"https://api.github.com/repos/download-monitor/download-monitor/issues/238/comments","events_url":"https://api.github.com/repos/download-monitor/download-monitor/issues/238/events","html_url":"https://github.com/download-monitor/download-monitor/pull/238","id":57918366,"number":238,"title":"Fix version string escaping in DLM_Download::get_version_id()","user":{"login":"attitude","id":387611,"avatar_url":"https://avatars.githubusercontent.com/u/387611?v=3","gravatar_id":"","url":"https://api.github.com/users/attitude","html_url":"https://github.com/attitude","followers_url":"https://api.github.com/users/attitude/followers","following_url":"https://api.github.com/users/attitude/following{/other_user}","gists_url":"https://api.github.com/users/attitude/gists{/gist_id}","starred_url":"https://api.github.com/users/attitude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/attitude/subscriptions","organizations_url":"https://api.github.com/users/attitude/orgs","repos_url":"https://api.github.com/users/attitude/repos","events_url":"https://api.github.com/users/attitude/events{/privacy}","received_events_url":"https://api.github.com/users/attitude/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-17T12:28:44Z","updated_at":"2015-03-10T07:21:46Z","closed_at":"2015-03-09T23:48:55Z","pull_request":{"url":"https://api.github.com/repos/download-monitor/download-monitor/pulls/238","html_url":"https://github.com/download-monitor/download-monitor/pull/238","diff_url":"https://github.com/download-monitor/download-monitor/pull/238.diff","patch_url":"https://github.com/download-monitor/download-monitor/pull/238.patch"},"body":"Fixes version string escaping. Escaping happens when generating download link by `dlm_download_get_the_download_link` filter, but is missing when comparing version strings.\r\n\r\nFix: simulate result of version string escaping and removes protocol added by the `esc_url_raw()`.\r\n\r\nUse case when `strtolower( $version->version ) === strtolower( $version_string )` fails:\r\n\r\n```php\r\nclass DLM_Download {\r\n    // [...]\r\n    public function get_the_download_link() {\r\n        // [...]  $link: 'http://example.com/download/123/?version=some text with spaces'\r\n\r\n        return apply_filters( 'dlm_download_get_the_download_link', esc_url_raw( $link ), $this, $this->version_id );\r\n        // esc_url_raw($link) >>> 'http://example.com/download/123/?version=sometextwithspaces'\r\n    }\r\n\r\n    // [...]\r\n\r\n    public function get_version_id( $version_string = '' ) {\r\n        // [...] $version_string from $_GET['version']: 'sometextwithspaces';\r\n\r\n        foreach ( $versions as $version_id => $version ) {\r\n            // $version->version: 'some text with spaces'\r\n            // strtolower( $url_compatible_version ) === strtolower( $version_string ): false\r\n        }\r\n    }\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/download-monitor/download-monitor/issues/comments/78006455","html_url":"https://github.com/download-monitor/download-monitor/pull/238#issuecomment-78006455","issue_url":"https://api.github.com/repos/download-monitor/download-monitor/issues/238","id":78006455,"user":{"login":"attitude","id":387611,"avatar_url":"https://avatars.githubusercontent.com/u/387611?v=3","gravatar_id":"","url":"https://api.github.com/users/attitude","html_url":"https://github.com/attitude","followers_url":"https://api.github.com/users/attitude/followers","following_url":"https://api.github.com/users/attitude/following{/other_user}","gists_url":"https://api.github.com/users/attitude/gists{/gist_id}","starred_url":"https://api.github.com/users/attitude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/attitude/subscriptions","organizations_url":"https://api.github.com/users/attitude/orgs","repos_url":"https://api.github.com/users/attitude/repos","events_url":"https://api.github.com/users/attitude/events{/privacy}","received_events_url":"https://api.github.com/users/attitude/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T07:21:46Z","updated_at":"2015-03-10T07:21:46Z","body":"Great to hear that. Thanks."}}