aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-04-03 17:03:27 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-04-06 00:47:21 +0200
commit61ee5cbd6cbce28385857f9cca184387234fe326 (patch)
treeab450f8aab00a5cca943147849a4a9231c3b5baa
parent2edf983698a18d45de1c9e7823dad0959bff2504 (diff)
global-functions: $FetchHuge: make sure to work with clean file names
-rw-r--r--global-functions.rsc7
1 files changed, 4 insertions, 3 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index 65dd06e..3c14f22 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -396,6 +396,7 @@
:local Url [ :tostr $2 ];
:local CheckCert [ :tobool $3 ];
+ :global CleanName;
:global FetchUserAgentStr;
:global GetRandom20CharAlNum;
:global IfThenElse;
@@ -405,13 +406,13 @@
:set CheckCert [ $IfThenElse ($CheckCert = false) "no" "yes-without-crl" ];
- :if ([ $MkDir "tmpfs/" . $ScriptName ] = false) do={
+ :local FileName ("tmpfs/" . [ $CleanName $ScriptName ]);
+ :if ([ $MkDir $FileName ] = false) do={
$LogPrint error $0 ("Failed creating directory!");
:return false;
}
- :local FileName ("tmpfs/" . $ScriptName . "/" . $0 . "-" . [ $GetRandom20CharAlNum ]);
-
+ :set FileName ($FileName . "/" . [ $CleanName $0 ] . "-" . [ $GetRandom20CharAlNum ]);
:do {
/tool/fetch check-certificate=$CheckCert $Url dst-path=$FileName \
http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) as-value;