summaryrefslogtreecommitdiff
path: root/fml/lib/FML/User
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-04-27 13:30:51 +0000
committerfukachan <fukachan>2004-04-27 13:30:51 +0000
commite811ff3057e5c2019d5b9f67b3d3c2fd7dd4b3c3 (patch)
tree130424def1aeef668f59f076eb182058f663aaf7 /fml/lib/FML/User
parentcef2817fedd4a0264009bbdd9efd58678a008b01 (diff)
downloadfml8-e811ff3057e5c2019d5b9f67b3d3c2fd7dd4b3c3.tar.gz
fml8-e811ff3057e5c2019d5b9f67b3d3c2fd7dd4b3c3.tar.bz2
fml8-e811ff3057e5c2019d5b9f67b3d3c2fd7dd4b3c3.zip
move quotemeta() from IO::Adapter to here.
Diffstat (limited to 'fml/lib/FML/User')
-rw-r--r--fml/lib/FML/User/DB.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/fml/lib/FML/User/DB.pm b/fml/lib/FML/User/DB.pm
index e70ede18..cac21b72 100644
--- a/fml/lib/FML/User/DB.pm
+++ b/fml/lib/FML/User/DB.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: DB.pm,v 1.4 2003/11/29 06:37:26 fukachan Exp $
+# $FML: DB.pm,v 1.5 2004/01/21 03:55:12 fukachan Exp $
#
package FML::User::DB;
@@ -115,6 +115,7 @@ sub find
my $config = $curproc->config();
my $mapname = sprintf("user_db_%s_maps", $class);
my $maps = $config->get_as_array_ref( $mapname );
+ my $_key = quotemeta($key);
if (@$maps) {
my $obj = undef;
@@ -128,12 +129,14 @@ sub find
$obj = new IO::Adapter $map;
$obj->open();
$obj->touch();
- $value = $obj->find($key, {
+
+ # XXX FIRST MATCH. OK ?
+ $value = $obj->find($_key, {
want => 'key,value',
case_sensitive => 0,
});
if ($value) {
- if ($value =~ /^$key\s+|^$key\s*$/) {
+ if ($value =~ /^$_key\s+|^$_key\s*$/) {
$obj->close();
last MAP;
}