• R/O
  • SSH
  • HTTPS

fswiki: Commit


Commit MetaInfo

Revision150 (tree)
Time2017-11-30 18:00:29
Authorkgsoft

Log Message

Perl5.26以降における "{", "}" の正規表現検査時のエスケープ対応。

Change Summary

Incremental Difference

--- fswiki/trunk/fswiki/lib/Wiki.pm (revision 149)
+++ fswiki/trunk/fswiki/lib/Wiki.pm (revision 150)
@@ -729,7 +729,7 @@
729729 my $text = shift;
730730 my ($cmd, @args_tmp) = split(/ /,$text);
731731 my $args_txt = &Util::trim(join(" ",@args_tmp));
732- if($cmd =~ s/}}(.*?)$//){
732+ if($cmd =~ s/\}\}(.*?)$//){
733733 return { command=>$cmd, args=>[], post=>"$1 $args_txt"};
734734 }
735735
--- fswiki/trunk/fswiki/lib/Wiki/Parser.pm (revision 149)
+++ fswiki/trunk/fswiki/lib/Wiki/Parser.pm (revision 150)
@@ -89,7 +89,7 @@
8989 }
9090
9191 # パラグラフプラグイン
92- if($line =~ /^{{(.+}})$/){
92+ if($line =~ /^\{\{(.+\}\})$/){
9393 if(!$self->{block}){
9494 my $plugin = $self->{wiki}->parse_inline_plugin($1);
9595 my $info = $self->{wiki}->get_plugin_info($plugin->{command});
@@ -101,7 +101,7 @@
101101 }
102102 next;
103103 }
104- } elsif($line =~ /^{{(.+)$/){
104+ } elsif($line =~ /^\{\{(.+)$/){
105105 if ($self->{block}) {
106106 my $plugin = $self->{wiki}->parse_inline_plugin($1);
107107 my $info = $self->{wiki}->get_plugin_info($plugin->{command});
@@ -282,7 +282,7 @@
282282 while ($source ne q{}) {
283283
284284 # どのインライン Wiki 書式の先頭にも match しない場合
285- if (!($source =~ /^(.*?)((?:{{|\[\[?|https?:|mailto:|f(?:tp:|ile:)|'''?|==|__|<<).*)$/)) {
285+ if (!($source =~ /^(.*?)((?:\{\{|\[\[?|https?:|mailto:|f(?:tp:|ile:)|'''?|==|__|<<).*)$/)) {
286286 # キーワード検索・置換処理のみ実施して終了する
287287 push @array, $self->_parse_line_keyword($pre . $source);
288288 return @array;
@@ -293,7 +293,7 @@
293293 @parsed = ();
294294
295295 # プラグイン
296- if ($source =~ /^{{/) {
296+ if ($source =~ /^\{\{/) {
297297 $source = $';
298298 my $plugin = $self->{wiki}->parse_inline_plugin($source);
299299 unless($plugin){
--- fswiki/trunk/fswiki/plugin/format/FormatBase.pm (revision 149)
+++ fswiki/trunk/fswiki/plugin/format/FormatBase.pm (revision 150)
@@ -25,15 +25,15 @@
2525
2626 $self->{block_level} = 0;
2727 foreach my $line (@lines){
28- if($line =~ /^{{.+}}$/){
28+ if($line =~ /^\{\{.+\}\}$/){
2929 $buf .= $line."\n";
3030 next;
31- } elsif($line =~ /^{{.+$/){
31+ } elsif($line =~ /^\{\{.+$/){
3232 $self->{block_level}++;
3333 $buf .= $line."\n";
3434 next;
3535 } elsif($self->{block_level} > 0){
36- if($line eq "}}"){
36+ if($line eq "\}\}"){
3737 $self->{block_level}--;
3838 }
3939 $buf .= $line."\n";
@@ -57,10 +57,10 @@
5757
5858 $self->{block_level} = 0;
5959 foreach my $line (@lines){
60- if($line =~ /^{{.+}}$/){
60+ if($line =~ /^\{\{.+\}\}$/){
6161 $buf .= $line."\n";
6262 next;
63- } elsif($line =~ /^{{.+$/){
63+ } elsif($line =~ /^\{\{.+$/){
6464 $self->{block_level}++;
6565 $buf .= $line."\n";
6666 next;
--- fswiki/trunk/fswiki/plugin/comment/CommentHandler.pm (revision 149)
+++ fswiki/trunk/fswiki/plugin/comment/CommentHandler.pm (revision 150)
@@ -56,7 +56,7 @@
5656 # 新着順の場合
5757 if($option eq "reverse"){
5858 $content = $content.$_."\n";
59- if(/^{{comment\s*.*}}$/ && $flag==0){
59+ if(/^\{\{comment\s*.*\}\}$/ && $flag==0){
6060 if($form_count==$count){
6161 $content = $content."*$message - $name (".Util::format_date(time()).")\n";
6262 $flag = 1;
@@ -70,7 +70,7 @@
7070
7171 # 投稿順の場合
7272 } else {
73- if(/^{{comment\s*.*}}$/ && $flag==0){
73+ if(/^\{\{comment\s*.*\}\}$/ && $flag==0){
7474 if($form_count==$count){
7575 $content = $content."*$message - $name (".Util::format_date(time()).")\n";
7676 $flag = 1;
@@ -105,7 +105,7 @@
105105 my $page = shift;
106106 my @lines = split(/\n/,$wiki->get_page($page));
107107 foreach(@lines){
108- if(/^{{comment\s*.*}}$/){
108+ if(/^\{\{comment\s*.*\}\}$/){
109109 return 1;
110110 }
111111 }
--- fswiki/trunk/fswiki/plugin/bbs/BBSHandler.pm (revision 149)
+++ fswiki/trunk/fswiki/plugin/bbs/BBSHandler.pm (revision 150)
@@ -61,7 +61,7 @@
6161
6262 foreach(@lines){
6363 $content = $content.$_."\n";
64- if(/^{{bbs\s*.*}}$/ && $flag==0){
64+ if(/^\{\{bbs\s*.*\}\}$/ && $flag==0){
6565 if($form_count==$count){
6666 $content .= "!!$subject - $name (".&Util::format_date(time()).")\n".
6767 "$message\n";
--- fswiki/trunk/fswiki/plugin/category/CategoryCache.pm (revision 149)
+++ fswiki/trunk/fswiki/plugin/category/CategoryCache.pm (revision 150)
@@ -102,7 +102,7 @@
102102 my @category;
103103 foreach my $line (split(/\n/,$source)){
104104 if(index($line," ")!=0 && index($line,"\t")!=0 && index($line,"//")!=0){
105- while($line =~ /{{(category\s+(.+?)\s*}})/g){
105+ while($line =~ /\{\{(category\s+(.+?)\s*\}\})/g){
106106 my $inline = $wiki->parse_inline_plugin($1);
107107 if(@{$inline->{args}} > 1 and $inline->{args}->[-1] eq 'nolink'){
108108 pop @{$inline->{args}};
Show on old repository browser