Merge branch 'develop' into feature/admin-gpm-dependencies

This commit is contained in:
Flavio Copes
2016-03-26 18:00:19 +01:00
14 changed files with 78 additions and 37 deletions

View File

@@ -107,7 +107,22 @@ class AdminController
} else {
$nonce = $this->grav['uri']->param('admin-nonce');
}
if (!$nonce || !Utils::verifyNonce($nonce, 'admin-form')) {
if (!$nonce || !Utils::verifyNonce($nonce, 'admin-form'))
{
if ($this->task == 'addmedia') {
$message = sprintf($this->admin->translate('PLUGIN_ADMIN.FILE_TOO_LARGE', null, true), ini_get('post_max_size'));
//In this case it's more likely that the image is too big than POST can handle. Show message
$this->admin->json_response = [
'status' => 'error',
'message' => $message
];
return false;
}
$this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INVALID_SECURITY_TOKEN'), 'error');
$this->admin->json_response = [
'status' => 'error',