FCGI-Fix für Charset-Encoding nur bei UTF-8-Installationen anwenden
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 3 Jan 2011 14:48:07 +0000 (15:48 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 3 Jan 2011 14:48:07 +0000 (15:48 +0100)
Andernfalls würden ISO-encodierte Strings vom Fix nochmal nach UTF-8
encodiert und danach erst ausgeliefert.

SL/FCGIFixes.pm
dispatcher.fpl

index 47393aa..d341f4a 100644 (file)
@@ -25,6 +25,7 @@ use version;
 
 sub fix_print_and_internal_encoding_after_0_68 {
   return if version->new("$FCGI::VERSION")->numify <= version->new("0.68")->numify;
+  return if lc($::dbcharset) !~ m/^(?:utf-?8|unicode)$/;
 
   my $encoder             = Encode::find_encoding('UTF-8');
   my $original_fcgi_print = \&FCGI::Stream::PRINT;
index ba5f288..7d2dfb5 100755 (executable)
@@ -6,10 +6,10 @@ use FCGI;
 use SL::Dispatcher;
 use SL::FCGIFixes;
 
-SL::FCGIFixes::apply_fixes();
-
 our $dispatcher = SL::Dispatcher->new('FastCGI');
-$dispatcher->pre_startup;
+$dispatcher->pre_startup_setup;
+SL::FCGIFixes::apply_fixes();
+$dispatcher->pre_startup_checks;
 
 my $request = FCGI::Request();
 $dispatcher->handle_request($request) while $request->Accept() >= 0;