packages feed

pms-domain-model 0.1.0.0 → 0.1.1.0

raw patch · 3 files changed

+19/−7 lines, 3 files

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for pms-domain-model +## 0.1.1.0 -- 2025-09-15++* Fixed validateMessage.+ ## 0.1.0.0 -- 2025-09-07  * Support invalidChars configs.
pms-domain-model.cabal view
@@ -20,7 +20,7 @@ -- PVP summary:     +-+------- breaking API changes --                  | | +----- non-breaking API additions --                  | | | +--- code changes with no API change-version:            0.1.0.0+version:            0.1.1.0  -- A short (one-line) description of the package. synopsis:           pms-domain-model
src/PMS/Domain/Model/DS/Utility.hs view
@@ -95,12 +95,20 @@ -- | -- validateMessage :: [String] ->  [String] -> String -> IO String-validateMessage invalidChars invalidCmds cmd = case words cmd of-  [] -> return cmd-  (c : args) -> do-    _ <- validateCommand invalidChars invalidCmds c-    _ <- validateArgs invalidChars args-    return cmd+validateMessage invalidChars invalidCmds cmd = do+  let tcmd = T.pack cmd++  mapM_ (\seqStr ->+          when (T.pack seqStr `T.isInfixOf` tcmd) $+            E.throwString $ "Command contains forbidden sequence: " ++ seqStr+        ) invalidChars++  mapM_ (\seqStr ->+          when (T.pack seqStr `T.isInfixOf` tcmd) $+            E.throwString $ "Command contains forbidden sequence: " ++ seqStr+        ) invalidCmds++  return cmd  -- | --