Horde Crash when the stream has an import with whitespaces in the stream view

This happens because of a Regex that can’t handle whitespaces in paths or files.

In the file PerforceViewMap.cs line 303 (As of Unreal 5.7) PerforceViewMapEntry::Parse(string entry) there is a regex that tries to match the view map entry but it doesn’t take into account whether the entry string has whitespaces in it or not.

This causes the EpicGames.Perforce module to throw an exeption and crash. Thus resulting in Horde being unable to make any builds for the stream in question.

Please make this parsing function more robust and able to parse filepaths with spaces in them.

Steps to Reproduce

  1. Create a file with whitespaces in it’s name. For example: “Tool That Is Important.exe”
  2. Submit the file to perforce
  3. Make a new stream and go to the Advanced tab
  4. In the Views/Paths text box, add an Import to the file you previously submitted. For example "import “Tool That Is Important.exe” “//depot/Tools/dist/Tool That Is Important.exe”
  5. Set up a horde server.
  6. Add the stream with the import to Horde
  7. Start a job on that stream
  8. Horde crashes

Thanks for reporting this. I’ve created an internal jira for us to get this fixed.

Kind regards,

Julian.