{"action":"created","issue":{"url":"https://api.github.com/repos/qtranslate/qtranslate-xt/issues/618","repository_url":"https://api.github.com/repos/qtranslate/qtranslate-xt","labels_url":"https://api.github.com/repos/qtranslate/qtranslate-xt/issues/618/labels{/name}","comments_url":"https://api.github.com/repos/qtranslate/qtranslate-xt/issues/618/comments","events_url":"https://api.github.com/repos/qtranslate/qtranslate-xt/issues/618/events","html_url":"https://github.com/qtranslate/qtranslate-xt/issues/618","id":385918448,"node_id":"MDU6SXNzdWUzODU5MTg0NDg=","number":618,"title":"init redirect causing exit from cli","user":{"login":"Ryvix","id":36013493,"node_id":"MDQ6VXNlcjM2MDEzNDkz","avatar_url":"https://avatars0.githubusercontent.com/u/36013493?v=4","gravatar_id":"","url":"https://api.github.com/users/Ryvix","html_url":"https://github.com/Ryvix","followers_url":"https://api.github.com/users/Ryvix/followers","following_url":"https://api.github.com/users/Ryvix/following{/other_user}","gists_url":"https://api.github.com/users/Ryvix/gists{/gist_id}","starred_url":"https://api.github.com/users/Ryvix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ryvix/subscriptions","organizations_url":"https://api.github.com/users/Ryvix/orgs","repos_url":"https://api.github.com/users/Ryvix/repos","events_url":"https://api.github.com/users/Ryvix/events{/privacy}","received_events_url":"https://api.github.com/users/Ryvix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-29T20:44:44Z","updated_at":"2018-11-30T14:03:36Z","closed_at":null,"author_association":"NONE","body":"Hi there,\r\n\r\nI'm using the php command to run a php file which loads WP and runs a cron task to sync a database. I'm not completely sure when this issue started but I've tracked it down to this plugin causing the cron that's being run from the cli to not fire due to exiting on the redirect on line 105 in qtranslate_core.php.\r\n\r\nI discovered if I change the line 101 in qtranslate_core.php to check if $target is empty it seems to fix it for me. Is there a better way to do this?\r\n\r\n```\t\t\tif ( !empty($target) && $target !== false && $target != $url_orig ) {```\r\n"},"comment":{"url":"https://api.github.com/repos/qtranslate/qtranslate-xt/issues/comments/443212539","html_url":"https://github.com/qtranslate/qtranslate-xt/issues/618#issuecomment-443212539","issue_url":"https://api.github.com/repos/qtranslate/qtranslate-xt/issues/618","id":443212539,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzIxMjUzOQ==","user":{"login":"herrvigg","id":19155375,"node_id":"MDQ6VXNlcjE5MTU1Mzc1","avatar_url":"https://avatars2.githubusercontent.com/u/19155375?v=4","gravatar_id":"","url":"https://api.github.com/users/herrvigg","html_url":"https://github.com/herrvigg","followers_url":"https://api.github.com/users/herrvigg/followers","following_url":"https://api.github.com/users/herrvigg/following{/other_user}","gists_url":"https://api.github.com/users/herrvigg/gists{/gist_id}","starred_url":"https://api.github.com/users/herrvigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/herrvigg/subscriptions","organizations_url":"https://api.github.com/users/herrvigg/orgs","repos_url":"https://api.github.com/users/herrvigg/repos","events_url":"https://api.github.com/users/herrvigg/events{/privacy}","received_events_url":"https://api.github.com/users/herrvigg/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T14:03:36Z","updated_at":"2018-11-30T14:03:36Z","author_association":"COLLABORATOR","body":"If you look in `qtranxf_can_redirect` defined in qtranslate_utils.php there is a check on `DOING_CRON` which should prevent the redirection. Is this global properly defined for you in the cron task? Note there is also `WP_CLI` which is handled similarly."}}
{"actor":{"display_login":"herrvigg"}}