Merge branch 'backport-235' of gitnex/GitNex into master

This commit is contained in:
M M Arif 2019-12-13 13:38:09 +00:00
commit 72ccc06226
1 changed files with 15 additions and 0 deletions

View File

@ -26,6 +26,8 @@ import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.models.Files;
import org.mian.gitnex.util.AppUtil;
import org.mian.gitnex.util.TinyDB;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import retrofit2.Call;
import retrofit2.Callback;
@ -76,6 +78,19 @@ public class FileViewActivity extends AppCompatActivity {
initCloseListener();
closeActivity.setOnClickListener(onClickListener);
try {
singleFileName = URLDecoder.decode(singleFileName, "UTF-8");
singleFileName = singleFileName.replaceAll("//", "/");
}
catch (UnsupportedEncodingException e) {
assert singleFileName != null;
Log.i("singleFileName", singleFileName);
}
getSingleFileContents(instanceUrl, instanceToken, repoOwner, repoName, singleFileName);
}