2 |
use strict; |
use strict; |
3 |
|
|
4 |
use lib qw[/home/httpd/html/www/markup/html/whatpm |
use lib qw[/home/httpd/html/www/markup/html/whatpm |
5 |
/home/wakaba/work/manakai/lib |
/home/wakaba/work/manakai2/lib]; |
|
/home/wakaba/public_html/-temp/wiki/lib]; |
|
6 |
use CGI::Carp qw[fatalsToBrowser]; |
use CGI::Carp qw[fatalsToBrowser]; |
7 |
use Time::HiRes qw/time/; |
use Time::HiRes qw/time/; |
8 |
|
|
9 |
use SuikaWiki::Input::HTTP; ## TODO: Use some better CGI module |
use Message::CGI::HTTP; |
10 |
|
my $http = Message::CGI::HTTP->new; |
|
my $http = SuikaWiki::Input::HTTP->new; |
|
11 |
|
|
12 |
## TODO: _charset_ |
## TODO: _charset_ |
13 |
|
|
14 |
my @mode = split m#/#, scalar $http->meta_variable ('PATH_INFO'), -1; |
my @mode = split m#/#, scalar $http->get_meta_variable ('PATH_INFO'), -1; |
15 |
shift @mode if @mode and $mode[0] == ''; |
shift @mode if @mode and $mode[0] == ''; |
16 |
## TODO: decode unreserved characters |
## TODO: decode unreserved characters |
17 |
|
|
18 |
my $s = $http->parameter ('s'); |
my $s = $http->get_parameter ('s'); |
19 |
if (length $s > 1000_000) { |
if (length $s > 1000_000) { |
20 |
print STDOUT "Status: 400 Document Too Long\nContent-Type: text/plain; charset=us-ascii\n\nToo long"; |
print STDOUT "Status: 400 Document Too Long\nContent-Type: text/plain; charset=us-ascii\n\nToo long"; |
21 |
exit; |
exit; |
153 |
exit; |
exit; |
154 |
} |
} |
155 |
|
|
156 |
if ($http->parameter ('dom5')) { |
if ($http->get_parameter ('dom5')) { |
157 |
require Whatpm::ContentChecker; |
require Whatpm::ContentChecker; |
158 |
my $onerror = sub { |
my $onerror = sub { |
159 |
my %opt = @_; |
my %opt = @_; |