{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/11715","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11715/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11715/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11715/events","html_url":"https://github.com/joomla/joomla-cms/pull/11715","id":172370627,"number":11715,"title":"Handle the case that JFolder::files returns 'false'","user":{"login":"okonomiyaki3000","id":79470,"avatar_url":"https://avatars3.githubusercontent.com/u/79470?v=4","gravatar_id":"","url":"https://api.github.com/users/okonomiyaki3000","html_url":"https://github.com/okonomiyaki3000","followers_url":"https://api.github.com/users/okonomiyaki3000/followers","following_url":"https://api.github.com/users/okonomiyaki3000/following{/other_user}","gists_url":"https://api.github.com/users/okonomiyaki3000/gists{/gist_id}","starred_url":"https://api.github.com/users/okonomiyaki3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okonomiyaki3000/subscriptions","organizations_url":"https://api.github.com/users/okonomiyaki3000/orgs","repos_url":"https://api.github.com/users/okonomiyaki3000/repos","events_url":"https://api.github.com/users/okonomiyaki3000/events{/privacy}","received_events_url":"https://api.github.com/users/okonomiyaki3000/received_events","type":"User","site_admin":false},"labels":[{"id":60721348,"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-22T05:08:17Z","updated_at":"2018-04-22T19:57:52Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/11715","html_url":"https://github.com/joomla/joomla-cms/pull/11715","diff_url":"https://github.com/joomla/joomla-cms/pull/11715.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/11715.patch"},"body":"Pull Request for Issue # .\r\n### Summary of Changes\r\n\r\nBasically, check that we actually got a list of files before trying to work on it as an array. \r\n`JFolder::files()` may return `false` in some cases. So we need to check that before using its response as an array. \r\n### Testing Instructions\r\n\r\nTo expose the error, I guess you need to install an extension whose manifest file specifies a schemapath which does not exist. So, yes, this bug only really shows up when the extension to be installed has something wrong with it. What will happen is that `JFolder::files()` will return `false` which is passed to str_replace. I'm not sure what gets returned at that point but it's definitely not an array as expected. That return value will be passed to `usort`, `count`, `foreach`, and `end` as if it were an array. These will generate warnings. \r\n\r\nAfter applying this fix, the function should exit when `JFolder::files()` return `false` or empty array. No warnings.\r\n### Documentation Changes Required\r\n\r\nNope.\r\n"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/383407979","html_url":"https://github.com/joomla/joomla-cms/pull/11715#issuecomment-383407979","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11715","id":383407979,"user":{"login":"Quy","id":368084,"avatar_url":"https://avatars2.githubusercontent.com/u/368084?v=4","gravatar_id":"","url":"https://api.github.com/users/Quy","html_url":"https://github.com/Quy","followers_url":"https://api.github.com/users/Quy/followers","following_url":"https://api.github.com/users/Quy/following{/other_user}","gists_url":"https://api.github.com/users/Quy/gists{/gist_id}","starred_url":"https://api.github.com/users/Quy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Quy/subscriptions","organizations_url":"https://api.github.com/users/Quy/orgs","repos_url":"https://api.github.com/users/Quy/repos","events_url":"https://api.github.com/users/Quy/events{/privacy}","received_events_url":"https://api.github.com/users/Quy/received_events","type":"User","site_admin":false},"created_at":"2018-04-22T19:57:52Z","updated_at":"2018-04-22T19:57:52Z","author_association":"CONTRIBUTOR","body":"RTC<hr /><sub>This comment was created with the <a href=\"https://github.com/joomla/jissues\">J!Tracker Application</a> at <a href=\"https://issues.joomla.org/tracker/joomla-cms/11715\">issues.joomla.org/tracker/joomla-cms/11715</a>.</sub>"}}
{"actor":{"display_login":"Quy"}}