a7df23ceba
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 🙈 Fixes https://github.com/owncloud/core/issues/14196 for core
15 lines
478 B
PHP
15 lines
478 B
PHP
<?php
|
|
|
|
OCP\JSON::checkLoggedIn();
|
|
OCP\JSON::checkAppEnabled('files_versions');
|
|
OCP\JSON::callCheck();
|
|
|
|
$file = (string)$_GET['file'];
|
|
$revision=(int)$_GET['revision'];
|
|
|
|
if(OCA\Files_Versions\Storage::rollback( $file, $revision )) {
|
|
OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
|
|
}else{
|
|
$l = \OC::$server->getL10N('files_versions');
|
|
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) ))));
|
|
}
|