From 677c80407aa1da5de08d2cfdc1623aba44c105d7 Mon Sep 17 00:00:00 2001 From: liuyongkai Date: Wed, 8 Feb 2023 13:29:04 +0800 Subject: [PATCH] # Resolve monaco editor can not read file which path has chinese charter. --- module/repo/control.php | 1 + module/repo/js/monaco.js | 4 ++-- module/svn/control.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index 8e90a7331a..2aceddb69f 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -421,6 +421,7 @@ class repo extends control */ public function view($repoID, $objectID = 0, $entry = '', $revision = 'HEAD', $showBug = 'false', $encoding = '') { + set_time_limit(0); $browser = helper::getBrowser(); if($this->get->repoPath) $entry = $this->get->repoPath; $this->repo->setBackSession('view', $withOtherModule = true); diff --git a/module/repo/js/monaco.js b/module/repo/js/monaco.js index 26df5dd680..d87643d01f 100644 --- a/module/repo/js/monaco.js +++ b/module/repo/js/monaco.js @@ -9,7 +9,7 @@ function createTab(filename, filepath) { $('[data-path="' + decodeURIComponent(filepath) + '"]').closest('li').addClass('selected'); - var tabID = Base64.encode(filepath).replaceAll('=', '-'); + var tabID = Base64.encode(Base64.encode(filepath).replaceAll('=', '-')).replaceAll('=', '-'); return { id: tabID, url: createLink('repo', 'ajaxGetEditorContent', urlParams.replace('%s', Base64.encode(encodeURIComponent(filepath)))), @@ -56,7 +56,7 @@ $(function() /* Remove file path for opened files. */ $('#fileTabs').on('onClose', function(event, tab) { - var filepath = decodeURIComponent(Base64.decode(tab.id.replaceAll('-', '='))); + var filepath = decodeURIComponent(Base64.decode(Base64.decode(tab.id.replaceAll('-', '=')).replaceAll('-', '='))); var index = openedFiles.indexOf(filepath); if(index > -1) { diff --git a/module/svn/control.php b/module/svn/control.php index 9514eccd65..c4e99d6efb 100644 --- a/module/svn/control.php +++ b/module/svn/control.php @@ -19,6 +19,7 @@ class svn extends control */ public function run() { + set_time_limit(0); $this->svn->run(); }