Skip to content

Commit 5de855f

Browse files
committed
ncp-web: avoid quotes in fields
Signed-off-by: nachoparker <nacho@ownyourbits.com>
1 parent 86f14ae commit 5de855f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

changelog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

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

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

etc/library.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function configure_app()
6262

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

6767
cfg="$(jq ".params[$i].value = \"${ret_vals[$i]}\"" <<<"$cfg")"
6868
done

ncp-web/ncp-launcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

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

7272
// save

0 commit comments

Comments
 (0)