diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-02-13 13:33:20 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-02-13 13:33:20 +0100 |
commit | a7df23cebadfc0a60095ff53e4ae5e293eb02b38 (patch) | |
tree | 54e8fd3e3179c65e8abda8e3bc61ce6547a501c6 /settings/ajax/setquota.php | |
parent | 51f8d240c1c7a2c5fe4ab89854aeae02a33406b4 (diff) | |
download | nextcloud-server-a7df23cebadfc0a60095ff53e4ae5e293eb02b38.tar.gz nextcloud-server-a7df23cebadfc0a60095ff53e4ae5e293eb02b38.zip |
Manually type-case all AJAX files
This enforces proper types on POST and GET arguments where I considered it sensible. I didn't update some as I don't know what kind of values they would support :see_no_evil:
Fixes https://github.com/owncloud/core/issues/14196 for core
Diffstat (limited to 'settings/ajax/setquota.php')
-rw-r--r-- | settings/ajax/setquota.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php index 64a686e83d7..c83430bfcfb 100644 --- a/settings/ajax/setquota.php +++ b/settings/ajax/setquota.php @@ -8,7 +8,7 @@ OC_JSON::checkSubAdminUser(); OCP\JSON::callCheck(); -$username = isset($_POST["username"])?$_POST["username"]:''; +$username = isset($_POST["username"]) ? (string)$_POST["username"] : ''; if(($username === '' && !OC_User::isAdminUser(OC_User::getUser())) || (!OC_User::isAdminUser(OC_User::getUser()) @@ -19,7 +19,7 @@ if(($username === '' && !OC_User::isAdminUser(OC_User::getUser())) } //make sure the quota is in the expected format -$quota=$_POST["quota"]; +$quota= (string)$_POST["quota"]; if($quota !== 'none' and $quota !== 'default') { $quota= OC_Helper::computerFileSize($quota); $quota=OC_Helper::humanFileSize($quota); |