|
Lines 21-26
use Modern::Perl;
Link Here
|
| 21 |
|
21 |
|
| 22 |
use Mojo::Base 'Mojolicious::Plugin'; |
22 |
use Mojo::Base 'Mojolicious::Plugin'; |
| 23 |
|
23 |
|
|
|
24 |
use CGI; |
| 24 |
use CGI::Compile; |
25 |
use CGI::Compile; |
| 25 |
use CGI::Emulate::PSGI; |
26 |
use CGI::Emulate::PSGI; |
| 26 |
use IO::Scalar; |
27 |
use IO::Scalar; |
|
Lines 28-33
use IO::Scalar;
Link Here
|
| 28 |
sub register { |
29 |
sub register { |
| 29 |
my ($self, $app, $conf) = @_; |
30 |
my ($self, $app, $conf) = @_; |
| 30 |
|
31 |
|
|
|
32 |
# CGI::Compile calls CGI::initialize_globals before each request, which resets PARAM_UTF8 to 0 |
| 33 |
# We need to set it back to the correct value |
| 34 |
{ |
| 35 |
no warnings 'redefine'; |
| 36 |
my $old_new = \&CGI::new; |
| 37 |
*CGI::new = sub { |
| 38 |
$CGI::PARAM_UTF8 = 1; |
| 39 |
return $old_new->(@_); |
| 40 |
}; |
| 41 |
} |
| 42 |
|
| 31 |
my $opac = $conf->{opac}; |
43 |
my $opac = $conf->{opac}; |
| 32 |
|
44 |
|
| 33 |
my $r = $app->routes; |
45 |
my $r = $app->routes; |
| 34 |
- |
|
|