Config array serialized

This commit is contained in:
Stefan Kalscheuer 2016-08-14 13:38:57 +02:00
parent 4727ce530f
commit 1e30ba334f
2 changed files with 4 additions and 4 deletions

View File

@ -85,7 +85,7 @@ class StatifyBlacklist
get_option('statify-blacklist'),
array(
'active_referer' => 0,
'referer' => ''
'referer' => array()
)
);
}
@ -112,7 +112,7 @@ class StatifyBlacklist
$referer = implode('.', $referer);
/* Get blacklist */
$blacklist = explode("\r\n", self::$_options['referer']);
$blacklist = self::$_options['referer'];
/* Check blacklist */
return in_array($referer, $blacklist);

View File

@ -5,7 +5,7 @@ if ( ! empty($_POST['statifyblacklist']) ) {
StatifyBlacklist::update_options(
array(
'active_referer' => (int)@$_POST['statifyblacklist']['active_referer'],
'referer' => (string)@$_POST['statifyblacklist']['referer']
'referer' => explode("\r\n", $_POST['statifyblacklist']['referer'])
)
);
}
@ -25,7 +25,7 @@ if ( ! empty($_POST['statifyblacklist']) ) {
<li>
<label for="statify-blacklist_referer">
<?php esc_html_e('Referer blacklist:', 'statify-blacklist'); ?><br />
<textarea cols="40" rows="5" name="statifyblacklist[referer]" id="statify-blacklist_referer"><?php print StatifyBlacklist::$_options['referer']; ?></textarea><br />
<textarea cols="40" rows="5" name="statifyblacklist[referer]" id="statify-blacklist_referer"><?php print implode("\r\n", StatifyBlacklist::$_options['referer']); ?></textarea><br />
<small>(<?php esc_html_e('Add one domain (without subdomains) each line, e.g. example.com', 'statify-blacklist'); ?>)</small>
</label>
</li>