From 3562210e2e2797351ee9d5c1a5d135d01279b8ac Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 1 Oct 2009 21:24:56 -0400 Subject: [PATCH] few bug fixes --- classes/WhatDidTheySayAdmin.inc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/classes/WhatDidTheySayAdmin.inc b/classes/WhatDidTheySayAdmin.inc index e3348dc..33fe4e5 100644 --- a/classes/WhatDidTheySayAdmin.inc +++ b/classes/WhatDidTheySayAdmin.inc @@ -53,6 +53,14 @@ class WhatDidTheySayAdmin { $options = get_option('what-did-they-say-options'); if (!is_array($options)) { $this->install(); + } else { + $any_changes = false; + foreach ($this->default_options as $key => $value) { + if (!isset($options[$key])) { + $any_changes = true; $options[$key] = $value; + } + } + if ($any_changes) { update_option('what-did-they-say-options', $options); } } add_action('admin_menu', array(&$this, 'admin_menu')); @@ -363,7 +371,13 @@ class WhatDidTheySayAdmin { } } } - return $updated; + + if (!is_admin()) { + header('Location: ' . $_SERVER['HTTP_REFERER']); + exit(0); + } else { + return $updated; + } } function handle_update_update_queued_transcript($info) {