Skip to content

Commit 092a2db

Browse files
committed
Merge branch 'release/2.4.3'
2 parents fbefb44 + 756b68d commit 092a2db

File tree

223 files changed

+1923
-1824
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+1923
-1824
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To join the discussion relating to using revIgniter subscribe and review archive
3232

3333
### Meta
3434

35-
- Version: 2.4.2
35+
- Version: 2.4.3
3636
- Web Site: <https://revigniter.com/>
3737
- User Guide: <https://revigniter.com/userGuide/index.html>
3838
- Author: [Ralf Bitter](mailto:rabit@revigniter.com)

assets/js/ASYNergy/asynergy.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/ASYNergy/asynergy.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.lc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?lc
22

33
global gRigA -- array keys are: EXT, FCPATH, SELF, BASEPATH, APPPATH, errorData, databaseID, docTypes, systemFolder
4-
-- controller, handler, module, COOKIE, segments, rSegments, applicationFolder, activeRecord, CLI
4+
-- controller, handler, module, COOKIE, segments, rSegments, applicationFolder, activeRecord, CLI, IsCreate
55

66
##
77
#---------------------------------------------------------------

system/helpers/formHelper.livecodescript

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ end libraryStack
7878
--| FUNCTION rigFormOpen
7979
--|
8080
--| Author: rabit
81-
--| Version: 1.5
81+
--| Version: 1.6
8282
--| Created: 2009-07-28
83-
--| Last Mod: 2023-04-13
83+
--| Last Mod: 2023-12-06
8484
--| Requires: rigUriString(), rigSiteURL(), _rigAttributesToString(),rigFetchConfigItem(),
8585
--| rigHiddenCSRFtoken(), rigQ(), rigFormHidden()
8686
--|
@@ -107,23 +107,28 @@ function rigFormOpen pAction pAttributesA pHiddenA
107107
put pAttributesA into tAttributes
108108
end if
109109

110-
# IF NO ACTION IS PROVIDED THEN SET TO THE CURRENT URL
111-
if pAction is empty then
112-
put rigUriString() into tURIstring
113-
put rigSiteURL(tURIstring) into tAction
110+
# SET ACTION ATTRIBUTE
111+
if "action" is not among the keys of pAttributesA then
112+
# IF NO ACTION IS PROVIDED THEN SET TO THE CURRENT URL
113+
if pAction is empty then
114+
put rigUriString() into tURIstring
115+
put rigSiteURL(tURIstring) into tAction
114116

115-
# IF AN ACTION IS NOT A FULL URL THEN TURN IT INTO ONE
116-
else if "://" is in pAction then
117-
put pAction into tAction
118-
else
119-
if pAction <> "#" then
120-
put rigSiteURL(pAction) into tAction
121-
else
122-
put pAction into tAction
123-
end if
124-
end if
117+
# IF AN ACTION IS NOT A FULL URL THEN TURN IT INTO ONE
118+
else if "://" is in pAction then
119+
put pAction into tAction
120+
else
121+
if pAction <> "#" then
122+
put rigSiteURL(pAction) into tAction
123+
else
124+
put pAction into tAction
125+
end if
126+
end if -- if pAction is empty
127+
128+
put "action=" & quote & tAction & quote into tAction
129+
end if -- if "action" is not among the keys of pAttributesA
125130

126-
put "<form action=" & quote & tAction & quote into tForm
131+
put "<form " & tAction into tForm
127132
put tForm & _rigAttributesToString(tAttributes, TRUE) into tForm
128133
put tForm & ">" into tForm
129134

system/helpers/jwtHelper.livecodescript

Lines changed: 85 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ script "jwtHelper"
2222
# @package revIgniter
2323
# @subpackage Helpers
2424
# @category Helpers
25-
# @requires com.livecode.library.json
25+
# @requires com.livecode.library.json (not required if the engine is LC Create)
2626
# @author rabit@revigniter.com
2727
# @link https://revigniter.com/userGuide/helpers/jwtHelper.html
2828
##
@@ -34,7 +34,7 @@ script "jwtHelper"
3434
global gRigA
3535

