From bac752da2f172779ef1ed98c79da303e69aaea65 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Mon, 12 Sep 2005 09:59:24 +0000 Subject: [PATCH] Support for plugin API configuration validation. Documented on http://www.s9y.org/index.php?node=43#A13 --- docs/NEWS | 6 ++ include/admin/plugins.inc.php | 25 ++++++- include/plugin_api.inc.php | 66 +++++++++++++++++++ lang/UTF-8/serendipity_lang_bg.inc.php | 3 +- lang/UTF-8/serendipity_lang_cn.inc.php | 3 +- lang/UTF-8/serendipity_lang_cs.inc.php | 3 +- lang/UTF-8/serendipity_lang_cz.inc.php | 3 +- lang/UTF-8/serendipity_lang_da.inc.php | 3 +- lang/UTF-8/serendipity_lang_de.inc.php | 3 +- lang/UTF-8/serendipity_lang_en.inc.php | 3 +- lang/UTF-8/serendipity_lang_es.inc.php | 3 +- lang/UTF-8/serendipity_lang_fa.inc.php | 3 +- lang/UTF-8/serendipity_lang_fi.inc.php | 3 +- lang/UTF-8/serendipity_lang_fr.inc.php | 3 +- lang/UTF-8/serendipity_lang_hu.inc.php | 1 + lang/UTF-8/serendipity_lang_is.inc.php | 3 +- lang/UTF-8/serendipity_lang_it.inc.php | 3 +- lang/UTF-8/serendipity_lang_ja.inc.php | 3 +- lang/UTF-8/serendipity_lang_ko.inc.php | 3 +- lang/UTF-8/serendipity_lang_nl.inc.php | 3 +- lang/UTF-8/serendipity_lang_no.inc.php | 3 +- lang/UTF-8/serendipity_lang_pt.inc.php | 3 +- lang/UTF-8/serendipity_lang_pt_PT.inc.php | 1 + lang/UTF-8/serendipity_lang_ro.inc.php | 1 + lang/UTF-8/serendipity_lang_ru.inc.php | 3 +- lang/UTF-8/serendipity_lang_se.inc.php | 1 + lang/UTF-8/serendipity_lang_tn.inc.php | 3 +- lang/UTF-8/serendipity_lang_tw.inc.php | 3 +- lang/UTF-8/serendipity_lang_zh.inc.php | 3 +- lang/addlang.txt | 3 +- lang/serendipity_lang_bg.inc.php | 1 + lang/serendipity_lang_cn.inc.php | 1 + lang/serendipity_lang_cs.inc.php | 1 + lang/serendipity_lang_cz.inc.php | 1 + lang/serendipity_lang_da.inc.php | 1 + lang/serendipity_lang_de.inc.php | 1 + lang/serendipity_lang_en.inc.php | 1 + lang/serendipity_lang_es.inc.php | 1 + lang/serendipity_lang_fa.inc.php | 1 + lang/serendipity_lang_fi.inc.php | 1 + lang/serendipity_lang_fr.inc.php | 1 + lang/serendipity_lang_hu.inc.php | 1 + lang/serendipity_lang_is.inc.php | 1 + lang/serendipity_lang_it.inc.php | 1 + lang/serendipity_lang_ja.inc.php | 1 + lang/serendipity_lang_ko.inc.php | 1 + lang/serendipity_lang_nl.inc.php | 1 + lang/serendipity_lang_no.inc.php | 1 + lang/serendipity_lang_pt.inc.php | 1 + lang/serendipity_lang_pt_PT.inc.php | 1 + lang/serendipity_lang_ro.inc.php | 1 + lang/serendipity_lang_ru.inc.php | 1 + lang/serendipity_lang_se.inc.php | 1 + lang/serendipity_lang_tn.inc.php | 1 + lang/serendipity_lang_tw.inc.php | 1 + lang/serendipity_lang_zh.inc.php | 1 + .../serendipity_event_spamblock.php | 1 + 57 files changed, 171 insertions(+), 26 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index e91cfbc..c292c15 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,12 @@ Version 0.9 () ------------------------------------------------------------------------ + * Plugin API now allows to validate config options via a "validate" + method, used by the plugin configuration panel. Need to set "validate" + and "validate_error" property bag attributes in your custom + introspect_config_item() calls, documented on + http://www.s9y.org/index.php?node=43#A13 (garvinhicking) + * Read/Write permissions for user-groups for specific categories. (garvinhicking) diff --git a/include/admin/plugins.inc.php b/include/admin/plugins.inc.php index 42e49a7..6a86233c 100644 --- a/include/admin/plugins.inc.php +++ b/include/admin/plugins.inc.php @@ -273,10 +273,20 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) { if (isset($_POST['SAVECONF'])) { /* enum properties and set their values */ + $save_errors = array(); foreach ($config_names as $config_item) { $cbag = new serendipity_property_bag; if ($plugin->introspect_config_item($config_item, $cbag)) { - $plugin->set_config($config_item, $_POST['serendipity']['plugin'][$config_item]); + $value = $_POST['serendipity']['plugin'][$config_item]; + + $validate = $plugin->validate($config_item, $cbag, $value); + + if ($validate === true) { +// echo $config_item . " validated: $validate
\n"; + $plugin->set_config($config_item, $value); + } else { + $save_errors[] = $validate; + } } } @@ -284,7 +294,18 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) { } ?> - + 0 ) { ?> +
+ \n"; + echo "\n"; + ?> +
+
diff --git a/include/plugin_api.inc.php b/include/plugin_api.inc.php index 323324b..2207145 100644 --- a/include/plugin_api.inc.php +++ b/include/plugin_api.inc.php @@ -860,6 +860,72 @@ class serendipity_plugin { return false; } + /* Called to validate a plugin option */ + function validate($config_item, &$cbag, &$value) { + static $pattern_mail = '([\.\-\+~@_0-9a-z]+?)'; + static $pattern_url = '([@!=~\?:&;0-9a-z#\.\-_\/]+?)'; + + $validate = $cbag->get('validate'); + $valid = true; + + if (!empty($validate)) { + switch ($validate) { + case 'string': + if (!preg_match('@^\w*$@i', $value)) { + $valid = false; + } + break; + + case 'words': + if (!preg_match('@^[\w\s\r\n,\.\-!\?:;&_/=%\$]*$@i', $value)) { + $valid = false; + } + break; + + case 'number': + if (!preg_match('@^[\d]*$@', $value)) { + $valid = false; + } + break; + + case 'url': + if (!preg_match('§^' . $pattern_url . '$§', $value)) { + $valid = false; + } + break; + + case 'mail': + if (!preg_match('§^' . $pattern_mail . '$§', $value)) { + $valid = false; + } + break; + + case 'path': + if (!preg_match('@^[\w/_.\-~]$§', $value)) { + $valid = false; + } + break; + + default: + if (!preg_match($validate, $value)) { + $valid = false; + } + break; + } + + $error = $cbag->get('validate_error'); + if ($valid) { + return true; + } elseif (!empty($error)) { + return $error; + } else { + return sprintf(PLUGIN_API_VALIDATE_ERROR, $config_item, $validate); + } + } + + return true; + } + /* Called by serendipity when it wants your plugin to display itself. * You need to set $title to be whatever text you want want to * appear in the item caption space. diff --git a/lang/UTF-8/serendipity_lang_bg.inc.php b/lang/UTF-8/serendipity_lang_bg.inc.php index 742faee..560ff64 100644 --- a/lang/UTF-8/serendipity_lang_bg.inc.php +++ b/lang/UTF-8/serendipity_lang_bg.inc.php @@ -1,4 +1,4 @@ - @@ -765,3 +765,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_cn.inc.php b/lang/UTF-8/serendipity_lang_cn.inc.php index dfdae15..3f94985 100644 --- a/lang/UTF-8/serendipity_lang_cn.inc.php +++ b/lang/UTF-8/serendipity_lang_cn.inc.php @@ -1,4 +1,4 @@ - @@ -781,3 +781,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_cz.inc.php b/lang/UTF-8/serendipity_lang_cz.inc.php index 32a54f4..5e1bf1e 100644 --- a/lang/UTF-8/serendipity_lang_cz.inc.php +++ b/lang/UTF-8/serendipity_lang_cz.inc.php @@ -1,4 +1,4 @@ - @@ -781,3 +781,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_da.inc.php b/lang/UTF-8/serendipity_lang_da.inc.php index 845362a..e833287 100644 --- a/lang/UTF-8/serendipity_lang_da.inc.php +++ b/lang/UTF-8/serendipity_lang_da.inc.php @@ -1,4 +1,4 @@ - @@ -780,3 +780,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_de.inc.php b/lang/UTF-8/serendipity_lang_de.inc.php index d6c4f40..c71570c 100644 --- a/lang/UTF-8/serendipity_lang_de.inc.php +++ b/lang/UTF-8/serendipity_lang_de.inc.php @@ -1,4 +1,4 @@ -, @@ -792,3 +792,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_fa.inc.php b/lang/UTF-8/serendipity_lang_fa.inc.php index 47f421d..59377fc 100644 --- a/lang/UTF-8/serendipity_lang_fa.inc.php +++ b/lang/UTF-8/serendipity_lang_fa.inc.php @@ -1,4 +1,4 @@ - @@ -780,3 +780,4 @@ @define('PERM_DENIED', 'دسترسی وجود ندارد.'); @define('INSTALL_ACL', 'اعمال کردن دسترسی خواندن برای موضوع ها'); @define('INSTALL_ACL_DESC', 'در صورت فعال بودن این گزینه, در صورتی که کاربران عضو شده، وارد سیستم شوند، دسترسی کاربران گروه ها اعمال می شود. در صورت غیر فعال بودن، دسترسی خواندن موضوعات اعمال نمی شود، اما کمی سرعت وبلاگ را زیاد می کند. پس اگر به وبلاگ چند کاربره با دسترسی محدود در خواندن نیازی ندارید، این گزینه را غیر فعال کنید.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_fi.inc.php b/lang/UTF-8/serendipity_lang_fi.inc.php index 93e7fe7..9fcdaae 100644 --- a/lang/UTF-8/serendipity_lang_fi.inc.php +++ b/lang/UTF-8/serendipity_lang_fi.inc.php @@ -1,4 +1,4 @@ - @@ -785,3 +785,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_hu.inc.php b/lang/UTF-8/serendipity_lang_hu.inc.php index b02c8d2..79b9852 100644 --- a/lang/UTF-8/serendipity_lang_hu.inc.php +++ b/lang/UTF-8/serendipity_lang_hu.inc.php @@ -779,3 +779,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_is.inc.php b/lang/UTF-8/serendipity_lang_is.inc.php index 058587b..a16d24c 100644 --- a/lang/UTF-8/serendipity_lang_is.inc.php +++ b/lang/UTF-8/serendipity_lang_is.inc.php @@ -1,4 +1,4 @@ - @@ -780,3 +780,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_ja.inc.php b/lang/UTF-8/serendipity_lang_ja.inc.php index e965f4e..b0e6287 100644 --- a/lang/UTF-8/serendipity_lang_ja.inc.php +++ b/lang/UTF-8/serendipity_lang_ja.inc.php @@ -1,4 +1,4 @@ -, 2004-2005. @@ -783,3 +783,4 @@ Serendipity のアップグレードステージを無視しました。正し @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_ko.inc.php b/lang/UTF-8/serendipity_lang_ko.inc.php index 6f5a4c0..2abcfa3 100644 --- a/lang/UTF-8/serendipity_lang_ko.inc.php +++ b/lang/UTF-8/serendipity_lang_ko.inc.php @@ -1,4 +1,4 @@ - @@ -781,3 +781,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_nl.inc.php b/lang/UTF-8/serendipity_lang_nl.inc.php index 5c7ac19..66bb99b 100644 --- a/lang/UTF-8/serendipity_lang_nl.inc.php +++ b/lang/UTF-8/serendipity_lang_nl.inc.php @@ -1,4 +1,4 @@ - @@ -781,3 +781,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_no.inc.php b/lang/UTF-8/serendipity_lang_no.inc.php index 5ae7bec..1e31d2c 100644 --- a/lang/UTF-8/serendipity_lang_no.inc.php +++ b/lang/UTF-8/serendipity_lang_no.inc.php @@ -1,4 +1,4 @@ - @@ -781,3 +781,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_pt.inc.php b/lang/UTF-8/serendipity_lang_pt.inc.php index e136c30..ecb2d64 100644 --- a/lang/UTF-8/serendipity_lang_pt.inc.php +++ b/lang/UTF-8/serendipity_lang_pt.inc.php @@ -1,4 +1,4 @@ - @@ -783,3 +783,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_pt_PT.inc.php b/lang/UTF-8/serendipity_lang_pt_PT.inc.php index 3b7b8b2..eed7890 100644 --- a/lang/UTF-8/serendipity_lang_pt_PT.inc.php +++ b/lang/UTF-8/serendipity_lang_pt_PT.inc.php @@ -782,3 +782,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_ro.inc.php b/lang/UTF-8/serendipity_lang_ro.inc.php index d7c80e0..7cae57e 100644 --- a/lang/UTF-8/serendipity_lang_ro.inc.php +++ b/lang/UTF-8/serendipity_lang_ro.inc.php @@ -778,3 +778,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_ru.inc.php b/lang/UTF-8/serendipity_lang_ru.inc.php index a0f6285..6947137 100644 --- a/lang/UTF-8/serendipity_lang_ru.inc.php +++ b/lang/UTF-8/serendipity_lang_ru.inc.php @@ -1,4 +1,4 @@ - @@ -781,3 +781,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_tw.inc.php b/lang/UTF-8/serendipity_lang_tw.inc.php index 20574cd..90c988e 100644 --- a/lang/UTF-8/serendipity_lang_tw.inc.php +++ b/lang/UTF-8/serendipity_lang_tw.inc.php @@ -1,4 +1,4 @@ - @@ -780,3 +780,4 @@ @define('PERM_DENIED', 'Permission denied.'); @define('INSTALL_ACL', 'Apply read-permissions for categories'); @define('INSTALL_ACL_DESC', 'If enabled, the usergroup permission settings you setup for categories will be applied when logged-in users view your blog. If disabled, the read-permissions of the categories are NOT applied, but the positive effect is a little speedup on your blog. So if you don\'t need multi-user read permissions for your blog, disable this setting.'); +@define('PLUGIN_API_VALIDATE_ERROR', 'Configuration syntax wrong for option "%s". Needs content of type "%s".'); diff --git a/lang/UTF-8/serendipity_lang_zh.inc.php b/lang/UTF-8/serendipity_lang_zh.inc.php index 4872ecf..b4fa8bb 100644 --- a/lang/UTF-8/serendipity_lang_zh.inc.php +++ b/lang/UTF-8/serendipity_lang_zh.inc.php @@ -1,4 +1,4 @@ -add('name', PLUGIN_EVENT_SPAMBLOCK_CAPTCHA_COLOR); $propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_CAPTCHA_COLOR_DESC); $propbag->add('default', '255,255,255'); + $propbag->add('validate', '@^[0-9]{1,3},[0-9]{1,3},[0-9]{1,3}$@'); break; case 'forcemoderation': -- 2.39.5