From e0e830e399aff7e0ff504d1caca8436bb6d82126 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 14 Jan 2010 16:24:25 -0500 Subject: [PATCH] shorten up verify_nonces --- classes/ComicPressAdmin.inc | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/classes/ComicPressAdmin.inc b/classes/ComicPressAdmin.inc index c59933d..b4222e6 100644 --- a/classes/ComicPressAdmin.inc +++ b/classes/ComicPressAdmin.inc @@ -518,22 +518,16 @@ class ComicPressAdmin { // @codeCoverageIgnoreEnd function verify_nonces() { - if (isset($_REQUEST['cp'])) { - if (is_array($_REQUEST['cp'])) { - if (isset($_REQUEST['cp']['_nonce'])) { - if (wp_verify_nonce($_REQUEST['cp']['_nonce'], 'comicpress')) { - if (isset($_POST['attachments'])) { - //coming from media editor - return 'attachments'; - } else if (isset($_REQUEST['cp']['action'])) { - $action = $_REQUEST['cp']['action']; - if (isset($_REQUEST['cp']['_action_nonce'])) { - if (wp_verify_nonce($_REQUEST['cp']['_action_nonce'], "comicpress-${action}")) { - $method = 'handle_update_' . strtolower(str_replace('-', '_', $action)); - return $method; - } - } - } + if (isset($_REQUEST['cp']['_nonce'])) { + if (wp_verify_nonce($_REQUEST['cp']['_nonce'], 'comicpress')) { + if (isset($_POST['attachments'])) { + //coming from media editor + return 'attachments'; + } else if (isset($_REQUEST['cp']['action'], $_REQUEST['cp']['_action_nonce'])) { + $action = $_REQUEST['cp']['action']; + if (wp_verify_nonce($_REQUEST['cp']['_action_nonce'], "comicpress-${action}")) { + $method = 'handle_update_' . strtolower(str_replace('-', '_', $action)); + return $method; } } }