3636
local sH0, sH1, sH2, sH3, sH4, sH5, sH6, sH7, sK
37-
local sSource, sIsFile, sBytesDone, sDataSize, sTail, sStackInUse
37+
local sSource, sIsFile, sBytesDone, sDataSize, sTail, sStackInUse, sBetterJSONIncluded
3838

3939
constant kRSAkeyLength = 4096
4040

@@ -46,34 +46,40 @@ constant kRSAkeyLength = 4096
4646
--| COMMAND libraryStack
4747
--|
4848
--| Author: rabit
49-
--| Version: 1.0
49+
--| Version: 1.1
5050
--| Created: 2018-12-28
51-
--| Last Mod: --
52-
--| Requires: _rigJWTinitHelper
51+
--| Last Mod: 2024-09-07
52+
--| Requires: _checkBetterJSON, _rigJWTinitHelper
5353
--|
54-
--| Summary: Run security check and run initial handler.
54+
--| Summary: Run security check and run initial handlers.
5555
--|
5656
--| Parameters: --
5757
--|
5858
--| Return: empty
5959
----------------------------------------------------------------------*/
6060

6161
on libraryStack
62-
if (gRigA is not an array) and (the environment is "server") then
63-
put "No direct script access allowed."
64-
exit to top
65-
end if
66-
67-
if the short name of the target = the short name of me then
68-
if sStackInUse <> TRUE then
69-
put TRUE into sStackInUse
70-
71-
_rigJWTinitHelper
72-
end if -- if sStackInUse <> TRUE
73-
74-
else
75-
pass libraryStack
76-
end if -- if the short name of the target = the short name of me
62+
if (gRigA is not an array) and (the environment is "server") then
63+
put "No direct script access allowed."
64+
exit to top
65+
end if
66+
67+
if the short name of the target = the short name of me then
68+
if sStackInUse <> TRUE then
69+
put TRUE into sStackInUse
70+
71+
# CHECK IF THE ENGINE IS LC CREATE AND
72+
# IF THE LC CREATE VERSION > 1.0.0-DP-1
73+
_checkBetterJSON
74+
75+
if not sBetterJSONIncluded then
76+
_rigJWTinitHelper
77+
end if
78+
end if -- if sStackInUse <> TRUE
79+
80+
else
81+
pass libraryStack
82+
end if -- if the short name of the target = the short name of me
7783
end libraryStack
7884

7985

@@ -109,9 +115,9 @@ end _rigJWTinitHelper
109115
--| FUNCTION rigJWTencode
110116
--|
111117
--| Author: rabit
112-
--| Version: 1.3
118+
--| Version: 1.4
113119
--| Created: 2016-07-08
114-
--| Last Mod: 2021-12-16
120+
--| Last Mod: 2024-09-07
115121
--| Requires: _rigStrToArray(), _rigJWTgenerateSecret(), _rigHmacSha2b64(), _rigJWTpurge
116122
--| _rigJWTrsaKeys(), rigLogMessage
117123
--|
@@ -151,14 +157,24 @@ function rigJWTencode pHeader pPayload pNumBits pAlg
151157
put _rigStrToArray(pHeader, , TRUE, TRUE) into tJWTheaderDataA
152158
end if
153159
end if
154-
put base64Encode(JsonExport(tJWTheaderDataA)) into tJWTheader
160+
161+
if sBetterJSONIncluded then
162+
put base64Encode(jsonEncode(tJWTheaderDataA)) into tJWTheader
163+
else
164+
put base64Encode(JsonExport(tJWTheaderDataA)) into tJWTheader
165+
end if
155166
#
156167

