{"action":"created","issue":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3787","labels_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3787/labels{/name}","comments_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3787/comments","events_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3787/events","html_url":"https://github.com/bcit-ci/CodeIgniter/issues/3787","id":69525153,"number":3787,"title":"FTP delete_dir issue as well as solution","user":{"login":"mainuljs","id":7961667,"avatar_url":"https://avatars.githubusercontent.com/u/7961667?v=3","gravatar_id":"","url":"https://api.github.com/users/mainuljs","html_url":"https://github.com/mainuljs","followers_url":"https://api.github.com/users/mainuljs/followers","following_url":"https://api.github.com/users/mainuljs/following{/other_user}","gists_url":"https://api.github.com/users/mainuljs/gists{/gist_id}","starred_url":"https://api.github.com/users/mainuljs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mainuljs/subscriptions","organizations_url":"https://api.github.com/users/mainuljs/orgs","repos_url":"https://api.github.com/users/mainuljs/repos","events_url":"https://api.github.com/users/mainuljs/events{/privacy}","received_events_url":"https://api.github.com/users/mainuljs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-20T07:22:16Z","updated_at":"2015-04-20T10:01:04Z","closed_at":null,"body":"Ftp delete_dir() does not work. \r\nProblem:\r\n\tif ( ! preg_match('#/\\.\\.?$#', $list[$i]) && ! @ftp_delete($this->conn_id, $list[$i]))\r\n\t{\r\n\t\t$this->delete_dir($list[$i]);\r\n\t}\r\n\r\n1. Regular expression checking failed. Because unwanted '/' after starting #. Maybe typo.\r\n\r\n2. list_files() returns array of only files and folders name. Not the path. So Recursive function argument will be $filepath.$lish[$i] and ftp_delete() path will $filepath.$lish[$i].\r\n\r\n3. Final Solution is \r\n\tif ( ! preg_match('#\\.\\.?$#', $list[$i]) && ! @ftp_delete($this->conn_id, $filepath.$list[$i]))\r\n\t{\r\n\t$this->delete_dir($filepath.$list[$i]);\r\n\t}\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/comments/94412860","html_url":"https://github.com/bcit-ci/CodeIgniter/issues/3787#issuecomment-94412860","issue_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3787","id":94412860,"user":{"login":"mainuljs","id":7961667,"avatar_url":"https://avatars.githubusercontent.com/u/7961667?v=3","gravatar_id":"","url":"https://api.github.com/users/mainuljs","html_url":"https://github.com/mainuljs","followers_url":"https://api.github.com/users/mainuljs/followers","following_url":"https://api.github.com/users/mainuljs/following{/other_user}","gists_url":"https://api.github.com/users/mainuljs/gists{/gist_id}","starred_url":"https://api.github.com/users/mainuljs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mainuljs/subscriptions","organizations_url":"https://api.github.com/users/mainuljs/orgs","repos_url":"https://api.github.com/users/mainuljs/repos","events_url":"https://api.github.com/users/mainuljs/events{/privacy}","received_events_url":"https://api.github.com/users/mainuljs/received_events","type":"User","site_admin":false},"created_at":"2015-04-20T10:01:04Z","updated_at":"2015-04-20T10:01:04Z","body":"<code>\r\n$this->delete_dir($filepath.$list[$i]);\r\n</code>"}}