PyukiWiki CVS Commit
pyuki****@lists*****
2012年 2月 20日 (月) 02:03:06 JST
Index: PyukiWiki-Devel/plugin/search.inc.pl diff -u PyukiWiki-Devel/plugin/search.inc.pl:1.458 PyukiWiki-Devel/plugin/search.inc.pl:1.459 --- PyukiWiki-Devel/plugin/search.inc.pl:1.458 Mon Feb 20 01:16:00 2012 +++ PyukiWiki-Devel/plugin/search.inc.pl Mon Feb 20 02:03:06 2012 @@ -1,6 +1,6 @@ ###################################################################### # search.inc.pl - This is PyukiWiki, yet another Wiki clone. -# $Id: search.inc.pl,v 1.458 2012/02/19 16:16:00 papu Exp $ +# $Id: search.inc.pl,v 1.459 2012/02/19 17:03:06 papu Exp $ # # "PyukiWiki" version 0.2.0-p2-preview3 $$ # Author: Nekyo http://nekyo.qp.land.to/ @@ -38,12 +38,33 @@ my $word=&escape(&code_convert(\$::form{word}, $::defaultcode)); $word=&escape(&code_convert(\$::form{mymsg}, $::defaultcode)) if($word eq ''); + my $body = ""; + my $word=&escape(&code_convert(\$::form{word}, $::defaultcode)); + $word=&escape(&code_convert(\$::form{mymsg}, $::defaultcode)) + if($word eq ''); if ($word) { - @words = split(/\s+/, $word); + my $spc; + if ($word) { + if($::lang eq "ja") { + if($::defaultcode eq 'utf8') { + $spc="\xe3\x80\x80"; + } else { + $spc="\xa1\xa1"; + } + } + } + if($spc ne "") { + foreach(" ", $spc) { + $wd=~s/$_/\t/g; + } + } + $wd=~s/(\t+)/\t/g; + my @words=split(/\t/,$word); my $total = 0; if ($::form{type} eq 'OR') { + $total = 0; foreach my $wd (@words) { - $total = 0; + next if($wd eq ''); foreach my $page (sort keys %::database) { next if( $page eq $::RecentChanges @@ -63,6 +84,7 @@ || !&is_readable($page)); my $exist = 1; foreach my $wd (@words) { + next if($wd eq ''); if (!($::database{$page} =~ /\Q$wd\E/i or $page =~ /\Q$wd\E/i)) { $exist = 0; } Index: PyukiWiki-Devel/plugin/search_fuzzy.inc.pl diff -u PyukiWiki-Devel/plugin/search_fuzzy.inc.pl:1.457 PyukiWiki-Devel/plugin/search_fuzzy.inc.pl:1.458 --- PyukiWiki-Devel/plugin/search_fuzzy.inc.pl:1.457 Mon Feb 20 01:16:00 2012 +++ PyukiWiki-Devel/plugin/search_fuzzy.inc.pl Mon Feb 20 02:03:06 2012 @@ -1,6 +1,6 @@ ###################################################################### # search_fuzzy.inc.pl - This is PyukiWiki, yet another Wiki clone. -# $Id: search_fuzzy.inc.pl,v 1.457 2012/02/19 16:16:00 papu Exp $ +# $Id: search_fuzzy.inc.pl,v 1.458 2012/02/19 17:03:06 papu Exp $ # # "PyukiWiki" version 0.2.0-p2-preview3 $$ # Author: Nanami http://nanakochi.daiba.cx/ @@ -33,11 +33,28 @@ $word=&escape(&code_convert(\$::form{mymsg}, $::defaultcode)) if($word eq ''); if ($word) { - @words = split(/\s+/, $word); + my $spc; + if ($word) { + if($::lang eq "ja") { + if($::defaultcode eq 'utf8') { + $spc="\xe3\x80\x80"; + } else { + $spc="\xa1\xa1"; + } + } + } + if($spc ne "") { + foreach(" ", $spc) { + $wd=~s/$_/\t/g; + } + } + $wd=~s/(\t+)/\t/g; + my @words=split(/\t/,$wd); my $total = 0; if ($::form{type} eq 'OR') { + $total = 0; foreach my $wd (@words) { - $total = 0; + next if($wd eq ''); foreach my $page (sort keys %::database) { next if( $page eq $::RecentChanges @@ -57,6 +74,7 @@ || !&is_readable($page)); my $exist = 1; foreach my $wd (@words) { + next if($wd eq ''); if (!(Nana::Search::Search($::database{$page}, $wd) eq 1 or Nana::Search::Search($page, $wd) eq 1)) { $exist = 0; }