157168
# PAYLOAD
158169
if pPayload is not an array then
159170
put _rigStrToArray(pPayload, , TRUE, TRUE) into pPayload
160171
end if
161-
put base64Encode(JsonExport(pPayload)) into tJWTpayload
172+
173+
if sBetterJSONIncluded then
174+
put base64Encode(jsonEncode(pPayload)) into tJWTpayload
175+
else
176+
put base64Encode(JsonExport(pPayload)) into tJWTpayload
177+
end if
162178
#
163179

164180
# SECRET
@@ -211,9 +227,9 @@ end rigJWTencode
211227
--| FUNCTION rigJWTdecode
212228
--|
213229
--| Author: rabit
214-
--| Version: 1.2
230+
--| Version: 1.3
215231
--| Created: 2016-07-09
216-
--| Last Mod: 2021-12-16
232+
--| Last Mod: 2024-09-07
217233
--| Requires: rigGetHTTPheader(), _rigJWTVerifySig(), rigLogMessage
218234
--|
219235
--| Summary: Decode and validate a JSON Web Token.
@@ -248,12 +264,17 @@ function rigJWTdecode pToken
248264
put item 3 of pToken into tJWThmac
249265

250266
if (pToken <> empty) and (the number of items of pToken is 3) then
251-
# GET HASH SIZE AND ALGORITHM FROM HEADER
252-
put JsonImport(base64Decode(tJWTheader)) into tJWTDecodedA["header"]
253-
put JsonImport(base64Decode(tJWTpayload)) into tJWTDecodedA["payload"]
267+
# GET HASH SIZE AND ALGORITHM FROM HEADER
268+
if sBetterJSONIncluded then
269+
put jsonDecode(base64Decode(tJWTheader)) into tJWTDecodedA["header"]
270+
put jsonDecode(base64Decode(tJWTpayload)) into tJWTDecodedA["payload"]
271+
else
272+
put JsonImport(base64Decode(tJWTheader)) into tJWTDecodedA["header"]
273+
put JsonImport(base64Decode(tJWTpayload)) into tJWTDecodedA["payload"]
274+
end if
254275

255-
put char 1 to 2 of tJWTDecodedA["header"]["alg"] into tAlg
256-
put char 3 to 5 of tJWTDecodedA["header"]["alg"] into tNumBits
276+
put char 1 to 2 of tJWTDecodedA["header"]["alg"] into tAlg
277+
put char 3 to 5 of tJWTDecodedA["header"]["alg"] into tNumBits
257278

258279
# CHECK INTEGRITY OF TOKEN
259280
put _rigJWTVerifySig(tJWTheader, tJWTpayload, tJWThmac, tNumBits, tAlg) into tJWTDecodedA["valid"]
@@ -1135,6 +1156,38 @@ end _rigJWTTypeNum
11351156

11361157

11371158

1159+
/*----------------------------------------------------------------------
1160+
--| COMMAND _checkBetterJSON
1161+
--|
1162+
--| Author: rabit
1163+
--| Version: 1.0
1164+
--| Created: 2024-09-07
1165+
--| Last Mod: --
1166+
--| Requires: --
1167+
--|
1168+
--| Summary: Check if the engine is lc create
1169+
--| and if the LC Create version > 1.0.0-DP-1
1170+
--|
1171+
--| Format: _checkBetterJSON
1172+
--|
1173+
--| Parameters: --
1174+
--|
1175+
--| Return: boolean
1176+
----------------------------------------------------------------------*/
1177+
1178+
private command _checkBetterJSON
1179+
put FALSE into sBetterJSONIncluded
1180+
if gRigA["IsCreate"] then
1181+
if productVersion() is not "1.0.0-dp-1" then
1182+
put TRUE into sBetterJSONIncluded
1183+
end if
1184+
end if
1185+
end _checkBetterJSON
1186+
1187+
1188+
1189+
1190+
11381191

11391192

11401193

0 commit comments

Comments
 (0)