summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuebinm2021-12-23 17:54:00 +0100
committerstuebinm2021-12-23 17:54:00 +0100
commite0d76fc6d740335454b4a23013d50af7f2513af4 (patch)
tree3167d21d7694d006be0d839475996b931c4cd1fd
parent9fd195314d30658052d2bdfd3bcd7a1da4485bed (diff)
disallow properties with different capitalisations
since apparently sometimes workadventure is case-insensitive, and sometimes it's not
-rw-r--r--lib/Properties.hs17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs
index 1b6cab8..6d7e03c 100644
--- a/lib/Properties.hs
+++ b/lib/Properties.hs
@@ -236,7 +236,6 @@ checkObjectProperty p@(Property name _) = do
(const $ forbid "using \"url\" to open local html files is disallowed.")
unless (objectType obj == "website")
$ complain "\"url\" can only be set for objects of type \"website\""
- "allowApi" -> forbidProperty name
"getBadge" -> do
when (1 /= length (getProperties obj))
$ warn "Objects with the property \"getBadge\" set are removed at runtime, \
@@ -291,6 +290,8 @@ checkObjectProperty p@(Property name _) = do
suggestPropertyName' "door"
suggestPropertyName "soundRadius"
"set \"soundRadius\" to limit the door sound to a certain area."
+ | T.toLower name `elem` [ "allowapi" ]
+ -> forbidProperty name
| otherwise ->
warn $ "unknown object property " <> prettyprint name <> "."
@@ -324,11 +325,6 @@ checkTileLayerProperty p@(Property name _value) = case name of
"jitsiTriggerMessage" -> do
isString p
requireProperty "jitsiTrigger"
- "jitsiUrl" -> isForbidden
- "jitsiConfig" -> isForbidden
- "jitsiClientConfig" -> isForbidden
- "jitsiRoomAdminTag" -> isForbidden
- "jitsiInterfaceConfig" -> isForbidden
"jitsiWidth" ->
isIntInRange 0 100 p
"bbbRoom" -> do
@@ -391,14 +387,11 @@ checkTileLayerProperty p@(Property name _value) = case name of
"openWebsiteTriggerMessage" -> do
isString p
requireProperty "openWebsiteTrigger"
- "openWebsitePolicy" -> isForbidden
- "openWebsiteAllowApi" -> isForbidden
"openTab" -> do
isString p
requireProperty "openWebsite"
"url" -> complain "the property \"url\" defining embedded iframes must be \
\set on an object in an objectgroup layer."
- "allowApi" -> isForbidden
"exitUrl" -> do
forbidEmptyLayer
unwrapURI (Proxy @"map") p
@@ -453,10 +446,14 @@ checkTileLayerProperty p@(Property name _value) = case name of
-> do { isString p; requireProperty "bellVariable" }
| name `elem` [ "enterValue", "leaveValue" ]
-> do { isString p; requireProperty "bindVariable" }
+ | T.toLower name `elem` [ "jitsiurl", "jitsiconfig", "jitsiclientconfig"
+ , "jitsiroomadmintag", "jitsiinterfaceconfig"
+ , "openwebsitepolicy", "openwebsiteallowapi"
+ , "allowapi" ]
+ -> forbidProperty name
| otherwise ->
warn $ "unknown property type " <> prettyprint name
where
- isForbidden = forbidProperty name
requireProperty req = propertyRequiredBy req name
isUnsupported = warn $ "property " <> name <> " is not (yet) supported by walint."
deprecatedUseInstead instead =