mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 04:56:52 +00:00
Apply suggestions from code review
Co-authored-by: Pablo Zmdl <57864086+pabzm@users.noreply.github.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
ca6230e4c6
commit
c97486f8a3
1 changed files with 7 additions and 7 deletions
|
|
@ -420,13 +420,13 @@ readonly class DockerActionManager {
|
||||||
|
|
||||||
// Additional Collabora options
|
// Additional Collabora options
|
||||||
if ($this->configurationManager->collaboraAdditionalOptions !== '') {
|
if ($this->configurationManager->collaboraAdditionalOptions !== '') {
|
||||||
// The regex not not extremely readable, should be the most thorough though.
|
// Split the list of Collabora options, which are stored as a string but must be assigned as an array.
|
||||||
// \s is any whitespace
|
// To avoid problems with whitespace or dashes in option arguments we use a regular expression
|
||||||
// + means one or more token
|
// that splits the string at every position where a whitespace is followed by '--o:'.
|
||||||
// (?=<characters>) defines a positive lookahead (requirement but won't remove that character
|
// The leading whitespace is removed in the split but the following characters are not.
|
||||||
// - the required character after an space
|
// Example: "--o:example_config1='some thing' --o:example_config2=something-else" -> ["--o:example_config1='some thing'", "--o:example_config2=something-else"]
|
||||||
$regEx = '/\s+(?=-)/';
|
$regEx = '/\s+(?=--o:)/';
|
||||||
$requestBody['Cmd'] = preg_split($regEx, $this->configurationManager->collaboraAdditionalOptions);
|
$requestBody['Cmd'] = preg_split($regEx, rtrim($this->configurationManager->collaboraAdditionalOptions));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue