--- suikawiki/script/wiki.cgi 2002/12/01 04:32:50 1.32 +++ suikawiki/script/wiki.cgi 2002/12/03 09:34:43 1.33 @@ -97,6 +97,7 @@ my $embed_interwiki = '^\[\[#(box|text|password):(\S+)\]\]$'; # Walrus add (5) my %embed_command = ( searched => '^\[\[#searched:([^\]]+)\]\]$', + form => qw/\[\[\#form:'((?:[^'\\]|\\.)+)':'((?:[^'\\]|\\.)+)'(?::'((?:[^'\\]|\\.)*)')?\]\]/, ); ############################## my $info_LastModified = 'LastModified'; @@ -152,14 +153,13 @@ rss => \&do_rss, diff => \&do_diff, interwikibox => \&do_interwiki_box, # Walrus add (5) + wikiform => \&do_wikiform, ); ############################## -my @ignore_html_page = ('FrontPage'); # Walrus add (6) -my @ignore_html_tags = ('a', 'br', 'img'); # Walrus add (6) my $walversion = '2.0.beta1.wal.1'; # Walrus add (1) ############################## # &test_convert; -my $UA = ''; +my $UA = ''; ## User agent name &main; exit(0); ############################## @@ -232,7 +232,7 @@ sub id_and_name ($) { my $name = shift; - if ($UA =~ m#Mozilla/2#) { + if ($UA =~ m#Mozilla/[12]\.#) { qq{id="$name"> 1, -goto => $url_cgi.'?mycmd=read;mypage='.&encode($form{mypage}).qq(;x-param=@{[time.[0..9]->[rand 10]]}).($form{__comment_anchor_index}?"#anchor-$form{__comment_anchor_index}":'')); + my $fragment; + if ($form{__comment_anchor_index}) { + $fragment = qq(anchor-$form{__comment_anchor_index}); + } elsif ($form{__wikiform_anchor_index}) { + $fragment = qq(wikiform-$form{__wikiform_anchor_index}); + } + &print_header($CompletedSuccessfully, -noindex => 1, -goto => $url_cgi.'?mycmd=read;mypage='.&encode($form{mypage}).qq(;x-param=@{[time.[0..9]->[rand 10]]}).($fragment?'#'.$fragment:'')); &print_message($resource{saved}); &print_content("$resource{continuereading} @{[&armor_name($form{mypage})]}"); &print_footer($CompletedSuccessfully); @@ -461,11 +467,13 @@ } $bodyclass .= " wiki-page-obsoleted" if $option{-content_format} =~ /obsoleted="yes"/; if ($option{-goto}) { - if ($UA =~ m#Mozilla/2|Opera#) { + if ($UA =~ m#Mozilla/[12]\.|Opera#) { $option{-goto} =~ tr/;/&/; - print qq{Refresh: 0; url=$option{-goto}\n}; + print qq{Refresh: 0; url=$option{-goto}\n}; + $option{-goto} = qq(); } else { - print qq{Refresh: 0; url="$option{-goto}"\n}; + print qq{Refresh: 0; url="$option{-goto}"\n}; + $option{-goto} = qq(); } } print qq{Last-Modified: $option{-last_modified}\n} if $option{-last_modified}; @@ -489,7 +497,7 @@ "http://www.w3.org/TR/html4/loose.dtd"> + RUBY -->
- $meta_ct + $meta_ct$option{-goto}