Merge branch 'master' of ssh://git-sdonath@lx-office.linet-services.de/~/lx-office-erp
[kivitendo-erp.git] / SL / Dispatcher.pm
index e5a7daa..8bd2968 100644 (file)
@@ -82,6 +82,10 @@ sub pre_startup_setup {
     %::myconfig    = ();
     %::called_subs = (); # currently used for recursion detection
   }
+
+  $SIG{__WARN__} = sub {
+    $::lxdebug->warn(@_);
+  }
 }
 
 sub pre_startup_checks {
@@ -126,13 +130,9 @@ sub handle_request {
   my $interface = lc(shift || 'cgi');
   my ($script_name, $action);
 
-  if ($interface =~ m/^(?:fastcgi|fcgid|fcgi)$/) {
-    $script_name = $ENV{SCRIPT_NAME};
-    unrequire_bin_mozilla();
+  $script_name = $ENV{SCRIPT_NAME};
 
-  } else {
-    $script_name = $0;
-  }
+  unrequire_bin_mozilla($interface);
 
   $::cgi         = CGI->new('');
   $::locale      = Locale->new($::language);
@@ -201,6 +201,8 @@ sub handle_request {
 }
 
 sub unrequire_bin_mozilla {
+  return unless $_[0] =~ m/^(?:fastcgi|fcgid|fcgi)$/;
+
   for (keys %INC) {
     next unless m#^bin/mozilla/#;
     next if /\bcommon.pl$/;