@@ -7,7 +7,7 @@ ClassMethod RandomString(size, lowerCase As %Boolean = 0, extras = "") As %Strin
7
7
set alpha = " ABCDEFGHIJKLMNOPQRSTUVWXYZ"
8
8
if lowerCase = 1 set alpha = alpha _$$$lcase(alpha )
9
9
if extras '= " " set alpha = alpha _extras
10
-
10
+
11
11
while $length (key ) < size {
12
12
set next = $select ($random (2 ) = 1 : $extract (alpha , $random ($length (alpha ))), 1 : $random (9 ))
13
13
set key = key _next
@@ -19,28 +19,28 @@ ClassMethod SanitizeFilename(fileName) As %String
19
19
{
20
20
if fileName [ " /" set fileName = $piece (fileName , " /" , *)
21
21
if fileName [ " \" set fileName = $piece (fileName , " \" , *)
22
-
22
+
23
23
set fileName = $translate (fileName , " àáÁÀÂâÃÁÂÃãèéÉÈêÊÉìíÍÌÎîòóÓÒÔôÕÓÔõùúÚÙÛûÇçÖöÜüÑ " , " aaAAAaAAAAaeeEEeEEiiIIIiooOOOOOoOouuUUUuCcOoUuN-" )
24
24
return $zstrip (fileName , " *E'N'A" , " " , " _-@." )
25
25
}
26
26
27
27
ClassMethod ReplacePlaceholders (definitions As %DynamicObject ) As %String
28
28
{
29
29
set text = definitions .text
30
-
30
+
31
31
set it = definitions .placeholders .%GetIterator ()
32
- while it .%GetNext (.key , .value ) { set text = $replace (text , key , value ) }
33
-
32
+ while it .%GetNext (.key , .value ) { set text = $replace (text , key , value ) }
33
+
34
34
return text
35
35
}
36
36
37
37
ClassMethod DeepExtend (sources ... As %DynamicObject ) As %DynamicObject
38
38
{
39
-
39
+
40
40
#dim result As %DynamicObject
41
-
42
- set result = {}
43
-
41
+
42
+ set result = {}
43
+
44
44
for i =1 :1 :sources {
45
45
set iterator = sources (i ).%GetIterator ()
46
46
while iterator .%GetNext (.property , .value ) {
@@ -53,7 +53,7 @@ ClassMethod DeepExtend(sources... As %DynamicObject) As %DynamicObject
53
53
}
54
54
} elseif 'result .%IsDefined (property ) {
55
55
set $property (result , property ) = value
56
- }
56
+ }
57
57
}
58
58
}
59
59
return result
@@ -63,7 +63,7 @@ ClassMethod SafeClassMethodCall(expression As %String, args... As %String) As %S
63
63
{
64
64
set sc = $$$OK
65
65
if expression = " " return sc
66
-
66
+
67
67
set class = $piece (expression , " :" )
68
68
set method = $piece (expression , " :" , 2 )
69
69
try {
@@ -77,7 +77,7 @@ ClassMethod SafeClassMethodCall(expression As %String, args... As %String) As %S
77
77
ClassMethod SafeMethodCallAndReturn (sc As %Status = {$$$OK}, instance As %RegisteredObject , method As %String , args ...)
78
78
{
79
79
set ret = " "
80
-
80
+
81
81
try {
82
82
set ret = $method (instance , method , args ...)
83
83
if $extract (ret , 1 , 2 ) = " 0 " && $lv ($p (ret , " " , 2 )) {
@@ -106,36 +106,36 @@ ClassMethod URLBase64Decode(value As %String) As %String
106
106
ClassMethod CallAndCapture (object , method As %String , Output str As %Stream .GlobalCharacter = " " , args ... As %String ) As %Status [ ProcedureBlock = 0 ]
107
107
{
108
108
new oldMnemonic , alreadyRedirected , sc
109
-
109
+
110
110
set sc = $$$OK
111
- set isRedirected = 0
112
-
111
+ set isRedirected = 0
112
+
113
113
set str = ##class (%Stream.GlobalCharacter ).%New ()
114
114
set alreadyRedirected = ##class (%Device ).ReDirectIO ()
115
115
set oldMnemonic = ##class (%Device ).GetMnemonicRoutine ()
116
- set initIO = $io
117
-
118
- try {
119
- use $io ::(" ^" _$zname )
116
+ set initIO = $io
117
+
118
+ try {
119
+ use $io ::(" ^" _$zname )
120
120
do ##class (%Device ).ReDirectIO (1 )
121
121
if $isobject (object ) set sc = $method (object , method , args ...)
122
122
else set class = object set sc = $classmethod (class , method , args ...)
123
123
do str .Rewind ()
124
124
} catch ex {
125
125
set str = " "
126
126
set sc = ex .AsStatus ()
127
- }
128
-
127
+ }
128
+
129
129
if oldMnemonic '= " " {
130
130
use initIO ::(" ^" _oldMnemonic )
131
131
} else {
132
132
use oldMnemonic
133
133
}
134
-
134
+
135
135
do ##class (%Device ).ReDirectIO (alreadyRedirected )
136
-
136
+
137
137
return sc
138
-
138
+
139
139
wstr (s ) Do str .Write (s ) Quit
140
140
wchr (a ) Do str .Write ($char (a )) Quit
141
141
wnl Do str .Write ($char (13 ,10 )) Quit
@@ -145,14 +145,14 @@ rstr(len,time) Quit ""
145
145
rchr (time ) Quit " "
146
146
}
147
147
148
- ClassMethod CreateSSLConfigurationIfNoneExists (name As %String ) [ Private ]
148
+ ClassMethod CreateSSLConfigurationIfNoneExists (name As %String )
149
149
{
150
150
new $namespace
151
151
set $namespace = " %SYS"
152
-
152
+
153
153
do ##class (Security.SSLConfigs ).Get (" Discord Webhook SSL" , .p )
154
- if $data (p ) quit
155
-
154
+ if $data (p ) quit
155
+
156
156
set p (" CipherList" )=" ALL:!aNULL:!eNULL:!EXP:!SSLv2"
157
157
set p (" CAFile" )=" "
158
158
set p (" CAPath" )=" "
@@ -169,7 +169,7 @@ ClassMethod CreateSSLConfigurationIfNoneExists(name As %String) [ Private ]
169
169
set p (" Type" )=0
170
170
set p (" VerifyDepth" )=9
171
171
set p (" VerifyPeer" )=0
172
-
172
+
173
173
do ##class (Security.SSLConfigs ).Create (name , .p )
174
174
}
175
175
0 commit comments