]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add CSRF token
authorLukas Reschke <lukas@statuscode.ch>
Thu, 1 Nov 2012 22:52:04 +0000 (23:52 +0100)
committerLukas Reschke <lukas@statuscode.ch>
Thu, 1 Nov 2012 23:09:28 +0000 (00:09 +0100)
apps/files/admin.php
apps/files/templates/admin.php

index e8b3cb0aca0715fa3a38e865164a66798e7db32d..c183a4ba4b4ef332cd1ebc52d8096ebd8de411da 100644 (file)
@@ -35,7 +35,7 @@ $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
 $post_max_size_possible = OCP\Util::computerFileSize(get_cfg_var('post_max_size'));
 $maxUploadFilesize = OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size));
 $maxUploadFilesizePossible = OCP\Util::humanFileSize(min($upload_max_filesize_possible, $post_max_size_possible));
-if($_POST) {
+if($_POST && OC_Util::isCallRegistered) {
        if(isset($_POST['maxUploadSize'])) {
                if(($setMaxSize = OC_Files::setUploadLimit(OCP\Util::computerFileSize($_POST['maxUploadSize']))) !== false) {
                        $maxUploadFilesize = OCP\Util::humanFileSize($setMaxSize);
index c4fe4c86569ad3298a543f450cc9e69dd614af6d..5869ed21072f26a9604f470d21517b084be5cfcb 100644 (file)
@@ -11,6 +11,7 @@
                        <input name="maxZipInputSize" id="maxZipInputSize" style="width:180px;" value='<?php echo $_['maxZipInputSize'] ?>' title="<?php echo $l->t( '0 is unlimited' ); ?>"<?php if (!$_['allowZipDownload']) echo ' disabled="disabled"'; ?> />
                        <label for="maxZipInputSize"><?php echo $l->t( 'Maximum input size for ZIP files' ); ?> </label><br />
 
+               <input type="hidden" value="<?php echo $_['requesttoken']; ?>" name="requesttoken" />
                <input type="submit" name="submitFilesAdminSettings" id="submitFilesAdminSettings" value="<?php echo $l->t( 'Save' ); ?>"/>
        </fieldset>
 </form>