Skip to content

Commit

Permalink
ncp-web: avoid quotes in fields
Browse files Browse the repository at this point in the history
Signed-off-by: nachoparker <[email protected]>
  • Loading branch information
nachoparker committed Jun 1, 2019
1 parent 86f14ae commit 5de855f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

[v1.13.0](https://github.com/nextcloud/nextcloudpi/commit/4572d74) (2019-06-01) upgrade to NC15.0.8
[v1.13.1](https://github.com/nextcloud/nextcloudpi/commit/18172be) (2019-06-01) ncp-web: avoid quotes in fields

[v1.13.0](https://github.com/nextcloud/nextcloudpi/commit/86f14ae) (2019-06-01) upgrade to NC15.0.8

[v1.12.10](https://github.com/nextcloud/nextcloudpi/commit/5924131) (2019-06-01) fail2ban: fix missing ufw filter

Expand Down
2 changes: 1 addition & 1 deletion etc/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function configure_app()

for (( i = 0 ; i < len ; i++ )); do
# check for invalid characters
grep -q '[\\&#;`|*?~<>^()[{}$&[:space:]]' <<< "${ret_vals[$i]}" && { echo "Invalid characters in field ${vars[$i]}"; return 1; }
grep -q '[\\&#;'"'"'`|*?~<>^"()[{}$&[:space:]]' <<< "${ret_vals[$i]}" && { echo "Invalid characters in field ${vars[$i]}"; return 1; }

cfg="$(jq ".params[$i].value = \"${ret_vals[$i]}\"" <<<"$cfg")"
done
Expand Down
2 changes: 1 addition & 1 deletion ncp-web/ncp-launcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

// sanitize
$val = trim(escapeshellarg($new_params[$id]),"'");
preg_match( '/ /' , $val , $matches )
preg_match( '/[\'" ]/' , $val , $matches )
and exit( '{ "output": "Invalid parameters" , "token": "' . getCSRFToken() . '" }' );

// save
Expand Down

0 comments on commit 5de855f

Please sign in to comment.