{"action":"created","comment":{"url":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/comments/226820909","pull_request_review_id":166743297,"id":226820909,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjgyMDkwOQ==","diff_hunk":"@@ -100,17 +104,41 @@ public static string SaveFilePanelInProject(string title, string defaultPath, st\n         /// Converts the specified absolute path to a path relative to the Assets folder.\n         /// Returns null if the path does not contains the Assets folder.\n         /// </summary>\n-        private static string AbsoluteToAssetsRelativePath(string absolutePath)\n+        internal static string AbsoluteToAssetsRelativePath(string absolutePath)\n+        {\n+            return AbsoluteToRelativePath(absolutePath, Application.dataPath);\n+        }\n+\n+        // Assumes the paths are separated with forward slashes.\n+        // Visible for testing.\n+        internal static string AbsoluteToRelativePath(string absolutePath, string parentPath)\n         {\n-            var parentPath = Application.dataPath + Path.DirectorySeparatorChar;\n-            var index = absolutePath.IndexOf(parentPath, StringComparison.Ordinal);\n-            if (index != 0)\n+            if (string.IsNullOrEmpty(absolutePath) || string.IsNullOrEmpty(parentPath))\n             {\n                 return null;\n             }\n \n-            var relativePath = absolutePath.Remove(index, parentPath.Length);\n-            return Path.Combine(\"Assets\", relativePath);\n+            // Strip trailing slash.\n+            if (parentPath.Last() == '/')\n+            {\n+                parentPath = parentPath.Remove(parentPath.Length - 1);\n+            }\n+\n+            if (!absolutePath.StartsWith(parentPath, StringComparison.Ordinal))\n+            {\n+                return null;\n+            }\n+\n+            char[] pathSeparator = {'/'};","path":"GooglePlayInstant/Editor/QuickDeploy/DialogHelper.cs","position":null,"original_position":50,"commit_id":"c1024bed3051cd61e5ba0e310db15056ce27e9b7","original_commit_id":"816b86ad0450fa6eb4c857c737f0c5c817cf0f63","user":{"login":"thanwah","id":38674020,"node_id":"MDQ6VXNlcjM4Njc0MDIw","avatar_url":"https://avatars2.githubusercontent.com/u/38674020?v=4","gravatar_id":"","url":"https://api.github.com/users/thanwah","html_url":"https://github.com/thanwah","followers_url":"https://api.github.com/users/thanwah/followers","following_url":"https://api.github.com/users/thanwah/following{/other_user}","gists_url":"https://api.github.com/users/thanwah/gists{/gist_id}","starred_url":"https://api.github.com/users/thanwah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanwah/subscriptions","organizations_url":"https://api.github.com/users/thanwah/orgs","repos_url":"https://api.github.com/users/thanwah/repos","events_url":"https://api.github.com/users/thanwah/events{/privacy}","received_events_url":"https://api.github.com/users/thanwah/received_events","type":"User","site_admin":false},"body":"Oh good question. I hadn't thought about this specific case carefully enough - I would've preferred `char[] pathSeparator = {'/'};` like you had originally. I might've considered making this a readonly field on the class.","created_at":"2018-10-20T08:54:34Z","updated_at":"2018-10-20T08:54:34Z","html_url":"https://github.com/google/play-instant-unity-plugin/pull/107#discussion_r226820909","pull_request_url":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/107","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/comments/226820909"},"html":{"href":"https://github.com/google/play-instant-unity-plugin/pull/107#discussion_r226820909"},"pull_request":{"href":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/107"}},"in_reply_to_id":226803816},"pull_request":{"url":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/107","id":224145845,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0MTQ1ODQ1","html_url":"https://github.com/google/play-instant-unity-plugin/pull/107","diff_url":"https://github.com/google/play-instant-unity-plugin/pull/107.diff","patch_url":"https://github.com/google/play-instant-unity-plugin/pull/107.patch","issue_url":"https://api.github.com/repos/google/play-instant-unity-plugin/issues/107","number":107,"state":"open","locked":false,"title":"Fixed save dialog issue on Windows","user":{"login":"jamcohen","id":4805315,"node_id":"MDQ6VXNlcjQ4MDUzMTU=","avatar_url":"https://avatars1.githubusercontent.com/u/4805315?v=4","gravatar_id":"","url":"https://api.github.com/users/jamcohen","html_url":"https://github.com/jamcohen","followers_url":"https://api.github.com/users/jamcohen/followers","following_url":"https://api.github.com/users/jamcohen/following{/other_user}","gists_url":"https://api.github.com/users/jamcohen/gists{/gist_id}","starred_url":"https://api.github.com/users/jamcohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamcohen/subscriptions","organizations_url":"https://api.github.com/users/jamcohen/orgs","repos_url":"https://api.github.com/users/jamcohen/repos","events_url":"https://api.github.com/users/jamcohen/events{/privacy}","received_events_url":"https://api.github.com/users/jamcohen/received_events","type":"User","site_admin":false},"body":"The issue blocked users from selecting a path for the generated loading scene. Instead, it would mistakenly declare that the chosen path was outside the Assets folder, and throw an error.","created_at":"2018-10-19T01:30:03Z","updated_at":"2018-10-20T08:54:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3c75e01b8508111b074597ea964b99d96c28145","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/107/commits","review_comments_url":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/107/comments","review_comment_url":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/play-instant-unity-plugin/issues/107/comments","statuses_url":"https://api.github.com/repos/google/play-instant-unity-plugin/statuses/c1024bed3051cd61e5ba0e310db15056ce27e9b7","head":{"label":"google:windowsbugfix","ref":"windowsbugfix","sha":"c1024bed3051cd61e5ba0e310db15056ce27e9b7","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":133990583,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM5OTA1ODM=","name":"play-instant-unity-plugin","full_name":"google/play-instant-unity-plugin","private":false,"owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/google/play-instant-unity-plugin","description":"The Google Play Instant Plugin for Unity Beta : Simplifies conversion of a Unity-based Android app into an instant app that can be deployed through Google Play Instant.","fork":false,"url":"https://api.github.com/repos/google/play-instant-unity-plugin","forks_url":"https://api.github.com/repos/google/play-instant-unity-plugin/forks","keys_url":"https://api.github.com/repos/google/play-instant-unity-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/play-instant-unity-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/play-instant-unity-plugin/teams","hooks_url":"https://api.github.com/repos/google/play-instant-unity-plugin/hooks","issue_events_url":"https://api.github.com/repos/google/play-instant-unity-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/google/play-instant-unity-plugin/events","assignees_url":"https://api.github.com/repos/google/play-instant-unity-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/google/play-instant-unity-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/google/play-instant-unity-plugin/tags","blobs_url":"https://api.github.com/repos/google/play-instant-unity-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/play-instant-unity-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/play-instant-unity-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/play-instant-unity-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/play-instant-unity-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/google/play-instant-unity-plugin/languages","stargazers_url":"https://api.github.com/repos/google/play-instant-unity-plugin/stargazers","contributors_url":"https://api.github.com/repos/google/play-instant-unity-plugin/contributors","subscribers_url":"https://api.github.com/repos/google/play-instant-unity-plugin/subscribers","subscription_url":"https://api.github.com/repos/google/play-instant-unity-plugin/subscription","commits_url":"https://api.github.com/repos/google/play-instant-unity-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/play-instant-unity-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/play-instant-unity-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/play-instant-unity-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/play-instant-unity-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/google/play-instant-unity-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/play-instant-unity-plugin/merges","archive_url":"https://api.github.com/repos/google/play-instant-unity-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/play-instant-unity-plugin/downloads","issues_url":"https://api.github.com/repos/google/play-instant-unity-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/google/play-instant-unity-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/google/play-instant-unity-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/play-instant-unity-plugin/labels{/name}","releases_url":"https://api.github.com/repos/google/play-instant-unity-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/google/play-instant-unity-plugin/deployments","created_at":"2018-05-18T18:28:57Z","updated_at":"2018-10-19T00:38:35Z","pushed_at":"2018-10-20T00:17:45Z","git_url":"git://github.com/google/play-instant-unity-plugin.git","ssh_url":"git@github.com:google/play-instant-unity-plugin.git","clone_url":"https://github.com/google/play-instant-unity-plugin.git","svn_url":"https://github.com/google/play-instant-unity-plugin","homepage":"","size":29815,"stargazers_count":84,"watchers_count":84,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":17,"open_issues":7,"watchers":84,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"902a2936ff5fa7c3fe121d5278ed0df8b6b5ca73","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":133990583,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM5OTA1ODM=","name":"play-instant-unity-plugin","full_name":"google/play-instant-unity-plugin","private":false,"owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/google/play-instant-unity-plugin","description":"The Google Play Instant Plugin for Unity Beta : Simplifies conversion of a Unity-based Android app into an instant app that can be deployed through Google Play Instant.","fork":false,"url":"https://api.github.com/repos/google/play-instant-unity-plugin","forks_url":"https://api.github.com/repos/google/play-instant-unity-plugin/forks","keys_url":"https://api.github.com/repos/google/play-instant-unity-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/play-instant-unity-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/play-instant-unity-plugin/teams","hooks_url":"https://api.github.com/repos/google/play-instant-unity-plugin/hooks","issue_events_url":"https://api.github.com/repos/google/play-instant-unity-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/google/play-instant-unity-plugin/events","assignees_url":"https://api.github.com/repos/google/play-instant-unity-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/google/play-instant-unity-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/google/play-instant-unity-plugin/tags","blobs_url":"https://api.github.com/repos/google/play-instant-unity-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/play-instant-unity-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/play-instant-unity-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/play-instant-unity-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/play-instant-unity-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/google/play-instant-unity-plugin/languages","stargazers_url":"https://api.github.com/repos/google/play-instant-unity-plugin/stargazers","contributors_url":"https://api.github.com/repos/google/play-instant-unity-plugin/contributors","subscribers_url":"https://api.github.com/repos/google/play-instant-unity-plugin/subscribers","subscription_url":"https://api.github.com/repos/google/play-instant-unity-plugin/subscription","commits_url":"https://api.github.com/repos/google/play-instant-unity-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/play-instant-unity-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/play-instant-unity-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/play-instant-unity-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/play-instant-unity-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/google/play-instant-unity-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/play-instant-unity-plugin/merges","archive_url":"https://api.github.com/repos/google/play-instant-unity-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/play-instant-unity-plugin/downloads","issues_url":"https://api.github.com/repos/google/play-instant-unity-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/google/play-instant-unity-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/google/play-instant-unity-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/play-instant-unity-plugin/labels{/name}","releases_url":"https://api.github.com/repos/google/play-instant-unity-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/google/play-instant-unity-plugin/deployments","created_at":"2018-05-18T18:28:57Z","updated_at":"2018-10-19T00:38:35Z","pushed_at":"2018-10-20T00:17:45Z","git_url":"git://github.com/google/play-instant-unity-plugin.git","ssh_url":"git@github.com:google/play-instant-unity-plugin.git","clone_url":"https://github.com/google/play-instant-unity-plugin.git","svn_url":"https://github.com/google/play-instant-unity-plugin","homepage":"","size":29815,"stargazers_count":84,"watchers_count":84,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":17,"open_issues":7,"watchers":84,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/107"},"html":{"href":"https://github.com/google/play-instant-unity-plugin/pull/107"},"issue":{"href":"https://api.github.com/repos/google/play-instant-unity-plugin/issues/107"},"comments":{"href":"https://api.github.com/repos/google/play-instant-unity-plugin/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/play-instant-unity-plugin/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/google/play-instant-unity-plugin/statuses/c1024bed3051cd61e5ba0e310db15056ce27e9b7"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"thanwah"}}