{"action":"created","comment":{"url":"https://api.github.com/repos/shaarli/Shaarli/pulls/comments/44987168","id":44987168,"diff_hunk":"@@ -168,3 +168,35 @@ function is_session_id_valid($sessionId)\n \n     return true;\n }\n+\n+/**\n+ * In a string, converts URLs to clickable links.\n+ *\n+ * @param string $text       input string.\n+ * @param string $redirector if a redirector is set, use it to gerenate links.\n+ *\n+ * @return string returns $text with all links converted to HTML links.\n+ *\n+ * @see Function inspired from http://www.php.net/manual/en/function.preg-replace.php#85722\n+ */\n+function text2clickable($text, $redirector)\n+{\n+    $regex = '!(((?:https?|ftp|file)://|apt:|magnet:)\\S+[[:alnum:]]/?)!si';\n+\n+    if (empty($redirector)) {\n+        return preg_replace($regex, '<a href=\"$1\" rel=\"nofollow\">$1</a>', $text);\n+    }\n+    // Redirector is , urlencode the final URL.\n+    return preg_replace(\n+        $regex . 'e',\n+        \"'<a href=\\\"\". $redirector .\"'. urlencode('$1') .'\\\" rel=\\\"nofollow\\\">$1</a>'\",\n+        $text\n+    );\n+}\n+\n+// This function inserts &nbsp; where relevant so that multiple spaces are properly displayed in HTML\n+// even in the absence of <pre>  (This is used in description to keep text formatting)","path":"application/Utils.php","position":31,"original_position":31,"commit_id":"5f8d3dec352d45585ca5ce71e8de3b8ad8a540dd","original_commit_id":"5f8d3dec352d45585ca5ce71e8de3b8ad8a540dd","user":{"login":"ArthurHoaro","id":1962678,"avatar_url":"https://avatars.githubusercontent.com/u/1962678?v=3","gravatar_id":"","url":"https://api.github.com/users/ArthurHoaro","html_url":"https://github.com/ArthurHoaro","followers_url":"https://api.github.com/users/ArthurHoaro/followers","following_url":"https://api.github.com/users/ArthurHoaro/following{/other_user}","gists_url":"https://api.github.com/users/ArthurHoaro/gists{/gist_id}","starred_url":"https://api.github.com/users/ArthurHoaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArthurHoaro/subscriptions","organizations_url":"https://api.github.com/users/ArthurHoaro/orgs","repos_url":"https://api.github.com/users/ArthurHoaro/repos","events_url":"https://api.github.com/users/ArthurHoaro/events{/privacy}","received_events_url":"https://api.github.com/users/ArthurHoaro/received_events","type":"User","site_admin":false},"body":"Comments.","created_at":"2015-11-16T21:37:37Z","updated_at":"2015-11-16T21:37:37Z","html_url":"https://github.com/shaarli/Shaarli/pull/379#discussion_r44987168","pull_request_url":"https://api.github.com/repos/shaarli/Shaarli/pulls/379","_links":{"self":{"href":"https://api.github.com/repos/shaarli/Shaarli/pulls/comments/44987168"},"html":{"href":"https://github.com/shaarli/Shaarli/pull/379#discussion_r44987168"},"pull_request":{"href":"https://api.github.com/repos/shaarli/Shaarli/pulls/379"}}},"pull_request":{"url":"https://api.github.com/repos/shaarli/Shaarli/pulls/379","id":50848692,"html_url":"https://github.com/shaarli/Shaarli/pull/379","diff_url":"https://github.com/shaarli/Shaarli/pull/379.diff","patch_url":"https://github.com/shaarli/Shaarli/pull/379.patch","issue_url":"https://api.github.com/repos/shaarli/Shaarli/issues/379","number":379,"state":"open","locked":false,"title":"PLUGIN Markdown","user":{"login":"ArthurHoaro","id":1962678,"avatar_url":"https://avatars.githubusercontent.com/u/1962678?v=3","gravatar_id":"","url":"https://api.github.com/users/ArthurHoaro","html_url":"https://github.com/ArthurHoaro","followers_url":"https://api.github.com/users/ArthurHoaro/followers","following_url":"https://api.github.com/users/ArthurHoaro/following{/other_user}","gists_url":"https://api.github.com/users/ArthurHoaro/gists{/gist_id}","starred_url":"https://api.github.com/users/ArthurHoaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArthurHoaro/subscriptions","organizations_url":"https://api.github.com/users/ArthurHoaro/orgs","repos_url":"https://api.github.com/users/ArthurHoaro/repos","events_url":"https://api.github.com/users/ArthurHoaro/events{/privacy}","received_events_url":"https://api.github.com/users/ArthurHoaro/received_events","type":"User","site_admin":false},"body":"Parse link description in Markdown (HTML) before rendering.\r\n\r\n  * hard remove of Shaarli's HTML before parsing.\r\n  * Using Parsedown <https://github.com/erusev/parsedown> PHP lib.\r\n  * fixes a bug where description links with a redirector aren't using urlencode() + coding style.","created_at":"2015-11-16T18:43:40Z","updated_at":"2015-11-16T21:37:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44ead38b9a53d4fb5a4dabfc8f3a910ca564d8f0","assignee":{"login":"ArthurHoaro","id":1962678,"avatar_url":"https://avatars.githubusercontent.com/u/1962678?v=3","gravatar_id":"","url":"https://api.github.com/users/ArthurHoaro","html_url":"https://github.com/ArthurHoaro","followers_url":"https://api.github.com/users/ArthurHoaro/followers","following_url":"https://api.github.com/users/ArthurHoaro/following{/other_user}","gists_url":"https://api.github.com/users/ArthurHoaro/gists{/gist_id}","starred_url":"https://api.github.com/users/ArthurHoaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArthurHoaro/subscriptions","organizations_url":"https://api.github.com/users/ArthurHoaro/orgs","repos_url":"https://api.github.com/users/ArthurHoaro/repos","events_url":"https://api.github.com/users/ArthurHoaro/events{/privacy}","received_events_url":"https://api.github.com/users/ArthurHoaro/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/shaarli/Shaarli/milestones/8","html_url":"https://github.com/shaarli/Shaarli/milestones/0.7.0","labels_url":"https://api.github.com/repos/shaarli/Shaarli/milestones/8/labels","id":1233261,"number":8,"title":"0.7.0","description":"Code cleanup! Tools!\r\nNew plugins and plugin settings UI.","creator":{"login":"virtualtam","id":1615162,"avatar_url":"https://avatars.githubusercontent.com/u/1615162?v=3","gravatar_id":"","url":"https://api.github.com/users/virtualtam","html_url":"https://github.com/virtualtam","followers_url":"https://api.github.com/users/virtualtam/followers","following_url":"https://api.github.com/users/virtualtam/following{/other_user}","gists_url":"https://api.github.com/users/virtualtam/gists{/gist_id}","starred_url":"https://api.github.com/users/virtualtam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virtualtam/subscriptions","organizations_url":"https://api.github.com/users/virtualtam/orgs","repos_url":"https://api.github.com/users/virtualtam/repos","events_url":"https://api.github.com/users/virtualtam/events{/privacy}","received_events_url":"https://api.github.com/users/virtualtam/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":4,"state":"open","created_at":"2015-07-30T10:09:53Z","updated_at":"2015-11-16T18:43:40Z","due_on":"2015-12-19T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/shaarli/Shaarli/pulls/379/commits","review_comments_url":"https://api.github.com/repos/shaarli/Shaarli/pulls/379/comments","review_comment_url":"https://api.github.com/repos/shaarli/Shaarli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shaarli/Shaarli/issues/379/comments","statuses_url":"https://api.github.com/repos/shaarli/Shaarli/statuses/5f8d3dec352d45585ca5ce71e8de3b8ad8a540dd","head":{"label":"ArthurHoaro:plugin-markdown","ref":"plugin-markdown","sha":"5f8d3dec352d45585ca5ce71e8de3b8ad8a540dd","user":{"login":"ArthurHoaro","id":1962678,"avatar_url":"https://avatars.githubusercontent.com/u/1962678?v=3","gravatar_id":"","url":"https://api.github.com/users/ArthurHoaro","html_url":"https://github.com/ArthurHoaro","followers_url":"https://api.github.com/users/ArthurHoaro/followers","following_url":"https://api.github.com/users/ArthurHoaro/following{/other_user}","gists_url":"https://api.github.com/users/ArthurHoaro/gists{/gist_id}","starred_url":"https://api.github.com/users/ArthurHoaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArthurHoaro/subscriptions","organizations_url":"https://api.github.com/users/ArthurHoaro/orgs","repos_url":"https://api.github.com/users/ArthurHoaro/repos","events_url":"https://api.github.com/users/ArthurHoaro/events{/privacy}","received_events_url":"https://api.github.com/users/ArthurHoaro/received_events","type":"User","site_admin":false},"repo":{"id":27923711,"name":"Shaarli","full_name":"ArthurHoaro/Shaarli","owner":{"login":"ArthurHoaro","id":1962678,"avatar_url":"https://avatars.githubusercontent.com/u/1962678?v=3","gravatar_id":"","url":"https://api.github.com/users/ArthurHoaro","html_url":"https://github.com/ArthurHoaro","followers_url":"https://api.github.com/users/ArthurHoaro/followers","following_url":"https://api.github.com/users/ArthurHoaro/following{/other_user}","gists_url":"https://api.github.com/users/ArthurHoaro/gists{/gist_id}","starred_url":"https://api.github.com/users/ArthurHoaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArthurHoaro/subscriptions","organizations_url":"https://api.github.com/users/ArthurHoaro/orgs","repos_url":"https://api.github.com/users/ArthurHoaro/repos","events_url":"https://api.github.com/users/ArthurHoaro/events{/privacy}","received_events_url":"https://api.github.com/users/ArthurHoaro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ArthurHoaro/Shaarli","description":"The personal, minimalist, super-fast, no-database delicious clone - community repo","fork":true,"url":"https://api.github.com/repos/ArthurHoaro/Shaarli","forks_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/forks","keys_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/teams","hooks_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/hooks","issue_events_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/issues/events{/number}","events_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/events","assignees_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/assignees{/user}","branches_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/branches{/branch}","tags_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/tags","blobs_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/git/refs{/sha}","trees_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/statuses/{sha}","languages_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/languages","stargazers_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/stargazers","contributors_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/contributors","subscribers_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/subscribers","subscription_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/subscription","commits_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/commits{/sha}","git_commits_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/git/commits{/sha}","comments_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/comments{/number}","issue_comment_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/issues/comments{/number}","contents_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/contents/{+path}","compare_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/merges","archive_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/downloads","issues_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/issues{/number}","pulls_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/pulls{/number}","milestones_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/milestones{/number}","notifications_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/labels{/name}","releases_url":"https://api.github.com/repos/ArthurHoaro/Shaarli/releases{/id}","created_at":"2014-12-12T14:31:01Z","updated_at":"2015-10-18T12:25:50Z","pushed_at":"2015-11-16T21:33:12Z","git_url":"git://github.com/ArthurHoaro/Shaarli.git","ssh_url":"git@github.com:ArthurHoaro/Shaarli.git","clone_url":"https://github.com/ArthurHoaro/Shaarli.git","svn_url":"https://github.com/ArthurHoaro/Shaarli","homepage":"https://github.com/shaarli/Shaarli","size":1834,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"shaarli:master","ref":"master","sha":"44d60adc5e2fa547bc49620f7e647794f0cad631","user":{"login":"shaarli","id":8275533,"avatar_url":"https://avatars.githubusercontent.com/u/8275533?v=3","gravatar_id":"","url":"https://api.github.com/users/shaarli","html_url":"https://github.com/shaarli","followers_url":"https://api.github.com/users/shaarli/followers","following_url":"https://api.github.com/users/shaarli/following{/other_user}","gists_url":"https://api.github.com/users/shaarli/gists{/gist_id}","starred_url":"https://api.github.com/users/shaarli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaarli/subscriptions","organizations_url":"https://api.github.com/users/shaarli/orgs","repos_url":"https://api.github.com/users/shaarli/repos","events_url":"https://api.github.com/users/shaarli/events{/privacy}","received_events_url":"https://api.github.com/users/shaarli/received_events","type":"Organization","site_admin":false},"repo":{"id":22287975,"name":"Shaarli","full_name":"shaarli/Shaarli","owner":{"login":"shaarli","id":8275533,"avatar_url":"https://avatars.githubusercontent.com/u/8275533?v=3","gravatar_id":"","url":"https://api.github.com/users/shaarli","html_url":"https://github.com/shaarli","followers_url":"https://api.github.com/users/shaarli/followers","following_url":"https://api.github.com/users/shaarli/following{/other_user}","gists_url":"https://api.github.com/users/shaarli/gists{/gist_id}","starred_url":"https://api.github.com/users/shaarli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaarli/subscriptions","organizations_url":"https://api.github.com/users/shaarli/orgs","repos_url":"https://api.github.com/users/shaarli/repos","events_url":"https://api.github.com/users/shaarli/events{/privacy}","received_events_url":"https://api.github.com/users/shaarli/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shaarli/Shaarli","description":"The personal, minimalist, super-fast, no-database delicious clone - community repo","fork":true,"url":"https://api.github.com/repos/shaarli/Shaarli","forks_url":"https://api.github.com/repos/shaarli/Shaarli/forks","keys_url":"https://api.github.com/repos/shaarli/Shaarli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shaarli/Shaarli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shaarli/Shaarli/teams","hooks_url":"https://api.github.com/repos/shaarli/Shaarli/hooks","issue_events_url":"https://api.github.com/repos/shaarli/Shaarli/issues/events{/number}","events_url":"https://api.github.com/repos/shaarli/Shaarli/events","assignees_url":"https://api.github.com/repos/shaarli/Shaarli/assignees{/user}","branches_url":"https://api.github.com/repos/shaarli/Shaarli/branches{/branch}","tags_url":"https://api.github.com/repos/shaarli/Shaarli/tags","blobs_url":"https://api.github.com/repos/shaarli/Shaarli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shaarli/Shaarli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shaarli/Shaarli/git/refs{/sha}","trees_url":"https://api.github.com/repos/shaarli/Shaarli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shaarli/Shaarli/statuses/{sha}","languages_url":"https://api.github.com/repos/shaarli/Shaarli/languages","stargazers_url":"https://api.github.com/repos/shaarli/Shaarli/stargazers","contributors_url":"https://api.github.com/repos/shaarli/Shaarli/contributors","subscribers_url":"https://api.github.com/repos/shaarli/Shaarli/subscribers","subscription_url":"https://api.github.com/repos/shaarli/Shaarli/subscription","commits_url":"https://api.github.com/repos/shaarli/Shaarli/commits{/sha}","git_commits_url":"https://api.github.com/repos/shaarli/Shaarli/git/commits{/sha}","comments_url":"https://api.github.com/repos/shaarli/Shaarli/comments{/number}","issue_comment_url":"https://api.github.com/repos/shaarli/Shaarli/issues/comments{/number}","contents_url":"https://api.github.com/repos/shaarli/Shaarli/contents/{+path}","compare_url":"https://api.github.com/repos/shaarli/Shaarli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shaarli/Shaarli/merges","archive_url":"https://api.github.com/repos/shaarli/Shaarli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shaarli/Shaarli/downloads","issues_url":"https://api.github.com/repos/shaarli/Shaarli/issues{/number}","pulls_url":"https://api.github.com/repos/shaarli/Shaarli/pulls{/number}","milestones_url":"https://api.github.com/repos/shaarli/Shaarli/milestones{/number}","notifications_url":"https://api.github.com/repos/shaarli/Shaarli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shaarli/Shaarli/labels{/name}","releases_url":"https://api.github.com/repos/shaarli/Shaarli/releases{/id}","created_at":"2014-07-26T14:10:30Z","updated_at":"2015-11-09T07:44:15Z","pushed_at":"2015-11-16T21:33:13Z","git_url":"git://github.com/shaarli/Shaarli.git","ssh_url":"git@github.com:shaarli/Shaarli.git","clone_url":"https://github.com/shaarli/Shaarli.git","svn_url":"https://github.com/shaarli/Shaarli","homepage":"https://github.com/shaarli/Shaarli","size":4163,"stargazers_count":156,"watchers_count":156,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":81,"forks":31,"open_issues":81,"watchers":156,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shaarli/Shaarli/pulls/379"},"html":{"href":"https://github.com/shaarli/Shaarli/pull/379"},"issue":{"href":"https://api.github.com/repos/shaarli/Shaarli/issues/379"},"comments":{"href":"https://api.github.com/repos/shaarli/Shaarli/issues/379/comments"},"review_comments":{"href":"https://api.github.com/repos/shaarli/Shaarli/pulls/379/comments"},"review_comment":{"href":"https://api.github.com/repos/shaarli/Shaarli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shaarli/Shaarli/pulls/379/commits"},"statuses":{"href":"https://api.github.com/repos/shaarli/Shaarli/statuses/5f8d3dec352d45585ca5ce71e8de3b8ad8a540dd"}}}}