{"action":"created","issue":{"url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/205","labels_url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/205/comments","events_url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/205/events","html_url":"https://github.com/deliciousbrains/GlotPress/pull/205","id":126230905,"number":205,"title":"203 Fix issue with permalink structures that did not have trailing slashes","user":{"login":"toolstack","id":9053749,"avatar_url":"https://avatars.githubusercontent.com/u/9053749?v=3","gravatar_id":"","url":"https://api.github.com/users/toolstack","html_url":"https://github.com/toolstack","followers_url":"https://api.github.com/users/toolstack/followers","following_url":"https://api.github.com/users/toolstack/following{/other_user}","gists_url":"https://api.github.com/users/toolstack/gists{/gist_id}","starred_url":"https://api.github.com/users/toolstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toolstack/subscriptions","organizations_url":"https://api.github.com/users/toolstack/orgs","repos_url":"https://api.github.com/users/toolstack/repos","events_url":"https://api.github.com/users/toolstack/events{/privacy}","received_events_url":"https://api.github.com/users/toolstack/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/deliciousbrains/GlotPress/labels/ready%20for%20review","name":"ready for review","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/deliciousbrains/GlotPress/milestones/1","html_url":"https://github.com/deliciousbrains/GlotPress/milestones/1.0","labels_url":"https://api.github.com/repos/deliciousbrains/GlotPress/milestones/1/labels","id":1322118,"number":1,"title":"1.0","description":"","creator":{"login":"bradt","id":190095,"avatar_url":"https://avatars.githubusercontent.com/u/190095?v=3","gravatar_id":"","url":"https://api.github.com/users/bradt","html_url":"https://github.com/bradt","followers_url":"https://api.github.com/users/bradt/followers","following_url":"https://api.github.com/users/bradt/following{/other_user}","gists_url":"https://api.github.com/users/bradt/gists{/gist_id}","starred_url":"https://api.github.com/users/bradt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradt/subscriptions","organizations_url":"https://api.github.com/users/bradt/orgs","repos_url":"https://api.github.com/users/bradt/repos","events_url":"https://api.github.com/users/bradt/events{/privacy}","received_events_url":"https://api.github.com/users/bradt/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":146,"state":"open","created_at":"2015-09-24T13:18:51Z","updated_at":"2016-01-13T21:11:29Z","due_on":"2016-01-17T23:00:00Z","closed_at":null},"comments":3,"created_at":"2016-01-12T17:32:46Z","updated_at":"2016-01-13T22:59:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/deliciousbrains/GlotPress/pulls/205","html_url":"https://github.com/deliciousbrains/GlotPress/pull/205","diff_url":"https://github.com/deliciousbrains/GlotPress/pull/205.diff","patch_url":"https://github.com/deliciousbrains/GlotPress/pull/205.patch"},"body":"… by adding user_trailingslashit() to gp_url_base_path() instead of ALWAYS appending a trailing slash.\r\n\r\nResolves #203."},"comment":{"url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/comments/171464836","html_url":"https://github.com/deliciousbrains/GlotPress/pull/205#issuecomment-171464836","issue_url":"https://api.github.com/repos/deliciousbrains/GlotPress/issues/205","id":171464836,"user":{"login":"ocean90","id":617637,"avatar_url":"https://avatars.githubusercontent.com/u/617637?v=3","gravatar_id":"","url":"https://api.github.com/users/ocean90","html_url":"https://github.com/ocean90","followers_url":"https://api.github.com/users/ocean90/followers","following_url":"https://api.github.com/users/ocean90/following{/other_user}","gists_url":"https://api.github.com/users/ocean90/gists{/gist_id}","starred_url":"https://api.github.com/users/ocean90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocean90/subscriptions","organizations_url":"https://api.github.com/users/ocean90/orgs","repos_url":"https://api.github.com/users/ocean90/repos","events_url":"https://api.github.com/users/ocean90/events{/privacy}","received_events_url":"https://api.github.com/users/ocean90/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T22:59:16Z","updated_at":"2016-01-13T22:59:16Z","body":"That's starting to get messy. We need a way to override the value of `GP_URL_BASE`, maybe a `gp_url_base` filter?\r\n\r\nWith the applied patch, permalinks set to `/%postname%` and `GP_URL_BASE` defined as `'/'` or `''` you will get a PHP notice:\r\n\r\n```\r\nNotice: Undefined index: path in /srv/www/glotpress-plugin/wordpress/wp-content/plugins/glotpress/gp-includes/url.php on line 14\r\nCall Stack\r\n#\tTime\tMemory\tFunction\tLocation\r\n1\t0.0023\t241552\t{main}( )\t.../index.php:0\r\n2\t0.0040\t242256\trequire( '/srv/www/glotpress-plugin/wordpress/wp-blog-header.php' )\t.../index.php:17\r\n3\t0.7019\t3149152\trequire_once( '/srv/www/glotpress-plugin/wordpress/wp-includes/template-loader.php' )\t.../wp-blog-header.php:16\r\n4\t0.7019\t3149200\tdo_action( string(17), ??? )\t.../template-loader.php:12\r\n5\t0.7113\t3425240\tcall_user_func_array:{/srv/www/glotpress-plugin/wordpress/wp-includes/plugin.php:525} ( string(12), array(1) )\t.../plugin.php:525\r\n6\t0.7113\t3425344\tgp_run_route( string(0) )\t.../plugin.php:525\r\n7\t0.7113\t3425824\tGP_Router->route( )\t.../rewrite.php:81\r\n8\t0.7114\t3426296\tgp_url_path( string(23) )\t.../router.php:148\r\n```\r\n\r\nThat's because `gp_url_path()` assumes that there is always a path. Changing the return value to `isset( $parsed['path'] ) ? $parsed['path'] : '';` will fix the notice but now many links don't include the domain anymore:\r\n\r\n```html\r\n<a href=\"http://projects/wordpress\" title=\"Project: WordPress\">WordPress</a>\r\n```\r\n"}}